45 #include "meshes/rectangular_quadmesh.h" 49 using namespace oomph;
67 {
return (*Pext_data_pt->value_pt(0))*pow(0.05,3)/12.0;}
72 const Vector<double> &x,
73 const Vector<double> &N,
76 for(
unsigned i=0;i<3;i++)
90 template <
class ELEMENT>
91 class ShellMesh :
public virtual RectangularQuadMesh<ELEMENT>,
92 public virtual SolidMesh
97 ShellMesh(
const unsigned &nx,
const unsigned &ny,
98 const double &lx,
const double &ly);
104 void assign_undeformed_positions(GeomObject*
const &undeformed_midplane_pt);
120 template <
class ELEMENT>
125 RectangularQuadMesh<ELEMENT>(nx,ny,lx,ly)
128 unsigned n_node = nnode();
133 for(
unsigned i=0;i<n_node;i++)
135 node_pt(i)->xi(0) = node_pt(i)->x(0);
136 node_pt(i)->xi(1) = node_pt(i)->x(1);
144 unsigned n_position_type = finite_element_pt(0)->nnodal_position_type();
148 if(n_position_type > 1)
150 double xstep = (this->Xmax - this->Xmin)/((this->Np-1)*this->Nx);
151 double ystep = (this->Ymax - this->Ymin)/((this->Np-1)*this->Ny);
152 for(
unsigned n=0;n<n_node;n++)
155 node_pt(n)->xi_gen(1,0) = 0.5*xstep;
156 node_pt(n)->xi_gen(2,1) = 0.5*ystep;
165 template <
class ELEMENT>
167 GeomObject*
const &undeformed_midplane_pt)
170 unsigned n_node = nnode();
173 for(
unsigned n=0;n<n_node;n++)
176 Vector<double> xi(2);
177 xi[0] = node_pt(n)->xi(0);
178 xi[1] = node_pt(n)->xi(1);
182 DenseMatrix<double> a(2,3);
183 RankThreeTensor<double> dadxi(2,2,3);
186 undeformed_midplane_pt->d2position(xi,R,a,dadxi);
189 for(
unsigned i=0;i<3;i++)
192 node_pt(n)->x_gen(0,i) = R[i];
196 node_pt(n)->x_gen(1,i) = 0.5*a(0,i)*((this->Xmax - this->Xmin)/this->Nx);
197 node_pt(n)->x_gen(2,i) = 0.5*a(1,i)*((this->Ymax - this->Ymin)/this->Ny);
201 node_pt(n)->x_gen(3,i) = 0.25*dadxi(0,1,i);
318 template<
class ELEMENT>
326 const double &lx,
const double &ly);
331 delete Problem::mesh_pt();
367 template<
class ELEMENT>
369 const double &lx,
const double &ly)
372 Mesh::Suppress_warning_about_empty_mesh_level_time_stepper_function=
true;
375 Use_continuation_timestepper =
true;
390 unsigned n_ends =
mesh_pt()->nboundary_node(1);
392 for(
unsigned i=0;i<n_ends;i++)
395 mesh_pt()->boundary_node_pt(1,i)->pin_position(2);
396 mesh_pt()->boundary_node_pt(3,i)->pin_position(2);
398 mesh_pt()->boundary_node_pt(1,i)->pin_position(2,2);
399 mesh_pt()->boundary_node_pt(3,i)->pin_position(2,2);
404 mesh_pt()->boundary_node_pt(1,i)->pin_position(0);
405 mesh_pt()->boundary_node_pt(3,i)->pin_position(0);
407 mesh_pt()->boundary_node_pt(1,i)->pin_position(2,0);
408 mesh_pt()->boundary_node_pt(3,i)->pin_position(2,0);
410 mesh_pt()->boundary_node_pt(1,i)->pin_position(1);
411 mesh_pt()->boundary_node_pt(3,i)->pin_position(1);
413 mesh_pt()->boundary_node_pt(1,i)->pin_position(2,1);
414 mesh_pt()->boundary_node_pt(3,i)->pin_position(2,1);
420 mesh_pt()->boundary_node_pt(1,i)->pin_position(1,0);
421 mesh_pt()->boundary_node_pt(1,i)->pin_position(1,1);
422 mesh_pt()->boundary_node_pt(3,i)->pin_position(1,0);
423 mesh_pt()->boundary_node_pt(3,i)->pin_position(1,1);
425 mesh_pt()->boundary_node_pt(1,i)->pin_position(3,0);
426 mesh_pt()->boundary_node_pt(1,i)->pin_position(3,1);
427 mesh_pt()->boundary_node_pt(3,i)->pin_position(3,0);
428 mesh_pt()->boundary_node_pt(3,i)->pin_position(3,1);
432 unsigned n_side =
mesh_pt()->nboundary_node(0);
433 for(
unsigned i=0;i<n_side;i++)
436 mesh_pt()->boundary_node_pt(0,i)->pin_position(1);
438 mesh_pt()->boundary_node_pt(0,i)->pin_position(1,1);
440 mesh_pt()->boundary_node_pt(0,i)->pin_position(2,0);
441 mesh_pt()->boundary_node_pt(0,i)->pin_position(2,2);
443 mesh_pt()->boundary_node_pt(0,i)->pin_position(3,0);
444 mesh_pt()->boundary_node_pt(0,i)->pin_position(3,2);
447 mesh_pt()->boundary_node_pt(2,i)->pin_position(0);
449 mesh_pt()->boundary_node_pt(2,i)->pin_position(1,0);
451 mesh_pt()->boundary_node_pt(2,i)->pin_position(2,1);
452 mesh_pt()->boundary_node_pt(2,i)->pin_position(2,2);
454 mesh_pt()->boundary_node_pt(2,i)->pin_position(3,1);
455 mesh_pt()->boundary_node_pt(2,i)->pin_position(3,2);
459 if((i>1) && (i<n_side-1))
461 mesh_pt()->boundary_node_pt(0,i)->x(0) += 0.05;
462 mesh_pt()->boundary_node_pt(2,i)->x(1) -= 0.1;
488 SolidFiniteElement* controlled_element_pt=
489 dynamic_cast<ELEMENT*
>(
mesh_pt()->element_pt(3*ny-1));
492 unsigned controlled_direction=1;
495 Vector<double> s_displ_control(2);
496 s_displ_control[0]=1.0;
497 s_displ_control[1]=0.0;
500 DisplacementControlElement* displ_control_el_pt;
504 new DisplacementControlElement(controlled_element_pt,
506 controlled_direction,
513 displacement_control_load_pt();
516 mesh_pt()->add_element_pt(displ_control_el_pt);
524 unsigned n_element = nx*ny;
527 ELEMENT* first_el_pt =
dynamic_cast<ELEMENT*
>(
mesh_pt()->element_pt(0));
530 for(
unsigned e=0;e<n_element;e++)
533 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(
mesh_pt()->element_pt(e));
548 el_pt->pre_compute_d2shape_lagrangian_at_knots();
555 el_pt->set_dshape_lagrangian_stored_from_element(first_el_pt);
565 cout <<
"------------------DISPLACEMENT CONTROL--------------------" 567 cout <<
"# of dofs " << assign_eqn_numbers() << std::endl;
568 cout <<
"----------------------------------------------------------" 578 template<
class ELEMENT>
585 Max_newton_iterations = 40;
588 ofstream trace(
"trace.dat");
591 double disp_incr = 0.05;
595 for(
unsigned i=1;i<13;i++)
598 if(i==3) {disp_incr = 0.1;}
602 cout << std::endl <<
"Increasing displacement: Prescribed_y is " 621 ofstream file(
"final_shape.dat");
634 cout <<
"-----------------ARC-LENGTH CONTINUATION --------------" 636 cout <<
"# of dofs " << assign_eqn_numbers() << std::endl;
637 cout <<
"-------------------------------------------------------" 642 Max_newton_iterations=6;
645 Desired_newton_iterations_ds=3;
648 Desired_proportion_of_arc_length = 0.2;
651 Bifurcation_detection =
true;
657 trace.open(
"trace_disp.dat");
659 for(
unsigned i=0;i<15;i++)
661 ds = arc_length_step_solve(
687 double L_phi=0.5*MathematicalConstants::Pi;
691 problem(5,5,L,L_phi);
void actions_before_newton_solve()
Actions before solve empty.
void assign_undeformed_positions(GeomObject *const &undeformed_midplane_pt)
In all elastic problems, the nodes must be assigned an undeformed, or reference, position, corresponding to the stress-free state of the elastic body. This function assigns the undeformed position for the nodes on the elastic tube.
Data * Pext_data_pt
Pointer to pressure load (stored in Data so it can become an unknown in the problem when displacement...
void press_load(const Vector< double > &xi, const Vector< double > &x, const Vector< double > &N, Vector< double > &load)
Load function, normal pressure loading.
Node * Trace_node_pt
First trace node.
GeomObject * Undeformed_midplane_pt
Pointer to GeomObject that specifies the undeformed midplane.
void actions_after_newton_solve()
Actions after solve empty.
Global variables that represent physical properties.
double external_pressure()
Return a reference to the external pressure load on the elastic tube.
~ShellProblem()
Destructor: delete mesh, geometric object.
double Prescribed_y
Prescribed position of control point.
ShellProblem(const unsigned &nx, const unsigned &ny, const double &lx, const double &ly)
Constructor.
ShellMesh(const unsigned &nx, const unsigned &ny, const double &lx, const double &ly)
Constructor for the mesh.
ShellMesh< ELEMENT > * mesh_pt()
Overload Access function for the mesh.
Node * Trace_node2_pt
Second trace node.