meshing/quad_from_triangle_mesh/unstructured_two_d_solid.cc File Reference
#include "generic.h"
#include "solid.h"
#include "constitutive.h"
#include "meshes/quad_from_triangle_mesh.h"

Classes

class  ElasticQuadFromTriangleMesh< ELEMENT >
 Triangle-based mesh upgraded to become a solid mesh. More...
 
class  UnstructuredSolidProblem< ELEMENT, MESH >
 Unstructured solid problem. More...
 

Namespaces

 Global_Physical_Variables
 Global variables.
 

Functions

void Global_Physical_Variables::gravity (const double &time, const Vector< double > &xi, Vector< double > &b)
 Non-dimensional gravity as body force. More...
 
void Global_Physical_Variables::constant_pressure (const Vector< double > &xi, const Vector< double > &x, const Vector< double > &n, Vector< double > &traction)
 Constant pressure load. More...
 
int main (int argc, char **argv)
 Demonstrate how to solve an unstructured solid problem. More...
 

Variables

double Global_Physical_Variables::Gravity =0.0
 Non-dim gravity. More...
 

Function Documentation

◆ main()

int main ( int argc  ,
char **  argv 
)

Demonstrate how to solve an unstructured solid problem.

439 {
440  // Store command line arguments
441  CommandLineArgs::setup(argc,argv);
442 
443  // Define case to be run
444  unsigned i_case=0;
446 
447  // Parse command line
449 
450  // Doc what has actually been specified on the command line
452 
453  // Create generalised Hookean constitutive equations
456 
457  if (i_case==0)
458  {
459  std::cout << "Running with pure displacement formulation\n";
460 
461  // Typedef the element
462  typedef QPVDElement<2,3> ELEMENT;
463 
464  // Set up the problem
466 
467  // Output initial configuration
468  problem.doc_solution();
469 
470  // Parameter study
473  double pressure_increment=-1.0e-4;
474 
475  unsigned nstep=2; // 10;
476  for (unsigned istep=0;istep<nstep;istep++)
477  {
478  // Solve the problem
479  problem.newton_solve();
480 
481  // Output solution
482  problem.doc_solution();
483 
484  // Bump up suction
485  Global_Physical_Variables::P+=pressure_increment;
486  }
487  } // end_displacement_formulation
488  else if (i_case==1)
489  // Displacement/pressure formulation
490  {
491  std::cout << "Running with pressure/displacement formulation\n";
492 
493  // Typedef the element
494  typedef QPVDElementWithContinuousPressure<2> ELEMENT;
495 
496  // Set up the problem
498 
499  // Output initial configuration
500  problem.doc_solution();
501 
502  // Parameter study
505  double pressure_increment=-1.0e-4;
506 
507  unsigned nstep=2;
508  for (unsigned istep=0;istep<nstep;istep++)
509  {
510  // Solve the problem
511  problem.newton_solve();
512 
513  // Output solution
514  problem.doc_solution();
515 
516  // Bump up suction
517  Global_Physical_Variables::P+=pressure_increment;
518  }
519  }
520  else if (i_case==2)
521  // Displacement/pressure formulation enforcing incompressibility
522  {
523  std::cout << "Running with pressure/displacement "
524  << "formulation (incompressible) \n";
525 
526  // Typedef the element
527  typedef QPVDElementWithContinuousPressure<2> ELEMENT;
528 
529  // Set up the problem
531 
532  // Output initial configuration
533  problem.doc_solution();
534 
535  // Loop over all elements and set incompressibility flag
536  {
537  const unsigned n_element = problem.mesh_pt()->nelement();
538  for(unsigned e=0;e<n_element;e++)
539  {
540  //Cast the element to the equation base of our 2D elastiticy elements
541  PVDEquationsWithPressure<2> *cast_el_pt =
542  dynamic_cast<PVDEquationsWithPressure<2>*>(
543  problem.mesh_pt()->element_pt(e));
544 
545  //If the cast was successful, it's a bulk element,
546  //so set the incompressibilty flag
547  if(cast_el_pt)
548  {
549  cast_el_pt->set_incompressible();
550  }
551  }
552  }
553 
554  // Output initial configuration
555  problem.doc_solution();
556 
557  // Parameter study
560  double pressure_increment=-1.0e-4;
561 
562  unsigned nstep=2;
563  for (unsigned istep=0;istep<nstep;istep++)
564  {
565  // Solve the problem
566  problem.newton_solve();
567 
568  //Output solution
569  problem.doc_solution();
570 
571  // Bump up suction
572  Global_Physical_Variables::P+=pressure_increment;
573  }
574  }
575 
576 
577 
578 } // end main
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Unstructured solid problem.
Definition: adaptive_unstructured_two_d_solid.cc:117
Definition: constitutive_laws.h:699
Definition: solid_elements.h:863
void set_incompressible()
Set the material to be incompressible.
Definition: solid_elements.h:881
Definition: solid_elements.h:1523
Definition: solid_elements.h:608
void setup(Time *time_pt)
Create all GeomObjects needed to define the cylinder and the flag.
Definition: turek_flag_non_fsi.cc:277
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:77
double Nu
Poisson's ratio.
Definition: TwenteMeshGluing.cpp:71
ConstitutiveLaw * Constitutive_law_pt
Pointer to constitutive law.
Definition: TwenteMeshGluing.cpp:65
double Gravity
Non-dim gravity.
Definition: meshing/quad_from_triangle_mesh/unstructured_two_d_solid.cc:214
void specify_command_line_flag(const std::string &command_line_flag, const std::string &doc)
Specify possible argument-free command line flag.
Definition: oomph_utilities.cc:451
void parse_and_assign(int argc, char *argv[], const bool &throw_on_unrecognised_args)
Definition: oomph_utilities.cc:760
void doc_specified_flags()
Document specified command line flags.
Definition: oomph_utilities.cc:610
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References Global_Physical_Variables::Constitutive_law_pt, oomph::CommandLineArgs::doc_specified_flags(), e(), Global_Physical_Variables::Gravity, Global_Physical_Variables::Nu, Global_Physical_Variables::P, oomph::CommandLineArgs::parse_and_assign(), problem, oomph::PVDEquationsWithPressure< DIM >::set_incompressible(), Flag_definition::setup(), and oomph::CommandLineArgs::specify_command_line_flag().