26#ifndef OOMPH_PML_MESH_HEADER
27#define OOMPH_PML_MESH_HEADER
31#include <oomph-lib-config.h>
35#include "../meshes/rectangular_quadmesh.h"
45 template<
class ELEMENT>
57 template<
unsigned DIM>
144 namespace TwoDimensionalPMLHelper
183 template<
class ELEMENT>
231 double tol = 1.0e-12;
255 const unsigned nx = this->
nx();
258 const unsigned ny = this->
ny();
311 for (
unsigned i = 0;
i <
nx;
i++)
327 for (
unsigned i = 0;
i <
ny;
i++)
356 for (
unsigned i = 0;
i <
nx;
i++)
378 <<
"has not been found." << std::endl;
387 for (
unsigned i = 0;
i <
ny;
i++)
409 <<
"has not been found." << std::endl;
428 template<
class ELEMENT>
441 const unsigned& boundary_id,
519 for (
unsigned j = 0;
j <
nnod;
j++)
556 if (
inod % nnode_1d == 0)
588 if ((
int)(
inod / nnode_1d) == 0)
693 if (
inod % nnode_1d == 0)
774 template<
class ELEMENT>
904 if ((
inod % nnode_1d == 0) && (
inod > 0))
919 if ((
inod % nnode_1d) == 0)
955 if (((
int)(
inod / nnode_1d) == 0) && (
inod > 0))
970 if ((
int)(
inod / nnode_1d) == 0)
1079 if ((
inod % nnode_1d == 0) &&
1095 if ((
inod % nnode_1d) == 0)
1131 if (((
unsigned)(
inod / nnode_1d) ==
1256 (
inod > (nnode_1d - 1)))
1308 if (((
int)(
inod / nnode_1d) == 0) &&
1316 if (
inod == (nnode_1d - 1))
1324 if ((
int)(
inod / nnode_1d) == 0)
1484 if (((
unsigned)(
inod / nnode_1d) ==
1531 namespace TwoDimensionalPMLHelper
1537 template<
class ASSOCIATED_PML_QUAD_ELEMENT>
1625 for (
unsigned j = 0;
j <
npin;
j++)
1644 template<
class ASSOCIATED_PML_QUAD_ELEMENT>
1731 for (
unsigned j = 0;
j <
npin;
j++)
1750 template<
class ASSOCIATED_PML_QUAD_ELEMENT>
1839 for (
unsigned j = 0;
j <
npin;
j++)
1858 template<
class ASSOCIATED_PML_QUAD_ELEMENT>
1947 for (
unsigned j = 0;
j <
npin;
j++)
1966 template<
class ASSOCIATED_PML_QUAD_ELEMENT>
2080 if ((b == 1) || (b == 2))
2082 for (
unsigned j = 0;
j <
npin;
j++)
2101 template<
class ASSOCIATED_PML_QUAD_ELEMENT>
2211 if ((b == 0) || (b == 1))
2213 for (
unsigned j = 0;
j <
npin;
j++)
2232 template<
class ASSOCIATED_PML_QUAD_ELEMENT>
2344 if ((b == 2) || (b == 3))
2346 for (
unsigned j = 0;
j <
npin;
j++)
2365 template<
class ASSOCIATED_PML_QUAD_ELEMENT>
2472 if ((b == 0) || (b == 3))
2474 for (
unsigned j = 0;
j <
npin;
j++)
A general Finite Element class.
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
unsigned nnode() const
Return the number of nodes.
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...
unsigned long nboundary_node(const unsigned &ibound) const
Return number of nodes on a particular boundary.
static Steady< 0 > Default_TimeStepper
Default Steady Timestepper, to be used in default arguments to Mesh constructors.
FiniteElement * finite_element_pt(const unsigned &e) const
Upcast (downcast?) to FiniteElement (needed to access FiniteElement member functions).
FiniteElement * boundary_element_pt(const unsigned &b, const unsigned &e) const
Return pointer to e-th finite element on boundary b.
unsigned long nnode() const
Return number of nodes in the mesh.
const Vector< GeneralisedElement * > & element_pt() const
Return reference to the Vector of elements.
Vector< Node * > prune_dead_nodes()
Prune nodes. Nodes that have been marked as obsolete are removed from the mesh (and its boundary-node...
unsigned long nelement() const
Return number of elements in the mesh.
Node *& boundary_node_pt(const unsigned &b, const unsigned &n)
Return pointer to node n on boundary b.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
void set_obsolete()
Mark node as obsolete.
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....
PML mesh, derived from RectangularQuadMesh.
PMLCornerQuadMesh(Mesh *PMLQuad_mesh_x_pt, Mesh *PMLQuad_mesh_y_pt, Mesh *bulk_mesh_pt, Node *special_corner_node_pt, const unsigned &parent_boundary_x_id, const unsigned &parent_boundary_y_id, const unsigned ¤t_boundary_x_id, const unsigned ¤t_boundary_y_id, const unsigned &n_pml_x, const unsigned &n_pml_y, const double &x_pml_start, const double &x_pml_end, const double &y_pml_start, const double &y_pml_end, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass pointer to "bulk" mesh and the two existing PML meshes in order to construct the co...
Base class for elements with pml capabilities.
bool Pml_is_enabled
Boolean indicating if element is used in pml mode.
virtual ~PMLElementBase()
Virtual destructor.
void enable_pml(const int &direction, const double &interface_border_value, const double &outer_domain_border_value)
Enable pml. Specify the coordinate direction along which pml boundary is constant,...
void disable_pml()
Disable pml. Ensures the PML-ification in all directions has been deactivated.
std::vector< bool > Pml_direction_active
Coordinate direction along which pml boundary is constant; alternatively: coordinate direction in whi...
Vector< double > Pml_outer_boundary
Coordinate of outer pml boundary (Storage is provided for any coordinate direction; only the entries ...
Vector< double > Pml_inner_boundary
Coordinate of inner pml boundary (Storage is provided for any coordinate direction; only the entries ...
PMLElementBase()
Constructor.
virtual void values_to_be_pinned_on_outer_pml_boundary(Vector< unsigned > &values_to_pin)=0
Pure virtual function in which we have to specify the values to be pinned (and set to zero) on the ou...
General definition of policy class defining the elements to be used in the actual PML layers....
PML mesh base class. Contains a pure virtual locate_zeta function to be uploaded in PMLQuadMesh and P...
virtual void pml_locate_zeta(const Vector< double > &x, FiniteElement *&el_pt)=0
Pure virtual function to provide an optimised version of the locate_zeta function for PML meshes....
PML mesh class. Policy class for 2D PML meshes.
void pml_locate_zeta(const Vector< double > &x, FiniteElement *&coarse_mesh_el_pt)
Overloaded function to allow the user to locate an element in mesh given the (Eulerian) position of a...
PMLQuadMeshBase(const unsigned &n_pml_x, const unsigned &n_pml_y, const double &x_pml_start, const double &x_pml_end, const double &y_pml_start, const double &y_pml_end, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Create the underlying rectangular quad mesh.
PML mesh, derived from RectangularQuadMesh.
PMLQuadMesh(Mesh *bulk_mesh_pt, const unsigned &boundary_id, const unsigned &quad_boundary_id, const unsigned &n_pml_x, const unsigned &n_pml_y, const double &x_pml_start, const double &x_pml_end, const double &y_pml_start, const double &y_pml_end, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass pointer to "bulk" mesh, the boundary ID of axis aligned boundary to which the mesh ...
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.
const double y_min() const
Return the minimum value of y coordinate.
const double x_max() const
Return the maximum value of x coordinate.
const double y_max() const
Return the maximum value of y coordinate.
const unsigned & nx() const
Return number of elements in x direction.
const double x_min() const
Return the minimum value of x coordinate.
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
bool sorter_bottom_boundary(Node *nod_i_pt, Node *nod_j_pt)
helper function for sorting the bottom boundary nodes
Mesh * create_bottom_left_pml_mesh(Mesh *pml_left_mesh_pt, Mesh *pml_bottom_mesh_pt, Mesh *bulk_mesh_pt, const unsigned &left_boundary_id, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
"Constructor" for PML bottom left corner mesh, aligned with the existing PML meshes
Mesh * create_top_left_pml_mesh(Mesh *pml_left_mesh_pt, Mesh *pml_top_mesh_pt, Mesh *bulk_mesh_pt, const unsigned &left_boundary_id, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
"Constructor" for PML top left corner mesh, aligned with the existing PML meshes
Mesh * create_bottom_pml_mesh(Mesh *bulk_mesh_pt, const unsigned &bottom_boundary_id, const unsigned &n_y_bottom_pml, const double &width_y_bottom_pml, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
"Constructor" for PML mesh,aligned with the bottom physical domain boundary
Mesh * create_top_right_pml_mesh(Mesh *pml_right_mesh_pt, Mesh *pml_top_mesh_pt, Mesh *bulk_mesh_pt, const unsigned &right_boundary_id, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
"Constructor" for PML top right corner mesh, aligned with the existing PML meshes
bool sorter_top_boundary(Node *nod_i_pt, Node *nod_j_pt)
helper function for sorting the top boundary nodes
Mesh * create_right_pml_mesh(Mesh *bulk_mesh_pt, const unsigned &right_boundary_id, const unsigned &n_x_right_pml, const double &width_x_right_pml, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
"Constructor" for PML mesh,aligned with the right physical domain boundary
Mesh * create_left_pml_mesh(Mesh *bulk_mesh_pt, const unsigned &left_boundary_id, const unsigned &n_x_left_pml, const double &width_x_left_pml, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
"Constructor" for PML mesh, aligned with the left physical domain boundary
Mesh * create_bottom_right_pml_mesh(Mesh *pml_right_mesh_pt, Mesh *pml_bottom_mesh_pt, Mesh *bulk_mesh_pt, const unsigned &right_boundary_id, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
"Constructor" for PML bottom right corner mesh, aligned with the existing PML meshes
bool sorter_right_boundary(Node *nod_i_pt, Node *nod_j_pt)
helper function for sorting the right boundary nodes
Mesh * create_top_pml_mesh(Mesh *bulk_mesh_pt, const unsigned &top_boundary_id, const unsigned &n_y_top_pml, const double &width_y_top_pml, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
"Constructor" for PML mesh, aligned with the top physical domain boundary
bool sorter_left_boundary(Node *nod_i_pt, Node *nod_j_pt)
helper function for sorting the left boundary nodes
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).