refineable_spin_up.cc File Reference

Classes

class  RefineableSphericalSpinUpProblem< ELEMENT >
 Driven cavity problem in rectangular domain - time dependent version. More...
 

Namespaces

 Global_Physical_Variables
 Global variables.
 
 Boundary_Items
 

Functions

void Boundary_Items::get_exact_u_b1 (double &time, const Vector< double > &x, double &u)
 
int main ()
 Driver for RefineableSphericalSpinUp test problem using a. More...
 

Variables

double Global_Physical_Variables::lambda =1.0
 

Function Documentation

◆ main()

int main ( )

Driver for RefineableSphericalSpinUp test problem using a.

///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////

461 {
462 
463  // Choose simulation interval and timestep
464  unsigned nstep = 1;
465  double dt = 0.25;
466 
467  // Set up doc info
468  // ---------------
469 
470  // Label for output
471  DocInfo doc_info;
472 
473  // Set output directory
474  doc_info.set_directory("RESLT");
475 
476  // Step number
477  doc_info.number()=0;
478 
479  // ---------------
480  // end of Set up doc info
481 
482 
483  // Doing QCrouzeixRaviartElements
484  {
485 
486  // Build the problem with QCrouzeixRaviartElements
488  problem;
489  cout << "Doing QCrouzeixRaviartElement" << std::endl;
490 
491  // Open a trace file
492  ofstream trace_file;
493  char filename[100];
494  sprintf(filename,"%s/trace0.dat",doc_info.directory().c_str());
495  trace_file.open(filename);
496  trace_file << "time " << "u " << "v " << "w "
497  << std::endl;
498 
499  //Refine uniformly once
500  problem.refine_uniformly();
501 
502  // Initialise timestep -- also sets the weights for all timesteppers
503  // in the problem.
504  problem.initialise_dt(dt);
505 
506  // Set initial conditions
507  problem.set_initial_condition();
508 
509  // Over-ride the maximum and minimum permitted errors
510  problem.mesh_pt()->max_permitted_error() = 1.0e-2; //Default = 1.0e-3
511  problem.mesh_pt()->min_permitted_error() = 1.0e-3; //Default = 1.0e-5
512 
513  // Over-ride the maximum and minimum permitted refinement levels
514  problem.mesh_pt()->max_refinement_level() = 4;//maximum_ref_level;
515  problem.mesh_pt()->min_refinement_level() = 1;//minimum_ref_level;
516 
517  //Specify the normalising factor explicitly
518  Z2ErrorEstimator* error_pt = dynamic_cast<Z2ErrorEstimator*>(
519  problem.mesh_pt()->spatial_error_estimator_pt());
520  error_pt->reference_flux_norm() = 0.01;
521 
522  //Output initial condition
523  problem.doc_solution(doc_info,trace_file);
524 
525  //Increment counter for solutions
526  doc_info.number()++;
527 
528  //Set the maximum adaptation
529  unsigned max_adapt = 3;
530 
531  bool first = true;
532 
533  // Timestepping loop
534  for (unsigned istep=0;istep<nstep;istep++)
535  {
536  cout << " Timestep " << istep << std::endl;
537 
538  // Take timestep
539  problem.unsteady_newton_solve(dt,max_adapt,first);
540 
541  //Set first to false
542  first=false;
543  max_adapt=1;
544 
545  //Output solution
546  problem.doc_solution(doc_info,trace_file);
547 
548  Node* nod_pt = //problem.mesh_pt()->finite_element_pt(435)->node_pt(0);
549  problem.mesh_pt()->node_pt(50);
550 
551  trace_file << problem.time() << " "
552  << nod_pt->x(0) << " " << nod_pt->x(1)
553  << " " << nod_pt->value(2) << std::endl;
554 
555  //Increment counter for solutions
556  doc_info.number()++;
557  }
558 
559  // Close trace file
560  trace_file.close();
561 
562  } // end of QCrouzeixRaviartElements
563 
564 
565 } // end_of_main
Driven cavity problem in rectangular domain - time dependent version.
Definition: refineable_spin_up.cc:91
Definition: oomph_utilities.h:499
std::string directory() const
Output directory.
Definition: oomph_utilities.h:524
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: nodes.h:906
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition: nodes.h:1060
double value(const unsigned &i) const
Definition: nodes.cc:2408
Definition: error_estimator.h:266
double & reference_flux_norm()
Access function for prescribed reference flux norm.
Definition: error_estimator.h:355
string filename
Definition: MergeRestartFiles.py:39
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References oomph::DocInfo::directory(), MergeRestartFiles::filename, oomph::DocInfo::number(), problem, oomph::Z2ErrorEstimator::reference_flux_norm(), oomph::DocInfo::set_directory(), oomph::Node::value(), and oomph::Node::x().