Wonton::Flat_Mesh_Wrapper< T > Class Template Reference

Flat_Mesh_Wrapper implements mesh methods. More...

#include <flat_mesh_wrapper.h>

Inheritance diagram for Wonton::Flat_Mesh_Wrapper< T >:
Wonton::AuxMeshTopology< Flat_Mesh_Wrapper<> >

Public Member Functions

 Flat_Mesh_Wrapper ()=default
 Constructor. More...
 
Flat_Mesh_Wrapperoperator= (Flat_Mesh_Wrapper const &)=delete
 Assignment operator (disabled) - don't know how to implement (RVG) More...
 
 ~Flat_Mesh_Wrapper ()=default
 Empty destructor. More...
 
template<class Mesh_Wrapper >
void initialize (Mesh_Wrapper &input)
 
void finish_init ()
 Finish mesh initialization, after initialize or MPI distribute. More...
 
void make_index_maps ()
 
void compute_offsets (const std::vector< int > &counts, std::vector< int > *offsets)
 Compute offsets from counts. More...
 
int num_owned_cells () const
 Number of owned cells in the mesh. More...
 
int num_ghost_cells () const
 Number of ghost cells in the mesh. More...
 
int num_owned_nodes () const
 Number of owned nodes in the mesh. More...
 
int num_ghost_nodes () const
 Number of ghost nodes in the mesh. More...
 
int num_owned_faces () const
 Number of owned faces in the mesh. More...
 
int num_ghost_faces () const
 Number of ghost faces in the mesh. More...
 
template<int D>
void node_get_coordinates (int const nodeid, Point< D > *pp) const
 Coords of a node. More...
 
Wonton::Entity_type cell_get_type (int const cellid) const
 Get the type of the cell - PARALLEL_OWNED or PARALLEL_GHOST. More...
 
Wonton::Entity_type node_get_type (int const nodeid) const
 Get the type of the node - PARALLEL_OWNED or PARALLEL_GHOST. More...
 
Wonton::Element_type cell_get_element_type (int const cellid) const
 
void cell_get_faces_and_dirs (int const cellid, std::vector< int > *cfaces, std::vector< int > *cfdirs) const
 Get cell faces and the directions in which they are used. More...
 
void cell_get_nodes (int const cellid, std::vector< int > *nodes) const
 Get list of nodes for a cell. More...
 
void face_get_nodes (int const faceid, std::vector< int > *fnodes) const
 Get nodes of a face. More...
 
void node_get_cells (int const nodeid, Entity_type const ptype, std::vector< int > *cells) const
 Get list of cells for a node. More...
 
template<int D>
void cell_get_coordinates (int const cellid, std::vector< Wonton::Point< D >> *pplist) const
 Coords of nodes of a cell. More...
 
std::vector< T > & get_coords ()
 get coordinates More...
 
std::vector< int > & get_cell_to_node_list ()
 
void set_cell_to_node_list (std::vector< int > &cellToNodeList)
 
std::vector< int > & get_cell_node_counts ()
 get/set cell node counts More...
 
void set_cell_node_counts (std::vector< int > &cellNodeCounts)
 
std::vector< int > & get_cell_node_offsets ()
 get cell node offsets More...
 
std::vector< int > & get_cell_to_face_list ()
 
void set_cell_to_face_list (std::vector< int > &cellToFaceList)
 
std::vector< bool > & get_cell_to_face_dirs ()
 get/set cell to face dirs More...
 
void set_cell_to_face_dirs (std::vector< bool > &cellToFaceDirs)
 
std::vector< int > & get_cell_face_counts ()
 get/set cell face counts More...
 
void set_cell_face_counts (std::vector< int > &cellFaceCounts)
 
std::vector< int > & get_cell_face_offsets ()
 get cell face offsets More...
 
std::vector< int > & get_face_to_node_list ()
 
void set_face_to_node_list (std::vector< int > &faceToNodeList)
 
std::vector< int > & get_face_node_counts ()
 get/set face node counts More...
 
void set_face_node_counts (std::vector< int > &faceNodeCounts)
 
std::vector< int > & get_face_node_offsets ()
 get face node offsets More...
 
std::vector< int > & get_node_to_cell_list ()
 
std::vector< int > & get_node_cell_counts ()
 get node cell counts More...
 
