26 #ifndef OOMPH_CIRCULAR_SHELL_MESH_TEMPLATE_CC
27 #define OOMPH_CIRCULAR_SHELL_MESH_TEMPLATE_CC
40 template<
class ELEMENT>
47 MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(2);
50 unsigned n_node = nnode();
55 for (
unsigned i = 0; i < n_node; i++)
57 node_pt(i)->xi(0) = scaled_x(node_pt(i)->x(0));
58 node_pt(i)->xi(1) = node_pt(i)->x(1);
66 std::map<Node*, double> min_dx;
67 unsigned nnod = nnode();
68 for (
unsigned j = 0; j < nnod; j++) min_dx[node_pt(j)] = DBL_MAX;
71 unsigned nelem = nelement();
72 for (
unsigned e = 0; e < nelem; e++)
74 ELEMENT* el_pt =
dynamic_cast<ELEMENT*
>(element_pt(e));
75 unsigned n_node = el_pt->nnode();
76 for (
unsigned j = 0; j < n_node; j++)
78 SolidNode* nod_pt =
dynamic_cast<SolidNode*
>(el_pt->node_pt(j));
79 double x = nod_pt->xi(0);
80 for (
unsigned k = 0; k < n_node; k++)
83 fabs(x -
dynamic_cast<SolidNode*
>(el_pt->node_pt(k))->xi(0));
84 if (dx < min_dx[nod_pt])
86 if (dx != 0.0) min_dx[nod_pt] = dx;
97 unsigned n_position_type = finite_element_pt(0)->nnodal_position_type();
101 if (n_position_type > 1)
104 double xstep = (this->Xmax - this->Xmin) / ((this->Np - 1) * this->Nx);
105 double ystep = (this->Ymax - this->Ymin) / ((this->Np - 1) * this->Ny);
108 for (
unsigned j = 0; j < n_node; j++)
110 SolidNode* nod_pt = node_pt(j);
113 xstep = min_dx[nod_pt];
116 nod_pt->xi_gen(1, 0) = 0.5 * xstep;
117 nod_pt->xi_gen(2, 1) = 0.5 * ystep;
126 template<
class ELEMENT>
128 GeomObject*
const& undeformed_midplane_pt)
131 unsigned nelem = nelement();
132 for (
unsigned e = 0; e < nelem; e++)
134 ELEMENT* el_pt =
dynamic_cast<ELEMENT*
>(element_pt(e));
135 unsigned n_node = el_pt->nnode();
136 for (
unsigned n = 0; n < n_node; n++)
139 Vector<double> xi(2);
140 xi[0] =
dynamic_cast<SolidNode*
>(el_pt->node_pt(n))->xi(0);
141 xi[1] =
dynamic_cast<SolidNode*
>(el_pt->node_pt(n))->xi(1);
145 DenseMatrix<double> a(2, 3);
146 RankThreeTensor<double> dadxi(2, 2, 3);
149 undeformed_midplane_pt->d2position(xi, R, a, dadxi);
153 DenseMatrix<double> dxids(2, 2);
155 el_pt->local_coordinate_of_node(n, s);
156 el_pt->interpolated_dxids(s, dxids);
157 double dxds = dxids(0, 0);
160 for (
unsigned i = 0; i < 3; i++)
163 el_pt->node_pt(n)->x_gen(0, i) = R[i];
166 el_pt->node_pt(n)->x_gen(1, i) = a(0, i) * dxds;
167 el_pt->node_pt(n)->x_gen(2, i) =
168 0.5 * a(1, i) * ((this->Ymax - this->Ymin) / this->Ny);
171 el_pt->node_pt(n)->x_gen(3, i) = 0.0;
174 if (dadxi(0, 1, i) != 0.0)
176 std::ostringstream error_stream;
178 <<
"Undef. GeomObject for this shell mesh should not be warped!\n"
179 <<
"It may be possible to generalise the mesh generator to \n"
180 <<
"deal with this case -- feel free to have a go...\n";
181 throw OomphLibError(error_stream.str(),
182 OOMPH_CURRENT_FUNCTION,
183 OOMPH_EXCEPTION_LOCATION);
void build_mesh(const unsigned &nx, const unsigned &ny, const double &lx, const double &ly)
Mesh build helper fct.
void assign_undeformed_positions(GeomObject *const &undeformed_midplane_pt)
In all elastic problems, the nodes must be assigned an undeformed, or reference, position,...
////////////////////////////////////////////////////////////////////// //////////////////////////////...