mesh_from_tetgen_poisson.cc File Reference
#include "generic.h"
#include "poisson.h"
#include "meshes/tetgen_mesh.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::get_exact_u (const Vector< double > &x, double &u)
 Exact solution as a scalar. More...
 
void TanhSolnForPoisson::get_source (const Vector< double > &x, double &source)
 Source function to make it an exact solution. More...
 
int main (int argc, char *argv[])
 Demonstrate how to solve Poisson problem. More...
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

Demonstrate how to solve Poisson problem.

325 {
326 
327 // Store command line arguments
328  CommandLineArgs::setup(argc,argv);
329 
330  // Check number of command line arguments: Need exactly three.
331  if (argc!=4)
332  {
333  std::string error_message =
334  "Wrong number of command line arguments.\n";
335  error_message +=
336  "Must specify the following file names \n";
337  error_message +=
338  "filename.node then filename.ele then filename.face\n";
339 
340  throw OomphLibError(error_message,
343  }
344 
345  // Convert arguments to strings that specify the input file names
346  string node_file_name(argv[1]);
347  string element_file_name(argv[2]);
348  string face_file_name(argv[3]);
349 
350 
351  // Label for output
352  DocInfo doc_info;
353 
354  // Output directory
355  doc_info.set_directory("RESLT");
356 
357  // Number of output points per edge
358  unsigned nplot=2;
359 
360  // Do the problem with linear elements
361  //------------------------------------
362  {
365  node_file_name,element_file_name,face_file_name);
366 
367  // Solve the problem
368  problem.newton_solve();
369 
370  //Output solution with 2 points per edge
371  nplot=2;
372  problem.doc_solution(nplot,doc_info);
373 
374  //Increment counter for solutions
375  doc_info.number()++;
376 
377  //Output solution with 5 points per edge
378  nplot=5;
379  problem.doc_solution(nplot,doc_info);
380 
381  //Increment counter for solutions
382  doc_info.number()++;
383 
384 
385  }
386 
387 
388 
389  // Do the problem with quadratic elements
390  //---------------------------------------
391  {
394  node_file_name,element_file_name,face_file_name);
395 
396  // Solve the problem
397  problem.newton_solve();
398 
399  //Output solution with 2 points per edge
400  nplot=2;
401  problem.doc_solution(nplot,doc_info);
402 
403  //Increment counter for solutions
404  doc_info.number()++;
405 
406  //Output solution with 5 points per edge
407  nplot=5;
408  problem.doc_solution(nplot,doc_info);
409 
410  //Increment counter for solutions
411  doc_info.number()++;
412 
413  }
414 
415 
416 }
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
void setup(Time *time_pt)
Create all GeomObjects needed to define the cylinder and the flag.
Definition: turek_flag_non_fsi.cc:277
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
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
#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::get_source(), oomph::DocInfo::number(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, problem, oomph::DocInfo::set_directory(), Flag_definition::setup(), and oomph::Global_string_for_annotation::string().