two_d_adv_diff_flux_bc.cc File Reference

Classes

class  TwoMeshFluxAdvectionDiffusionProblem< ELEMENT >
 

Namespaces

 TanhSolnForAdvectionDiffusion
 

Functions

void TanhSolnForAdvectionDiffusion::get_exact_u (const Vector< double > &x, Vector< double > &u)
 Exact solution as a Vector. More...
 
void TanhSolnForAdvectionDiffusion::get_exact_u (const Vector< double > &x, double &u)
 Exact solution as a scalar. More...
 
void TanhSolnForAdvectionDiffusion::source_function (const Vector< double > &x_vect, double &source)
 Source function required to make the solution above an exact solution. More...
 
void TanhSolnForAdvectionDiffusion::prescribed_flux_on_fixed_x_boundary (const Vector< double > &x, double &flux)
 Flux required by the exact solution on a boundary on which x is fixed. More...
 
void TanhSolnForAdvectionDiffusion::wind_function (const Vector< double > &x, Vector< double > &wind)
 Wind. More...
 
int main ()
 

Function Documentation

◆ main()

int main ( )

Demonstrate how to solve 2D AdvectionDiffusion problem with flux boundary conditions, using two meshes.

500 {
501 
502  //Set up the problem
503  //------------------
504 
505  //Set up the problem with 2D nine-node elements from the
506  //RefineableQuadAdvectionDiffusionElement family.
507  //Pass pointer to source function.
511 
512  // Create label for output
513  //------------------------
514  DocInfo doc_info;
515 
516  // Set output directory
517  doc_info.set_directory("RESLT");
518 
519  // Step number
520  doc_info.number()=0;
521 
522  // Check if we're ready to go:
523  //----------------------------
524  cout << "\n\n\nProblem self-test ";
525  if (problem.self_test()==0)
526  {
527  cout << "passed: Problem can be solved." << std::endl;
528  }
529  else
530  {
531  throw OomphLibError("Self test failed",
534  }
535 
536  // Set the orientation of the "step" to 45 degrees
538 
539  // Initial value for the steepness of the "step"
541 
542  //Output solution
543  problem.doc_solution(doc_info);
544 
545  // Do a couple of solutions for different forcing functions
546  //---------------------------------------------------------
547  unsigned nstep=4;
548  for (unsigned istep=0;istep<nstep;istep++)
549  {
550  cout << "\n\nSolving for TanhSolnForAdvectionDiffusion::Alpha="
551  << TanhSolnForAdvectionDiffusion::Alpha << std::endl << std::endl;
552 
553  // Solve the problem, allowing for up to four adaptations
554  problem.newton_solve(4);
555 
556  //Output solution
557  problem.doc_solution(doc_info);
558 
559  //Increment counter for solutions
560  doc_info.number()++;
561 
562  // Increase the steepness of the step:
564 
565  }
566 
567 } //end of main
Definition: two_d_adv_diff_flux_bc.cc:120
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: oomph_definitions.h:222
Definition: refineable_advection_diffusion_elements.h:355
double TanPhi
Parameter for angle of step.
Definition: two_d_adv_diff_adapt.cc:56
double Alpha
Parameter for steepness of step.
Definition: two_d_adv_diff_adapt.cc:53
void source_function(const Vector< double > &x_vect, double &source)
Source function required to make the solution above an exact solution.
Definition: two_d_adv_diff_adapt.cc:71
void wind_function(const Vector< double > &x, Vector< double > &wind)
Wind.
Definition: two_d_adv_diff_adapt.cc:84
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References TanhSolnForAdvectionDiffusion::Alpha, oomph::DocInfo::number(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, problem, oomph::DocInfo::set_directory(), TanhSolnForAdvectionDiffusion::source_function(), TanhSolnForAdvectionDiffusion::TanPhi, and TanhSolnForAdvectionDiffusion::wind_function().