algebraic_free_boundary_poisson.cc File Reference
#include "generic.h"
#include "poisson.h"
#include "meshes/fish_mesh.h"
#include "circle_as_generalised_element.h"

Classes

class  RefineableFishPoissonProblem< ELEMENT >
 

Namespaces

 ConstSourceForPoisson
 Namespace for const source term in Poisson equation.
 

Functions

void ConstSourceForPoisson::get_source (const Vector< double > &x, double &source)
 Const source function. More...
 
template<class ELEMENT >
void demo_fish_poisson (const string &directory_name)
 
template<class ELEMENT >
void demo_elastic_fish_poisson (const string &directory_name)
 
int main (int argc, char *argv[])
 

Variables

double ConstSourceForPoisson::Strength =1.0
 Strength of source function: default value 1.0. More...
 

Function Documentation

◆ demo_elastic_fish_poisson()

template<class ELEMENT >
void demo_elastic_fish_poisson ( const string &  directory_name)

Demonstrate how to solve "elastic" 2D Poisson problem in deformable fish-shaped domain with mesh adaptation.

512 {
513 
514  // Loop over all cases
515  for (unsigned i_case=0;i_case<5;i_case++)
516  //unsigned i_case=1;
517  {
518  std::cout << "[CR residuals] " << std::endl;
519  std::cout << "[CR residuals]=================================================="
520  << std::endl;
521  std::cout << "[CR residuals] " << std::endl;
522  //Set up the problem with "elastic" fish back
523  bool fix_position=false;
525  directory_name,
526  i_case);
527 
528  // Doc refinement targets
529  problem.fish_mesh_pt()->doc_adaptivity_targets(cout);
530 
531  // Do some uniform mesh refinement first
532  //--------------------------------------
533  problem.refine_uniformly();
534  problem.refine_uniformly();
535 
536 
537  // Initial value for load on fish back
538  problem.load()=0.0;
539 
540  // Solve/doc
541  unsigned max_solve=2;
542  problem.newton_solve(max_solve);
543  problem.doc_solution();
544  }
545 
546 
547 }
Definition: algebraic_free_boundary_poisson.cc:81
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References problem.

◆ demo_fish_poisson()

template<class ELEMENT >
void demo_fish_poisson ( const string &  directory_name)

///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// Demonstrate how to solve 2D Poisson problem in deformable fish-shaped domain with mesh adaptation.

461 {
462 
463  // Set up the problem with prescribed displacement of fish back
464  bool fix_position=true;
465  RefineableFishPoissonProblem<ELEMENT> problem(fix_position,directory_name,0);
466 
467  // Doc refinement targets
468  problem.fish_mesh_pt()->doc_adaptivity_targets(cout);
469 
470  // Do some uniform mesh refinement first
471  //--------------------------------------
472  problem.refine_uniformly();
473  problem.refine_uniformly();
474 
475  // Initial value for the vertical displacement of the fish's back
476  problem.y_c()=-0.3;
477 
478  // Loop for different fish shapes
479  //-------------------------------
480 
481  // Number of steps
482  unsigned nstep=5;
483 
484  // Increment in displacement
485  double dyc=0.6/double(nstep-1);
486 
487  // Valiation: Just do one step
488  if (CommandLineArgs::Argc>1) nstep=1;
489 
490  for (unsigned istep=0;istep<nstep;istep++)
491  {
492  // Solve/doc
493  unsigned max_solve=2;
494  problem.newton_solve(max_solve);
495  problem.doc_solution();
496 
497  //Increment counter for solutions
498  problem.doc_info().number()++;
499 
500  // Change vertical displacement
501  problem.y_c()+=dyc;
502  }
503 }
int Argc
Number of arguments + 1.
Definition: oomph_utilities.cc:407

References oomph::CommandLineArgs::Argc, and problem.

◆ main()

int main ( int argc  ,
char argv[] 
)

Driver for "elastic" fish poisson solver with adaptation. If there are any command line arguments, we regard this as a validation run and perform only a single step.

559 {
560  // Store command line arguments
561  CommandLineArgs::setup(argc,argv);
562 
563  // Shorthand for element type
565 
566  // Compute solution of Poisson equation in various domains
567  demo_fish_poisson<ELEMENT>("RESLT");
568 
569  // Compute "elastic" coupled solution directly
570  demo_elastic_fish_poisson<ELEMENT>("RESLT_coupled");
571 
572 }
Definition: algebraic_elements.h:540
void setup(Time *time_pt)
Create all GeomObjects needed to define the cylinder and the flag.
Definition: turek_flag_non_fsi.cc:277

References Flag_definition::setup().