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

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