26 #ifndef OOMPH_SINGLE_LAYER_SPINE_MESH_TEMPLATE_CC
27 #define OOMPH_SINGLE_LAYER_SPINE_MESH_TEMPLATE_CC
47 template<
class ELEMENT>
55 nx, ny, 0.0, lx, 0.0, h, false, false, time_stepper_pt)
58 MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(2);
61 MeshChecker::assert_geometric_element<SpineFiniteElement, ELEMENT>(2);
83 template<
class ELEMENT>
89 const bool& periodic_in_x,
92 nx, ny, 0.0, lx, 0.0, h, periodic_in_x, false, time_stepper_pt)
95 MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(2);
98 MeshChecker::assert_geometric_element<SpineFiniteElement, ELEMENT>(2);
113 template<
class ELEMENT>
118 MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(2);
124 unsigned n_x = this->Nx;
125 unsigned n_y = this->Ny;
131 unsigned n_p =
dynamic_cast<ELEMENT*
>(finite_element_pt(0))->nnode_1d();
136 Spine_pt.reserve((n_p - 1) * n_x);
140 Spine_pt.reserve((n_p - 1) * n_x + 1);
151 Spine_pt.push_back(new_spine_pt);
155 SpineNode* nod_pt = element_node_pt(0, 0);
165 for (
unsigned long i = 0;
i < n_y;
i++)
168 for (
unsigned l1 = 1; l1 < n_p; l1++)
171 SpineNode* nod_pt = element_node_pt(
i * n_x, l1 * n_p);
176 (double(
i) + double(l1) / double(n_p - 1)) /
double(n_y);
187 for (
unsigned long j = 0; j < n_x; j++)
193 unsigned n_pmax = n_p;
194 if ((this->Xperiodic) && (j == n_x - 1)) n_pmax = n_p - 1;
196 for (
unsigned l2 = 1; l2 < n_pmax; l2++)
199 new_spine_pt =
new Spine(1.0);
200 Spine_pt.push_back(new_spine_pt);
203 SpineNode* nod_pt = element_node_pt(j, l2);
213 for (
unsigned long i = 0;
i < n_y;
i++)
216 for (
unsigned l1 = 1; l1 < n_p; l1++)
219 SpineNode* nod_pt = element_node_pt(
i * n_x + j, l1 * n_p + l2);
224 (double(
i) + double(l1) / double(n_p - 1)) /
double(n_y);
238 Spine* final_spine_pt = Spine_pt[0];
241 SpineNode* nod_pt = element_node_pt((n_x - 1), (n_p - 1));
244 nod_pt->
spine_pt() = final_spine_pt;
246 nod_pt->
fraction() = element_node_pt(0, 0)->fraction();
248 nod_pt->
spine_mesh_pt() = element_node_pt(0, 0)->spine_mesh_pt();
251 for (
unsigned i = 0;
i < n_y;
i++)
254 for (
unsigned l1 = 1; l1 < n_p; l1++)
258 element_node_pt(
i * n_x + (n_x - 1), l1 * n_p + (n_p - 1));
261 nod_pt->
spine_pt() = final_spine_pt;
263 nod_pt->
fraction() = element_node_pt(
i * n_x, l1 * n_p)->fraction();
266 element_node_pt(
i * n_x, l1 * n_p)->spine_mesh_pt();
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.
SingleLayerSpineMesh(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_single_layer_mesh(TimeStepper *time_stepper_pt)
Helper function to actually build the single-layer spine mesh (called from various constructors)
Class for nodes that live on spines. The assumption is that each Node lies at a fixed fraction on a s...
SpineMesh *& spine_mesh_pt()
Access function to Pointer to SpineMesh that this node is a part of and which implements the node upd...
Spine *& spine_pt()
Access function to spine.
double & fraction()
Set reference to fraction along spine.
Spines are used for algebraic node update operations in free-surface fluid problems: They form the ba...
////////////////////////////////////////////////////////////////////// //////////////////////////////...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...