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

351 {
352  //Set up the problem
353  //------------------
354 
355  // Create the problem with 2D nine-node refineable elements from the
356  // RefineableQuadPoissonElement family. Pass pointer to source function.
359 
360  // Create label for output
361  //------------------------
362  DocInfo doc_info;
363 
364  // Set output directory
365  doc_info.set_directory("RESLT_2d");
366 
367  // Step number
368  doc_info.number()=0;
369 
370  // Check if we're ready to go:
371  //----------------------------
372  cout << "\n\n\nProblem self-test ";
373  if (problem.self_test()==0)
374  {
375  cout << "passed: Problem can be solved." << std::endl;
376  }
377  else
378  {
379  throw OomphLibError("Self test failed",
382  }
383 
384 
385  problem.mesh_pt()->output("initial.dat");
386 
387  // Set the orientation of the "step" to 45 degrees
389 
390  // Choose a large value for the steepness of the "step"
392 
393  //Solve the problem, performing up to 4 adaptive refinements
394  problem.newton_solve(4);
395 
396  //Output the solution
397  problem.doc_solution(doc_info);
398 
399 } //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.