poisson/two_d_poisson/two_d_poisson.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 ()
 Driver code for 2D Poisson problem. More...
 

Function Documentation

◆ main()

int main ( )

Driver code for 2D Poisson problem.

272 {
273 
274  //Set up the problem
275  //------------------
276 
277  // Create the problem with 2D nine-node elements from the
278  // QPoissonElement family. Pass pointer to source function.
281 
282  // Create label for output
283  //------------------------
284  DocInfo doc_info;
285 
286  // Set output directory
287  doc_info.set_directory("RESLT");
288 
289  // Step number
290  doc_info.number()=0;
291 
292  // Check that we're ready to go:
293  //----------------------------
294  cout << "\n\n\nProblem self-test ";
295  if (problem.self_test()==0)
296  {
297  cout << "passed: Problem can be solved." << std::endl;
298  }
299  else
300  {
301  throw OomphLibError("Self test failed",
304  }
305 
306 
307  // Set the orientation of the "step" to 45 degrees
309 
310  // Initial value for the steepness of the "step"
312 
313 
314  // Do a couple of solutions for different forcing functions
315  //---------------------------------------------------------
316  unsigned nstep=4;
317  for (unsigned istep=0;istep<nstep;istep++)
318  {
319 
320  // Increase the steepness of the step:
322 
323  cout << "\n\nSolving for TanhSolnForPoisson::Alpha="
324  << TanhSolnForPoisson::Alpha << std::endl << std::endl;
325 
326  // Solve the problem
327  problem.newton_solve();
328 
329  //Output the solution
330  problem.doc_solution(doc_info);
331 
332  //Increment counter for solutions
333  doc_info.number()++;
334 
335  }
336 
337 
338 } //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.