30 #ifndef OOMPH_CIRCULAR_SHELL_MESH_TEMPLATE_CC 31 #define OOMPH_CIRCULAR_SHELL_MESH_TEMPLATE_CC 46 template <
class ELEMENT>
55 MeshChecker::assert_geometric_element<QElementGeometricBase,ELEMENT>(2);
58 unsigned n_node = nnode();
63 for(
unsigned i=0;
i<n_node;
i++)
65 node_pt(
i)->xi(0) = scaled_x(node_pt(
i)->x(0));
66 node_pt(
i)->xi(1) = node_pt(
i)->x(1);
74 std::map<Node*,double> min_dx;
75 unsigned nnod=nnode();
76 for (
unsigned j=0;j<nnod;j++) min_dx[node_pt(j)]=DBL_MAX;
79 unsigned nelem=nelement();
80 for (
unsigned e=0;
e<nelem;
e++)
82 ELEMENT* el_pt=
dynamic_cast<ELEMENT*
>(element_pt(
e));
83 unsigned n_node=el_pt->nnode();
84 for(
unsigned j=0;j<n_node;j++)
87 double x=nod_pt->
xi(0);
88 for(
unsigned k=0;k<n_node;k++)
90 double dx=fabs(x-dynamic_cast<SolidNode*>(el_pt->node_pt(k))->xi(0));
91 if (dx<min_dx[nod_pt])
93 if (dx!=0.0) min_dx[nod_pt]=dx;
104 unsigned n_position_type = finite_element_pt(0)->nnodal_position_type();
108 if(n_position_type > 1)
111 double xstep = (this->Xmax - this->Xmin)/((this->Np-1)*this->Nx);
112 double ystep = (this->Ymax - this->Ymin)/((this->Np-1)*this->Ny);
115 for(
unsigned j=0;j<n_node;j++)
120 xstep=min_dx[nod_pt];
123 nod_pt->
xi_gen(1,0) = 0.5*xstep;
124 nod_pt->
xi_gen(2,1) = 0.5*ystep;
135 template <
class ELEMENT>
141 unsigned nelem=nelement();
142 for (
unsigned e=0;
e<nelem;
e++)
144 ELEMENT* el_pt=
dynamic_cast<ELEMENT*
>(element_pt(
e));
145 unsigned n_node=el_pt->nnode();
146 for(
unsigned n=0;n<n_node;n++)
150 xi[0] =
dynamic_cast<SolidNode*
>(el_pt->node_pt(n))->xi(0);
151 xi[1] =
dynamic_cast<SolidNode*
>(el_pt->node_pt(n))->xi(1);
159 undeformed_midplane_pt->
d2position(xi,R,a,dadxi);
165 el_pt->local_coordinate_of_node(n,s);
166 el_pt->interpolated_dxids(s,dxids);
167 double dxds=dxids(0,0);
170 for(
unsigned i=0;
i<3;
i++)
173 el_pt->node_pt(n)->x_gen(0,
i) = R[
i];
176 el_pt->node_pt(n)->x_gen(1,
i)=a(0,
i)*dxds;
177 el_pt->node_pt(n)->x_gen(2,
i)=
178 0.5*a(1,
i)*((this->Ymax-this->Ymin)/this->Ny);
181 el_pt->node_pt(n)->x_gen(3,
i) = 0.0;
184 if (dadxi(0,1,
i)!=0.0)
187 std::ostringstream error_stream;
189 <<
"Undef. GeomObject for this shell mesh should not be warped!\n" 190 <<
"It may be possible to generalise the mesh generator to \n" 191 <<
"deal with this case -- feel free to have a go...\n";
194 OOMPH_CURRENT_FUNCTION,
195 OOMPH_EXCEPTION_LOCATION);
double & xi(const unsigned &i)
Reference to i-th Lagrangian position.
double & xi_gen(const unsigned &k, const unsigned &i)
Reference to the generalised Lagrangian position. `Type': k; 'Coordinate direction: i...
virtual void d2position(const Vector< double > &zeta, RankThreeTensor< double > &ddrdzeta) const
2nd derivative of position Vector w.r.t. to coordinates: = ddrdzeta(alpha,beta,i). Evaluated at current time.
void build_mesh(const unsigned &nx, const unsigned &ny, const double &lx, const double &ly)
Mesh build helper fct.
A Class for nodes that deform elastically (i.e. position is an unknown in the problem). The idea is that the Eulerian positions are stored in a Data object and the Lagrangian coordinates are stored in addition. The pointer that addresses the Eulerian positions is set to the pointer to Value in the Data object. Hence, SolidNode uses knowledge of the internal structure of Data and must be a friend of the Data class. In order to allow a mesh to deform via an elastic-style equation in deforming-domain problems, the positions are stored separately from the values, so that elastic problems may be combined with any other type of problem.
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.