std::vector< int > & get_node_cell_offsets ()
 get node cell offsets More...
 
std::vector< GID_t > & get_global_cell_ids ()
 get global cell ids More...
 
std::vector< GID_t > & get_global_node_ids ()
 get global node ids More...
 
std::vector< GID_t > & get_global_face_ids ()
 get global face ids More...
 
void set_node_global_ids (std::vector< GID_t > &nodeGlobalIds)
 
void set_num_owned_cells (int numOwnedCells)
 set the number of owned cells More...
 
void set_num_owned_faces (int numOwnedFaces)
 set the number of owned cells More...
 
void set_num_owned_nodes (int numOwnedNodes)
 set the number of owned nodes More...
 
int space_dimension () const
 get spatial dimension More...
 
GID_t get_global_id (int ent, Entity_kind onwhat) const
 Get global ID of entities. More...
 
- Public Member Functions inherited from Wonton::AuxMeshTopology< Flat_Mesh_Wrapper<> >
 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...
 
void cell_get_coordinates (int const cellid, std::vector< Point< D >> *pplist) const
 Coordinates of nodes of cell. More...
 
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...
 
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 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 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_wedges_get_coordinates (int nodeid, std::vector< std::array< Point< 3 >, 4 >> *wcoords) const
 
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...
 

Additional Inherited Members

- Protected Member Functions inherited from Wonton::AuxMeshTopology< Flat_Mesh_Wrapper<> >
void build_aux_entities ()
 

Detailed Description

template<class T = double>
class Wonton::Flat_Mesh_Wrapper< T >

Flat_Mesh_Wrapper implements mesh methods.

Flat_Mesh_Wrapper stores mesh coordinates in a flat vector. It supports arbitrary polygons in 2D and arbitrary polyhedra in 3D.

Constructor & Destructor Documentation

◆ Flat_Mesh_Wrapper()

template<class T = double>
Wonton::Flat_Mesh_Wrapper< T >::Flat_Mesh_Wrapper ( )
default

Constructor.

◆ ~Flat_Mesh_Wrapper()

template<class T = double>
Wonton::Flat_Mesh_Wrapper< T >::~Flat_Mesh_Wrapper ( )
default

Empty destructor.

Member Function Documentation

◆ cell_get_coordinates()

template<class T = double>
template<int D>
void Wonton::Flat_Mesh_Wrapper< T >::cell_get_coordinates ( int const  cellid,
std::vector< Wonton::Point< D >> *  pplist 
) const
inline

Coords of nodes of a cell.

◆ cell_get_element_type()

template<class T = double>
Wonton::Element_type Wonton::Flat_Mesh_Wrapper< T >::cell_get_element_type ( int const  cellid) const
inline

Get the element type of a cell - TRI, QUAD, POLYGON, TET, HEX, PRISM OR POLYHEDRON

◆ cell_get_faces_and_dirs()

template<class T = double>
void Wonton::Flat_Mesh_Wrapper< T >::cell_get_faces_and_dirs ( int const  cellid,
std::vector< int > *  cfaces,
std::vector< int > *  cfdirs 
) const
inline

Get cell faces and the directions in which they are used.

◆ cell_get_nodes()

template<class T = double>
void Wonton::Flat_Mesh_Wrapper< T >::cell_get_nodes ( int const  cellid,
std::vector< int > *  nodes 
) const
inline

Get list of nodes for a cell.

◆ cell_get_type()

template<class T = double>
Wonton::Entity_type Wonton::Flat_Mesh_Wrapper< T >::cell_get_type ( int const  cellid) const
inline

Get the type of the cell - PARALLEL_OWNED or PARALLEL_GHOST.

◆ compute_offsets()

template<class T = double>
void Wonton::Flat_Mesh_Wrapper< T >::compute_offsets ( const std::vector< int > &  counts,
std::vector< int > *  offsets 
)
inline

Compute offsets from counts.

◆ face_get_nodes()

template<class T = double>
void Wonton::Flat_Mesh_Wrapper< T >::face_get_nodes ( int const  faceid,
std::vector< int > *  fnodes 
) const
inline

Get nodes of a face.

◆ finish_init()

template<class T = double>
void Wonton::Flat_Mesh_Wrapper< T >::finish_init ( )
inline

Finish mesh initialization, after initialize or MPI distribute.

