PRAgMaTIc  master
Public Member Functions | Friends | List of all members
Mesh< real_t > Class Template Reference

Manages mesh data. More...

#include <Mesh.h>

Public Member Functions

 Mesh (int NNodes, int NElements, const index_t *ENList, const real_t *x, const real_t *y)
 
 Mesh (int NNodes, int NElements, const index_t *ENList, const real_t *x, const real_t *y, const real_t *z)
 
 ~Mesh ()
 Default destructor. More...
 
index_t append_vertex (const real_t *x, const double *m)
 Add a new vertex. More...
 
void erase_vertex (const index_t nid)
 Erase a vertex. More...
 
index_t append_element (const index_t *n)
 Add a new element. More...
 
index_t append_element (const index_t *n, const int *b)
 Add a new element and boundary. More...
 
void create_boundary ()
 
void set_boundary (int nfacets, const int *facets, const int *ids)
 
void erase_element (const index_t eid)
 Erase an element. More...
 
void invert_element (size_t eid)
 Flip orientation of element. More...
 
const index_tget_element (size_t eid) const
 Return a pointer to the element-node list. More...
 
void get_element (size_t eid, index_t *ele) const
 Return copy of element-node list. More...
 
size_t get_number_nodes () const
 Return the number of nodes in the mesh. More...
 
size_t get_number_elements () const
 Return the number of elements in the mesh. More...
 
size_t get_number_dimensions () const
 Return the number of spatial dimensions. More...
 
const real_t * get_coords (index_t nid) const
 Return positions vector. More...
 
void get_coords (index_t nid, real_t *x) const
 Return copy of the coordinate. More...
 
const double * get_metric (index_t nid) const
 Return metric at that vertex. More...
 
void get_metric (index_t nid, double *m) const
 Return copy of metric. More...
 
bool is_halo_node (index_t nid) const
 Returns true if the node is in any of the partitioned elements. More...
 
bool is_owned_node (index_t nid) const
 Returns true if the node is assigned to the local partition. More...
 
double get_lmean ()
 Get the mean edge length metric space. More...
 
double calculate_perimeter ()
 Calculate perimeter. More...
 
double calculate_area ()
 Calculate area. More...
 
double calculate_volume ()
 Calculate volume. More...
 
double get_qmean () const
 Get the element mean quality in metric space. More...
 
void print_quality () const
 Print out the qualities. Useful if you want to plot a histogram of element qualities. More...
 
double get_qmin () const
 Get the element minimum quality in metric space. More...
 
double get_qmin_2d () const
 
double get_qmin_3d () const
 
std::set< index_tget_node_patch (index_t nid) const
 Return the node id's connected to the specified node_id. More...
 
std::set< index_tget_node_patch (index_t nid, size_t min_patch_size)
 Grow a node patch around node id's until it reaches a minimum size. More...
 
real_t calc_edge_length (index_t nid0, index_t nid1) const
 Calculates the edge lengths in metric space. More...
 
real_t maximal_edge_length () const
 
void defragment ()
 
bool verify () const
 This is used to verify that the mesh and its metadata is correct. More...
 
void send_all_to_all (std::vector< std::vector< index_t > > send_vec, std::vector< std::vector< index_t > > *recv_vec)
 

Friends

template<typename _real_t , int _dim>
class MetricField
 
template<typename _real_t , int _dim>
class Smooth
 
template<typename _real_t , int _dim>
class Swapping
 
template<typename _real_t , int _dim>
class Coarsen
 
template<typename _real_t , int _dim>
class Refine
 
template<typename _real_t >
class DeferredOperations
 
template<typename _real_t >
class VTKTools
 
template<typename _real_t >
class CUDATools
 

Detailed Description

template<typename real_t>
class Mesh< real_t >

Manages mesh data.

This class is used to store the mesh and associated meta-data.

Definition at line 70 of file Mesh.h.

Constructor & Destructor Documentation

template<typename real_t>
Mesh< real_t >::Mesh ( int  NNodes,
int  NElements,
const index_t ENList,
const real_t *  x,
const real_t *  y 
)
inline

2D triangular mesh constructor. This is for use when there is no MPI.

