Definition of the computational domain in 2D as a set of boundary points, and set of holes (each hole defined as a set of boundary points). More...
#include <ptems/domaindefinition.hpp>
Public Types | |
typedef std::vector< Vector< 2 > > | Polygon |
A polygon defined using a list of points defining the boundary of the polygon. More... | |
Public Member Functions | |
DomainDefinition2D (Polygon &&points) | |
Create a computational domain by the list of vertices defining the boundary. More... | |
DomainDefinition2D (const Polygon &points) | |
Create a computational domain by the list of vertices defining the boundary. More... | |
DomainDefinition2D (const std::initializer_list< Vector< 2 >> &points) | |
Create a computational domain by the list of vertices defining the boundary. More... | |
template<typename It > | |
DomainDefinition2D (It begin, It end) | |
Create a computational domain by the list of vertices defining the boundary. More... | |
void | AddHole (Polygon &&points) |
Adds a hole into the domain. More... | |
void | AddHole (const Polygon &points) |
Adds a hole into the domain. More... | |
void | AddHole (const std::initializer_list< Vector< 2 >> &points) |
Adds a hole into the domain. More... | |
template<typename It > | |
void | AddHole (It begin, It end) |
Adds a hole into the domain. More... | |
bool | IsAligned () const |
Returns whether the domain boundaries are aligned with the axis (i.e., only vertical or horizontal lines). More... | |
std::size_t | MinElementsX () const |
Returns the minimum number of elements (or the multiplier) in the x-coordinate for uniform refinement to ensure that the mesh aligns with the boundary. More... | |
std::size_t | MinElementsY () const |
Returns the minimum number of elements (or the multiplier) in the y-coordinate for uniform refinement to ensure that the mesh aligns with the boundary. More... | |
double | SmallestDistanceX () const |
Calculates the smallest distance in the X coordinate between any two points in the domain boundary. More... | |
double | SmallestDistanceY () const |
Calculates the smallest distance in the Y coordinate between any two points in the domain boundary. More... | |
BBox< 2 > | BoundingBox () const |
Gets the bounding box of the domain. More... | |
const Polygon & | Boundary () const |
Gets the list of points defining the boundary. More... | |
const std::vector< Polygon > & | Holes () const |
Gets the list of holes in the domain. More... | |
bool | IsValid () const |
Checks if the domain is valid (contains at least three points in the boundary) More... | |
operator bool () const | |
Checks if the domain is valid (contains at least three points in the boundary) More... | |
DomainDefinition3D | ExtrudeX (double start, double end) const |
Create a 3D domain by extruding this 2D domain representing a plane parallel to YZ plane along the X axis. More... | |
DomainDefinition3D | ExtrudeY (double start, double end) const |
Create a 3D domain by extruding this 2D domain representing a plane parallel to XZ plane along the Y axis. More... | |
DomainDefinition3D | ExtrudeZ (double start, double end) const |
Create a 3D domain by extruding this 2D domain representing a plane parallel to XY plane along the Z axis. More... | |
Static Public Member Functions | |
static DomainDefinition2D | Square (double xMin, double xMax, double yMin, double yMax) |
Create a rectangle computational domain with the specified dimensions. More... | |
static DomainDefinition2D | Square (const Vector< 2 > &p1, const Vector< 2 > &p2) |
Create a square computational domain with the specified opposite corners. More... | |
static DomainDefinition2D | Square (double min, double max) |
Create a square computational domain with the specified dimensions. More... | |
static DomainDefinition2D | Square () |
Create a unit square \( (0,1)^2 \) computational domain. More... | |
static DomainDefinition2D | Obstacle (double xMin, double xMax, double yMin, double yMax, double xMinObstacle, double xMaxObstacle, double yMinObstacle, double yMaxObstacle) |
Create a rectangle computational domain with the specified dimensions, containing a rectangle obstacle with the specified dimensions. More... | |
static DomainDefinition2D | Obstacle (const Vector< 2 > &p1, const Vector< 2 > &p2, const Vector< 2 > &obs1, const Vector< 2 > &obs2) |
Create a square computational domain with the opposite corners for the domain and obstacle. More... | |
static DomainDefinition2D | Obstacle (double min, double max, double minObstacle, double maxObstacle) |
Create a square computational domain with the specified dimensions, containing a square obstacle with the specified dimensions. More... | |
static DomainDefinition2D | LShape (double xMin, double xMax, double yMin, double yMax, double xCentre, double yCentre, LShapeDomain shape=LShapeDomain::MinusSE) |
Creates an L-shape computational domain defined by the specified dimensions. More... | |
static DomainDefinition2D | LShape (const Vector< 2 > &p1, const Vector< 2 > &p2, const Vector< 2 > ¢re, LShapeDomain shape=LShapeDomain::MinusSE) |
Create a L-shape computational domain within the square defined by the opposite corners. More... | |
static DomainDefinition2D | LShape (double xMin, double xMax, double yMin, double yMax, LShapeDomain shape=LShapeDomain::MinusSE) |
Creates an L-shape computational domain defined by the specified dimensions with centre point (re-entrant corner) of the L-shape at the midpoint of the domain limit. More... | |
static DomainDefinition2D | LShape (const Vector< 2 > &p1, const Vector< 2 > &p2, LShapeDomain shape=LShapeDomain::MinusSE) |
Create a L-shape computational domain within the square defined by the opposite corners with centre point (re-entrant corner) of the L-shape at the midpoint of the domain limit. More... | |
static DomainDefinition2D | LShape (double min, double max, double centre, LShapeDomain shape=LShapeDomain::MinusSE) |
Creates an L-shape computational domain defined by the specified dimensions. More... | |
static DomainDefinition2D | LShape (double min, double max, LShapeDomain shape=LShapeDomain::MinusSE) |
Creates an L-shape computational domain defined by the specified dimensions with centre point (re-entrant corner) of the L-shape at the midpoint of the domain limit. More... | |
static DomainDefinition2D | LShape (LShapeDomain shape=LShapeDomain::MinusSE) |
Creates an L-shape computational domain with limits [-1,1] for all coordinate directions and centre point (re-entrant corner) at (0,0). More... | |
Definition of the computational domain in 2D as a set of boundary points, and set of holes (each hole defined as a set of boundary points).
typedef std::vector<Vector<2> > ptems::DomainDefinition2D::Polygon |
A polygon defined using a list of points defining the boundary of the polygon.
|
inline |
Create a computational domain by the list of vertices defining the boundary.
std::invalid_argument | If the number points is less than three, or the points are all colinear. |
points | List of vertices defining the boundary. |
|
inline |
Create a computational domain by the list of vertices defining the boundary.
std::invalid_argument | If the number points is less than three, or the points are all colinear. |
points | List of vertices defining the boundary. |
|
inline |
Create a computational domain by the list of vertices defining the boundary.
std::invalid_argument | If the number points is less than three, or the points are all colinear. |
points | List of vertices defining the boundary. |
|
inline |
Create a computational domain by the list of vertices defining the boundary.
std::invalid_argument | If the number points is less than three, or the points are all colinear. |
It | The iterator type |
begin | Start iterator for list of vertices defining the boundary |
end | End iterator for list of vertices defining the boundary |
|
inline |
Adds a hole into the domain.
std::invalid_argument | If the number points is less than three, or the points are all colinear. |
points | List of vertices defining the boundary of the hole. |
|
inline |
Adds a hole into the domain.
std::invalid_argument | If the number points is less than three, or the points are all colinear. |
points | List of vertices defining the boundary of the hole. |
|
inline |
Adds a hole into the domain.
std::invalid_argument | If the number points is less than three, or the points are all colinear. |
It | The iterator type |
begin | Start iterator for list of vertices defining the boundary of the hole |
end | End iterator for list of vertices defining the boundary of the hole |
|
inline |
Adds a hole into the domain.
std::invalid_argument | If the number points is less than three, or the points are all colinear. |
points | List of vertices defining the boundary of the hole. |
|
inline |
Gets the list of points defining the boundary.
BBox<2> ptems::DomainDefinition2D::BoundingBox | ( | ) | const |
Gets the bounding box of the domain.
|
inline |
Create a 3D domain by extruding this 2D domain representing a plane parallel to YZ plane along the X axis.
start | The X value of the "bottom" plane of the extruded volume |
end | The X value of the "top" plane of the extruded volume |
std::invalid_argument | if end is less than or equal to start |
|
inline |
Create a 3D domain by extruding this 2D domain representing a plane parallel to XZ plane along the Y axis.
start | The Y value of the "bottom" plane of the extruded volume |
end | The Y value of the "top" plane of the extruded volume |
std::invalid_argument | if end is less than or equal to start |
|
inline |
Create a 3D domain by extruding this 2D domain representing a plane parallel to XY plane along the Z axis.
start | The Z value of the "bottom" plane of the extruded volume |
end | The Z value of the "top" plane of the extruded volume |
std::invalid_argument | if end is less than or equal to start |
|
inline |
Gets the list of holes in the domain.
bool ptems::DomainDefinition2D::IsAligned | ( | ) | const |
Returns whether the domain boundaries are aligned with the axis (i.e., only vertical or horizontal lines).
|
inline |
Checks if the domain is valid (contains at least three points in the boundary)
|
inlinestatic |
Create a L-shape computational domain within the square defined by the opposite corners.
The L-shape has one of the following four layouts:
p1 | Coordinates of the first corner of the square bounding box of the L-shape domain |
p2 | Coordinates of the second, opposite, corner of square bounding box of the L-shape domain |
centre | Coordinates of the centre (re-entrant) corner in the L-shape |
shape | Which L-shape domain to create (default = MinusSE) |
std::invalid_argument | If the difference between the two coordinates of the outer domain, in the X or Y coordinates, is zero. |
std::invalid_argument | If the centre (re-entrant) corner is not contained within the domain limits. |
|
inlinestatic |
Create a L-shape computational domain within the square defined by the opposite corners with centre point (re-entrant corner) of the L-shape at the midpoint of the domain limit.
p1 | Coordinates of the first corner of the square bounding box of the L-shape domain |
p2 | Coordinates of the second, opposite, corner of square bounding box of the L-shape domain |
shape | Which L-shape domain to create (default = MinusSE) |
The L-shape has one of the following four layouts:
std::invalid_argument | If the difference between the two coordinates of the outer domain, in the X or Y coordinates, is zero. |
|
inlinestatic |
Creates an L-shape computational domain defined by the specified dimensions.
The L-shape has one of the following four layouts:
min | The lower limit of the L-shape in the x and y coordinate directions. |
max | The upper limit of the L-shape in the x and y coordinate directions. |
centre | The x and y coordinate of the centre (re-entrant) corner in the L-shape |
shape | Which L-shape domain to create (default = MinusSE) |
std::invalid_argument | If the lower limit of the domain in any coordinate direction is greater (or equal) to the upper limit |
std::invalid_argument | If the centre (re-entrant) corner is not contained within the domain limits. |
|
inlinestatic |
Creates an L-shape computational domain defined by the specified dimensions with centre point (re-entrant corner) of the L-shape at the midpoint of the domain limit.
The L-shape has one of the following four layouts:
min | The lower limit of the L-shape in the x and y coordinate directions. |
max | The upper limit of the L-shape in the x and y coordinate directions. |
shape | Which L-shape domain to create (default = MinusSE) |
std::invalid_argument | If the lower limit of the domain in any coordinate direction is greater (or equal) to the upper limit |
|
static |
Creates an L-shape computational domain defined by the specified dimensions.
The L-shape has one of the following four layouts:
xMin | The lower limit of the L-shape in the x coordinate direction. |
xMax | The upper limit of the L-shape in the x coordinate direction. |
yMin | The lower limit of the L-shape in the y coordinate direction. |
yMax | The upper limit of the L-shape in the y coordinate direction. |
xCentre | The x coordinate of the centre (re-entrant) corner in the L-shape |
yCentre | The y coordinate of the centre (re-entrant) corner in the L-shape |
shape | Which L-shape domain to create (default = MinusSE) |
std::invalid_argument | If the lower limit of the domain in any coordinate direction is greater (or equal) to the upper limit |
std::invalid_argument | If the centre (re-entrant) corner is not contained within the domain limits. |
|
inlinestatic |
Creates an L-shape computational domain defined by the specified dimensions with centre point (re-entrant corner) of the L-shape at the midpoint of the domain limit.
The L-shape has one of the following four layouts:
xMin | The lower limit of the L-shape in the x coordinate direction. |
xMax | The upper limit of the L-shape in the x coordinate direction. |
yMin | The lower limit of the L-shape in the y coordinate direction. |
yMax | The upper limit of the L-shape in the y coordinate direction. |
shape | Which L-shape domain to create (default = MinusSE) |
std::invalid_argument | If the lower limit of the domain in any coordinate direction is greater (or equal) to the upper limit |
|
inlinestatic |
Creates an L-shape computational domain with limits [-1,1] for all coordinate directions and centre point (re-entrant corner) at (0,0).
The L-shape has one of the following four layouts:
shape | Which L-shape domain to create (default = MinusSE) |
std::size_t ptems::DomainDefinition2D::MinElementsX | ( | ) | const |
Returns the minimum number of elements (or the multiplier) in the x-coordinate for uniform refinement to ensure that the mesh aligns with the boundary.
std::size_t ptems::DomainDefinition2D::MinElementsY | ( | ) | const |
Returns the minimum number of elements (or the multiplier) in the y-coordinate for uniform refinement to ensure that the mesh aligns with the boundary.
|
inlinestatic |
Create a square computational domain with the opposite corners for the domain and obstacle.
p1 | Coordinates of the first corner of the outer domain |
p2 | Coordinates of the second, opposite, corner of the outer domain |
obs1 | Coordinates of the first corner of the obstacle |
obs2 | Coordinates of the second, opposite, corner of the obstacle |
std::invalid_argument | If the difference between the two coordinates of the outer domain, in the X or Y coordinates, is zero. |
std::invalid_argument | If the difference between the two coordinates of the obstacle, in the X or Y coordinates, is zero. |
std::invalid_argument | If the obstacle is not completely contained within the outer domain |
|
inlinestatic |
Create a square computational domain with the specified dimensions, containing a square obstacle with the specified dimensions.
min | The lower limit of the square in all coordinate directions. |
max | The upper limit of the square in all coordinate directions. |
minObstacle | The lower limit of the square obstacle in all coordinate directions. |
maxObstacle | The upper limit of the square obstacle in all coordinate directions. |
std::invalid_argument | If the lower limit (min) is greater (or equal) to the upper limit (max) |
std::invalid_argument | If the lower limit of the obstacle (minObstacle) is greater (or equal) to the upper limit of the obstacle (maxObstacle) |
std::invalid_argument | If the obstacle is not completely contained within the outer domain |
|
static |
Create a rectangle computational domain with the specified dimensions, containing a rectangle obstacle with the specified dimensions.
xMin | The lower limit of the rectangle in the x coordinate direction. |
xMax | The upper limit of the rectangle in the x coordinate direction. |
yMin | The lower limit of the rectangle in the y coordinate direction. |
yMax | The upper limit of the rectangle in the y coordinate direction. |
xMinObstacle | The lower limit of the rectangle obstacle in the x coordinate direction. |
xMaxObstacle | The upper limit of the rectangle obstacle in the x coordinate direction. |
yMinObstacle | The lower limit of the rectangle obstacle in the y coordinate direction. |
yMaxObstacle | The upper limit of the rectangle obstacle in the y coordinate direction. |
std::invalid_argument | If the lower limit of the outer domain in any coordinate direction is greater (or equal) to the upper limit |
std::invalid_argument | If the lower limit of the obstacle in any coordinate direction is greater (or equal) to the upper limit |
std::invalid_argument | If the obstacle is not completely contained within the outer domain |
|
inlineexplicit |
Checks if the domain is valid (contains at least three points in the boundary)
double ptems::DomainDefinition2D::SmallestDistanceX | ( | ) | const |
Calculates the smallest distance in the X coordinate between any two points in the domain boundary.
double ptems::DomainDefinition2D::SmallestDistanceY | ( | ) | const |
Calculates the smallest distance in the Y coordinate between any two points in the domain boundary.
|
inlinestatic |
Create a unit square \( (0,1)^2 \) computational domain.
|
inlinestatic |
Create a square computational domain with the specified opposite corners.
p1 | Coordinates of the first corner |
p2 | Coordinates of the second, opposite, corner |
std::invalid_argument | If the difference between the two points, in the X or Y coordinates, is zero. |
|
inlinestatic |
Create a square computational domain with the specified dimensions.
min | The lower limit of the square in all coordinate directions. |
max | The upper limit of the square in all coordinate directions. |
std::invalid_argument | If the lower limit (min) is greater (or equal) to the upper limit (max) |
|
static |
Create a rectangle computational domain with the specified dimensions.
xMin | The lower limit of the rectangle in the x coordinate direction. |
xMax | The upper limit of the rectangle in the x coordinate direction. |
yMin | The lower limit of the rectangle in the y coordinate direction. |
yMax | The upper limit of the rectangle in the y coordinate direction. |
std::invalid_argument | If the lower limit in any coordinate direction is greater (or equal) to the upper limit |