◆ get_cell_face_counts()

template<class T = double>
std::vector<int>& Wonton::Flat_Mesh_Wrapper< T >::get_cell_face_counts ( )
inline

get/set cell face counts

◆ get_cell_face_offsets()

template<class T = double>
std::vector<int>& Wonton::Flat_Mesh_Wrapper< T >::get_cell_face_offsets ( )
inline

get cell face offsets

◆ get_cell_node_counts()

template<class T = double>
std::vector<int>& Wonton::Flat_Mesh_Wrapper< T >::get_cell_node_counts ( )
inline

get/set cell node counts

◆ get_cell_node_offsets()

template<class T = double>
std::vector<int>& Wonton::Flat_Mesh_Wrapper< T >::get_cell_node_offsets ( )
inline

get cell node offsets

◆ get_cell_to_face_dirs()

template<class T = double>
std::vector<bool>& Wonton::Flat_Mesh_Wrapper< T >::get_cell_to_face_dirs ( )
inline

get/set cell to face dirs

◆ get_cell_to_face_list()

template<class T = double>
std::vector<int>& Wonton::Flat_Mesh_Wrapper< T >::get_cell_to_face_list ( )
inline

cell –> face get/set cell to face list

◆ get_cell_to_node_list()

template<class T = double>
std::vector<int>& Wonton::Flat_Mesh_Wrapper< T >::get_cell_to_node_list ( )
inline

cell –> node get/set cell to node lists

◆ get_coords()

template<class T = double>
std::vector<T>& Wonton::Flat_Mesh_Wrapper< T >::get_coords ( )
inline

get coordinates

◆ get_face_node_counts()

template<class T = double>
std::vector<int>& Wonton::Flat_Mesh_Wrapper< T >::get_face_node_counts ( )
inline

get/set face node counts

◆ get_face_node_offsets()

template<class T = double>
std::vector<int>& Wonton::Flat_Mesh_Wrapper< T >::get_face_node_offsets ( )
inline

get face node offsets

◆ get_face_to_node_list()

template<class T = double>
std::vector<int>& Wonton::Flat_Mesh_Wrapper< T >::get_face_to_node_list ( )
inline

face –> node get/set face to node list

◆ get_global_cell_ids()

template<class T = double>
std::vector<GID_t>& Wonton::Flat_Mesh_Wrapper< T >::get_global_cell_ids ( )
inline

get global cell ids

◆ get_global_face_ids()

template<class T = double>
std::vector<GID_t>& Wonton::Flat_Mesh_Wrapper< T >::get_global_face_ids ( )
inline

get global face ids

◆ get_global_id()

template<class T = double>
GID_t Wonton::Flat_Mesh_Wrapper< T >::get_global_id ( int  ent,
Entity_kind  onwhat 
) const
inline

Get global ID of entities.

◆ get_global_node_ids()

template<class T = double>
std::vector<GID_t>& Wonton::Flat_Mesh_Wrapper< T >::get_global_node_ids ( )
inline

get global node ids

◆ get_node_cell_counts()

template<class T = double>
std::vector<int>& Wonton::Flat_Mesh_Wrapper< T >::get_node_cell_counts ( )
inline

get node cell counts

◆ get_node_cell_offsets()

template<class T = double>
std::vector<int>& Wonton::Flat_Mesh_Wrapper< T >::get_node_cell_offsets ( )
inline

get node cell offsets

◆ get_node_to_cell_list()

template<class T = double>
std::vector<int>& Wonton::Flat_Mesh_Wrapper< T >::get_node_to_cell_list ( )
inline

node –> cell get node to cell list

◆ initialize()

template<class T = double>
template<class Mesh_Wrapper >
void Wonton::Flat_Mesh_Wrapper< T >::initialize ( Mesh_Wrapper &  input)
inline

◆ make_index_maps()

template<class T = double>
void Wonton::Flat_Mesh_Wrapper< T >::make_index_maps ( )
inline

◆ node_get_cells()

template<class T = double>
void Wonton::Flat_Mesh_Wrapper< T >::node_get_cells ( int const  nodeid,
Entity_type const  ptype,
std::vector< int > *  cells 
) const
inline

Get list of cells for a node.

◆ node_get_coordinates()

