#include <AuxMeshTopology.h>
Public Member Functions | |
AuxMeshTopology (bool request_sides=true, bool request_wedges=true, bool request_corners=true) | |
Constructor indicating which entities are wanted. More... | |
int | num_owned_sides () const |
Number of owned sides in the mesh. More... | |
int | num_owned_wedges () const |
Number of owned wedges in the mesh. More... | |
int | num_owned_corners () const |
Number of owned corners in the mesh. More... | |
int | num_ghost_sides () const |
Number of ghost sides in the mesh. More... | |
int | num_ghost_wedges () const |
Number of ghost wedges in the mesh. More... | |
int | num_ghost_corners () const |
Number of ghost corners in the mesh. More... | |
int | num_entities (Entity_kind const entity, Entity_type const etype=Entity_type::ALL) const |
Number of items of given entity. More... | |
counting_iterator | begin (Entity_kind const entity, Entity_type const etype=Entity_type::ALL) const |
Iterators on mesh entity - begin. More... | |
counting_iterator | end (Entity_kind const entity, Entity_type const etype=Entity_type::ALL) const |
Iterator on mesh entity - end. More... | |
void | cell_get_node_adj_cells (int const cellid, Entity_type const ptype, std::vector< int > *adjcells) const |
Get the list of cell IDs for all cells attached to a specific cell through its nodes. More... | |
void | face_get_cells (int const faceid, Entity_type const etype, std::vector< int > *cells) const |
Get cells of given Entity_type connected to face (in no particular order) More... | |
int | cell_get_face_adj_cell (int cell, int face) const |
Retrieve the cell incident to a given face of a given cell. More... | |
void | cell_get_face_adj_cells (int const cellid, Entity_type const ptype, std::vector< int > *adjcells) const |
Get the list of cell IDs for all cells attached to a specific cell through its faces. More... | |
void | node_get_cell_adj_nodes (int const nodeid, Entity_type const ptype, std::vector< int > *adjnodes) const |
Get the list of node IDs for all nodes attached to all cells attached to a specific node. More... | |
bool | on_exterior_boundary (Entity_kind const entity, int const entity_id) const |
if entity is on exterior boundary More... | |
template<int D> | |
void | cell_get_coordinates (int const cellid, std::vector< Point< D >> *pplist) const |
Coordinates of nodes of cell. More... | |
template<int D> | |
void | cell_centroid (int const cellid, Point< D > *ccen) const |
Centroid of a cell. More... | |
double | cell_volume (int const cellid) const |
Volume of a cell. More... | |
template<int D> | |
void | face_centroid (int const faceid, Point< D > *fcen) const |
Centroid of a face. More... | |
int | side_get_node (int const sideid, int const inode) const |
int | side_get_cell (int const sideid) const |
Cell of side. More... | |
int | side_get_face (int const sideid) const |
Face of side. More... | |
int | side_get_wedge (int const sideid, int iwedge) const |
int | side_get_opposite_side (int const sideid) const |
void | cell_get_sides (int const cellid, std::vector< int > *csides) const |
Get all the sides of a cell. More... | |
void | side_get_coordinates (int const sideid, std::array< Point< 3 >, 4 > *scoords, bool posvol_order=false) const |
side coordinates in 3D More... | |
void | side_get_coordinates (int const sideid, std::array< Point< 2 >, 3 > *scoords, bool posvol_order=false) const |
side coordinates in 2D More... | |
void | side_get_coordinates (int const sideid, std::array< Point< 1 >, 2 > *scoords, bool posvol_order=false) const |
side coordinates in 1D More... | |
double | side_volume (int const sideid) const |
Volume of a side. More... | |
int | wedge_get_side (int const wedgeid) const |
Side of wedge. More... | |
int | wedge_get_cell (int const wedgeid) const |
Cell of wedge. More... | |
int | wedge_get_face (int const wedgeid) const |
Face of wedge. More... | |
int | wedge_get_corner (int const wedgeid) const |
Corner of a wedge. More... | |
int | wedge_get_node (int const wedgeid) const |
node of a wedge More... | |
int | wedge_get_opposite_wedge (const int wedgeid) const |
int | wedge_get_adjacent_wedge (const int wedgeid) const |
double | wedge_volume (int const wedgeid) const |
Volume of a wedge - half its side volume. More... | |
void | wedge_get_coordinates (int const wedgeid, std::array< Point< 3 >, 4 > *wcoords, bool posvol_order=false) const |
Wedge coordinates in 3D. More... | |
void | wedge_get_coordinates (int const wedgeid, std::array< Point< 2 >, 3 > *wcoords, bool posvol_order=false) const |
Wedge coordinates in 2D. More... | |
void | wedge_get_coordinates (int const wedgeid, std::array< Point< 1 >, 2 > *wcoords, bool posvol_order=false) const |
Wedge coordinates in 1D. More... | |
void | cell_get_wedges (int const cellid, std::vector< int > *wedgeids) const |
Get all the wedges in a cell. More... | |
void | node_get_wedges (int const nodeid, Entity_type const type, std::vector< int > *wedgeids) const |
Get wedges at a node. More... | |
int | corner_get_node (const int cornerid) const |
Get node of corner. More... | |
int | corner_get_cell (int const cornerid) const |
Get cell of corner. More... | |
void | corner_get_wedges (int const cornerid, std::vector< int > *wedgeids) const |
Get wedges of a corner. More... | |
void | node_get_corners (int const nodeid, Entity_type const type, std::vector< int > *cornerids) const |
Get corners connected to a node. More... | |
void | cell_get_corners (int const cellid, std::vector< int > *cornerids) const |
Get corners in a cell. More... | |
int | cell_get_corner_at_node (int const cellid, int const nodeid) const |
Get a cell's corner at a particular node of the cell. More... | |
double | corner_volume (int const cornerid) const |
Volume of a corner. More... | |
void | cell_get_facetization (int const cellid, std::vector< std::vector< int >> *facetpoints, std::vector< Point< 3 >> *points) const |
Get a triangular facetization of polyhedral cell boundary. More... | |
void | dual_cell_get_facetization (int const nodeid, std::vector< std::vector< int >> *facetpoints, std::vector< Point< 3 >> *points) const |
void | decompose_cell_into_tets (int cellid, std::vector< std::array< Wonton::Point< 3 >, 4 >> *tcoords, const bool planar_hex) const |
Get the simplest possible decomposition of a 3D cell into tets. More... | |
void | dual_cell_get_coordinates (int const nodeid, std::vector< Point< 2 >> *pplist) const |
2D version of coords of nodes of a dual cell More... | |
void | order_wedges_ccw (std::vector< int > *wedgeids) const |
Order wedges around a node in ccw manner. More... | |
bool | ccw (Point< 2 > const &p1, Point< 2 > const &p2, Point< 2 > const &p3) const |
std::vector< Point< 2 > > | cellToXY (int cellID) const |
void | wedges_get_coordinates (int cellID, std::vector< std::array< Point< 3 >, 4 >> *wcoords) const |
Get coordinates of wedge in 3D. More... | |
void | sides_get_coordinates (int cellID, std::vector< std::array< Point< 3 >, 4 >> *scoords) const |
Get coordinates of side in 3D. More... | |
void | dual_cell_get_node_adj_cells (int const nodeid, Entity_type const ptype, std::vector< int > *adjnodes) const |
Get adjacent "dual cells" of a given "dual cell". More... | |
void | dual_cell_get_coordinates (int const nodeid, std::vector< Point< 3 >> *pplist) const |
3D version of coords of nodes of a dual cell More... | |
void | dual_wedges_get_coordinates (int nodeid, std::vector< std::array< Point< 3 >, 4 >> *wcoords) const |
template<int D> | |
void | dual_cell_centroid (int nodeid, Point< D > *centroid) const |
Centroid of a dual cell. More... | |
double | dual_cell_volume (int const nodeid) const |
Get the volume of dual cell by finding the corners that attach to the node. More... | |
Protected Member Functions | |
void | build_aux_entities () |
Friends | |
void | build_sides_1D (AuxMeshTopology< BasicMesh > &mesh) |
void | build_sides_2D (AuxMeshTopology< BasicMesh > &mesh) |
void | build_sides_3D (AuxMeshTopology< BasicMesh > &mesh) |
Detailed Description
template<typename BasicMesh>
class Wonton::AuxMeshTopology< BasicMesh >
2D: A side is a triangle formed by the two nodes of an edge/face and the cell center. A wedge is half of a side formed by one node of the edge, the edge center and the cell center. A corner is a quadrilateral formed by the two wedges in a cell at a node
3D: A side is a tet formed by the two nodes of an edge, a face center and a cell center. A wedge is half a side, formed by a node of the edge, the edge center, the face center and the cell center. A corner is formed by all the wedges of a cell at a node.
The basic mesh class must support cells, faces and nodes and adjacency queries between these entities (In 2D, faces are the same as edges and in 1D, faces are the same as nodes). In particular, the basic mesh class is expected to support the following methods to successfully instantiate this class:
NOTE: Entity_type is Wonton::OWNED or Wonton::GHOST
Can be Wonton::UNKNOWN_TOPOLOGY, Wonton::TRI, Wonton::QUAD, Wonton::POLYGON, Wonton::TET, Wonton::PRISM, Wonton::PYRAMID, Wonton::HEX, Wonton::POLYHEDRON
NOTE: The 'cfdirs' conveys the directions in which the faces are used by the cell. If the natural normal of the face points out of the cell, its direction should be returned as 1, if not, it should be returned as -1
******************************** NOTE ***********************************
THIS IS AN INCOMPLETE CLASS DESIGNED TO BE USED IN A 'CRTP' (CURIOUSLY RECURRING TEMPLATE PATTERN) DESIGN ALONG WITH THE BASICMESH CLASS TO PROVIDE A COMPLETE MESH CLASS (See https://en.m.wikipedia.org/wiki/Curiously_recurring_template_pattern)
So, If one is writing a mesh wrapper class called MY_MESH_WRAPPER
, it is declared like so
and it will automatically have the methods of the AuxMeshTopology class.
If MY_MESH_WRAPPER has equivalent classes for the ones in AuxMeshTopology (possibly because they are more efficient), then the ones from AuxMeshTopology are overridden
NOTE THAT THIS CLASS IS NOT DESIGNED TO EVER BE INSTANTIATED DIRECTLY
Constructor & Destructor Documentation
◆ AuxMeshTopology()
|
inline |
Constructor indicating which entities are wanted.
It is possible to request none of the auxiliary entities so that one can instantiate a version of a derived class with the auxiliary entities or without (to save memory)
Member Function Documentation
◆ begin()
|
inline |
Iterators on mesh entity - begin.
◆ build_aux_entities()
|
inlineprotected |
◆ ccw()
|
inline |
Returns true if the three 2D points (p1, p2, p3) are a counter-clockwise turn, otherwise returns false (corresponding to clockwise or collinear)
◆ cell_centroid()
|
inline |
Centroid of a cell.
◆ cell_get_coordinates()
void Wonton::AuxMeshTopology< BasicMesh >::cell_get_coordinates | ( | int const | cellid, |
std::vector< Point< D >> * | pplist | ||
) | const |
Coordinates of nodes of cell.
coords of nodes of a cell
◆ cell_get_corner_at_node()
|
inline |
Get a cell's corner at a particular node of the cell.
◆ cell_get_corners()
|
inline |
Get corners in a cell.
◆ cell_get_face_adj_cell()
|
inline |
Retrieve the cell incident to a given face of a given cell.
- Parameters
-
cell the current cell. face the current face of the given cell.
- Returns
- the index of the incident cell to the given face or -1.
◆ cell_get_face_adj_cells()
|
inline |
Get the list of cell IDs for all cells attached to a specific cell through its faces.
- Parameters
-
[in] cellid The ID of the cell. [in] ptype The Entity_type (e.g. PARALLEL_OWNED) [out] adjcells The list of cell IDs for all cells attached to cell cellid
through its faces, excludingcellid
. The order of cells is consistent with the order of respective interfaces returned by cell_get_faces_and_dirs, but all the boundary faces are skipped.
◆ cell_get_facetization()
void Wonton::AuxMeshTopology< BasicMesh >::cell_get_facetization | ( | int const | cellid, |
std::vector< std::vector< int >> * | facetpoints, | ||
std::vector< Point< 3 >> * | points | ||
) | const |
Get a triangular facetization of polyhedral cell boundary.
Get a faceted (all planar faces) representation of a general 3D polyhedralcell
◆ cell_get_node_adj_cells()
|
inline |
Get the list of cell IDs for all cells attached to a specific cell through its nodes.
- Parameters
-
[in] cellid The ID of the cell. [in] ptype The Entity_type (e.g. PARALLEL_OWNED) [out] adjcells The list of cell IDs for all cells attached to cell cellid
through its nodes, excludingcellid
.
◆ cell_get_sides()
|
inline |
Get all the sides of a cell.
◆ cell_get_wedges()
|
inline |
Get all the wedges in a cell.
◆ cell_volume()
|
inline |
Volume of a cell.
◆ cellToXY()
|
inline |
◆ corner_get_cell()
|
inline |
Get cell of corner.
◆ corner_get_node()
|
inline |
Get node of corner.
◆ corner_get_wedges()
|
inline |
Get wedges of a corner.
◆ corner_volume()
|
inline |
Volume of a corner.
◆ decompose_cell_into_tets()
|
inline |
Get the simplest possible decomposition of a 3D cell into tets.
◆ dual_cell_centroid()
|
inline |
Centroid of a dual cell.
◆ dual_cell_get_coordinates() [1/2]
|
inline |
2D version of coords of nodes of a dual cell
◆ dual_cell_get_coordinates() [2/2]
|
inline |
3D version of coords of nodes of a dual cell
◆ dual_cell_get_facetization()
void Wonton::AuxMeshTopology< BasicMesh >::dual_cell_get_facetization | ( | int const | nodeid, |
std::vector< std::vector< int >> * | facetpoints, | ||
std::vector< Point< 3 >> * | points | ||
) | const |
Get a triangular facetization of boundary of dual cell (or in other words, control volume) corresponding to a node
◆ dual_cell_get_node_adj_cells()
|
inline |
Get adjacent "dual cells" of a given "dual cell".
◆ dual_cell_volume()
|
inline |
Get the volume of dual cell by finding the corners that attach to the node.
◆ dual_wedges_get_coordinates()
|
inline |
◆ end()
|
inline |
Iterator on mesh entity - end.
◆ face_centroid()
|
inline |
Centroid of a face.
◆ face_get_cells()
|
inline |
Get cells of given Entity_type connected to face (in no particular order)
◆ node_get_cell_adj_nodes()
|
inline |
Get the list of node IDs for all nodes attached to all cells attached to a specific node.
- Parameters
-
[in] nodeid The ID of the node. [in] ptype The Entity_type (e.g. PARALLEL_OWNED) [out] adjnodes The list of node IDs for all cells attached to nodeid
, excludingnodeid
.
◆ node_get_corners()
|
inline |
Get corners connected to a node.
◆ node_get_wedges()
|
inline |
Get wedges at a node.
◆ num_entities()
|
inline |
Number of items of given entity.
◆ num_ghost_corners()
|
inline |
Number of ghost corners in the mesh.
◆ num_ghost_sides()
|
inline |
Number of ghost sides in the mesh.
◆ num_ghost_wedges()
|
inline |
Number of ghost wedges in the mesh.
◆ num_owned_corners()
|
inline |
Number of owned corners in the mesh.
◆ num_owned_sides()
|
inline |
Number of owned sides in the mesh.
◆ num_owned_wedges()
|
inline |
Number of owned wedges in the mesh.
◆ on_exterior_boundary()
|
inline |
if entity is on exterior boundary
◆ order_wedges_ccw()
|
inline |
Order wedges around a node in ccw manner.
◆ side_get_cell()
|
inline |
Cell of side.
◆ side_get_coordinates() [1/3]
void Wonton::AuxMeshTopology< BasicMesh >::side_get_coordinates | ( | int const | sideid, |
std::array< Point< 3 >, 4 > * | scoords, | ||
bool | posvol_order = false |
||
) | const |
side coordinates in 3D
Get coordinates of side in 3D
If posvol_order = true, then the coordinates will be returned in an order that will result in a positive volume (in 3D this assumes that the computation for volume is done as (V01 x V02).V03 where V0k is a vector from coordinate 0 to coordinate k of the tet). If posvol_order is false, the coordinates will be returned in a fixed order - in 3D, this is node point 0, node point 1, face center, cell center. By default the coordinates are returned in the natural order (posvol_order = false)
◆ side_get_coordinates() [2/3]
void Wonton::AuxMeshTopology< BasicMesh >::side_get_coordinates | ( | int const | sideid, |
std::array< Point< 2 >, 3 > * | scoords, | ||
bool | posvol_order = false |
||
) | const |
side coordinates in 2D
Get coordinates of side in 2D
If posvol_order = true, then the coordinates will be returned in an order that will result in a positive area (in 2D this assumes that the computation for area is done as (V01 x V02).V03 where V0k is a vector from coordinate 0 to coordinate k of the tri). If posvol_order is false, the coordinates will be returned in a fixed order - in 2D, this is node point 0, node point 1, cell center. By default the coordinates are returned in the natural order (posvol_order = false)
◆ side_get_coordinates() [3/3]
void Wonton::AuxMeshTopology< BasicMesh >::side_get_coordinates | ( | int const | sideid, |
std::array< Point< 1 >, 2 > * | scoords, | ||
bool | posvol_order = false |
||
) | const |
side coordinates in 1D
Get coordinates of side in 1D
If posvol_order = true, then the coordinates will be returned in an order that will result in a positive length. If posvol_order is false, the coordinates will be returned in a fixed order - in 1D, this is node point and cell center. By default the coordinates are returned in the natural order (posvol_order = false)
◆ side_get_face()
|
inline |
Face of side.
◆ side_get_node()
|
inline |
Node of a side
Each side is tied to two mesh nodes in 2D and 3D and inode = 0 or 1 indicates which one to return. In 1D, the same node is returned whether inode = 0 or 1. In 2D and 3D, the node ordering is such that node 0, node 1 and the cell centroid form a positive area triangle and in 3D, node 0, node 1, the face centroid and cell centroid form a positive volume tet.
◆ side_get_opposite_side()
|
inline |
Opposite side in neighboring cell of a side.
The two sides share facet 0 of wedge comprised of nodes 0,1 of the common edge and center point of the common face in 3D, and nodes 0,1 of the common edge in 2D. At boundaries, this routine returns -1
◆ side_get_wedge()
|
inline |
Wedge of side
Each side points to two wedges - iwedge (0, 1) indicates which one to return; the wedge returned will be consistent with the node returned by side_get_node. So, side_get_node(s,i) = wedge_get_node(side_get_wedge(s,i))
◆ side_volume()
|
inline |
Volume of a side.
◆ sides_get_coordinates()
|
inline |
Get coordinates of side in 3D.
◆ wedge_get_adjacent_wedge()
|
inline |
adjacent wedge along edge in the same cell.
The two wedges share facet 1 of wedge comprised of edge center, face center and zone center in 3D, and node and zone center in 2D
◆ wedge_get_cell()
|
inline |
Cell of wedge.
◆ wedge_get_coordinates() [1/3]
void Wonton::AuxMeshTopology< BasicMesh >::wedge_get_coordinates | ( | int const | wedgeid, |
std::array< Point< 3 >, 4 > * | wcoords, | ||
bool | posvol_order = false |
||
) | const |
Wedge coordinates in 3D.
Get coordinates of wedge in 3D
If posvol_order = true, then the coordinates will be returned in an order that will result in a positive volume (in 3D this assumes that the computation for volume is done as (V01 x V02).V03 where V0k is a vector from coordinate 0 to coordinate k of the tet). If posvol_order is false, the coordinates will be returned in a fixed order - in 3D, this is node point, edge center, face center, cell center. By default the coordinates are returned in the natural order (posvol_order = false)
◆ wedge_get_coordinates() [2/3]
void Wonton::AuxMeshTopology< BasicMesh >::wedge_get_coordinates | ( | int const | wedgeid, |
std::array< Point< 2 >, 3 > * | wcoords, | ||
bool | posvol_order = false |
||
) | const |
Wedge coordinates in 2D.
Get coordinates of wedge in 2D
If posvol_order = true, then the coordinates will be returned in an order that will result in a positive area (in 2D this assumes that the computation for area is done as (V01 x V02).V03 where V0k is a vector from coordinate 0 to coordinate k of the tri). If posvol_order is false, the coordinates will be returned in a fixed order - in 2D, this is node point, face center, cell center. By default the coordinates are returned in the natural order (posvol_order = false)
◆ wedge_get_coordinates() [3/3]
void Wonton::AuxMeshTopology< BasicMesh >::wedge_get_coordinates | ( | int const | wedgeid, |
std::array< Point< 1 >, 2 > * | wcoords, | ||
bool | posvol_order = false |
||
) | const |
Wedge coordinates in 1D.
Get coordinates of wedge in 1D
If posvol_order = true, then the coordinates will be returned in an order that will result in a positive length. If posvol_order is false, the coordinates will be returned in a fixed order - in 1D, this is node point and cell center. By default the coordinates are returned in the natural order (posvol_order = false)
◆ wedge_get_corner()
|
inline |
Corner of a wedge.
◆ wedge_get_face()
|
inline |
Face of wedge.
◆ wedge_get_node()
|
inline |
node of a wedge
◆ wedge_get_opposite_wedge()
|
inline |
Opposite wedge in neighboring cell of a wedge.
The two wedges share facet 0 of wedge comprised of the node, center point of the common edge and center point of the common face in 3D, and node and edge center in 2D. At boundaries, this routine returns -1
◆ wedge_get_side()
|
inline |
Side of wedge.
◆ wedge_volume()
|
inline |
Volume of a wedge - half its side volume.
◆ wedges_get_coordinates()
|
inline |
Get coordinates of wedge in 3D.
Friends And Related Function Documentation
◆ build_sides_1D
|
friend |
◆ build_sides_2D
|
friend |
◆ build_sides_3D
|
friend |
The documentation for this class was generated from the following file:
- /home/wonton/wonton/wonton/mesh/AuxMeshTopology.h