36 #include "meshes/one_d_lagrangian_mesh.h"
40 using namespace oomph;
65 const Vector<double> &x,
66 const Vector<double>& N,
69 for(
unsigned i=0;i<2;i++)
96 template<
class ELEMENT>
106 bool& load_data_already_exists);
111 return dynamic_cast<OneDLagrangianMesh<ELEMENT>*
>(Problem::mesh_pt());
121 void doc_solution(DocInfo& doc_info, ofstream& trace_file);
124 void parameter_study(DocInfo& doc_info);
148 template<
class ELEMENT>
150 (
const unsigned& n_element,
bool& displ_control,
bool& load_data_already_exists) :
151 Displ_control(displ_control),Nbeam_element(n_element)
158 double length=2.0*atan(1.0);
162 new OneDLagrangianMesh<ELEMENT>(n_element,length,
Undef_geom_pt);
169 mesh_pt()->boundary_node_pt(ibound,0)->pin_position(1);
171 mesh_pt()->boundary_node_pt(ibound,0)->pin_position(1,0);
176 mesh_pt()->boundary_node_pt(ibound,0)->pin_position(0);
178 mesh_pt()->boundary_node_pt(ibound,0)->pin_position(1,1);
197 SolidFiniteElement* controlled_element_pt=
201 unsigned controlled_direction=1;
204 Vector<double> s_displ_control(1);
205 s_displ_control[0]=1.0;
208 DisplacementControlElement* displ_control_el_pt;
212 if (!load_data_already_exists)
216 new DisplacementControlElement(controlled_element_pt,
218 controlled_direction,
225 displacement_control_load_pt();
244 new DisplacementControlElement(controlled_element_pt,
246 controlled_direction,
252 mesh_pt()->add_element_pt(displ_control_el_pt);
262 ELEMENT *elem_pt =
dynamic_cast<ELEMENT*
>(
mesh_pt()->element_pt(i));
285 cout <<
"# of dofs " << assign_eqn_numbers() << std::endl;
293 template<
class ELEMENT>
295 ofstream& trace_file)
304 sprintf(filename,
"%s/ring%i.dat",doc_info.directory().c_str(),
306 some_file.open(filename);
307 mesh_pt()->output(some_file,npts);
311 Vector<double> s_left(1);
313 Vector<double> s_right(1);
321 <<
dynamic_cast<ELEMENT*
>(mesh_pt()->
322 element_pt(0))->interpolated_x(s_left,0)
324 <<
dynamic_cast<ELEMENT*
>
325 (mesh_pt()->element_pt(Nbeam_element-1))->interpolated_x(s_right,1)
336 template<
class ELEMENT>
342 sprintf(filename,
"%s/trace.dat",doc_info.directory().c_str());
343 ofstream trace_file(filename);
344 trace_file <<
"VARIABLES=\"p_e_x_t\",\"R_1\",\"R_2\"" << std::endl;
345 trace_file <<
"ZONE" << std::endl;
348 doc_solution(doc_info,trace_file);
354 double displ_increment=1.0/double(nstep-1);
357 double pext_increment=(p_owc-p_buckl)/
double(nstep-1);
370 Max_newton_iterations=100;
383 for(
unsigned i=1;i<=nstep;i++)
403 doc_solution(doc_info,trace_file);
416 trace_file <<
"ZONE" << std::endl;
420 for(
unsigned i=nstep;i<2*nstep;i++)
440 doc_solution(doc_info,trace_file);
459 unsigned n_element = 13;
462 bool displ_control=
true;
470 bool load_data_already_exists=
true;
474 problem(n_element,displ_control,load_data_already_exists);
477 doc_info.set_directory(
"RESLT_global");
486 bool load_data_already_exists=
false;
490 problem(n_element,displ_control,load_data_already_exists);
493 doc_info.set_directory(
"RESLT_no_global");
////////////////////////////////////////////////////////////////// //////////////////////////////////...
GeomObject * Undef_geom_pt
Pointer to geometric object that represents the undeformed shape.
ElasticRingProblem(const unsigned &n_element, bool &displ_control, bool &load_data_already_exists)
Constructor: Number of elements and flags for displ control and displacement control with existing da...
void actions_after_newton_solve()
Update function is empty.
void actions_before_newton_solve()
Update function is empty.
OneDLagrangianMesh< ELEMENT > * mesh_pt()
Access function for the specific mesh.
bool Displ_control
Use displacement control?
unsigned Nbeam_element
Number of elements in the beam mesh.
void doc_solution(DocInfo &doc_info, ofstream &trace_file)
Doc solution.
void parameter_study(DocInfo &doc_info)
Perform the parameter study.
Namespace for physical parameters.
double Xprescr
Prescribed position (only used for displacement control)
void press_load(const Vector< double > &xi, const Vector< double > &x, const Vector< double > &N, Vector< double > &load)
Load function: Constant external pressure with cos variation to induce buckling in n=2 mode.
double & external_pressure()
Return a reference to the external pressure load on the elastic ring. A reference is obtained by de-r...
Data * Pext_data_pt
Pointer to pressure load (stored in Data so it can become an unknown in the problem when displacement...
double Pcos
Perturbation pressure.
double H
Nondim thickness.
int main()
///////////////////////////////////////////////////////////////////// ///////////////////////////////...