Parameters
NNodesnumber of nodes in the local mesh.
NElementsnumber of nodes in the local mesh.
ENListarray storing the global node number for each element.
xis the X coordinate.
yis the Y coordinate.

Definition at line 81 of file Mesh.h.

template<typename real_t>
Mesh< real_t >::Mesh ( int  NNodes,
int  NElements,
const index_t ENList,
const real_t *  x,
const real_t *  y,
const real_t *  z 
)
inline

3D tetrahedra mesh constructor. This is for use when there is no MPI.

Parameters
NNodesnumber of nodes in the local mesh.
NElementsnumber of nodes in the local mesh.
ENListarray storing the global node number for each element.
xis the X coordinate.
yis the Y coordinate.
zis the Z coordinate.

Definition at line 117 of file Mesh.h.

template<typename real_t>
Mesh< real_t >::~Mesh ( )
inline

Default destructor.

Definition at line 147 of file Mesh.h.

Member Function Documentation

template<typename real_t>
index_t Mesh< real_t >::append_element ( const index_t n)
inline

Add a new element.

Definition at line 173 of file Mesh.h.

template<typename real_t>
index_t Mesh< real_t >::append_element ( const index_t n,
const int *  b 
)
inline

Add a new element and boundary.

Definition at line 188 of file Mesh.h.

template<typename real_t>
index_t Mesh< real_t >::append_vertex ( const real_t *  x,
const double *  m 
)
inline

Add a new vertex.

Definition at line 152 of file Mesh.h.

template<typename real_t>
real_t Mesh< real_t >::calc_edge_length ( index_t  nid0,
index_t  nid1 
) const
inline

Calculates the edge lengths in metric space.

Definition at line 911 of file Mesh.h.

template<typename real_t>
double Mesh< real_t >::calculate_area ( )
inline

Calculate area.

Definition at line 508 of file Mesh.h.

template<typename real_t>
double Mesh< real_t >::calculate_perimeter ( )
inline

Calculate perimeter.

Definition at line 454 of file Mesh.h.

template<typename real_t>
double Mesh< real_t >::calculate_volume ( )
inline

Calculate volume.

Definition at line 693 of file Mesh.h.

template<typename real_t>
void Mesh< real_t >::create_boundary ( )
inline

Definition at line 204 of file Mesh.h.

template<typename real_t>
void Mesh< real_t >::defragment ( )
inline

Defragment mesh. This compresses the storage of internal data structures. This is useful if the mesh has been significantly coarsened.

Definition at line 958 of file Mesh.h.

template<typename real_t>
void Mesh< real_t >::erase_element ( const index_t  eid)
inline

Erase an element.

Definition at line 341 of file Mesh.h.

template<typename real_t>
void Mesh< real_t >::erase_vertex ( const index_t  nid)
inline

Erase a vertex.

Definition at line 165 of file Mesh.h.

template<typename real_t>
const real_t* Mesh< real_t >::get_coords ( index_t  nid) const
inline

Return positions vector.

Definition at line 384 of file Mesh.h.

template<typename real_t>
void Mesh< real_t >::get_coords ( index_t  nid,
real_t *  x 
) const
inline

Return copy of the coordinate.

Definition at line 389 of file Mesh.h.

template<typename real_t>
const index_t* Mesh< real_t >::get_element ( size_t  eid) const
inline

Return a pointer to the element-node list.

Definition at line 358 of file Mesh.h.

template<typename real_t>
void Mesh< real_t >::get_element ( size_t  eid,
index_t ele 
) const
inline

Return copy of element-node list.

Definition at line 363 of file Mesh.h.

template<typename real_t>
double Mesh< real_t >::get_lmean ( )
inline

Get the mean edge length metric space.

Definition at line 420 of file Mesh.h.

template<typename real_t>
const double* Mesh< real_t >::get_metric ( index_t  nid) const
inline

Return metric at that vertex.

Definition at line 396 of file Mesh.h.

template<typename real_t>
void Mesh< real_t >::get_metric ( index_t  nid,
double *  m 
) const
inline

Return copy of metric.

Definition at line 402 of file Mesh.h.

template<typename real_t>
std::set<index_t> Mesh< real_t >::get_node_patch ( index_t  nid) const
inline

Return the node id's connected to the specified node_id.

Definition at line 876 of file Mesh.h.

template<typename real_t>
std::set<index_t> Mesh< real_t >::get_node_patch ( index_t  nid,
size_t  min_patch_size 
)
inline

Grow a node patch around node id's until it reaches a minimum size.

Definition at line 885 of file Mesh.h.

template<typename real_t>
size_t Mesh< real_t >::get_number_dimensions ( ) const
inline

Return the number of spatial dimensions.

Definition at line 379 of file Mesh.h.

template<typename real_t>
size_t Mesh< real_t >::get_number_elements ( ) const
inline

Return the number of elements in the mesh.

Definition at line 374 of file Mesh.h.

template<typename real_t>
size_t Mesh< real_t >::get_number_nodes ( ) const
inline

Return the number of nodes in the mesh.

Definition at line 369 of file Mesh.h.

template<typename real_t>
double Mesh< real_t >::get_qmean ( ) const
inline

Get the element mean quality in metric space.

Definition at line 764 of file Mesh.h.

template<typename real_t>
double Mesh< real_t >::get_qmin ( ) const
inline

Get the element minimum quality in metric space.

Definition at line 825 of file Mesh.h.

template<typename real_t>
double Mesh< real_t >::get_qmin_2d ( ) const
inline

Definition at line 832 of file Mesh.h.

template<typename real_t>
double Mesh< real_t >::get_qmin_3d ( ) const
inline

Definition at line 850 of file Mesh.h.

template<typename real_t>
void Mesh< real_t >::invert_element ( size_t  eid)
inline

Flip orientation of element.

Definition at line 351 of file Mesh.h.

template<typename real_t>
bool Mesh< real_t >::is_halo_node ( index_t  nid) const
inline

Returns true if the node is in any of the partitioned elements.

Definition at line 410 of file Mesh.h.

template<typename real_t>
bool Mesh< real_t >::is_owned_node ( index_t  nid) const
inline

Returns true if the node is assigned to the local partition.

Definition at line 415 of file Mesh.h.

template<typename real_t>
real_t Mesh< real_t >::maximal_edge_length ( ) const
inline

Definition at line 936 of file Mesh.h.

template<typename real_t>
void Mesh< real_t >::print_quality ( ) const
inline

Print out the qualities. Useful if you want to plot a histogram of element qualities.

Definition at line 801 of file Mesh.h.

template<typename real_t>
void Mesh< real_t >::send_all_to_all ( std::vector< std::vector< index_t > >  send_vec,
std::vector< std::vector< index_t > > *  recv_vec 
)
inline

Definition at line 1392 of file Mesh.h.

template<typename real_t>
void Mesh< real_t >::set_boundary ( int  nfacets,
const int *  facets,
const int *  ids 
)
inline

Definition at line 309 of file Mesh.h.

template<typename real_t>
bool Mesh< real_t >::verify ( ) const
inline

This is used to verify that the mesh and its metadata is correct.

Definition at line 1181 of file Mesh.h.

Friends And Related Function Documentation

template<typename real_t>
template<typename _real_t , int _dim>
friend class Coarsen
friend

Definition at line 1425 of file Mesh.h.

template<typename real_t>
template<typename _real_t >
friend class CUDATools
friend

Definition at line 1429 of file Mesh.h.

template<typename real_t>
template<typename _real_t >
friend class DeferredOperations
friend

Definition at line 1427 of file Mesh.h.

template<typename real_t>
template<typename _real_t , int _dim>
friend class MetricField
friend

Definition at line 1422 of file Mesh.h.

template<typename real_t>
template<typename _real_t , int _dim>
friend class Refine
friend

Definition at line 1426 of file Mesh.h.

template<typename real_t>
template<typename _real_t , int _dim>
friend class Smooth
friend

Definition at line 1423 of file Mesh.h.

template<typename real_t>
template<typename _real_t , int _dim>
friend class Swapping
friend

Definition at line 1424 of file Mesh.h.

template<typename real_t>
template<typename _real_t >
friend class VTKTools
friend

Definition at line 1428 of file Mesh.h.


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