30 #ifndef OOMPH_CHANNEL_SPINE_MESH_HEADER 31 #define OOMPH_CHANNEL_SPINE_MESH_HEADER 34 #include "../generic/spines.h" 46 template <
class ELEMENT>
66 TimeStepper* time_stepper_pt=&Mesh::Default_TimeStepper);
83 const bool& periodic_in_x,
84 TimeStepper* time_stepper_pt=&Mesh::Default_TimeStepper);
128 double W = spine_node_pt->fraction();
131 Vector<double> s_wall(1);
132 s_wall[0] = spine_node_pt->spine_pt()->geom_parameter(0);
135 Vector<double> position(2);
136 spine_node_pt->spine_pt()->geom_object_pt(0)->position(s_wall,position);
139 spine_node_pt->x(1) = this->
Ymin + W*position[1];
149 unsigned yelement,
unsigned ynode)
152 double xstep1 =
Lx0/((this->
Np-1)*
Nx0);
154 double xstep2 =
Lx1/((this->
Np-1)*
Nx1);
156 double xstep3 =
Lx2/((this->
Np-1)*
Nx2);
162 return (this->
Xmin + xstep1*((this->
Np-1)*xelement + xnode));
165 else if (xelement<
Nx0+
Nx1)
168 return (
Lx0 + xstep2*((this->
Np-1)*(xelement-
Nx0) + xnode));
174 return (
Lx0+
Lx1 + xstep3*((this->
Np-1)*(xelement-
Nx0-
Nx1) + xnode));
178 throw OomphLibError(
"Should not have got here",
179 OOMPH_CURRENT_FUNCTION,
180 OOMPH_EXCEPTION_LOCATION);
192 throw OomphLibError(
"Arguemnt out of range",
193 OOMPH_CURRENT_FUNCTION,
194 OOMPH_EXCEPTION_LOCATION);
205 throw OomphLibError(
"Arguemnt out of range",
206 OOMPH_CURRENT_FUNCTION,
207 OOMPH_EXCEPTION_LOCATION);
220 throw OomphLibError(
"Arguemnt out of range",
221 OOMPH_CURRENT_FUNCTION,
222 OOMPH_EXCEPTION_LOCATION);
GeomObject * straight_wall_pt()
Access function to the GeomObject for the straight upper wall.
unsigned Nx0
Number of elements in the left region.
Spine *& left_spine_pt(const unsigned long &i)
Access function for spines in left region.
unsigned long nright() const
Number of elements in right region.
void element_reorder()
Reorder the elements so we loop over them vertically first (advantageous in "wide" domains if a front...
FiniteElement *& right_element_pt(const unsigned long &i)
Access functions for pointers to the -th element in the right region.
virtual void spine_node_update(SpineNode *spine_node_pt)
General node update function implements pure virtual function defined in SpineMesh base class and per...
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...
FiniteElement *& centre_element_pt(const unsigned long &i)
Access functions for pointers to the -th element in the centre region.
FiniteElement *& left_element_pt(const unsigned long &i)
Access functions for pointers to the -th element in the left region.
virtual void build_channel_spine_mesh(TimeStepper *time_stepper_pt)
Helper function to actually build the channel-spine mesh (called from various constructors) ...
double Lx1
Length of centre region.
unsigned nleft_spine()
Access function for the number of spines in the left region.
unsigned long ncentre() const
Number of elements in centre region.
const unsigned & ny() const
Return number of elements in y direction.
unsigned Nx1
Number of elements in the centre region.
Vector< FiniteElement * > Centre_element_pt
Vector of pointers to element in the centre region.
unsigned Np
Np: number of (linear) points in the element.
unsigned Ncentre_spine
Number of spines in centre region.
Spine *& centre_spine_pt(const unsigned long &i)
Access function for spines in centre region.
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, ynode) in the element (xelement,yelement). The description is in a "psudeo" two-dimensional coordinate system, so the range of xelement is [0,Nx-1], yelement is [0,Ny-1], and that of xnode and ynode is [0,Np-1]. The default is to return nodes that are equally spaced in the x coodinate.
GeomObject * wall_pt()
Access function to the GeomObject for upper wall.
unsigned Nx2
Number of elements in the right region.
GeomObject * Straight_wall_pt
GeomObject for the straight upper wall.
double Lx2
Length of right region.
unsigned Nleft_spine
Number of spines in left region.
double Xmin
Minimum value of x coordinate.
unsigned long nleft() const
Number of elements in left region.
double Lx0
Length of left region.
Vector< FiniteElement * > Right_element_pt
Vector of pointers to element in the right region.
unsigned ncentre_spine()
Access function for the number of spines in the centre region.
Vector< FiniteElement * > Left_element_pt
Vector of pointers to element in the left region.
unsigned Nright_spine
Number of spines in right region.
GeomObject * Wall_pt
GeomObject for upper wall.
double Ymin
Minimum value of y coordinate.
unsigned nright_spine()
Access function for the number of spines in the right region.
unsigned long nbulk() const
Number of elements in bulk.
Spine *& right_spine_pt(const unsigned long &i)
Access function for spines in right region.