31 #ifndef OOMPH_RECTANGULAR_QUADMESH_HEADER 32 #define OOMPH_RECTANGULAR_QUADMESH_HEADER 36 #include <oomph-lib-config.h> 40 #include "../generic/mesh.h" 41 #include "../generic/quad_mesh.h" 42 #include "../generic/refineable_quad_mesh.h" 62 template <
class ELEMENT>
99 const double &xmin,
const double &xmax,
100 const double &ymin,
const double &ymax,
101 const bool &periodic_in_x,
104 Nx(nx), Ny(ny), Xmin(xmin), Xmax(xmax), Ymin(ymin), Ymax(ymax),
105 Xperiodic(periodic_in_x)
121 const double &lx,
const double &ly,
123 Nx(nx), Ny(ny), Xmin(0.0), Xmax(lx), Ymin(0.0), Ymax(ly), Xperiodic(false)
126 MeshChecker::assert_geometric_element<QElementGeometricBase,ELEMENT>(2);
135 const double &xmin,
const double &xmax,
136 const double &ymin,
const double &ymax,
138 Nx(nx), Ny(ny), Xmin(xmin), Xmax(xmax), Ymin(ymin), Ymax(ymax),
142 MeshChecker::assert_geometric_element<QElementGeometricBase,ELEMENT>(2);
154 const double &lx,
const double &ly,
155 const bool& periodic_in_x,
157 Nx(nx), Ny(ny), Xmin(0.0), Xmax(lx), Ymin(0.0), Ymax(ly),
158 Xperiodic(periodic_in_x)
161 MeshChecker::assert_geometric_element<QElementGeometricBase,ELEMENT>(2);
171 const double &xmin,
const double &xmax,
172 const double &ymin,
const double &ymax,
173 const bool& periodic_in_x,
175 Nx(nx), Ny(ny), Xmin(xmin), Xmax(xmax), Ymin(ymin), Ymax(ymax),
176 Xperiodic(periodic_in_x)
179 MeshChecker::assert_geometric_element<QElementGeometricBase,ELEMENT>(2);
186 const unsigned&
nx()
const 193 const unsigned&
ny()
const 242 unsigned yelement,
unsigned ynode)
245 double xstep = (Xmax-
Xmin)/((Np-1)*
Nx);
247 return (Xmin + xstep*((Np-1)*xelement + xnode));
257 unsigned yelement,
unsigned ynode)
259 double ystep = (Ymax-
Ymin)/((Np-1)*
Ny);
261 return (Ymin + ystep*((Np-1)*yelement + ynode));
284 template <
class ELEMENT>
297 const double &lx,
const double &ly,
304 this->setup_quadtree_forest();
313 const double &lx,
const double &ly,
314 const bool &periodic_in_x,
321 this->setup_quadtree_forest();
328 const double &xmin,
const double &xmax,
329 const double &ymin,
const double &ymax,
336 this->setup_quadtree_forest();
343 const double &xmin,
const double &xmax,
344 const double &ymin,
const double &ymax,
345 const bool &periodic_in_x,
352 this->setup_quadtree_forest();
372 template <
class ELEMENT>
396 unsigned nnod=
nnode();
397 for (
unsigned j=0;j<nnod;j++)
406 set_lagrangian_nodal_coordinates();
409 set_boundary_coordinates(origin);
433 set_lagrangian_nodal_coordinates();
436 set_boundary_coordinates(origin);
448 const bool& periodic_in_x,
460 set_lagrangian_nodal_coordinates();
463 set_boundary_coordinates(origin);
479 for (
unsigned b=0;b<3;b+=2)
485 for(
unsigned i=0;
i<n_nod;
i++)
497 for (
unsigned b=1;b<4;b+=2)
503 for(
unsigned i=0;
i<n_nod;
i++)
536 template <
class ELEMENT>
560 this->setup_quadtree_forest();
572 const bool& periodic_in_x,
581 this->setup_quadtree_forest();
603 this->setup_quadtree_forest();
const unsigned & nx() const
Return number of elements in x direction.
virtual void set_coordinates_on_boundary(const unsigned &b, const unsigned &k, const Vector< double > &boundary_zeta)
Set the vector of the k-th generalised boundary coordinates on mesh boundary b. Broken virtual interf...
Node *& boundary_node_pt(const unsigned &b, const unsigned &n)
Return pointer to node n on boundary b.
RefineableRectangularQuadMesh(const unsigned &nx, const unsigned &ny, const double &xmin, const double &xmax, const double &ymin, const double &ymax, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor that allows the specification of minimum and maximum values of x and y coordinates Also p...
static Steady< 0 > Default_TimeStepper
Default Steady Timestepper, to be used in default arguments to Mesh constructors. ...
std::vector< bool > Boundary_coordinate_exists
Vector of boolean data that indicates whether the boundary coordinates have been set for the boundary...
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.
RectangularQuadMesh(const unsigned &nx, const unsigned &ny, const double &lx, const double &ly, const bool &periodic_in_x, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Simple constructor: nx: number of elements in x direction; ny: number of elements in y direction; lx...
unsigned long nboundary_node(const unsigned &ibound) const
Return number of nodes on a particular boundary.
unsigned Ny
Ny: number of elements in y-direction.
const double x_min() const
Return the minimum value of x coordinate.
virtual double y_spacing_function(unsigned xelement, unsigned xnode, unsigned yelement, unsigned ynode)
Return the value of the y-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 it to return nodes that are equally spaced in the y coordinate.
double & x(const unsigned &i)
Return the i-th nodal coordinate.
RefineableRectangularQuadMesh(const unsigned &nx, const unsigned &ny, const double &lx, const double &ly, const bool &periodic_in_x, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Simple constructor: nx: number of elements in x direction; ny: number of elements in y direction; lx...
RefineableRectangularQuadMesh(const unsigned &nx, const unsigned &ny, const double &lx, const double &ly, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Simple constructor: nx: number of elements in x direction; ny: number of elements in y direction; lx...
RefineableRectangularQuadMesh(const unsigned &nx, const unsigned &ny, const double &xmin, const double &xmax, const double &ymin, const double &ymax, const bool &periodic_in_x, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor that allows the specification of minimum and maximum values of x and y coordinates and pe...
const unsigned & ny() const
Return number of elements in y direction.
const double x_max() const
Return the maximum value of x coordinate.
unsigned Nx
Nx: number of elements in x-direction.
RectangularQuadMesh(const unsigned &nx, const unsigned &ny, const double &xmin, const double &xmax, const double &ymin, const double &ymax, const bool &periodic_in_x, const bool &build, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor that allows the specification of minimum and maximum values of x and y coordinates and do...
unsigned Np
Np: number of (linear) points in the element.
bool Xperiodic
Boolean variable used to determine whether the mesh is periodic in the x-direction.
RectangularQuadMesh(const unsigned &nx, const unsigned &ny, const double &lx, const double &ly, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Simple constructor: nx: number of elements in x direction; ny: number of elements in y direction; lx...
virtual void element_reorder()
Reorder the elements: By default they are ordered in "horizontal" layers (increasing in x...
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
void build_mesh(TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Generic mesh construction function: contains all the hard work.
unsigned long nnode() const
Return number of nodes in the mesh.
Base class for quad meshes (meshes made of 2D quad elements).
RectangularQuadMesh(const unsigned &nx, const unsigned &ny, const double &xmin, const double &xmax, const double &ymin, const double &ymax, const bool &periodic_in_x, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor that allows the specification of minimum and maximum values of x and y coordinates...
const double y_max() const
Return the maximum value of y coordinate.
void set_boundary_coordinates(const Vector< double > &origin)
Setup the boundary coordinates. Vector origin specifies the coordinates of the lower left corner of t...
RectangularQuadMesh(const unsigned &nx, const unsigned &ny, const double &xmin, const double &xmax, const double &ymin, const double &ymax, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor that allows the specification of minimum and maximum values of x and y coordinates...
double Xmin
Minimum value of x coordinate.
double Ymax
Maximum value of y coordinate.
const double y_min() const
Return the minimum value of y coordinate.
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
double Xmax
Maximum value of x coordinate.
double Ymin
Minimum value of y coordinate.