37 #include "constitutive.h" 40 #include "meshes/simple_cubic_mesh.template.h" 43 #include "meshes/quarter_tube_mesh.h" 46 using namespace oomph;
56 template<
class ELEMENT>
58 public virtual RefineableQuarterTubeMesh<ELEMENT>,
59 public virtual SolidMesh
66 const Vector<double>& xi_lo,
67 const double& fract_mid,
68 const Vector<double>& xi_hi,
69 const unsigned& nlayer,
70 TimeStepper* time_stepper_pt=
71 &Mesh::Default_TimeStepper) :
72 QuarterTubeMesh<ELEMENT>(wall_pt,xi_lo,fract_mid,xi_hi,
73 nlayer,time_stepper_pt),
74 RefineableQuarterTubeMesh<ELEMENT>(wall_pt,xi_lo,fract_mid,xi_hi,
75 nlayer,time_stepper_pt)
78 set_lagrangian_nodal_coordinates();
94 template<
class ELEMENT>
96 public virtual SolidMesh
103 const Vector<double>& xi_lo,
104 const double& fract_mid,
105 const Vector<double>& xi_hi,
106 const unsigned& nlayer,
107 TimeStepper* time_stepper_pt=
108 &Mesh::Default_TimeStepper) :
109 QuarterTubeMesh<ELEMENT>(wall_pt,xi_lo,fract_mid,xi_hi,
110 nlayer,time_stepper_pt)
113 set_lagrangian_nodal_coordinates();
152 const Vector<double> &xi,
185 template<
class ELEMENT>
207 PVDEquationsBase<3>::pin_redundant_nodal_solid_pressures(
208 mesh_pt()->element_pt());
235 void run_tests(
const unsigned& i_case,
236 const bool& incompress,
250 template<
class ELEMENT>
257 GeomObject* wall_pt=
new EllipticalTube(radius,radius);
260 Vector<double> xi_lo(2);
264 Vector<double> xi_hi(2);
266 xi_hi[1]=2.0*atan(1.0);
279 (wall_pt,xi_lo,frac_mid,xi_hi,nlayer);
283 mesh_pt())->spatial_error_estimator_pt()=
new Z2ErrorEstimator;
286 mesh_pt()->max_permitted_error()=0.05;
287 mesh_pt()->min_permitted_error()=0.005;
299 (wall_pt,xi_lo,frac_mid,xi_hi,nlayer);
305 unsigned n_element=mesh_pt()->nelement();
306 for(
unsigned i=0;i<n_element;i++)
309 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(i));
312 el_pt->constitutive_law_pt() =
320 PVDEquationsWithPressure<3>* cast_el_pt =
321 dynamic_cast<PVDEquationsWithPressure<3>*
>(mesh_pt()->element_pt(i));
324 cast_el_pt->set_incompressible();
332 unsigned n_side = mesh_pt()->nboundary_node(b);
335 for(
unsigned i=0;i<n_side;i++)
337 mesh_pt()->boundary_node_pt(b,i)->pin_position(0);
338 mesh_pt()->boundary_node_pt(b,i)->pin_position(1);
339 mesh_pt()->boundary_node_pt(b,i)->pin_position(2);
343 PVDEquationsBase<3>::pin_redundant_nodal_solid_pressures(
344 mesh_pt()->element_pt());
347 assign_eqn_numbers();
350 Doc_info.set_directory(
"RESLT");
359 template<
class ELEMENT>
370 sprintf(filename,
"%s/soln%i.dat",Doc_info.directory().c_str(),
372 some_file.open(filename);
373 mesh_pt()->output(some_file,n_plot);
387 template<
class ELEMENT>
389 const bool& incompress,
397 sprintf(dirname,
"RESLT_refine%i",i_case);
399 sprintf(dirname,
"RESLT_norefine%i",i_case);
403 Doc_info.set_directory(dirname);
407 unsigned n_element=mesh_pt()->nelement();
408 for(
unsigned i=0;i<n_element;i++)
411 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(i));
416 el_pt->enable_evaluate_jacobian_by_fd();
420 el_pt->disable_evaluate_jacobian_by_fd();
426 PVDEquationsWithPressure<3>* cast_el_pt =
427 dynamic_cast<PVDEquationsWithPressure<3>*
>(
428 mesh_pt()->element_pt(i));
431 cast_el_pt->set_compressible();
446 double g_increment=1.0e-5;
447 for(
unsigned i=0;i<nstep;i++)
456 unsigned max_adapt=1;
457 newton_solve(max_adapt);
477 int main(
int argc,
char* argv[])
491 new IsotropicStrainEnergyFunctionConstitutiveLaw(
506 double g_increment=5.0e-4;
507 for(
unsigned i=0;i<nstep;i++)
514 unsigned max_adapt=1;
515 problem.newton_solve(max_adapt);
539 bool incompress=
true;
542 for (
unsigned i=0;i<2;i++)
558 problem.
run_tests(0+i*ncase,incompress,use_fd);
564 problem.
run_tests(0+i*ncase,incompress,use_fd);
573 problem.
run_tests(1+i*ncase,incompress,use_fd);
579 problem.
run_tests(1+i*ncase,incompress,use_fd);
588 problem.
run_tests(2+i*ncase,incompress,use_fd);
594 problem.
run_tests(2+i*ncase,incompress,use_fd);
613 new IsotropicStrainEnergyFunctionConstitutiveLaw(
623 problem.
run_tests(3+i*ncase,incompress,use_fd);
629 problem.
run_tests(3+i*ncase,incompress,use_fd);
639 problem.
run_tests(4+i*ncase,incompress,use_fd);
645 problem.
run_tests(4+i*ncase,incompress,use_fd);
658 std::cout <<
"\n\n\n CR Total fill_in... : bla \n\n\n " << std::endl;
double Gravity
Non-dim gravity.
Problem class for the 3D cantilever "beam" structure.
void run_tests(const unsigned &i_case, const bool &incompress, const bool &use_fd)
Run extended tests – doc in RESLTi_case.
ElasticQuarterTubeMesh< ELEMENT > * mesh_pt()
Access function for the mesh.
int main(int argc, char *argv[])
Driver for 3D cantilever beam loaded by gravity.
virtual ~RefineableElasticQuarterTubeMesh()
Empty Destructor.
Simple quarter tube mesh upgraded to become a solid mesh.
void actions_before_newton_solve()
Update function (empty)
ConstitutiveLaw * Constitutive_law_pt
Pointer to constitutive law.
void actions_after_adapt()
Actions after adapt.
void gravity(const double &time, const Vector< double > &xi, Vector< double > &b)
Non-dimensional gravity as body force.
virtual ~ElasticQuarterTubeMesh()
Empty Destructor.
void actions_after_newton_solve()
Update function (empty)
ElasticQuarterTubeMesh(GeomObject *wall_pt, const Vector< double > &xi_lo, const double &fract_mid, const Vector< double > &xi_hi, const unsigned &nlayer, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor:
void doc_solution()
Doc the solution.
double C1
First "Mooney Rivlin" coefficient.
StrainEnergyFunction * Strain_energy_function_pt
Pointer to strain energy function.
CantileverProblem()
Constructor:
RefineableElasticQuarterTubeMesh< ELEMENT > * mesh_pt()
Access function for the mesh.
double C2
Second "Mooney Rivlin" coefficient.
void actions_before_adapt()
Actions before adapt. Empty.
RefineableElasticQuarterTubeMesh(GeomObject *wall_pt, const Vector< double > &xi_lo, const double &fract_mid, const Vector< double > &xi_hi, const unsigned &nlayer, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor:
Simple quarter tube mesh upgraded to become a solid mesh.
double Nu
Poisson's ratio.
DocInfo Doc_info
DocInfo object for output.