two_d_poisson2.cc File Reference

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

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