33 #include "constitutive.h"
36 #include "meshes/simple_cubic_mesh.template.h"
39 #include "meshes/quarter_tube_mesh.h"
42 using namespace oomph;
52 template<
class ELEMENT>
54 public virtual RefineableQuarterTubeMesh<ELEMENT>,
55 public virtual SolidMesh
62 const Vector<double>& xi_lo,
63 const double& fract_mid,
64 const Vector<double>& xi_hi,
65 const unsigned& nlayer,
66 TimeStepper* time_stepper_pt=
67 &Mesh::Default_TimeStepper) :
68 QuarterTubeMesh<ELEMENT>(wall_pt,xi_lo,fract_mid,xi_hi,
69 nlayer,time_stepper_pt),
70 RefineableQuarterTubeMesh<ELEMENT>(wall_pt,xi_lo,fract_mid,xi_hi,
71 nlayer,time_stepper_pt)
74 set_lagrangian_nodal_coordinates();
90 template<
class ELEMENT>
92 public virtual SolidMesh
99 const Vector<double>& xi_lo,
100 const double& fract_mid,
101 const Vector<double>& xi_hi,
102 const unsigned& nlayer,
103 TimeStepper* time_stepper_pt=
104 &Mesh::Default_TimeStepper) :
105 QuarterTubeMesh<ELEMENT>(wall_pt,xi_lo,fract_mid,xi_hi,
106 nlayer,time_stepper_pt)
109 set_lagrangian_nodal_coordinates();
148 const Vector<double> &xi,
181 template<
class ELEMENT>
203 PVDEquationsBase<3>::pin_redundant_nodal_solid_pressures(
204 mesh_pt()->element_pt());
231 void run_tests(
const unsigned& i_case,
232 const bool& incompress,
246 template<
class ELEMENT>
253 GeomObject* wall_pt=
new EllipticalTube(radius,radius);
256 Vector<double> xi_lo(2);
260 Vector<double> xi_hi(2);
262 xi_hi[1]=2.0*atan(1.0);
275 (wall_pt,xi_lo,frac_mid,xi_hi,nlayer);
279 mesh_pt())->spatial_error_estimator_pt()=
new Z2ErrorEstimator;
282 mesh_pt()->max_permitted_error()=0.05;
283 mesh_pt()->min_permitted_error()=0.005;
295 (wall_pt,xi_lo,frac_mid,xi_hi,nlayer);
301 unsigned n_element=mesh_pt()->nelement();
302 for(
unsigned i=0;i<n_element;i++)
305 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(i));
308 el_pt->constitutive_law_pt() =
316 PVDEquationsWithPressure<3>* cast_el_pt =
317 dynamic_cast<PVDEquationsWithPressure<3>*
>(mesh_pt()->element_pt(i));
320 cast_el_pt->set_incompressible();
328 unsigned n_side = mesh_pt()->nboundary_node(b);
331 for(
unsigned i=0;i<n_side;i++)
333 mesh_pt()->boundary_node_pt(b,i)->pin_position(0);
334 mesh_pt()->boundary_node_pt(b,i)->pin_position(1);
335 mesh_pt()->boundary_node_pt(b,i)->pin_position(2);
339 PVDEquationsBase<3>::pin_redundant_nodal_solid_pressures(
340 mesh_pt()->element_pt());
343 assign_eqn_numbers();
346 Doc_info.set_directory(
"RESLT");
355 template<
class ELEMENT>
366 sprintf(filename,
"%s/soln%i.dat",Doc_info.directory().c_str(),
368 some_file.open(filename);
369 mesh_pt()->output(some_file,n_plot);
383 template<
class ELEMENT>
385 const bool& incompress,
393 sprintf(dirname,
"RESLT_refine%i",i_case);
395 sprintf(dirname,
"RESLT_norefine%i",i_case);
399 Doc_info.set_directory(dirname);
403 unsigned n_element=mesh_pt()->nelement();
404 for(
unsigned i=0;i<n_element;i++)
407 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(i));
412 el_pt->enable_evaluate_jacobian_by_fd();
416 el_pt->disable_evaluate_jacobian_by_fd();
422 PVDEquationsWithPressure<3>* cast_el_pt =
423 dynamic_cast<PVDEquationsWithPressure<3>*
>(
424 mesh_pt()->element_pt(i));
427 cast_el_pt->set_compressible();
442 double g_increment=1.0e-5;
443 for(
unsigned i=0;i<nstep;i++)
452 unsigned max_adapt=1;
453 newton_solve(max_adapt);
473 int main(
int argc,
char* argv[])
487 new IsotropicStrainEnergyFunctionConstitutiveLaw(
502 double g_increment=5.0e-4;
503 for(
unsigned i=0;i<nstep;i++)
510 unsigned max_adapt=1;
511 problem.newton_solve(max_adapt);
535 bool incompress=
true;
538 for (
unsigned i=0;i<2;i++)
554 problem.
run_tests(0+i*ncase,incompress,use_fd);
560 problem.
run_tests(0+i*ncase,incompress,use_fd);
569 problem.
run_tests(1+i*ncase,incompress,use_fd);
575 problem.
run_tests(1+i*ncase,incompress,use_fd);
584 problem.
run_tests(2+i*ncase,incompress,use_fd);
590 problem.
run_tests(2+i*ncase,incompress,use_fd);
609 new IsotropicStrainEnergyFunctionConstitutiveLaw(
619 problem.
run_tests(3+i*ncase,incompress,use_fd);
625 problem.
run_tests(3+i*ncase,incompress,use_fd);
635 problem.
run_tests(4+i*ncase,incompress,use_fd);
641 problem.
run_tests(4+i*ncase,incompress,use_fd);
654 std::cout <<
"\n\n\n CR Total fill_in... : bla \n\n\n " << std::endl;
Problem class for the 3D cantilever "beam" structure.
RefineableElasticQuarterTubeMesh< ELEMENT > * mesh_pt()
Access function for the mesh.
void actions_before_newton_solve()
Update function (empty)
DocInfo Doc_info
DocInfo object for output.
ElasticQuarterTubeMesh< ELEMENT > * mesh_pt()
Access function for the mesh.
void actions_after_newton_solve()
Update function (empty)
void actions_before_adapt()
Actions before adapt. Empty.
void doc_solution()
Doc the solution.
CantileverProblem()
Constructor:
void actions_after_adapt()
Actions after adapt.
void run_tests(const unsigned &i_case, const bool &incompress, const bool &use_fd)
Run extended tests – doc in RESLTi_case.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
virtual ~ElasticQuarterTubeMesh()
Empty Destructor.
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:
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
virtual ~RefineableElasticQuarterTubeMesh()
Empty Destructor.
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:
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
void gravity(const double &time, const Vector< double > &xi, Vector< double > &b)
Non-dimensional gravity as body force.
ConstitutiveLaw * Constitutive_law_pt
Pointer to constitutive law.
double Nu
Poisson's ratio.
StrainEnergyFunction * Strain_energy_function_pt
Pointer to strain energy function.
double C1
First "Mooney Rivlin" coefficient.
double Gravity
Non-dim gravity.
double C2
Second "Mooney Rivlin" coefficient.
int main(int argc, char *argv[])
Driver for 3D cantilever beam loaded by gravity.