old_for_doc.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[])
 

Function Documentation

◆ demo_elastic_fish_poisson()

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

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

447 {
448 
449  //Set up the problem with "elastic" fish back
450  bool fix_position=false;
451  RefineableFishPoissonProblem<ELEMENT> problem(fix_position,directory_name);
452 
453  // Change/doc targets for mesh adaptation
454  if (CommandLineArgs::Argc>1)
455  {
456  problem.fish_mesh_pt()->max_permitted_error()=0.05;
457  problem.fish_mesh_pt()->min_permitted_error()=0.005;
458  }
459  problem.fish_mesh_pt()->doc_adaptivity_targets(cout);
460 
461 
462  // Do some uniform mesh refinement first
463  problem.refine_uniformly();
464  problem.refine_uniformly();
465 
466  // Initial guess for "load" on fish back
467  problem.load()=0.0;
468 
469  // Solve/doc fully coupled problem
470  unsigned max_solve=2;
471  problem.newton_solve(max_solve);
472  problem.doc_solution();
473 
474 }
Definition: algebraic_free_boundary_poisson.cc:81
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, and 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.

384 {
385 
386  // Set up the problem with prescribed displacement of fish back
387  bool fix_position=true;
388  RefineableFishPoissonProblem<ELEMENT> problem(fix_position,directory_name);
389 
390 
391  // Change/doc targets for mesh adaptation
392  if (CommandLineArgs::Argc>1)
393  {
394  problem.fish_mesh_pt()->max_permitted_error()=0.05;
395  problem.fish_mesh_pt()->min_permitted_error()=0.005;
396  }
397  else
398  {
399  problem.fish_mesh_pt()->max_permitted_error()=0.005;
400  problem.fish_mesh_pt()->min_permitted_error()=0.0005;
401  }
402  problem.fish_mesh_pt()->doc_adaptivity_targets(cout);
403 
404 
405  // Do some uniform mesh refinement first
406  //--------------------------------------
407  problem.refine_uniformly();
408  problem.refine_uniformly();
409 
410  // Initial value for the vertical displacement of the fish's back
411  problem.y_c()=-0.3;
412 
413  // Loop for different fish shapes
414  //-------------------------------
415 
416  // Number of steps
417  unsigned nstep=5;
418  if (CommandLineArgs::Argc>1) nstep=1;
419 
420  // Increment in displacement
421  double dyc=0.6/double(nstep-1);
422 
423  // Loop over different fish shapes
424  for (unsigned istep=0;istep<nstep;istep++)
425  {
426  // Solve/doc
427  unsigned max_solve=2;
428  problem.newton_solve(max_solve);
429  problem.doc_solution();
430 
431  //Increment counter for solutions
432  problem.doc_info().number()++;
433 
434  // Change vertical displacement
435  problem.y_c()+=dyc;
436  }
437 
438 }

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 reduce the targets for the mesh adaptation.

486 {
487 
488  // Store command line arguments
489  CommandLineArgs::setup(argc,argv);
490 
491  // Shorthand for element type
493 
494  // Compute solution of Poisson equation in various domains -- prescribed
495  // boundary shape.
496  demo_fish_poisson<ELEMENT>("RESLT");
497 
498  // Compute coupled "elastic" coupled solution directly
499  demo_elastic_fish_poisson<ELEMENT>("RESLT_coupled");
500 
501 }
Definition: macro_element_node_update_element.h:265
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().