SolidBeamUnitTest.cpp File Reference
#include "Oomph/SolidProblem.h"
#include "Math/Helpers.h"

Classes

class  Beam
 Defines a SolidProblem of element type RefineableQDPVDElement<3,2>. Add functionality to write output. More...
 

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

Simulates a cubic rod (20mm x 2mm x 2mm) of density 2500 kg/m^3, elastic modulus 100 MPa, fixed on left side, bent by gravity

69 {
70  #ifdef OOMPH_HAS_MPI
71  MPI_Helpers::init(argc,argv);
72  #endif
73  // Solve the problem
74  Beam problem;
75  problem.setName("SolidBeamUnitTest");
76  problem.setElasticModulus(1e8);
77  problem.setDensity(2500);
78  problem.setSolidCubicMesh(20, 2, 2, 0, 0.2, 0, 0.02, 0, 0.02);
79  problem.pinBoundary(Beam::Boundary::X_MIN);
80  problem.setBodyForceAsGravity();
81  problem.setNewtonSolverTolerance(3e-8);
82  problem.prepareForSolve();
83  #ifdef OOMPH_HAS_MPI
84  // Distribute the problem
85  problem.distribute();
86  // Check halo schemes (optional)
87  //problem.check_halo_schemes();
88  #endif
89  problem.linear_solver_pt()->disable_doc_time();
90  //problem.disable_info_in_newton_solve();
91  problem.solveSteady();
92  problem.checkBeamDeflection();
93  #ifdef OOMPH_HAS_MPI
94  MPI_Helpers::finalize();
95  #endif
96 
97  return 0;
98 }
Defines a SolidProblem of element type RefineableQDPVDElement<3,2>. Add functionality to write output...
Definition: SolidBeam.cpp:31
void checkBeamDeflection()
Definition: SolidBeamUnitTest.cpp:37
void setElasticModulus(double elasticModulus)
set function for elasticModulus_
Definition: SolidProblem.h:153
void setName(const std::string &name)
set function for name_
Definition: SolidProblem.h:140
void prepareForSolve()
Definition: SolidProblem.h:322
void setSolidCubicMesh(const unsigned &nx, const unsigned &ny, const unsigned &nz, const double &xMin, const double &xMax, const double &yMin, const double &yMax, const double &zMin, const double &zMax)
Definition: SolidProblem.h:546
void pinBoundary(unsigned b)
Definition: SolidProblem.h:227
void setDensity(double density)
set function for density_
Definition: SolidProblem.h:192
void setBodyForceAsGravity(double gravity=9.8)
set function for body_force_pt
Definition: SolidProblem.h:205
void solveSteady()
Definition: SolidProblem.h:411
void setNewtonSolverTolerance(double Newton_solver_tolerance)
set function for Newton_solver_tolerance
Definition: SolidProblem.h:257

References Beam::checkBeamDeflection(), SolidProblem< ELEMENT_TYPE >::pinBoundary(), SolidProblem< ELEMENT_TYPE >::prepareForSolve(), SolidProblem< ELEMENT_TYPE >::setBodyForceAsGravity(), SolidProblem< ELEMENT_TYPE >::setDensity(), SolidProblem< ELEMENT_TYPE >::setElasticModulus(), SolidProblem< ELEMENT_TYPE >::setName(), SolidProblem< ELEMENT_TYPE >::setNewtonSolverTolerance(), SolidProblem< ELEMENT_TYPE >::setSolidCubicMesh(), and SolidProblem< ELEMENT_TYPE >::solveSteady().