41 #include "meshes/rectangular_quadmesh.h"
45 using namespace oomph;
68 const Vector<double> &x,
69 const Vector<double> &N,
72 for(
unsigned i=0;i<3;i++)
86 template <
class ELEMENT>
87 class ShellMesh :
public virtual RectangularQuadMesh<ELEMENT>,
88 public virtual SolidMesh
94 const double &lx,
const double &ly);
116 template <
class ELEMENT>
121 RectangularQuadMesh<ELEMENT>(nx,ny,lx,ly)
124 unsigned n_node = nnode();
129 for(
unsigned i=0;i<n_node;i++)
131 node_pt(i)->xi(0) = node_pt(i)->x(0);
132 node_pt(i)->xi(1) = node_pt(i)->x(1);
140 unsigned n_position_type = finite_element_pt(0)->nnodal_position_type();
144 if(n_position_type > 1)
146 double xstep = (this->Xmax - this->Xmin)/((this->Np-1)*this->Nx);
147 double ystep = (this->Ymax - this->Ymin)/((this->Np-1)*this->Ny);
148 for(
unsigned n=0;n<n_node;n++)
151 node_pt(n)->xi_gen(1,0) = 0.5*xstep;
152 node_pt(n)->xi_gen(2,1) = 0.5*ystep;
161 template <
class ELEMENT>
163 GeomObject*
const &undeformed_midplane_pt)
166 unsigned n_node = nnode();
169 for(
unsigned n=0;n<n_node;n++)
172 Vector<double> xi(2);
173 xi[0] = node_pt(n)->xi(0);
174 xi[1] = node_pt(n)->xi(1);
178 DenseMatrix<double> a(2,3);
179 RankThreeTensor<double> dadxi(2,2,3);
182 undeformed_midplane_pt->d2position(xi,R,a,dadxi);
185 for(
unsigned i=0;i<3;i++)
188 node_pt(n)->x_gen(0,i) = R[i];
192 node_pt(n)->x_gen(1,i) = 0.5*a(0,i)*((this->Xmax - this->Xmin)/this->Nx);
193 node_pt(n)->x_gen(2,i) = 0.5*a(1,i)*((this->Ymax - this->Ymin)/this->Ny);
197 node_pt(n)->x_gen(3,i) = 0.25*dadxi(0,1,i);
314 template<
class ELEMENT>
322 const double &lx,
const double &ly);
327 delete Problem::mesh_pt();
363 template<
class ELEMENT>
365 const double &lx,
const double &ly)
368 Mesh::Suppress_warning_about_empty_mesh_level_time_stepper_function=
true;
371 Use_continuation_timestepper =
true;
374 Undeformed_midplane_pt =
new EllipticalTube(1.0,1.0);
380 mesh_pt()->assign_undeformed_positions(Undeformed_midplane_pt);
383 mesh_pt()->element_reorder();
386 unsigned n_ends = mesh_pt()->nboundary_node(1);
388 for(
unsigned i=0;i<n_ends;i++)
391 mesh_pt()->boundary_node_pt(1,i)->pin_position(2);
392 mesh_pt()->boundary_node_pt(3,i)->pin_position(2);
394 mesh_pt()->boundary_node_pt(1,i)->pin_position(2,2);
395 mesh_pt()->boundary_node_pt(3,i)->pin_position(2,2);
400 mesh_pt()->boundary_node_pt(1,i)->pin_position(0);
401 mesh_pt()->boundary_node_pt(3,i)->pin_position(0);
403 mesh_pt()->boundary_node_pt(1,i)->pin_position(2,0);
404 mesh_pt()->boundary_node_pt(3,i)->pin_position(2,0);
406 mesh_pt()->boundary_node_pt(1,i)->pin_position(1);
407 mesh_pt()->boundary_node_pt(3,i)->pin_position(1);
409 mesh_pt()->boundary_node_pt(1,i)->pin_position(2,1);
410 mesh_pt()->boundary_node_pt(3,i)->pin_position(2,1);
416 mesh_pt()->boundary_node_pt(1,i)->pin_position(1,0);
417 mesh_pt()->boundary_node_pt(1,i)->pin_position(1,1);
418 mesh_pt()->boundary_node_pt(3,i)->pin_position(1,0);
419 mesh_pt()->boundary_node_pt(3,i)->pin_position(1,1);
421 mesh_pt()->boundary_node_pt(1,i)->pin_position(3,0);
422 mesh_pt()->boundary_node_pt(1,i)->pin_position(3,1);
423 mesh_pt()->boundary_node_pt(3,i)->pin_position(3,0);
424 mesh_pt()->boundary_node_pt(3,i)->pin_position(3,1);
428 unsigned n_side = mesh_pt()->nboundary_node(0);
429 for(
unsigned i=0;i<n_side;i++)
432 mesh_pt()->boundary_node_pt(0,i)->pin_position(1);
434 mesh_pt()->boundary_node_pt(0,i)->pin_position(1,1);
436 mesh_pt()->boundary_node_pt(0,i)->pin_position(2,0);
437 mesh_pt()->boundary_node_pt(0,i)->pin_position(2,2);
439 mesh_pt()->boundary_node_pt(0,i)->pin_position(3,0);
440 mesh_pt()->boundary_node_pt(0,i)->pin_position(3,2);
443 mesh_pt()->boundary_node_pt(2,i)->pin_position(0);
445 mesh_pt()->boundary_node_pt(2,i)->pin_position(1,0);
447 mesh_pt()->boundary_node_pt(2,i)->pin_position(2,1);
448 mesh_pt()->boundary_node_pt(2,i)->pin_position(2,2);
450 mesh_pt()->boundary_node_pt(2,i)->pin_position(3,1);
451 mesh_pt()->boundary_node_pt(2,i)->pin_position(3,2);
455 if((i>1) && (i<n_side-1))
457 mesh_pt()->boundary_node_pt(0,i)->x(0) += 0.05;
458 mesh_pt()->boundary_node_pt(2,i)->x(1) -= 0.1;
484 SolidFiniteElement* controlled_element_pt=
485 dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(3*ny-1));
488 unsigned controlled_direction=1;
491 Vector<double> s_displ_control(2);
492 s_displ_control[0]=1.0;
493 s_displ_control[1]=0.0;
496 DisplacementControlElement* displ_control_el_pt;
500 new DisplacementControlElement(controlled_element_pt,
502 controlled_direction,
509 displacement_control_load_pt();
512 mesh_pt()->add_element_pt(displ_control_el_pt);
520 unsigned n_element = nx*ny;
523 ELEMENT* first_el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(0));
526 for(
unsigned e=0;e<n_element;e++)
529 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(e));
535 el_pt->undeformed_midplane_pt() = Undeformed_midplane_pt;
544 el_pt->pre_compute_d2shape_lagrangian_at_knots();
551 el_pt->set_dshape_lagrangian_stored_from_element(first_el_pt);
556 Trace_node_pt = mesh_pt()->finite_element_pt(2*ny-1)->node_pt(3);
557 Trace_node2_pt = mesh_pt()->finite_element_pt(ny)->node_pt(1);
561 cout <<
"------------------DISPLACEMENT CONTROL--------------------"
563 cout <<
"# of dofs " << assign_eqn_numbers() << std::endl;
564 cout <<
"----------------------------------------------------------"
574 template<
class ELEMENT>
581 Max_newton_iterations = 40;
584 ofstream trace(
"trace.dat");
587 double disp_incr = 0.05;
591 for(
unsigned i=1;i<13;i++)
594 if(i==3) {disp_incr = 0.1;}
598 cout << std::endl <<
"Increasing displacement: Prescribed_y is "
608 << Trace_node_pt->x(0) <<
" " << Trace_node_pt->x(1) <<
" "
610 << Trace_node2_pt->x(0) <<
" " << Trace_node2_pt->x(1) << std::endl;
617 ofstream file(
"final_shape.dat");
618 mesh_pt()->output(file,5);
630 cout <<
"-----------------ARC-LENGTH CONTINUATION --------------"
632 cout <<
"# of dofs " << assign_eqn_numbers() << std::endl;
633 cout <<
"-------------------------------------------------------"
638 Max_newton_iterations=6;
641 Desired_newton_iterations_ds=3;
644 Desired_proportion_of_arc_length = 0.2;
647 Bifurcation_detection =
true;
653 trace.open(
"trace_disp.dat");
655 for(
unsigned i=0;i<15;i++)
657 ds = arc_length_step_solve(
664 << Trace_node_pt->x(0) <<
" " << Trace_node_pt->x(1) <<
" "
666 << Trace_node2_pt->x(0) <<
" " << Trace_node2_pt->x(1) << std::endl;
683 double L_phi=0.5*MathematicalConstants::Pi;
687 problem(5,5,L,L_phi);
A 2D Mesh class. The tube wall is represented by two Lagrangian coordinates that correspond to z and ...
void assign_undeformed_positions(GeomObject *const &undeformed_midplane_pt)
In all elastic problems, the nodes must be assigned an undeformed, or reference, position,...
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.
GeomObject * Undeformed_midplane_pt
Pointer to GeomObject that specifies the undeformed midplane.
ShellProblem(const unsigned &nx, const unsigned &ny, const double &lx, const double &ly)
Constructor.
void actions_before_newton_solve()
Actions before solve empty.
Node * Trace_node_pt
First trace node.
void actions_after_newton_solve()
Actions after solve empty.
~ShellProblem()
Destructor: delete mesh, geometric object.
Global variables that represent physical properties.
double external_pressure()
Return a reference to the external pressure load on the elastic tube.
void press_load(const Vector< double > &xi, const Vector< double > &x, const Vector< double > &N, Vector< double > &load)
Load function, normal pressure loading.
double Prescribed_y
Prescribed position of control point.
Data * Pext_data_pt
Pointer to pressure load (stored in Data so it can become an unknown in the problem when displacement...