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

Label for output

365 {
366 
367  // Store command line arguments
368  CommandLineArgs::setup(argc,argv);
369 
371  DocInfo doc_info;
372 
373  // Output directory
374  doc_info.set_directory("RESLT");
375 
376 
377 
378  // Output for convergence data
379  ofstream convergence_file("RESLT/convergence.dat");
380 
381  convergence_file << "VARIABLES=\"log h\",\"log e\",\"theory\",\"log u\" "
382  << std::endl;
383 
384  unsigned nstep;
385 
386 
387 
388  cout << "Linear element" << std::endl;
389  cout << "==============" << std::endl << std::endl;
390 
391 
392 
393  // Number of steps (reduced for validation)
394  nstep = 5;
395  if (CommandLineArgs::Argc>1)
396  {
397  nstep=3;
398  }
399 
400  //Tecplot output separator for convergence results
401  convergence_file << "ZONE T=\"Linear element\"" << std::endl;
402  for (unsigned h_power=1;h_power<nstep+1;h_power++)
403  {
404  //Set up the problem
407 
408  // Solve the problem
409  problem.newton_solve();
410 
411  //Output solution & convergence data
412  problem.doc_solution(doc_info,convergence_file);
413 
414  //Increment counter for solutions
415  doc_info.number()++;
416  }
417 
418 
419 
420  cout << "Quadratic element" << std::endl;
421  cout << "=================" << std::endl << std::endl;
422 
423  // Number of steps (reduced for validation)
424  nstep = 4;
425  if (CommandLineArgs::Argc>1)
426  {
427  nstep=3;
428  }
429 
430  //Tecplot output separator for convergence results
431  convergence_file << "ZONE T=\"Quadratic element\"" << std::endl;
432  for (unsigned h_power=1;h_power<nstep+1;h_power++)
433  {
434  //Set up the problem
437 
438  // Solve the problem
439  problem.newton_solve();
440 
441  //Output solution & convergence data
442  problem.doc_solution(doc_info,convergence_file);
443 
444  //Increment counter for solutions
445  doc_info.number()++;
446  }
447 
448 
449 
450 
451  cout << "Cubic element" << std::endl;
452  cout << "=============" << std::endl << std::endl;
453 
454  // Number of steps (reduced for validation)
455  nstep = 4;
456  if (CommandLineArgs::Argc>1)
457  {
458  nstep=3;
459  }
460 
461  //Tecplot output separator for convergence results
462  convergence_file << "ZONE T=\"Cubic element\"" << std::endl;
463  for (unsigned h_power=1;h_power<nstep+1;h_power++)
464  {
465  //Set up the problem
468 
469  // Solve the problem
470  problem.newton_solve();
471 
472  //Output solution & convergence data
473  problem.doc_solution(doc_info,convergence_file);
474 
475  //Increment counter for solutions
476  doc_info.number()++;
477  }
478 
479 
480 
481 
482 
483 
484 
485 
486 
487 } // 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().