26#ifndef OOMPH_CHANNEL_SPINE_MESH_TEMPLATE_HEADER
27#define OOMPH_CHANNEL_SPINE_MESH_TEMPLATE_HEADER
29#ifndef OOMPH_CHANNEL_SPINE_MESH_HEADER
30#error __FILE__ should only be included from channel_spine_mesh.h.
49 template<
class ELEMENT>
78 MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(2);
81 MeshChecker::assert_geometric_element<SpineFiniteElement, ELEMENT>(2);
103 template<
class ELEMENT>
133 MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(2);
136 MeshChecker::assert_geometric_element<SpineFiniteElement, ELEMENT>(2);
152 template<
class ELEMENT>
161 unsigned n_x = this->Nx;
162 unsigned n_y = this->Ny;
163 unsigned n_x0 = this->Nx0;
164 unsigned n_x1 = this->Nx1;
165 unsigned n_x2 = this->Nx2;
170 Left_element_pt.reserve(nleft);
173 Centre_element_pt.reserve(ncentre);
176 Right_element_pt.reserve(nright);
179 for (
unsigned e = 0;
e <
n_x0;
e++)
181 Left_element_pt.push_back(this->finite_element_pt(
irow *
n_x +
e));
183 for (
unsigned e = 0;
e <
n_x1;
e++)
185 Centre_element_pt.push_back(
188 for (
unsigned e = 0;
e <
n_x2;
e++)
190 Right_element_pt.push_back(
197 if (nelement() != nleft + ncentre + nright)
209 unsigned n_p =
dynamic_cast<ELEMENT*
>(finite_element_pt(0))->
nnode_1d();
216 Spine_pt.reserve(nspine);
219 Nleft_spine = (
n_p - 1) *
n_x0 + 1;
220 Ncentre_spine = (
n_p - 1) *
n_x1 + 1;
221 Nright_spine = (
n_p - 1) *
n_x2;
225 nspine = (
n_p - 1) *
n_x + 1;
226 Spine_pt.reserve(nspine);
229 Nleft_spine = (
n_p - 1) *
n_x0 + 1;
230 Ncentre_spine = (
n_p - 1) *
n_x1 + 1;
231 Nright_spine = (
n_p - 1) *
n_x2 + 1;
270 nod_pt->spine_mesh_pt() =
this;
272 nod_pt->node_update_fct_id() = 0;
301 nod_pt->spine_pt()->set_geom_object_pt(geom_object_pt);
306 for (
unsigned long i = 0;
i <
n_y;
i++)
319 nod_pt->spine_mesh_pt() =
this;
321 nod_pt->node_update_fct_id() = 0;
329 for (
unsigned long j = 0;
j <
n_x0;
j++)
348 nod_pt->spine_mesh_pt() =
this;
350 nod_pt->node_update_fct_id() = 0;
380 nod_pt->spine_pt()->set_geom_object_pt(geom_object_pt);
385 for (
unsigned long i = 0;
i <
n_y;
i++)
398 nod_pt->spine_mesh_pt() =
this;
400 nod_pt->node_update_fct_id() = 0;
441 nod_pt->spine_mesh_pt() =
this;
443 nod_pt->node_update_fct_id() = 1;
473 nod_pt->spine_pt()->set_geom_object_pt(geom_object_pt);
478 for (
unsigned long i = 0;
i <
n_y;
i++)
491 nod_pt->spine_mesh_pt() =
this;
493 nod_pt->node_update_fct_id() = 1;
528 nod_pt->node_update_fct_id() = 2;
556 nod_pt->spine_pt()->set_geom_object_pt(geom_object_pt);
581 nod_pt->spine_mesh_pt() =
this;
583 nod_pt->node_update_fct_id() = 2;
613 nod_pt->spine_pt()->set_geom_object_pt(geom_object_pt);
618 for (
unsigned long i = 0;
i <
n_y;
i++)
631 nod_pt->spine_mesh_pt() =
this;
633 nod_pt->node_update_fct_id() = 2;
655 nod_pt->fraction() = element_node_pt(0, 0)->fraction();
657 nod_pt->spine_mesh_pt() = element_node_pt(0, 0)->spine_mesh_pt();
660 for (
unsigned i = 0;
i <
n_y;
i++)
675 element_node_pt(
i *
n_x,
l1 *
n_p)->spine_mesh_pt();
686 template<
class ELEMENT>
689 unsigned n_x = this->Nx;
690 unsigned n_y = this->Ny;
692 unsigned long Nelement = nelement();
699 for (
unsigned long j = 0;
j <
n_x;
j++)
702 for (
unsigned long i = 0;
i <
n_y;
i++)
705 dummy.push_back(finite_element_pt(
n_x *
i +
j));
713 for (
unsigned long e = 0;
e < Nelement;
e++)
virtual void build_channel_spine_mesh(TimeStepper *time_stepper_pt)
Helper function to actually build the channel-spine mesh (called from various constructors)
GeomObject * Straight_wall_pt
GeomObject for the straight upper wall.
ChannelSpineMesh(const unsigned &nx0, const unsigned &nx1, const unsigned &nx2, const unsigned &ny, const double &lx0, const double &lx1, const double &lx2, const double &h, GeomObject *wall_pt, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass number of elements in x-direction in regions 0,1 and 2, number of elements in y-dir...
void element_reorder()
Reorder the elements so we loop over them vertically first (advantageous in "wide" domains if a front...
void position(const Vector< double > &zeta, Vector< double > &r) const
Return the parametrised position of the FiniteElement in its incarnation as a GeomObject,...
void locate_zeta(const Vector< double > &zeta, GeomObject *&geom_object_pt, Vector< double > &s, const bool &use_coordinate_as_initial_guess=false)
For a given value of zeta, the "global" intrinsic coordinate of a mesh of FiniteElements represented ...
virtual unsigned nnode_1d() const
Return the number of nodes along one edge of the element Default is to return zero — must be overload...
A geometric object is an object that provides a parametrised description of its shape via the functio...
TimeStepper *& time_stepper_pt()
Access function for pointer to time stepper: Null if object is not time-dependent.
An OomphLibError object which should be thrown when an run-time error is encountered....
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.
Class for nodes that live on spines. The assumption is that each Node lies at a fixed fraction on a s...
Spines are used for algebraic node update operations in free-surface fluid problems: They form the ba...
Steady, straight 1D line in 2D space.
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
TAdvectionDiffusionReactionElement()
Constructor: Call constructors for TElement and AdvectionDiffusionReaction equations.
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).