26 #ifndef OOMPH_ANNULAR_MESH_TEMPLATE_CC
27 #define OOMPH_ANNULAR_MESH_TEMPLATE_CC
36 template<
class ELEMENT>
40 const double& azimuthal_fraction,
44 Ellipse ellipse(a, a);
48 Vector<double> base(2);
50 const unsigned n_node = this->nnode();
51 for (
unsigned n = 0; n < n_node; n++)
54 Node* nod_pt = this->node_pt(n);
59 xi[0] = (1.0 - 1.0e-10) * (-azimuthal_fraction * nod_pt->x(0)) * 2.0 *
60 MathematicalConstants::Pi +
61 MathematicalConstants::Pi -
62 (1.0 - azimuthal_fraction) * 2.0 * MathematicalConstants::Pi;
68 double w = nod_pt->x(1);
71 ellipse.position(xi, base);
74 double norm = sqrt(base[0] * base[0] + base[1] * base[1]);
75 N[0] = base[0] / norm;
76 N[1] = base[1] / norm;
79 nod_pt->x(0) = base[0] + w * (h + a - norm) * N[0];
80 nod_pt->x(1) = base[1] + w * (h + a - norm) * N[1];
83 Vector<double> xi_bound(1);
86 if (nod_pt->is_on_boundary(0))
88 xi_bound[0] = atan2(nod_pt->x(1), nod_pt->x(0));
89 nod_pt->set_coordinates_on_boundary(0, xi_bound);
93 if (nod_pt->is_on_boundary(1))
95 xi_bound[0] = sqrt(pow(nod_pt->x(0), 2) + pow(nod_pt->x(1), 2));
96 nod_pt->set_coordinates_on_boundary(1, xi_bound);
100 if (nod_pt->is_on_boundary(2))
102 xi_bound[0] = atan2(nod_pt->x(1), nod_pt->x(0));
103 nod_pt->set_coordinates_on_boundary(2, xi_bound);
107 if (nod_pt->is_on_boundary(3))
109 xi_bound[0] = sqrt(pow(nod_pt->x(0), 2) + pow(nod_pt->x(1), 2));
110 nod_pt->set_coordinates_on_boundary(3, xi_bound);
114 this->Boundary_coordinate_exists[0] =
true;
115 this->Boundary_coordinate_exists[1] =
true;
116 this->Boundary_coordinate_exists[2] =
true;
117 this->Boundary_coordinate_exists[3] =
true;
void wrap_into_annular_shape(const double &a, const double &h, const double &azimuthal_fraction, const double &phi)
Wrap mesh into annular shape.
////////////////////////////////////////////////////////////////////// //////////////////////////////...