tree_2d.cc File Reference
#include <typeinfo>
#include "generic.h"
#include "poisson.h"
#include "meshes/simple_rectangular_quadmesh.h"

Classes

class  CompareElementCoordinate< ELEMENT >
 
class  Rotateable< ELEMENT >
 
class  TestRefineableRectangularQuadMesh< ELEMENT >
 
class  TestRefineablePoissonProblem< ELEMENT >
 

Namespaces

 TanhSolnForPoisson
 Namespace for exact solution for Poisson equation with "sharp step".
 

Functions

void TanhSolnForPoisson::get_exact_u (const Vector< double > &x, Vector< double > &u)
 Exact solution as a Vector. More...
 
void TanhSolnForPoisson::get_source (const Vector< double > &x, double &source)
 Source function to make it an exact solution. More...
 
template<class ELEMENT >
void run_test (const unsigned &i)
 
int main ()
 Driver code for 2D Poisson problem. More...
 

Function Documentation

◆ main()

int main ( )

Driver code for 2D Poisson problem.

753 {
754  //Run the test three times for three different types of element
755  run_test<Rotateable<RefineableQPoissonElement<2,2> > >(1);
756  run_test<Rotateable<RefineableQPoissonElement<2,3> > >(2);
757  run_test<Rotateable<RefineableQSpectralPoissonElement<2,4> > >(3);
758 }

◆ run_test()

template<class ELEMENT >
void run_test ( const unsigned i)

Global function that is used to run the rotation tests for different elements

698 {
699  char dirname[100];
700  sprintf(dirname,"RESLT%i",i);
701 
702  // Create label for output
703  //------------------------
704  DocInfo doc_info;
705 
706  // Set output directory
707  doc_info.set_directory(dirname);
708 
709  // Step number
710  doc_info.number()=0;
711 
712 
713  //Set up the problem
714  //------------------
715  for(unsigned i=0;i<4;i++)
716  {
717  //Create the problem with rotation i
720 
721  //Attach the info to the mesh
722  //problem.mesh_pt()->doc_info_pt() = &doc_info;
723 
724 
725  // Check if we're ready to go:
726  //----------------------------
727  cout << "\n\n\nProblem self-test ";
728  if (problem.self_test()==0)
729  {
730  cout << "passed: Problem can be solved." << std::endl;
731  }
732  else
733  {
734  throw OomphLibError("Self test failed",
737  }
738 
739  // Solve the problem, performing up to 3 adaptive refinements
740  problem.newton_solve(3);
741 
742  //Output the solution
743  problem.doc_solution(doc_info);
744 
745  doc_info.number()++;
746  }
747 }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Definition: tree_2d.cc:500
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
void get_source(const Vector< double > &x, double &source)
Source function to make it an exact solution.
Definition: extrude_with_macro_element_representation.cc:224
#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 TanhSolnForPoisson::get_source(), i, oomph::DocInfo::number(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, problem, and oomph::DocInfo::set_directory().