template<class T = double>
template<int D>
void Wonton::Flat_Mesh_Wrapper< T >::node_get_coordinates ( int const  nodeid,
Point< D > *  pp 
) const
inline

Coords of a node.

◆ node_get_type()

template<class T = double>
Wonton::Entity_type Wonton::Flat_Mesh_Wrapper< T >::node_get_type ( int const  nodeid) const
inline

Get the type of the node - PARALLEL_OWNED or PARALLEL_GHOST.

◆ num_ghost_cells()

template<class T = double>
int Wonton::Flat_Mesh_Wrapper< T >::num_ghost_cells ( ) const
inline

Number of ghost cells in the mesh.

◆ num_ghost_faces()

template<class T = double>
int Wonton::Flat_Mesh_Wrapper< T >::num_ghost_faces ( ) const
inline

Number of ghost faces in the mesh.

◆ num_ghost_nodes()

template<class T = double>
int Wonton::Flat_Mesh_Wrapper< T >::num_ghost_nodes ( ) const
inline

Number of ghost nodes in the mesh.

◆ num_owned_cells()

template<class T = double>
int Wonton::Flat_Mesh_Wrapper< T >::num_owned_cells ( ) const
inline

Number of owned cells in the mesh.

◆ num_owned_faces()

template<class T = double>
int Wonton::Flat_Mesh_Wrapper< T >::num_owned_faces ( ) const
inline

Number of owned faces in the mesh.

◆ num_owned_nodes()

template<class T = double>
int Wonton::Flat_Mesh_Wrapper< T >::num_owned_nodes ( ) const
inline

Number of owned nodes in the mesh.

◆ operator=()

template<class T = double>
Flat_Mesh_Wrapper& Wonton::Flat_Mesh_Wrapper< T >::operator= ( Flat_Mesh_Wrapper< T > const &  )
delete

Assignment operator (disabled) - don't know how to implement (RVG)

◆ set_cell_face_counts()

template<class T = double>
void Wonton::Flat_Mesh_Wrapper< T >::set_cell_face_counts ( std::vector< int > &  cellFaceCounts)
inline

◆ set_cell_node_counts()

template<class T = double>
void Wonton::Flat_Mesh_Wrapper< T >::set_cell_node_counts ( std::vector< int > &  cellNodeCounts)
inline

◆ set_cell_to_face_dirs()

template<class T = double>
void Wonton::Flat_Mesh_Wrapper< T >::set_cell_to_face_dirs ( std::vector< bool > &  cellToFaceDirs)
inline

◆ set_cell_to_face_list()

template<class T = double>
void Wonton::Flat_Mesh_Wrapper< T >::set_cell_to_face_list ( std::vector< int > &  cellToFaceList)
inline

◆ set_cell_to_node_list()

template<class T = double>
void Wonton::Flat_Mesh_Wrapper< T >::set_cell_to_node_list ( std::vector< int > &  cellToNodeList)
inline

◆ set_face_node_counts()

template<class T = double>
void Wonton::Flat_Mesh_Wrapper< T >::set_face_node_counts ( std::vector< int > &  faceNodeCounts)
inline

◆ set_face_to_node_list()

template<class T = double>
void Wonton::Flat_Mesh_Wrapper< T >::set_face_to_node_list ( std::vector< int > &  faceToNodeList)
inline

◆ set_node_global_ids()

template<class T = double>
void Wonton::Flat_Mesh_Wrapper< T >::set_node_global_ids ( std::vector< GID_t > &  nodeGlobalIds)
inline

◆ set_num_owned_cells()

template<class T = double>
void Wonton::Flat_Mesh_Wrapper< T >::set_num_owned_cells ( int  numOwnedCells)
inline

set the number of owned cells

◆ set_num_owned_faces()

template<class T = double>
void Wonton::Flat_Mesh_Wrapper< T >::set_num_owned_faces ( int  numOwnedFaces)
inline

set the number of owned cells

◆ set_num_owned_nodes()

template<class T = double>
void Wonton::Flat_Mesh_Wrapper< T >::set_num_owned_nodes ( int  numOwnedNodes)
inline

set the number of owned nodes

◆ space_dimension()

template<class T = double>
int Wonton::Flat_Mesh_Wrapper< T >::space_dimension ( ) const
inline

get spatial dimension


The documentation for this class was generated from the following file: