27#ifndef OOMPH_CHANNEL_WITH_LEAFLET_MESH_TEMPLATE_HEADER
28#define OOMPH_CHANNEL_WITH_LEAFLET_MESH_TEMPLATE_HEADER
30#ifndef OOMPH_CHANNEL_WITH_LEAFLET_MESH_HEADER
31#error __FILE__ should only be included from channel_with_leaflet_mesh.h.
48 template<
class ELEMENT>
53 const double& hleaflet,
55 const unsigned& nleft,
56 const unsigned& nright,
61 nright + nleft,
ny1 +
ny2, lright + lleft, htot, time_stepper_pt)
64 MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(2);
72 leaflet_pt, lleft, lright, hleaflet, htot, nleft, nright,
ny1,
ny2);
101 for (
unsigned e = 0;
e < nleft;
e++)
103 for (
unsigned i = 0;
i < nnode_1d;
i++)
107 if (
e != nleft - 1 ||
i != 2)
114 for (
unsigned e = nleft;
e < nleft + nright;
e++)
116 for (
unsigned i = 0;
i < nnode_1d;
i++)
127 for (
unsigned k = 0;
k <
ny1;
k++)
129 unsigned e = (nleft + nright) *
k + nleft - 1;
130 for (
unsigned i = 0;
i < nnode_1d;
i++)
156 unsigned e = nleft - 1;
164 for (
unsigned i = 0;
i < nnode_1d;
i++)
167 (
i + 1) * nnode_1d - 1, time_stepper_pt);
180 for (
unsigned k = 1;
k <
ny1;
k++)
182 e = (nleft + nright) *
k + nleft - 1;
192 for (
unsigned i = 1;
i < nnode_1d;
i++)
195 if ((
k ==
ny1 - 1) && (
i == nnode_1d - 1))
204 (
i + 1) * nnode_1d - 1, time_stepper_pt);
238 template<
class ELEMENT>
242 double hleaflet = this->domain_pt()->hleaflet();
243 double htot = this->domain_pt()->htot();
244 double lleft = this->domain_pt()->lleft();
245 double lright = this->domain_pt()->lright();
249 for (
unsigned j = 0;
j <
nnod;
j++)
264 if ((
r[0] != X_0) || (
r[1] != hleaflet))
267 error_stream <<
"Wall must be in its undeformed position when\n"
268 <<
"algebraic node update information is set up!\n "
269 <<
r[0] <<
" " << X_0 <<
" " <<
r[1] <<
" " << hleaflet
279 if ((x <= X_0) && (y <= hleaflet))
288 ref_value[3] =
zeta[0];
305 ref_value[2] = (lleft + x - X_0) / lleft;
309 nod_pt->add_node_update_info(1,
315 if ((x >= X_0) && (y <= hleaflet))
324 ref_value[3] =
zeta[0];
341 ref_value[2] = (x - X_0) / lright;
345 nod_pt->add_node_update_info(2,
351 if ((x <= X_0) && (y >= hleaflet))
357 ref_value[1] = (y - hleaflet) / (htot - hleaflet);
361 ref_value[2] = (lleft + x - X_0) / lleft;
365 geom_object_pt[0] = this->Leaflet_pt;
369 nod_pt->add_node_update_info(3,
375 if ((x >= X_0) && (y >= hleaflet))
381 ref_value[1] = (y - hleaflet) / (htot - hleaflet);
385 ref_value[2] = (x - X_0) / lright;
389 geom_object_pt[0] = this->Leaflet_pt;
393 nod_pt->add_node_update_info(4,
405 template<
class ELEMENT>
409 unsigned id =
node_pt->node_update_fct_id();
430 std::ostringstream error_message;
431 error_message <<
"The node update fct id is " <<
id
432 <<
", but it should only be one of " << 1 <<
", " << 2
433 <<
", " << 3 <<
" or " << 4 << std::endl;
435 "AlgebraicChannelWithLeafletMesh::algebraic_node_update()";
447 template<
class ELEMENT>
452 double lleft = this->domain_pt()->lleft();
465 double y0 = ref_value[0];
466 double x0 = -lleft + X_0;
478 double r = ref_value[2];
488 template<
class ELEMENT>
493 double lright = this->domain_pt()->lright();
506 double y0 = ref_value[0];
507 double x0 = X_0 + lright;
519 double r = ref_value[2];
529 template<
class ELEMENT>
535 double htot = this->domain_pt()->htot();
542 this->Leaflet_pt->position(
t, xi,
r_join);
551 template<
class ELEMENT>
556 double lleft = this->domain_pt()->lleft();
563 double y0 = ref_value[0];
564 double x0 = -lleft + X_0;
575 double r = ref_value[2];
585 template<
class ELEMENT>
590 double lright = this->domain_pt()->lright();
597 double y0 = ref_value[0];
598 double x0 = X_0 + lright;
610 double r = ref_value[2];
625 template<
class ELEMENT>
630 unsigned id =
node_pt->node_update_fct_id();
632 if ((
id == 1) || (
id == 2))
662 node_pt->kill_node_update_info(1);
665 node_pt->add_node_update_info(1,
673 node_pt->kill_node_update_info(2);
676 node_pt->add_node_update_info(2,
void setup_algebraic_node_update()
Function to setup the algebraic node update.
void algebraic_node_update(const unsigned &t, AlgebraicNode *&node_pt)
Update nodal position at time level t (t=0: present; t>0: previous)
void node_update_I(const unsigned &t, AlgebraicNode *&node_pt)
Update function for nodes in lower left region (I)
void node_update_III(const unsigned &t, AlgebraicNode *&node_pt)
Update function for nodes in upper left region (III)
void node_update_II(const unsigned &t, AlgebraicNode *&node_pt)
Update function for nodes in lower right region (II)
void slanted_bound_up(const unsigned &t, const Vector< double > &zeta, Vector< double > &r)
Helper function.
void node_update_IV(const unsigned &t, AlgebraicNode *&node_pt)
Update function for nodes in upper right region (IV)
Algebraic nodes are nodes with an algebraic positional update function.
Rectangular domain with a leaflet blocking the lower half.
ChannelWithLeafletDomain * Domain_pt
Pointer to domain.
GeomObject * Leaflet_pt
Pointer to GeomObject that represents the leaflet.
ChannelWithLeafletMesh(GeomObject *leaflet_pt, const double &lleft, const double &lright, const double &hleaflet, const double &htot, const unsigned &nleft, const unsigned &nright, const unsigned &ny1, const unsigned &ny2, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass pointer to GeomObject that represents the leaflet, the length of the domain to left...
MacroElement * macro_element_pt(const unsigned &i)
Access to i-th macro element.
A general Finite Element class.
virtual void set_macro_elem_pt(MacroElement *macro_elem_pt)
Set pointer to macro element – can be overloaded in derived elements to perform additional tasks.
void position(const Vector< double > &zeta, Vector< double > &r) const
Return the parametrised position of the FiniteElement in its incarnation as a GeomObject,...
unsigned nnode() const
Return the number of nodes.
virtual Node * construct_boundary_node(const unsigned &n)
Construct the local node n as a boundary node; that is a node that MAY be placed on a mesh boundary a...
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
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...
virtual void position(const Vector< double > &zeta, Vector< double > &r) const =0
Parametrised position on object at current time: r(zeta).
virtual void locate_zeta(const Vector< double > &zeta, GeomObject *&sub_geom_object_pt, Vector< double > &s, const bool &use_coordinate_as_initial_guess=false)
A geometric object may be composed of may sub-objects (e.g. a finite-element representation of a boun...
void add_boundary_node(const unsigned &b, Node *const &node_pt)
Add a (pointer to) a node to the b-th boundary.
FiniteElement * finite_element_pt(const unsigned &e) const
Upcast (downcast?) to FiniteElement (needed to access FiniteElement member functions).
void set_nboundary(const unsigned &nbound)
Set the number of boundaries in the mesh.
void remove_boundary_nodes()
Clear all pointers to boundary nodes.
virtual void node_update(const bool &update_all_solid_nodes=false)
Update nodal positions in response to changes in the domain shape. Uses the FiniteElement::get_x(....
void convert_to_boundary_node(Node *&node_pt, const Vector< FiniteElement * > &finite_element_pt)
A function that upgrades an ordinary node to a boundary node We shouldn't ever really use this,...
void set_boundary_coordinate_exists(const unsigned &i)
Set boundary coordinate on the i-th boundary to be existing.
void add_node_pt(Node *const &node_pt)
Add a (pointer to a) node to the mesh.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
double & x(const unsigned &i)
Return the i-th nodal coordinate.
An OomphLibError object which should be thrown when an run-time error is encountered....
void setup_boundary_element_info()
Setup lookup schemes which establish whic elements are located next to mesh's boundaries (wrapper to ...
void update_node_update(AlgebraicNode *&node_pt)
Update the node update data for specified node following any mesh adapation.
Simple rectangular 2D Quad mesh class. Nx : number of elements in the x direction.
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).