39 #include "meshes/quarter_circle_sector_mesh.h"
43 using namespace oomph;
71 const Vector<double> &n, Vector<double> &traction)
73 unsigned dim = traction.size();
74 for(
unsigned i=0;i<dim;i++)
76 traction[i] = -
P*n[i];
111 template <
class ELEMENT>
113 public virtual RefineableQuarterCircleSectorMesh<ELEMENT>,
114 public virtual SolidMesh
124 const double& fract_mid,
126 TimeStepper* time_stepper_pt=
127 &Mesh::Default_TimeStepper) :
128 RefineableQuarterCircleSectorMesh<ELEMENT>(wall_pt,xi_lo,fract_mid,xi_hi,
134 set_lagrangian_nodal_coordinates();
143 traction_mesh_pt =
new SolidMesh;
147 unsigned n_element = this->nboundary_element(b);
148 for (
unsigned e=0;e<n_element;e++)
151 FiniteElement* fe_pt = this->boundary_element_pt(b,e);
154 int face_index = this->face_index_at_boundary(b,e);
157 traction_mesh_pt->add_element_pt(
new SolidTractionElement<ELEMENT>
169 template<
class ELEMENT>
179 void parameter_study(
const unsigned& case_number);
182 void doc_solution(DocInfo& doc_info);
209 template<
class ELEMENT>
214 Ellipse* curved_boundary_pt =
new Ellipse(1.0,1.0);
219 double xi_hi=2.0*atan(1.0);
223 double fract_mid=0.5;
227 curved_boundary_pt,xi_lo,fract_mid,xi_hi);
231 unsigned n_boundary_node = Solid_mesh_pt->nboundary_node(1);
232 Trace_node_pt.resize(n_boundary_node);
233 for(
unsigned j=0;j<n_boundary_node;j++)
234 {Trace_node_pt[j]=Solid_mesh_pt->boundary_node_pt(1,j);}
237 Solid_mesh_pt->refine_uniformly();
240 Solid_mesh_pt->make_traction_element_mesh(Traction_mesh_pt);
243 add_sub_mesh(Solid_mesh_pt);
246 add_sub_mesh(Traction_mesh_pt);
253 unsigned n_side = mesh_pt()->nboundary_node(2);
254 for(
unsigned i=0;i<n_side;i++)
255 {Solid_mesh_pt->boundary_node_pt(2,i)->pin_position(0);}
258 unsigned n_bottom = mesh_pt()->nboundary_node(0);
259 for(
unsigned i=0;i<n_bottom;i++)
260 {Solid_mesh_pt->boundary_node_pt(0,i)->pin_position(1);}
263 PVDEquationsBase<2>::pin_redundant_nodal_solid_pressures(
264 Solid_mesh_pt->element_pt());
267 unsigned n_element =Solid_mesh_pt->nelement();
268 for(
unsigned i=0;i<n_element;i++)
271 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(Solid_mesh_pt->element_pt(i));
274 el_pt->constitutive_law_pt() =
282 n_element=Traction_mesh_pt->nelement();
283 for(
unsigned i=0;i<n_element;i++)
286 SolidTractionElement<ELEMENT> *el_pt =
287 dynamic_cast<SolidTractionElement<ELEMENT>*
>
288 (Traction_mesh_pt->element_pt(i));
295 cout <<
"Number of equations: " << assign_eqn_numbers() << std::endl;
302 template<
class ELEMENT>
313 sprintf(filename,
"%s/soln%i.dat",doc_info.directory().c_str(),
315 some_file.open(filename);
316 Solid_mesh_pt->output(some_file,npts);
320 unsigned nelement = Solid_mesh_pt->nelement();
324 for(
unsigned e=0;e<nelement;e++)
325 {volume+= Solid_mesh_pt->finite_element_pt(e)->size();}
331 *((1.0+nu)*(1.0-2.0*nu)));
341 unsigned ntrace_node=Trace_node_pt.size();
342 for (
unsigned j=0;j<ntrace_node;j++)
344 Trace_file << sqrt(pow(Trace_node_pt[j]->x(0),2)+
345 pow(Trace_node_pt[j]->x(1),2)) <<
" ";
347 Trace_file << std::endl;
355 template<
class ELEMENT>
357 const unsigned& case_number)
363 sprintf(dirname,
"RESLT%i",case_number);
366 doc_info.set_directory(dirname);
373 sprintf(filename,
"%s/trace.dat",doc_info.directory().c_str());
374 Trace_file.open(filename);
377 double delta_p=0.0125;
382 if (CommandLineArgs::Argc!=1)
392 for(
unsigned i=0;i<nstep;i++)
398 doc_solution(doc_info);
411 int main(
int argc,
char* argv[])
415 CommandLineArgs::setup(argc,argv);
425 new IsotropicStrainEnergyFunctionConstitutiveLaw(
434 cout <<
"gen. M.R.: RefineableQPVDElement<2,3>" << std::endl;
447 RefineableQPVDElementWithContinuousPressure<2> > problem;
449 cout <<
"gen. M.R.: RefineableQPVDElementWithContinuousPressure<2> "
466 cout <<
"gen. M.R.: RefineableQPVDElementWithPressure<2>" << std::endl;
488 cout <<
"gen. Hooke: RefineableQPVDElement<2,3> " << std::endl;
501 RefineableQPVDElementWithContinuousPressure<2> > problem;
503 cout <<
"gen. Hooke: RefineableQPVDElementWithContinuousPressure<2> "
519 cout <<
"gen. Hooke: RefineableQPVDElementWithPressure<2> " << std::endl;
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
void make_traction_element_mesh(SolidMesh *&traction_mesh_pt)
Function to create mesh made of traction elements.
Uniform compression of a circular disk in a state of plane strain, subject to uniform growth.
void actions_before_newton_solve()
Update function (empty)
StaticDiskCompressionProblem()
Constructor:
void actions_after_newton_solve()
Update function (empty)
SolidMesh * Traction_mesh_pt
Pointer to mesh of traction elements.
ElasticRefineableQuarterCircleSectorMesh< ELEMENT > * Solid_mesh_pt
Pointer to solid mesh.
ofstream Trace_file
Trace file.
Vector< Node * > Trace_node_pt
Vector of pointers to nodes whose position we're tracing.
void doc_solution(DocInfo &doc_info)
Doc the solution.
void parameter_study(const unsigned &case_number)
Run simulation: Pass case number to label output files.
int main(int argc, char *argv[])
Driver code for disk-compression.
void constant_pressure(const Vector< double > &xi, const Vector< double > &x, const Vector< double > &n, Vector< double > &traction)
Constant pressure load.
double P
Uniform pressure.
ConstitutiveLaw * Constitutive_law_pt
Pointer to constitutive law.
double Nu
Poisson's ratio.
void growth_function(const Vector< double > &xi, double &gamma)
Growth function.
StrainEnergyFunction * Strain_energy_function_pt
Pointer to strain energy function.
double C1
"Mooney Rivlin" coefficient for generalised Mooney Rivlin law
double Uniform_gamma
Uniform volumetric expansion.