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

Classes

class  PoissonProblem< ELEMENT >
 Micky mouse Poisson problem. More...
 

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::source_function (const Vector< double > &x, double &source)
 Source function required to make the solution above an exact solution. More...
 
int main (int argc, char **argv)
 Driver code for 2D Poisson problem. More...
 

Function Documentation

◆ main()

int main ( int argc  ,
char **  argv 
)

Driver code for 2D Poisson problem.

279 {
280  //Set up the problem
281  //------------------
282 
283  // Create the problem with 2D nine-node elements from the
284  // QPoissonElement family. Pass pointer to source function.
287 
288  // Create label for output
289  //------------------------
290  DocInfo doc_info;
291 
292  // Set output directory
293  doc_info.set_directory("RESLT");
294 
295  // Step number
296  doc_info.number()=0;
297 
298  // Check that we're ready to go:
299  //----------------------------
300  cout << "\n\n\nProblem self-test ";
301  if (problem.self_test()==0)
302  {
303  cout << "passed: Problem can be solved." << std::endl;
304  }
305  else
306  {
307  throw OomphLibError("Self test failed",
310  }
311 
312 
313  // Set the orientation of the "step" to 45 degrees
315 
316  // Initial value for the steepness of the "step"
318 
319 
320  // Do a couple of solutions for different forcing functions
321  //---------------------------------------------------------
322  unsigned nstep=4;
323  for (unsigned istep=0;istep<nstep;istep++)
324  {
325 
326  // Increase the steepness of the step:
328 
329  cout << "\n\nSolving for TanhSolnForPoisson::Alpha="
330  << TanhSolnForPoisson::Alpha << std::endl << std::endl;
331 
332  // Solve the problem
333  problem.newton_solve();
334 
335  //Output the solution
336  problem.doc_solution(doc_info);
337 
338  //Increment counter for solutions
339  doc_info.number()++;
340 
341  }
342 } //end of main
Micky mouse Poisson problem.
Definition: HypreSolver_test.cc:81
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 source_function(const Vector< double > &x, double &source)
Source function required to make the solution above an exact solution.
Definition: HypreSolver_test.cc:60
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, oomph::DocInfo::number(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, problem, oomph::DocInfo::set_directory(), TanhSolnForPoisson::source_function(), and TanhSolnForPoisson::TanPhi.