27 #ifndef OOMPH_RECTANGULAR_QUADMESH_HEADER
28 #define OOMPH_RECTANGULAR_QUADMESH_HEADER
32 #include <oomph-lib-config.h>
36 #include "../generic/mesh.h"
37 #include "../generic/quad_mesh.h"
38 #include "../generic/refineable_quad_mesh.h"
57 template<
class ELEMENT>
84 void build_mesh(TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper);
100 const bool& periodic_in_x,
102 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
128 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
138 MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(2);
153 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
163 MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(2);
179 const bool& periodic_in_x,
180 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
190 MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(2);
206 const bool& periodic_in_x,
207 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
217 MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(2);
224 const unsigned&
nx()
const
231 const unsigned&
ny()
const
287 return (
Xmin + xstep * ((
Np - 1) * xelement + xnode));
303 return (
Ymin + ystep * ((
Np - 1) * yelement + ynode));
322 template<
class ELEMENT>
325 public RefineableQuadMesh<ELEMENT>
337 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
342 this->setup_quadtree_forest();
355 const bool& periodic_in_x,
356 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
358 nx,
ny, lx, ly, periodic_in_x, time_stepper_pt)
362 this->setup_quadtree_forest();
375 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
377 nx,
ny, xmin, xmax, ymin, ymax, time_stepper_pt)
381 this->setup_quadtree_forest();
394 const bool& periodic_in_x,
395 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
397 nx,
ny, xmin, xmax, ymin, ymax, periodic_in_x, time_stepper_pt)
401 this->setup_quadtree_forest();
419 template<
class ELEMENT>
422 public virtual SolidMesh
434 const Vector<double>& origin,
435 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
439 unsigned nnod = nnode();
440 for (
unsigned j = 0; j < nnod; j++)
442 node_pt(j)->x(0) += origin[0];
443 node_pt(j)->x(1) += origin[1];
449 set_lagrangian_nodal_coordinates();
464 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
468 Vector<double> origin(2, 0.0);
473 set_lagrangian_nodal_coordinates();
489 const bool& periodic_in_x,
490 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
492 nx,
ny, lx, ly, periodic_in_x, time_stepper_pt)
495 Vector<double> origin(2, 0.0);
500 set_lagrangian_nodal_coordinates();
513 Vector<double> zeta(1);
517 for (
unsigned b = 0; b < 3; b += 2)
520 unsigned n_nod = nboundary_node(b);
523 for (
unsigned i = 0; i < n_nod; i++)
526 zeta[0] = boundary_node_pt(b, i)->xi(0) - origin[0];
527 boundary_node_pt(b, i)->set_coordinates_on_boundary(b, zeta);
529 Boundary_coordinate_exists[b] =
true;
535 for (
unsigned b = 1; b < 4; b += 2)
538 unsigned n_nod = nboundary_node(b);
541 for (
unsigned i = 0; i < n_nod; i++)
544 zeta[0] = boundary_node_pt(b, i)->xi(1) - origin[1] -
546 boundary_node_pt(b, i)->set_coordinates_on_boundary(b, zeta);
548 Boundary_coordinate_exists[b] =
true;
569 template<
class ELEMENT>
572 public RefineableQuadMesh<ELEMENT>
584 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
591 this->setup_quadtree_forest();
604 const bool& periodic_in_x,
605 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
607 nx,
ny, lx, ly, periodic_in_x, time_stepper_pt),
609 nx,
ny, lx, ly, periodic_in_x, time_stepper_pt)
613 this->setup_quadtree_forest();
627 const Vector<double>& origin,
628 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
631 nx,
ny, lx, ly, origin, time_stepper_pt)
636 this->setup_quadtree_forest();
/////////////////////////////////////////////////////////////////////// /////////////////////////////...
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 is a two-dimensional mesh of Quad elements with Nx elements in the "x" (horizonal...
unsigned Nx
Nx: number of elements in x-direction.
const double y_min() const
Return the minimum value of y coordinate.
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,...
const double x_max() const
Return the maximum value of x coordinate.
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 Ny
Ny: number of elements in y-direction.
const double y_max() const
Return the maximum value of y coordinate.
bool Xperiodic
Boolean variable used to determine whether the mesh is periodic in the x-direction.
const unsigned & ny() const
Return number of elements in y direction.
unsigned Np
Np: number of (linear) points in the element.
double Ymax
Maximum value of y coordinate.
const double x_min() const
Return the minimum value of x coordinate.
double Xmax
Maximum value of x coordinate.
const unsigned & nx() const
Return 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, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor that allows the specification of minimum and maximum values of x and y coordinates....
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,...
double Ymin
Minimum value of y coordinate.
virtual void element_reorder()
Reorder the elements: By default they are ordered in "horizontal" layers (increasing in x,...
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,...
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.
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...
double Xmin
Minimum value of x coordinate.
void build_mesh(TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Generic mesh construction function: contains all the hard work.
Refineable version of the RectangularQuadMesh: A two-dimensional mesh of Quad elements with Nx elemen...
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, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor that allows the specification of minimum and maximum values of x and y coordinates Also p...
////////////////////////////////////////////////////////////////////// //////////////////////////////...