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

Classes

class  ElasticFishBackElement
 
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[])
 

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.

579 {
580 
581  //Set up the problem with "elastic" fish back
582  bool fix_position=false;
583  RefineableFishPoissonProblem<ELEMENT> problem(fix_position,directory_name);
584 
585  // Doc refinement targets
586  problem.fish_mesh_pt()->doc_adaptivity_targets(cout);
587 
588  // Do some uniform mesh refinement first
589  //--------------------------------------
590  problem.refine_uniformly();
591  problem.refine_uniformly();
592 
593 
594  // Initial value for load on fish back
595  problem.load()=0.0;
596 
597  // Solve/doc
598  unsigned max_solve=2;
599  problem.newton_solve(max_solve);
600  problem.doc_solution();
601 
602 }
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.

530 {
531 
532  // Set up the problem with prescribed displacement of fish back
533  bool fix_position=true;
534  RefineableFishPoissonProblem<ELEMENT> problem(fix_position,directory_name);
535 
536  // Doc refinement targets
537  problem.fish_mesh_pt()->doc_adaptivity_targets(cout);
538 
539  // Do some uniform mesh refinement first
540  //--------------------------------------
541  problem.refine_uniformly();
542  problem.refine_uniformly();
543 
544  // Initial value for the load on the fish back
545  problem.load()=-0.3;
546 
547  // Loop for different fish shapes
548  //-------------------------------
549 
550  // Number of steps
551  unsigned nstep=5;
552  if (CommandLineArgs::Argc>1) nstep=1;
553 
554  // Increment in load
555  double dp=0.6/double(nstep-1);
556 
557  for (unsigned istep=0;istep<nstep;istep++)
558  {
559  // Solve/doc
560  unsigned max_solve=2;
561  problem.newton_solve(max_solve);
562  problem.doc_solution();
563 
564  //Increment counter for solutions
565  problem.doc_info().number()++;
566 
567  // Change load on ring
568  problem.load()+=dp;
569  }
570 }
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.

614 {
615  // Store command line arguments
616  CommandLineArgs::setup(argc,argv);
617 
618  // Shorthand for element type
620 
621  // Compute solution of Poisson equation in various domains
622  demo_fish_poisson<ELEMENT>("RESLT");
623 
624  // Compute "elastic" coupled solution directly
625  demo_elastic_fish_poisson<ELEMENT>("RESLT_elastic");
626 
627 
628 }
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().