26 #ifndef OOMPH_HORIZONTAL_SINGLE_LAYER_SPINE_MESH_TEMPLATE_CC
27 #define OOMPH_HORIZONTAL_SINGLE_LAYER_SPINE_MESH_TEMPLATE_CC
46 template<
class ELEMENT>
52 TimeStepper* time_stepper_pt)
54 nx, ny, 0.0, lx, 0.0, h, false, false, time_stepper_pt)
57 MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(2);
60 MeshChecker::assert_geometric_element<SpineFiniteElement, ELEMENT>(2);
73 template<
class ELEMENT>
75 ELEMENT>::build_horizontal_single_layer_mesh(TimeStepper* time_stepper_pt)
81 unsigned n_x = this->Nx;
82 unsigned n_y = this->Ny;
88 unsigned n_p =
dynamic_cast<ELEMENT*
>(finite_element_pt(0))->nnode_1d();
89 Spine_pt.reserve((n_p - 1) * n_y + 1);
97 Spine* new_spine_pt =
new Spine(1.0);
98 Spine_pt.push_back(new_spine_pt);
102 SpineNode* nod_pt = element_node_pt(0, 0);
104 nod_pt->spine_pt() = new_spine_pt;
106 nod_pt->fraction() = 0.0;
108 nod_pt->spine_mesh_pt() =
this;
112 for (
unsigned long i = 0; i < n_x; i++)
115 for (
unsigned l1 = 1; l1 < n_p; l1++)
121 SpineNode* nod_pt = element_node_pt(i, l1);
123 nod_pt->spine_pt() = new_spine_pt;
126 (double(i) + double(l1) / double(n_p - 1)) /
double(n_x);
128 nod_pt->spine_mesh_pt() =
this;
137 for (
unsigned long j = 0; j < n_y; j++)
143 unsigned n_pmax = n_p;
145 for (
unsigned l2 = 1; l2 < n_pmax; l2++)
148 new_spine_pt =
new Spine(1.0);
149 Spine_pt.push_back(new_spine_pt);
155 SpineNode* nod_pt = element_node_pt(j * n_x, l2 * n_p);
157 nod_pt->spine_pt() = new_spine_pt;
159 nod_pt->fraction() = 0.0;
161 nod_pt->spine_mesh_pt() =
this;
165 for (
unsigned long i = 0; i < n_x; i++)
168 for (
unsigned l1 = 1; l1 < n_p; l1++)
174 SpineNode* nod_pt = element_node_pt(j * n_x + i, l2 * n_p + l1);
176 nod_pt->spine_pt() = new_spine_pt;
179 (double(i) + double(l1) / double(n_p - 1)) /
double(n_x);
181 nod_pt->spine_mesh_pt() =
this;
Horizontal Single-layer spine mesh class derived from standard 2D mesh. The mesh contains a layer of ...
HorizontalSingleLayerSpineMesh(const unsigned &nx, const unsigned &ny, const double &lx, const double &h, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass number of elements in x-direction, number of elements in y-direction,...
virtual void build_horizontal_single_layer_mesh(TimeStepper *time_stepper_pt)
Helper function to actually build the single-layer spine mesh (called from various constructors)
RectangularQuadMesh is a two-dimensional mesh of Quad elements with Nx elements in the "x" (horizonal...
void build_mesh(TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Generic mesh construction function: contains all the hard work.
////////////////////////////////////////////////////////////////////// //////////////////////////////...