locate_zeta_tester.cc File Reference

Classes

class  SimpleRefineableRectangularQuadMesh< ELEMENT >
 
class  RefineablePoissonProblem< ELEMENT >
 

Namespaces

 GlobalParameters
 Global parameters.
 

Functions

double GlobalParameters::distorted_y (const double &y_normalised)
 Function to distort mesh. More...
 
void GlobalParameters::get_exact_u (const Vector< double > &x, Vector< double > &u)
 Exact solution as a Vector. More...
 
void GlobalParameters::get_source (const Vector< double > &x, double &source)
 Source function required to make the solution above an exact solution. More...
 
int main (int argc, char *argv[])
 Driver code for 2D Poisson problem. More...
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

Driver code for 2D Poisson problem.

354 {
355 
356 #ifdef OOMPH_HAS_CGAL
357  oomph_info << "have it" << std::endl;
358 #else
359  oomph_info << "don't have it" << std::endl;
360 #endif
361 
362 
363  // Store command line arguments
364  CommandLineArgs::setup(argc,argv);
365 
366  // Validation of projection?
368 
369  // Number of biased refinements for locate zeta test
370  unsigned nrefine_for_locate_zeta_test=2; // hierher
371  CommandLineArgs::specify_command_line_flag("--nrefine_for_locate_zeta_test",
372  &nrefine_for_locate_zeta_test);
373 
374  // Number of genuine refinements for locate zeta test
375  unsigned nrefine_genuine=2; // hierher
376  CommandLineArgs::specify_command_line_flag("--nrefine_genuine",
377  &nrefine_genuine);
378 
379  // Parse command line
381 
382  // Doc what has actually been specified on the command line
384 
385  //Set up the problem
386  //------------------
387 
388  // Create the problem with 2D nine-node refineable elements from the
389  // RefineableQuadPoissonElement family. Pass pointer to source function.
392 
393  // Create label for output
394  //------------------------
395  DocInfo doc_info;
396 
397  // Set output directory
398  doc_info.set_directory("RESLT");
399 
400  // Step number
401  doc_info.number()=0;
402 
403  // Set the orientation of the "step" to 45 degrees
405 
406  // Choose a large value for the steepness of the "step"
408 
409  // Solve the problem, performing adaptive refinements
410  problem.newton_solve(nrefine_genuine);
411 
412  //Output the solution
413  problem.doc_solution(doc_info);
414  doc_info.number()++;
415 
416  // Setup fake error estimator: Boundaries of refinement region
417  Vector<double> lower_left(2);
418  Vector<double> upper_right(2);
419 
420  double box_size=0.7;
421  lower_left[0]=0.2;
422  lower_left[1]=0.9;
423  upper_right[0]=lower_left[0]+box_size;
424  upper_right[1]=lower_left[1]+box_size;
425  unsigned central_node_number=8;
426 
427  // Stop unrefinement and allow for infinite refinement
428  problem.mesh_pt()->min_permitted_error()=-1.0;
429  problem.mesh_pt()->max_refinement_level()=UINT_MAX;
430 
431  // Adapt lots of times
432  for (unsigned i=0;i<nrefine_for_locate_zeta_test;i++)
433  {
434  // Clean up
435  delete problem.mesh_pt()->spatial_error_estimator_pt();
436 
437  // Make a new error estimator
438  problem.mesh_pt()->spatial_error_estimator_pt()=
439  new DummyErrorEstimator(problem.mesh_pt(),lower_left,upper_right,
440  central_node_number);
441 
442  // Adapt
443  problem.adapt();
444 
445  // Shrink box
446  box_size*=0.5;
447  upper_right[0]=lower_left[0]+box_size;
448  upper_right[1]=lower_left[1]+box_size;
449  }
450 
451  //Output the solution
452  problem.doc_solution(doc_info);
453 
454  // Check it out!
455  check_locate_zeta(problem.mesh_pt());
456 
457 
458 } //end of main
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Definition: optimisation/use_coarse_base_meshes/two_d_poisson_adapt.cc:149
Definition: oomph_utilities.h:499
void set_directory(const std::string &directory)
Definition: oomph_utilities.cc:298
unsigned & number()
Number used (e.g.) for labeling output files.
Definition: oomph_utilities.h:554
Definition: error_estimator.h:435
void check_locate_zeta(Mesh *mesh_pt)
Definition: locate_zeta_tester.h:28
void setup(Time *time_pt)
Create all GeomObjects needed to define the cylinder and the flag.
Definition: turek_flag_non_fsi.cc:277
double TanPhi
Parameter for angle of step.
Definition: two_d_unsteady_heat_2adapt_load_balance.cc:147
void get_source(const double &time, const Vector< double > &x, double &source)
Source function.
Definition: stefan_boltzmann.cc:154
double Alpha
Parameter for steepness of step.
Definition: two_d_unsteady_heat_2adapt_load_balance.cc:138
void specify_command_line_flag(const std::string &command_line_flag, const std::string &doc)
Specify possible argument-free command line flag.
Definition: oomph_utilities.cc:451
void parse_and_assign(int argc, char *argv[], const bool &throw_on_unrecognised_args)
Definition: oomph_utilities.cc:760
void doc_specified_flags()
Document specified command line flags.
Definition: oomph_utilities.cc:610
OomphInfo oomph_info
Definition: oomph_definitions.cc:319
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References GlobalParameters::Alpha, check_locate_zeta(), oomph::CommandLineArgs::doc_specified_flags(), GlobalParameters::get_source(), i, oomph::DocInfo::number(), oomph::oomph_info, oomph::CommandLineArgs::parse_and_assign(), problem, oomph::DocInfo::set_directory(), Flag_definition::setup(), oomph::CommandLineArgs::specify_command_line_flag(), and GlobalParameters::TanPhi.