41 #include "meshes/rectangular_quadmesh.h"
45 using namespace oomph;
72 const Vector<double> &x,
73 const Vector<double> &N,
78 for(
unsigned i=0;i<3;i++)
81 Pcos*pow(0.05,3)/12.0*cos(2.0*xi[1]))*N[i];
93 template <
class ELEMENT>
94 class ShellMesh :
public virtual RectangularQuadMesh<ELEMENT>,
95 public virtual SolidMesh
100 ShellMesh(
const unsigned &nx,
const unsigned &ny,
101 const double &lx,
const double &ly);
107 void assign_undeformed_positions(GeomObject*
const &undeformed_midplane_pt);
123 template <
class ELEMENT>
128 RectangularQuadMesh<ELEMENT>(nx,ny,lx,ly)
131 unsigned n_node = nnode();
136 for(
unsigned i=0;i<n_node;i++)
138 node_pt(i)->xi(0) = node_pt(i)->x(0);
139 node_pt(i)->xi(1) = node_pt(i)->x(1);
147 unsigned n_position_type = finite_element_pt(0)->nnodal_position_type();
151 if(n_position_type > 1)
153 double xstep = (this->Xmax - this->Xmin)/((this->Np-1)*this->Nx);
154 double ystep = (this->Ymax - this->Ymin)/((this->Np-1)*this->Ny);
155 for(
unsigned n=0;n<n_node;n++)
158 node_pt(n)->xi_gen(1,0) = 0.5*xstep;
159 node_pt(n)->xi_gen(2,1) = 0.5*ystep;
168 template <
class ELEMENT>
170 GeomObject*
const &undeformed_midplane_pt)
173 unsigned n_node = nnode();
176 for(
unsigned n=0;n<n_node;n++)
179 Vector<double> xi(2);
180 xi[0] = node_pt(n)->xi(0);
181 xi[1] = node_pt(n)->xi(1);
185 DenseMatrix<double> a(2,3);
186 RankThreeTensor<double> dadxi(2,2,3);
189 undeformed_midplane_pt->d2position(xi,R,a,dadxi);
192 for(
unsigned i=0;i<3;i++)
195 node_pt(n)->x_gen(0,i) = R[i];
199 node_pt(n)->x_gen(1,i) = 0.5*a(0,i)*((this->Xmax - this->Xmin)/this->Nx);
200 node_pt(n)->x_gen(2,i) = 0.5*a(1,i)*((this->Ymax - this->Ymin)/this->Ny);
204 node_pt(n)->x_gen(3,i) = 0.25*dadxi(0,1,i);
213 template<
class ELEMENT>
221 const double &lx,
const double &ly);
254 template<
class ELEMENT>
256 const double &lx,
const double &ly)
259 Undeformed_midplane_pt =
new EllipticalTube(1.0,1.0);
265 mesh_pt()->assign_undeformed_positions(Undeformed_midplane_pt);
268 mesh_pt()->element_reorder();
271 unsigned n_ends = mesh_pt()->nboundary_node(1);
273 for(
unsigned i=0;i<n_ends;i++)
276 mesh_pt()->boundary_node_pt(1,i)->pin_position(2);
277 mesh_pt()->boundary_node_pt(3,i)->pin_position(2);
279 mesh_pt()->boundary_node_pt(1,i)->pin_position(2,2);
280 mesh_pt()->boundary_node_pt(3,i)->pin_position(2,2);
285 mesh_pt()->boundary_node_pt(1,i)->pin_position(0);
286 mesh_pt()->boundary_node_pt(3,i)->pin_position(0);
288 mesh_pt()->boundary_node_pt(1,i)->pin_position(2,0);
289 mesh_pt()->boundary_node_pt(3,i)->pin_position(2,0);
291 mesh_pt()->boundary_node_pt(1,i)->pin_position(1);
292 mesh_pt()->boundary_node_pt(3,i)->pin_position(1);
294 mesh_pt()->boundary_node_pt(1,i)->pin_position(2,1);
295 mesh_pt()->boundary_node_pt(3,i)->pin_position(2,1);
301 mesh_pt()->boundary_node_pt(1,i)->pin_position(1,0);
302 mesh_pt()->boundary_node_pt(1,i)->pin_position(1,1);
303 mesh_pt()->boundary_node_pt(3,i)->pin_position(1,0);
304 mesh_pt()->boundary_node_pt(3,i)->pin_position(1,1);
306 mesh_pt()->boundary_node_pt(1,i)->pin_position(3,0);
307 mesh_pt()->boundary_node_pt(1,i)->pin_position(3,1);
308 mesh_pt()->boundary_node_pt(3,i)->pin_position(3,0);
309 mesh_pt()->boundary_node_pt(3,i)->pin_position(3,1);
313 unsigned n_side = mesh_pt()->nboundary_node(0);
314 for(
unsigned i=0;i<n_side;i++)
317 mesh_pt()->boundary_node_pt(0,i)->pin_position(1);
319 mesh_pt()->boundary_node_pt(0,i)->pin_position(1,1);
321 mesh_pt()->boundary_node_pt(0,i)->pin_position(2,0);
322 mesh_pt()->boundary_node_pt(0,i)->pin_position(2,2);
324 mesh_pt()->boundary_node_pt(0,i)->pin_position(3,0);
325 mesh_pt()->boundary_node_pt(0,i)->pin_position(3,2);
328 mesh_pt()->boundary_node_pt(2,i)->pin_position(0);
330 mesh_pt()->boundary_node_pt(2,i)->pin_position(1,0);
332 mesh_pt()->boundary_node_pt(2,i)->pin_position(2,1);
333 mesh_pt()->boundary_node_pt(2,i)->pin_position(2,2);
335 mesh_pt()->boundary_node_pt(2,i)->pin_position(3,1);
336 mesh_pt()->boundary_node_pt(2,i)->pin_position(3,2);
371 Vector<double> s_displ_control(2);
376 nel_ctrl=unsigned(floor(0.5*
double(nx))+1.0)*ny-1;
377 s_displ_control[0]=0.0;
378 s_displ_control[1]=1.0;
382 nel_ctrl=unsigned(floor(0.5*
double(nx))+1.0)*ny-1;
383 s_displ_control[0]=-1.0;
384 s_displ_control[1]=1.0;
388 SolidFiniteElement* controlled_element_pt=
389 dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(nel_ctrl));
393 unsigned controlled_direction=1;
396 DisplacementControlElement* displ_control_el_pt;
400 new DisplacementControlElement(controlled_element_pt,
402 controlled_direction,
407 Vector<double> xi(2);
409 controlled_element_pt->interpolated_xi(s_displ_control,xi);
410 controlled_element_pt->interpolated_x(s_displ_control,x);
411 std::cout << std::endl;
412 std::cout <<
"Controlled element: " << nel_ctrl << std::endl;
413 std::cout <<
"Displacement control applied at xi = ("
414 << xi[0] <<
", " << xi[1] <<
")" << std::endl;
415 std::cout <<
"Corresponding to x = ("
416 << x[0] <<
", " << x[1] <<
", " << x[2] <<
")" << std::endl;
423 displacement_control_load_pt();
426 mesh_pt()->add_element_pt(displ_control_el_pt);
434 unsigned n_element = nx*ny;
437 ELEMENT* first_el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(0));
440 for(
unsigned e=0;e<n_element;e++)
443 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(e));
449 el_pt->undeformed_midplane_pt() = Undeformed_midplane_pt;
458 el_pt->pre_compute_d2shape_lagrangian_at_knots();
465 el_pt->set_dshape_lagrangian_stored_from_element(first_el_pt);
470 Trace_node_pt = mesh_pt()->finite_element_pt(2*ny-1)->node_pt(3);
471 Trace_node2_pt = mesh_pt()->finite_element_pt(ny)->node_pt(1);
475 cout <<
"# of dofs " << assign_eqn_numbers() << std::endl;
484 template<
class ELEMENT>
491 Max_newton_iterations = 40;
496 ofstream trace(
"trace.dat");
501 for(
unsigned i=1;i<11;i++)
506 cout << std::endl <<
"Increasing displacement: Prescribed_y is "
517 << Trace_node_pt->x(0) <<
" " << Trace_node_pt->x(1) <<
" "
519 << Trace_node2_pt->x(0) <<
" " << Trace_node2_pt->x(1) << std::endl;
529 ofstream file(
"final_shape.dat");
530 mesh_pt()->output(file,5);
545 double L_phi=0.5*MathematicalConstants::Pi;
549 problem(5,3,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.
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.
double Pcos
Perturbation pressure.
Data * Pext_data_pt
Pointer to pressure load (stored in Data so it can become an unknown in the problem when displacement...