26#ifndef OOMPH_CHANNEL_SPINE_MESH_TEMPLATE_CC
27#define OOMPH_CHANNEL_SPINE_MESH_TEMPLATE_CC
47 template<
class ELEMENT>
76 MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(2);
79 MeshChecker::assert_geometric_element<SpineFiniteElement, ELEMENT>(2);
102 template<
class ELEMENT>
132 MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(2);
135 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;
272 nod_pt->spine_mesh_pt() =
this;
274 nod_pt->node_update_fct_id() = 0;
303 nod_pt->spine_pt()->set_geom_object_pt(geom_object_pt);
308 for (
unsigned long i = 0;
i <
n_y;
i++)
321 nod_pt->spine_mesh_pt() =
this;
323 nod_pt->node_update_fct_id() = 0;
332 for (
unsigned long j = 0;
j <
n_x0;
j++)
351 nod_pt->spine_mesh_pt() =
this;
353 nod_pt->node_update_fct_id() = 0;
383 nod_pt->spine_pt()->set_geom_object_pt(geom_object_pt);
388 for (
unsigned long i = 0;
i <
n_y;
i++)
401 nod_pt->spine_mesh_pt() =
this;
403 nod_pt->node_update_fct_id() = 0;
445 nod_pt->spine_mesh_pt() =
this;
447 nod_pt->node_update_fct_id() = 1;
477 nod_pt->spine_pt()->set_geom_object_pt(geom_object_pt);
482 for (
unsigned long i = 0;
i <
n_y;
i++)
495 nod_pt->spine_mesh_pt() =
this;
497 nod_pt->node_update_fct_id() = 1;
533 nod_pt->node_update_fct_id() = 2;
561 nod_pt->spine_pt()->set_geom_object_pt(geom_object_pt);
586 nod_pt->spine_mesh_pt() =
this;
588 nod_pt->node_update_fct_id() = 2;
618 nod_pt->spine_pt()->set_geom_object_pt(geom_object_pt);
623 for (
unsigned long i = 0;
i <
n_y;
i++)
636 nod_pt->spine_mesh_pt() =
this;
638 nod_pt->node_update_fct_id() = 2;
660 nod_pt->fraction() = element_node_pt(0, 0)->fraction();
662 nod_pt->spine_mesh_pt() = element_node_pt(0, 0)->spine_mesh_pt();
665 for (
unsigned i = 0;
i <
n_y;
i++)
680 element_node_pt(
i *
n_x,
l1 *
n_p)->spine_mesh_pt();
693 template<
class ELEMENT>
696 unsigned n_x = this->Nx;
697 unsigned n_y = this->Ny;
699 unsigned long Nelement = nelement();
706 for (
unsigned long j = 0;
j <
n_x;
j++)
709 for (
unsigned long i = 0;
i <
n_y;
i++)
712 dummy.push_back(finite_element_pt(
n_x *
i +
j));
720 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...
/////////////////////////////////////////////////////////////////////
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...
////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
TAdvectionDiffusionReactionElement()
Constructor: Call constructors for TElement and AdvectionDiffusionReaction equations.
////////////////////////////////////////////////////////////////////// //////////////////////////////...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...