45 #include "meshes/rectangular_quadmesh.h" 49 using namespace oomph;
71 {
return (*Pext_data_pt->value_pt(0))*pow(0.05,3)/12.0;}
76 const Vector<double> &x,
77 const Vector<double> &N,
82 for(
unsigned i=0;i<3;i++)
85 Pcos*pow(0.05,3)/12.0*cos(2.0*xi[1]))*N[i];
97 template <
class ELEMENT>
98 class ShellMesh :
public virtual RectangularQuadMesh<ELEMENT>,
99 public virtual SolidMesh
104 ShellMesh(
const unsigned &nx,
const unsigned &ny,
105 const double &lx,
const double &ly);
111 void assign_undeformed_positions(GeomObject*
const &undeformed_midplane_pt);
127 template <
class ELEMENT>
132 RectangularQuadMesh<ELEMENT>(nx,ny,lx,ly)
135 unsigned n_node = nnode();
140 for(
unsigned i=0;i<n_node;i++)
142 node_pt(i)->xi(0) = node_pt(i)->x(0);
143 node_pt(i)->xi(1) = node_pt(i)->x(1);
151 unsigned n_position_type = finite_element_pt(0)->nnodal_position_type();
155 if(n_position_type > 1)
157 double xstep = (this->Xmax - this->Xmin)/((this->Np-1)*this->Nx);
158 double ystep = (this->Ymax - this->Ymin)/((this->Np-1)*this->Ny);
159 for(
unsigned n=0;n<n_node;n++)
162 node_pt(n)->xi_gen(1,0) = 0.5*xstep;
163 node_pt(n)->xi_gen(2,1) = 0.5*ystep;
172 template <
class ELEMENT>
174 GeomObject*
const &undeformed_midplane_pt)
177 unsigned n_node = nnode();
180 for(
unsigned n=0;n<n_node;n++)
183 Vector<double> xi(2);
184 xi[0] = node_pt(n)->xi(0);
185 xi[1] = node_pt(n)->xi(1);
189 DenseMatrix<double> a(2,3);
190 RankThreeTensor<double> dadxi(2,2,3);
193 undeformed_midplane_pt->d2position(xi,R,a,dadxi);
196 for(
unsigned i=0;i<3;i++)
199 node_pt(n)->x_gen(0,i) = R[i];
203 node_pt(n)->x_gen(1,i) = 0.5*a(0,i)*((this->Xmax - this->Xmin)/this->Nx);
204 node_pt(n)->x_gen(2,i) = 0.5*a(1,i)*((this->Ymax - this->Ymin)/this->Ny);
208 node_pt(n)->x_gen(3,i) = 0.25*dadxi(0,1,i);
217 template<
class ELEMENT>
225 const double &lx,
const double &ly);
258 template<
class ELEMENT>
260 const double &lx,
const double &ly)
263 Undeformed_midplane_pt =
new EllipticalTube(1.0,1.0);
272 mesh_pt()->element_reorder();
275 unsigned n_ends = mesh_pt()->nboundary_node(1);
277 for(
unsigned i=0;i<n_ends;i++)
280 mesh_pt()->boundary_node_pt(1,i)->pin_position(2);
281 mesh_pt()->boundary_node_pt(3,i)->pin_position(2);
283 mesh_pt()->boundary_node_pt(1,i)->pin_position(2,2);
284 mesh_pt()->boundary_node_pt(3,i)->pin_position(2,2);
289 mesh_pt()->boundary_node_pt(1,i)->pin_position(0);
290 mesh_pt()->boundary_node_pt(3,i)->pin_position(0);
292 mesh_pt()->boundary_node_pt(1,i)->pin_position(2,0);
293 mesh_pt()->boundary_node_pt(3,i)->pin_position(2,0);
295 mesh_pt()->boundary_node_pt(1,i)->pin_position(1);
296 mesh_pt()->boundary_node_pt(3,i)->pin_position(1);
298 mesh_pt()->boundary_node_pt(1,i)->pin_position(2,1);
299 mesh_pt()->boundary_node_pt(3,i)->pin_position(2,1);
305 mesh_pt()->boundary_node_pt(1,i)->pin_position(1,0);
306 mesh_pt()->boundary_node_pt(1,i)->pin_position(1,1);
307 mesh_pt()->boundary_node_pt(3,i)->pin_position(1,0);
308 mesh_pt()->boundary_node_pt(3,i)->pin_position(1,1);
310 mesh_pt()->boundary_node_pt(1,i)->pin_position(3,0);
311 mesh_pt()->boundary_node_pt(1,i)->pin_position(3,1);
312 mesh_pt()->boundary_node_pt(3,i)->pin_position(3,0);
313 mesh_pt()->boundary_node_pt(3,i)->pin_position(3,1);
317 unsigned n_side = mesh_pt()->nboundary_node(0);
318 for(
unsigned i=0;i<n_side;i++)
321 mesh_pt()->boundary_node_pt(0,i)->pin_position(1);
323 mesh_pt()->boundary_node_pt(0,i)->pin_position(1,1);
325 mesh_pt()->boundary_node_pt(0,i)->pin_position(2,0);
326 mesh_pt()->boundary_node_pt(0,i)->pin_position(2,2);
328 mesh_pt()->boundary_node_pt(0,i)->pin_position(3,0);
329 mesh_pt()->boundary_node_pt(0,i)->pin_position(3,2);
332 mesh_pt()->boundary_node_pt(2,i)->pin_position(0);
334 mesh_pt()->boundary_node_pt(2,i)->pin_position(1,0);
336 mesh_pt()->boundary_node_pt(2,i)->pin_position(2,1);
337 mesh_pt()->boundary_node_pt(2,i)->pin_position(2,2);
339 mesh_pt()->boundary_node_pt(2,i)->pin_position(3,1);
340 mesh_pt()->boundary_node_pt(2,i)->pin_position(3,2);
375 Vector<double> s_displ_control(2);
380 nel_ctrl=unsigned(floor(0.5*
double(nx))+1.0)*ny-1;
381 s_displ_control[0]=0.0;
382 s_displ_control[1]=1.0;
386 nel_ctrl=unsigned(floor(0.5*
double(nx))+1.0)*ny-1;
387 s_displ_control[0]=-1.0;
388 s_displ_control[1]=1.0;
392 SolidFiniteElement* controlled_element_pt=
393 dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(nel_ctrl));
397 unsigned controlled_direction=1;
400 DisplacementControlElement* displ_control_el_pt;
404 new DisplacementControlElement(controlled_element_pt,
406 controlled_direction,
411 Vector<double> xi(2);
413 controlled_element_pt->interpolated_xi(s_displ_control,xi);
414 controlled_element_pt->interpolated_x(s_displ_control,x);
415 std::cout << std::endl;
416 std::cout <<
"Controlled element: " << nel_ctrl << std::endl;
417 std::cout <<
"Displacement control applied at xi = (" 418 << xi[0] <<
", " << xi[1] <<
")" << std::endl;
419 std::cout <<
"Corresponding to x = (" 420 << x[0] <<
", " << x[1] <<
", " << x[2] <<
")" << std::endl;
427 displacement_control_load_pt();
430 mesh_pt()->add_element_pt(displ_control_el_pt);
438 unsigned n_element = nx*ny;
441 ELEMENT* first_el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(0));
444 for(
unsigned e=0;e<n_element;e++)
447 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(e));
453 el_pt->undeformed_midplane_pt() = Undeformed_midplane_pt;
462 el_pt->pre_compute_d2shape_lagrangian_at_knots();
469 el_pt->set_dshape_lagrangian_stored_from_element(first_el_pt);
474 Trace_node_pt = mesh_pt()->finite_element_pt(2*ny-1)->node_pt(3);
475 Trace_node2_pt = mesh_pt()->finite_element_pt(ny)->node_pt(1);
479 cout <<
"# of dofs " << assign_eqn_numbers() << std::endl;
488 template<
class ELEMENT>
495 Max_newton_iterations = 40;
500 ofstream trace(
"trace.dat");
505 for(
unsigned i=1;i<11;i++)
510 cout << std::endl <<
"Increasing displacement: Prescribed_y is " 521 << Trace_node_pt->x(0) <<
" " << Trace_node_pt->x(1) <<
" " 523 << Trace_node2_pt->x(0) <<
" " << Trace_node2_pt->x(1) << std::endl;
533 ofstream file(
"final_shape.dat");
534 mesh_pt()->output(file,5);
549 double L_phi=0.5*MathematicalConstants::Pi;
553 problem(5,3,L,L_phi);
void actions_before_newton_solve()
Actions before solve empty.
double Pcos
Perturbation pressure.
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.
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.