solid/three_d_cantilever/three_d_cantilever.cc File Reference

Classes

class  RefineableElasticQuarterTubeMesh< ELEMENT >
 Simple quarter tube mesh upgraded to become a solid mesh. More...
 
class  ElasticQuarterTubeMesh< ELEMENT >
 Simple quarter tube mesh upgraded to become a solid mesh. More...
 
class  CantileverProblem< ELEMENT >
 Problem class for the cantilever "beam" structure. 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...
 
int main (int argc, char *argv[])
 Driver for 3D cantilever beam loaded by gravity. More...
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

Driver for 3D cantilever beam loaded by gravity.

474 {
475 
476  // Run main demo code if no command line arguments are specified
477  if (argc==1)
478  {
479 
480  // Create incompressible Mooney Rivlin strain energy function
484 
485  // Define a constitutive law (based on strain energy function)
489 
490  //Set up the problem with continous pressure/displacement
492 
493  // Doc solution
494  problem.doc_solution();
495 
496  // Initial values for parameter values
498 
499  //Parameter incrementation
500  unsigned nstep=10;
501 
502  double g_increment=5.0e-4;
503  for(unsigned i=0;i<nstep;i++)
504  {
505  // Increment load
507 
508  // Solve the problem with Newton's method, allowing
509  // up to max_adapt mesh adaptations after every solve.
510  unsigned max_adapt=1;
511  problem.newton_solve(max_adapt);
512 
513  // Doc solution
514  problem.doc_solution();
515  }
516 
517  } // end main demo code
518 
519  // Run self-tests
520  else
521  {
522 
523  // Additional test cases combining adaptive/non-adaptive
524  // elements with displacement/displacement-pressure
525  // discretisation and various constitutive equations
526 
527 
528  // Initialise flag for FD evaluation
529  bool use_fd=false;
530 
531  // Number of cases per implementation
532  unsigned ncase=5;
533 
534  // Is the material incomressible?
535  bool incompress=true;
536 
537  // Loop over fd and analytical implementation
538  for (unsigned i=0;i<2;i++)
539  {
540 
541  // Generalised Hookean constitutive equations
542  //-------------------------------------------
543  {
547 
548  incompress=false;
549 
550 #ifdef REFINE
551  {
552  //Set up the problem with pure displacement based elements
554  problem.run_tests(0+i*ncase,incompress,use_fd);
555  }
556 #else
557  {
558  //Set up the problem with pure displacement based elements
560  problem.run_tests(0+i*ncase,incompress,use_fd);
561  }
562 #endif
563 
564 
565 #ifdef REFINE
566  {
567  //Set up the problem with continous pressure/displacement
569  problem.run_tests(1+i*ncase,incompress,use_fd);
570  }
571 #else
572  {
573  //Set up the problem with continous pressure/displacement
575  problem.run_tests(1+i*ncase,incompress,use_fd);
576  }
577 #endif
578 
579 
580 #ifdef REFINE
581  {
582  //Set up the problem with discontinous pressure/displacement
584  problem.run_tests(2+i*ncase,incompress,use_fd);
585  }
586 #else
587  {
588  //Set up the problem with discontinous pressure/displacement
590  problem.run_tests(2+i*ncase,incompress,use_fd);
591  }
592 #endif
593 
596  }
597 
598 
599 
600  // Incompressible Mooney Rivlin
601  //-----------------------------
602  {
606 
607  // Define a constitutive law (based on strain energy function)
611 
612  incompress=true;
613 
614 
615 #ifdef REFINE
616  {
617  //Set up the problem with continous pressure/displacement
619  problem.run_tests(3+i*ncase,incompress,use_fd);
620  }
621 #else
622  {
623  //Set up the problem with continous pressure/displacement
625  problem.run_tests(3+i*ncase,incompress,use_fd);
626  }
627 #endif
628 
629 
630 
631 #ifdef REFINE
632  {
633  //Set up the problem with discontinous pressure/displacement
635  problem.run_tests(4+i*ncase,incompress,use_fd);
636  }
637 #else
638  {
639  //Set up the problem with discontinous pressure/displacement
641  problem.run_tests(4+i*ncase,incompress,use_fd);
642  }
643 #endif
644 
647 
650  }
651 
652 
653  use_fd=true;
654  std::cout << "\n\n\n CR Total fill_in... : bla \n\n\n " << std::endl;
655 
656  }
657  }
658 
659 
660 } //end of main
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Problem class for the cantilever "beam" structure.
Definition: mpi/distribution/airy_cantilever/airy_cantilever2.cc:213
Definition: constitutive_laws.h:699
Definition: constitutive_laws.h:801
Definition: constitutive_laws.h:145
double E
Elastic modulus.
Definition: TwenteMeshGluing.cpp:68
double Nu
Poisson's ratio.
Definition: TwenteMeshGluing.cpp:71
ConstitutiveLaw * Constitutive_law_pt
Pointer to constitutive law.
Definition: TwenteMeshGluing.cpp:65
double C1
"Mooney Rivlin" coefficient for generalised Mooney Rivlin law
Definition: TwenteMeshGluing.cpp:74
double Gravity
Non-dim gravity.
Definition: meshing/quad_from_triangle_mesh/unstructured_two_d_solid.cc:214
StrainEnergyFunction * Strain_energy_function_pt
Pointer to strain energy function.
Definition: TwenteMeshGluing.cpp:62
double C2
"Mooney Rivlin" coefficient for generalised Mooney Rivlin law
Definition: mpi/distribution/airy_cantilever/airy_cantilever2.cc:156
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References Global_Physical_Variables::C1, Global_Physical_Variables::C2, Global_Physical_Variables::Constitutive_law_pt, Global_Physical_Variables::E, Global_Physical_Variables::Gravity, i, Global_Physical_Variables::Nu, problem, and Global_Physical_Variables::Strain_energy_function_pt.