refineable_spin_up_cyl.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...
 

Function Documentation

◆ main()

int main ( )

Driver for RefineableSphericalSpinUp test problem using a.

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

431 {
432 
433  // Choose simulation interval and timestep
434  unsigned nstep =1;
435  double dt=0.25;
436 
437  // Set up doc info
438  // ---------------
439 
440  // Label for output
441  DocInfo doc_info;
442 
443  // Set output directory
444  doc_info.set_directory("RESLT");
445 
446  // Step number
447  doc_info.number()=0;
448 
449  // ---------------
450  // end of Set up doc info
451 
452 
453  // Doing QCrouzeixRaviartElements
454  {
455 
456  // Build the problem with QCrouzeixRaviartElements
458  problem;
459  cout << "Doing QCrouzeixRaviartElement" << std::endl;
460 
461  // Open a trace file
462  ofstream trace_file;
463  char filename[100];
464  sprintf(filename,"%s/trace0.dat",doc_info.directory().c_str());
465  trace_file.open(filename);
466  trace_file << "time " << "u " << "v " << "w "
467  << std::endl;
468 
469  //Refine uniformly once
470  problem.refine_uniformly();
471 
472 
473  // Initialise timestep -- also sets the weights for all timesteppers
474  // in the problem.
475  problem.initialise_dt(dt);
476 
477  // Set initial conditions
478  problem.set_initial_condition();
479 
480  // Over-ride the maximum and minimum permitted errors
481  problem.mesh_pt()->max_permitted_error() = 1.0e-2; //Default = 1.0e-3
482  problem.mesh_pt()->min_permitted_error() = 1.0e-3; //Default = 1.0e-5
483 
484  // Over-ride the maximum and minimum permitted refinement levels
485  problem.mesh_pt()->max_refinement_level() = 4;//maximum_ref_level;
486  problem.mesh_pt()->min_refinement_level() = 1;//minimum_ref_level;
487 
488  //Specify the normalising factor explicitly
489  Z2ErrorEstimator* error_pt = dynamic_cast<Z2ErrorEstimator*>(
490  problem.mesh_pt()->spatial_error_estimator_pt());
491  error_pt->reference_flux_norm() = 0.01;
492 
493  //Output initial condition
494  problem.doc_solution(doc_info,trace_file);
495 
496  //Increment counter for solutions
497  doc_info.number()++;
498 
499  unsigned max_adapt = 3;
500 
501  bool first = true;
502 
503  // Timestepping loop
504  for (unsigned istep=0;istep<nstep;istep++)
505  {
506  cout << " Timestep " << istep << std::endl;
507 
508  // Take timestep
509  problem.unsteady_newton_solve(dt,max_adapt,first);
510 
511  //Set first to false
512  first=false;
513  max_adapt=1;
514 
515  //Output solution
516  problem.doc_solution(doc_info,trace_file);
517 
518  Node* nod_pt = //problem.mesh_pt()->finite_element_pt(435)->node_pt(0);
519  problem.mesh_pt()->node_pt(50);
520 
521  trace_file << problem.time() << " "
522  << nod_pt->x(0) << " " << nod_pt->x(1)
523  << " " << nod_pt->value(2) << std::endl;
524 
525  //Increment counter for solutions
526  doc_info.number()++;
527  }
528 
529  // Close trace file
530  trace_file.close();
531 
532  } // end of QCrouzeixRaviartElements
533 
534 
535 } // 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().