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

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