eighth_sphere_poisson.cc File Reference
#include "generic.h"
#include "poisson.h"
#include "meshes/eighth_sphere_mesh.h"

Classes

class  EighthSpherePoissonProblem< ELEMENT >
 Poisson problem in refineable eighth of a sphere mesh. 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[])
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// Driver for 3D Poisson problem in eighth of a sphere. Solution has a sharp step. If there are any command line arguments, we regard this as a validation run and perform only a single adaptation.

327 {
328 
329  // Store command line arguments
330  CommandLineArgs::setup(argc,argv);
331 
332  // Set up the problem with 27-node brick elements, pass pointer to
333  // source function
336 
337  // Setup labels for output
338  DocInfo doc_info;
339 
340  // Output directory
341  doc_info.set_directory("RESLT");
342 
343  // Step number
344  doc_info.number()=0;
345 
346  // Check if we're ready to go
347  cout << "Self test: " << problem.self_test() << std::endl;
348 
349  // Solve the problem
350  problem.newton_solve();
351 
352  //Output solution
353  problem.doc_solution(doc_info);
354 
355  //Increment counter for solutions
356  doc_info.number()++;
357 
358  // Now do (up to) three rounds of fully automatic adapation in response to
359  // error estimate
360  unsigned max_solve;
361  if (CommandLineArgs::Argc>1)
362  {
363  // Validation run: Just one adaptation
364  max_solve=1;
365  cout << "Only doing one adaptation for validation" << std::endl;
366  }
367  else
368  {
369  // Up to four adaptations
370  max_solve=4;
371  }
372 
373  for (unsigned isolve=0;isolve<max_solve;isolve++)
374  {
375  // Adapt problem/mesh
376  problem.adapt();
377 
378  // Re-solve the problem if the adaptation has changed anything
379  if ((problem.mesh_pt()->nrefined() !=0)||
380  (problem.mesh_pt()->nunrefined()!=0))
381  {
382  problem.newton_solve();
383  }
384  else
385  {
386  cout << "Mesh wasn't adapted --> we'll stop here" << std::endl;
387  break;
388  }
389 
390  //Output solution
391  problem.doc_solution(doc_info);
392 
393  //Increment counter for solutions
394  doc_info.number()++;
395  }
396 
397 // pause("done");
398 
399 } // end of main
Poisson problem in refineable eighth of a sphere mesh.
Definition: eighth_sphere_poisson.cc:132
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().