t_convergence_3d.cc File Reference
#include "generic.h"
#include "poisson.h"
#include "meshes/simple_cubic_tet_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.

///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////

Label for output

379 {
380 
381  // Store command line arguments
382  CommandLineArgs::setup(argc,argv);
383 
385  DocInfo doc_info;
386 
387  // Output directory
388  doc_info.set_directory("RESLT");
389 
390  // Step number
391  doc_info.number()=0;
392 
393  unsigned nstep;
394 
395  // Output for convergence data
396  ofstream convergence_file("RESLT/convergence.dat");
397 
398  convergence_file << "VARIABLES=\"log h\",\"log e\",\"theory\",\"log u\" "
399  << std::endl;
400 
401 
402  //Tecplot output separator for convergence results
403  convergence_file << "ZONE T=\"Linear element\"" << std::endl;
404 
405  cout << "Doing linear elements" << std::endl;
406  cout << "=====================" << std::endl;
407 
408  // Number of steps (reduced for validation)
409  nstep = 5;
410  if (CommandLineArgs::Argc>1)
411  {
412  nstep=2;
413  }
414  for (unsigned h_power=0;h_power<nstep;h_power++)
415  {
416 
417  //Set up the problem
420 
421  cout << "Self test: " << problem.self_test() << std::endl;
422 
423  // Solve the problem
424  problem.newton_solve();
425 
426  //Output solution & convergence data
427  problem.doc_solution(doc_info,convergence_file);
428 
429  //Increment counter for solutions
430  doc_info.number()++;
431  }
432 
433 
434  cout << "Doing quadratic elements" << std::endl;
435  cout << "========================" << std::endl;
436 
437  //Tecplot output separator for convergence results
438  convergence_file << "ZONE T=\"Quadratic element\"" << std::endl;
439 
440  // Number of steps (reduced for validation)
441  nstep = 4;
442  if (CommandLineArgs::Argc>1)
443  {
444  nstep=2;
445  }
446  for (unsigned h_power=0;h_power<nstep;h_power++)
447  {
448 
449  //Set up the problem
452 
453  // Solve the problem
454  problem.newton_solve();
455 
456  //Output solution & convergence data
457  problem.doc_solution(doc_info,convergence_file);
458 
459  //Increment counter for solutions
460  doc_info.number()++;
461  }
462 
463 
464  convergence_file.close();
465 
466 }
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
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
int Argc
Number of arguments + 1.
Definition: oomph_utilities.cc:407
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References oomph::CommandLineArgs::Argc, TanhSolnForPoisson::get_source(), oomph::DocInfo::number(), problem, oomph::DocInfo::set_directory(), and Flag_definition::setup().