poisson/two_d_poisson_adapt/two_d_poisson_adapt.cc File Reference
#include "generic.h"
#include "poisson.h"
#include "meshes/simple_rectangular_quadmesh.h"

Classes

class  SimpleRefineableRectangularQuadMesh< ELEMENT >
 
class  RefineablePoissonProblem< 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...
 
int main ()
 Driver code for 2D Poisson problem. More...
 

Function Documentation

◆ main()

int main ( )

Driver code for 2D Poisson problem.

330 {
331 
332  //Set up the problem
333  //------------------
334 
335  // Create the problem with 2D nine-node refineable elements from the
336  // RefineableQuadPoissonElement family. Pass pointer to source function.
339 
340  // Create label for output
341  //------------------------
342  DocInfo doc_info;
343 
344  // Set output directory
345  doc_info.set_directory("RESLT");
346 
347  // Step number
348  doc_info.number()=0;
349 
350  // Check if we're ready to go:
351  //----------------------------
352  cout << "\n\n\nProblem self-test ";
353  if (problem.self_test()==0)
354  {
355  cout << "passed: Problem can be solved." << std::endl;
356  }
357  else
358  {
359  throw OomphLibError("Self test failed",
362  }
363 
364 
365  // Set the orientation of the "step" to 45 degrees
367 
368  // Choose a large value for the steepness of the "step"
370 
371  // Solve the problem, performing up to 4 adaptive refinements
372  problem.newton_solve(4);
373 
374  //Output the solution
375  problem.doc_solution(doc_info);
376 
377 } //end of main
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: oomph_definitions.h:222
double TanPhi
Parameter for angle Phi of "step".
Definition: HypreSolver_test.cc:51
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
double Alpha
Parameter for steepness of step.
Definition: extrude_with_macro_element_representation.cc:185
#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::Alpha, TanhSolnForPoisson::get_source(), oomph::DocInfo::number(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, problem, oomph::DocInfo::set_directory(), and TanhSolnForPoisson::TanPhi.