26 #ifndef OOMPH_CHANNEL_SPINE_MESH_HEADER
27 #define OOMPH_CHANNEL_SPINE_MESH_HEADER
30 #include "../generic/spines.h"
41 template<
class ELEMENT>
59 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper);
76 const bool& periodic_in_x,
77 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper);
136 double W = spine_node_pt->fraction();
139 Vector<double> s_wall(1);
140 s_wall[0] = spine_node_pt->spine_pt()->geom_parameter(0);
143 Vector<double> position(2);
144 spine_node_pt->spine_pt()->geom_object_pt(0)->position(s_wall, position);
147 spine_node_pt->x(1) = this->
Ymin + W * position[1];
162 double xstep1 =
Lx0 / ((this->
Np - 1) *
Nx0);
165 double xstep2 =
Lx1 / ((this->
Np - 1) *
Nx1);
168 double xstep3 =
Lx2 / ((this->
Np - 1) *
Nx2);
174 return (this->
Xmin + xstep1 * ((this->
Np - 1) * xelement + xnode));
177 else if (xelement <
Nx0 +
Nx1)
180 return (
Lx0 + xstep2 * ((this->
Np - 1) * (xelement -
Nx0) + xnode));
187 xstep3 * ((this->
Np - 1) * (xelement -
Nx0 -
Nx1) + xnode));
191 throw OomphLibError(
"Should not have got here",
192 OOMPH_CURRENT_FUNCTION,
193 OOMPH_EXCEPTION_LOCATION);
205 throw OomphLibError(
"Arguemnt out of range",
206 OOMPH_CURRENT_FUNCTION,
207 OOMPH_EXCEPTION_LOCATION);
218 throw OomphLibError(
"Arguemnt out of range",
219 OOMPH_CURRENT_FUNCTION,
220 OOMPH_EXCEPTION_LOCATION);
233 throw OomphLibError(
"Arguemnt out of range",
234 OOMPH_CURRENT_FUNCTION,
235 OOMPH_EXCEPTION_LOCATION);
Spine mesh class derived from standard 2D mesh. The mesh contains a StraightLine GeomObject which def...
Vector< FiniteElement * > Centre_element_pt
Vector of pointers to element in the centre region.
virtual void build_channel_spine_mesh(TimeStepper *time_stepper_pt)
Helper function to actually build the channel-spine mesh (called from various constructors)
virtual double x_spacing_function(unsigned xelement, unsigned xnode, unsigned yelement, unsigned ynode)
Return the value of the x-coordinate at the node given by the local node number (xnode,...
unsigned Nx0
Number of elements in the left region.
FiniteElement *& centre_element_pt(const unsigned long &i)
Access functions for pointers to the -th element in the centre region.
GeomObject * Straight_wall_pt
GeomObject for the straight upper wall.
double Lx1
Length of centre region.
double Lx0
Length of left region.
unsigned long ncentre() const
Number of elements in centre region.
unsigned Nx2
Number of elements in the right region.
unsigned nright_spine()
Access function for the number of spines in the right region.
double Lx2
Length of right region.
GeomObject * straight_wall_pt()
Access function to the GeomObject for the straight upper wall.
unsigned long nright() const
Number of elements in right region.
unsigned Nright_spine
Number of spines in right region.
unsigned Nleft_spine
Number of spines in left region.
unsigned Nx1
Number of elements in the centre region.
Spine *& centre_spine_pt(const unsigned long &i)
Access function for spines in centre region.
unsigned long nleft() const
Number of elements in left region.
GeomObject * wall_pt()
Access function to the GeomObject for upper wall.
Spine *& right_spine_pt(const unsigned long &i)
Access function for spines in right region.
FiniteElement *& left_element_pt(const unsigned long &i)
Access functions for pointers to the -th element in the left region.
unsigned ncentre_spine()
Access function for the number of spines in the centre region.
unsigned long nbulk() const
Number of elements in bulk.
FiniteElement *& right_element_pt(const unsigned long &i)
Access functions for pointers to the -th element in the right region.
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...
Vector< FiniteElement * > Right_element_pt
Vector of pointers to element in the right region.
Vector< FiniteElement * > Left_element_pt
Vector of pointers to element in the left region.
void element_reorder()
Reorder the elements so we loop over them vertically first (advantageous in "wide" domains if a front...
Spine *& left_spine_pt(const unsigned long &i)
Access function for spines in left region.
GeomObject * Wall_pt
GeomObject for upper wall.
virtual void spine_node_update(SpineNode *spine_node_pt)
General node update function implements pure virtual function defined in SpineMesh base class and per...
unsigned nleft_spine()
Access function for the number of spines in the left region.
unsigned Ncentre_spine
Number of spines in centre region.
RectangularQuadMesh is a two-dimensional mesh of Quad elements with Nx elements in the "x" (horizonal...
const unsigned & ny() const
Return number of elements in y direction.
unsigned Np
Np: number of (linear) points in the element.
double Ymin
Minimum value of y coordinate.
double Xmin
Minimum value of x coordinate.
////////////////////////////////////////////////////////////////////// //////////////////////////////...