omega_h
Reliable mesh adaptation
Classes | Public Types | Public Member Functions | Public Attributes | Protected Attributes | Friends | List of all members
Omega_h::Mesh Class Reference
Inheritance diagram for Omega_h::Mesh:
Omega_h::Mesh2D

Public Types

typedef std::shared_ptr< const TagBaseTagPtr
 
typedef std::shared_ptr< const AdjAdjPtr
 
typedef std::shared_ptr< const DistDistPtr
 
typedef std::shared_ptr< const inertia::RibRibPtr
 
typedef std::shared_ptr< const ParentsParentPtr
 
typedef std::shared_ptr< const ChildrenChildrenPtr
 

Public Member Functions

 Mesh (Library *library)
 
void set_library (Library *library)
 
void set_comm (CommPtr const &comm)
 
void set_family (Omega_h_Family family)
 
void set_matched (I8 is_matched)
 
virtual void set_dim (Int dim_in)
 
void set_verts (LO nverts_in)
 
void set_ents (Int ent_dim, Adj down)
 
void set_parents (Int ent_dim, Parents parents)
 
Librarylibrary () const
 
CommPtr comm () const
 
Omega_h_Parting parting () const
 
virtual Int dim () const
 
Omega_h_Family family () const
 
I8 is_matched () const
 
LO nents (Int ent_dim) const
 
LO nelems () const
 
LO nregions () const
 
LO nfaces () const
 
LO nedges () const
 
LO nverts () const
 
GO nglobal_ents (Int dim)
 
template<typename T >
void add_tag (Int dim, std::string const &name, Int ncomps)
 
template<typename T >
void add_tag (Int dim, std::string const &name, Int ncomps, ArrayType array_type)
 
template<typename T >
void add_tag (Int dim, std::string const &name, Int ncomps, Read< T > array, bool internal=false, ArrayType array_type=ArrayType::VectorND)
 
template<typename T >
void set_tag (Int dim, std::string const &name, Read< T > array, bool internal=false, ArrayType array_type=ArrayType::VectorND)
 
TagBase const * get_tagbase (Int dim, std::string const &name) const
 
template<typename T >
Tag< T > const * get_tag (Int dim, std::string const &name) const
 
template<typename T >
Read< T > get_array (Int dim, std::string const &name) const
 
void remove_tag (Int dim, std::string const &name)
 
bool has_tag (Int dim, std::string const &name) const
 
Int ntags (Int dim) const
 
Int nrctags (Int dim) const
 
TagBase const * get_tag (Int dim, Int i) const
 
bool has_ents (Int dim) const
 
bool has_adj (Int from, Int to) const
 
Adj get_adj (Int from, Int to) const
 
Adj ask_down (Int from, Int to)
 
LOs ask_verts_of (Int dim)
 
LOs ask_elem_verts ()
 
Adj ask_up (Int from, Int to)
 
Graph ask_star (Int dim)
 
Graph ask_dual ()
 
Adj ask_revClass (Int edim, LOs class_ids)
 
Adj ask_revClass (Int edim)
 
Adj ask_revClass_downAdj (Int from, Int to)
 
bool has_revClass (Int edim) const
 
template<typename T >
void add_rcField (LOs class_ids, Int ent_dim, std::string const &name, Int ncomps)
 
template<typename T >
void set_rcField_array (Int ent_dim, std::string const &name, Read< T > array)
 
void remove_rcField (Int ent_dim, std::string const &name)
 
Adj get_revClass (Int edim) const
 
template<typename T >
void add_rcField (Int ent_dim, std::string const &name, Int ncomps)
 
template<typename T >
Read< T > get_rcField_array (Int ent_dim, std::string const &name) const
 
void reduce_rcField (Int ent_dim, std::string const &name, Omega_h_Op op)
 
template<typename T >
void add_rcField (Int ent_dim, std::string const &name, Int ncomps, Read< T > array)
 
void sync_rcField (Int ent_dim, std::string const &name)
 
bool has_rcField (Int ent_dim, std::string const &name) const
 
template<typename T >
void set_rc_from_mesh_array (Int ent_dim, Int ncomps, LOs class_ids, std::string const &name, Read< T > array)
 
template<typename T >
Read< T > get_rc_mesh_array (Int ent_dim, Int ncomps, std::string const &name, LOs class_ids)
 
template<typename T >
Read< T > get_rc_array_from_mesh_array (Int ent_dim, Int ncomps, std::string const &name, LOs class_ids, Read< T > mesh_array)
 
template<typename T >
std::unique_ptr< Tag< T > > get_rc_mesh_tag_from_rc_tag (Int dim, Tag< T > const *)
 
template<typename T >
Read< T > get_rc_array (Int dim, std::string const &name) const
 
template<typename T >
Read< T > get_rc_mesh_array_from_rc_array (Int ent_dim, Int ncomps, LOs class_ids, Read< T > rc_field)
 
void add_coords (Reals array)
 
Reals coords () const
 
void set_coords (Reals const &array)
 
Read< GO > globals (Int dim) const
 
Reals ask_lengths ()
 
Reals ask_qualities ()
 
Reals ask_sizes ()
 
Bytes ask_levels (Int dim)
 
Bytes ask_leaves (Int dim)
 
Parents ask_parents (Int child_dim)
 
Children ask_children (Int parent_dim, Int child_dim)
 
bool has_any_parents () const
 
void set_owners (Int dim, Remotes owners)
 
Remotes ask_owners (Int dim)
 
Read< I8 > owned (Int dim)
 
Dist ask_dist (Int dim)
 
Int nghost_layers () const
 
void set_parting (Omega_h_Parting parting_in, Int nlayers, bool verbose)
 
void set_parting (Omega_h_Parting parting_in, bool verbose=false)
 
void balance (bool predictive=false)
 
void balance (Reals weights)
 
void migrate (Remotes &owners)
 
Graph ask_graph (Int from, Int to)
 
template<typename T >
Read< T > sync_array (Int ent_dim, Read< T > a, Int width)
 
template<typename T >
Future< T > isync_array (Int ent_dim, Read< T > a, Int width)
 
template<typename T >
Read< T > sync_subset_array (Int ent_dim, Read< T > a_data, LOs a2e, T default_val, Int width)
 
template<typename T >
Read< T > reduce_array (Int ent_dim, Read< T > a, Int width, Omega_h_Op op)
 
template<typename T >
Read< T > owned_array (Int ent_dim, Read< T > a, Int width)
 
template<typename T >
Read< T > owned_subset_array (Int ent_dim, Read< T > a_data, LOs a2e, T default_val, Int width)
 
void sync_tag (Int dim, std::string const &name)
 
void reduce_tag (Int dim, std::string const &name, Omega_h_Op op)
 
bool operator== (Mesh &other)
 
Real min_quality ()
 
Real max_length ()
 
bool could_be_shared (Int ent_dim) const
 
bool owners_have_all_upward (Int ent_dim) const
 
bool have_all_upward () const
 
Mesh copy_meta () const
 
RibPtr rib_hints () const
 
void set_rib_hints (RibPtr hints)
 
Real imbalance (Int ent_dim=-1) const
 
Adj derive_revClass (Int edim, I8 should_sort=-1)
 
void set_model_ents (Int ent_dim, LOs Ids)
 
void set_model_matches (Int ent_dim, LOs matches)
 
LOs get_model_ents (Int ent_dim)
 
LOs get_model_matches (Int ent_dim)
 
void set_match_owners (Int dim, Remotes owners)
 
Remotes ask_match_owners (Int dim)
 
void set_matches (Int dim, c_Remotes matches)
 
c_Remotes get_matches (Int dim)
 
void swap_root_owner (Int dim)
 
void sync_tag_matched (Int dim, std::string const &name)
 
template<typename T >
Read< T > sync_array_matched (Int ent_dim, Read< T > a, Int width)
 
Real ghosted_ratio (Int ent_dim)
 
LO nents_owned (Int ent_dim)
 
std::string string (int verbose=0)
 
const TagVector & get_rc_tags (Int dim) const
 
std::unique_ptr< TagBaseget_rc_mesh_tag_from_rc_tag (Int dim, TagBase const *)
 

Public Attributes

c_Remotes matches_ [DIMS]
 
ClassSets class_sets
 

Protected Attributes

Int dim_
 

Friends

class ScopedChangeRCFieldsToMesh
 

Member Function Documentation

◆ add_rcField() [1/2]

template<typename T >
void Omega_h::Mesh::add_rcField ( Int  ent_dim,
std::string const &  name,
Int  ncomps 
)

Takes input of entity dimension, name of field and number of components. to create a space where the rcField values can be stored. This function is used when fields are to be stored with mesh entities returned by ask_revClass (Int edim)

◆ add_rcField() [2/2]

template<typename T >
void Omega_h::Mesh::add_rcField ( LOs  class_ids,
Int  ent_dim,
std::string const &  name,
Int  ncomps 
)

Takes input of model entity IDs, entity dimension, name of field and number of components, to create a the rcField. This function is used when fields are to be stored with mesh entities returned by ask_revClass (Int edim, LOs class_ids)

◆ ask_revClass() [1/2]

Adj Omega_h::Mesh::ask_revClass ( Int  edim)

ask_revClass (Int edim): see ask_revClass (Int edim, LOs class_ids) above. Here, the output is for all model entities of dimension 'edim' instead of a input list

◆ ask_revClass() [2/2]

Adj Omega_h::Mesh::ask_revClass ( Int  edim,
LOs  class_ids 
)

ask_revClass (Int edim, LOs class_ids): takes input of entity dimension 'edim', and an 1d array of model entity IDs to return a CSR structure (Adj) containing IDs of mesh entities classified on the requested input model entities. Note here that 'edim' is equal to the model entity dimension as well as the dimension of returned mesh entities NOTE: if the model entity is a region, the memory usage is high

◆ ask_revClass_downAdj()

Adj Omega_h::Mesh::ask_revClass_downAdj ( Int  from,
Int  to 
)

ask_revClass_downAdj (Int from, Int to): takes input of a higher dimension 'from' and a lower dimension 'to'. The value of 'from' is equal to the mesh and model entity dimensions used to get reverse class. (similar to 'edim' for ask_revClass functions above.) This function can be understood as a two step process. Firstly, for all the model entities of dimension 'from', we get the reverse classified mesh entities. Then combine the reverse classification, and downward adjacency information. The final output is a CSR containing downward adjacent mesh entities of dimension 'to' which bound the reverse classified mesh entities of dimension 'from'.

◆ ask_sizes()

Reals Omega_h::Mesh::ask_sizes ( )

get the size of each mesh element

◆ has_revClass()

bool Omega_h::Mesh::has_revClass ( Int  edim) const

has_revClass (Int edim): Input is a entity dimension 'edim'. This function checks if the reverse classification for that dimension is present in memory or not.

◆ migrate()

void Omega_h::Mesh::migrate ( Remotes owners)

migrate mesh elements by constructing a distributed graph where each rank defines which elements it will own via a pair of integers for each element:

  • rank - which process currently owns the element
  • index - the local index on the rank for the element see migrate_test.cpp for an example

◆ remove_rcField()

void Omega_h::Mesh::remove_rcField ( Int  ent_dim,
std::string const &  name 
)

Takes input of entity dimension, name of field and deletes the field information from memory

◆ set_rcField_array()

template<typename T >
void Omega_h::Mesh::set_rcField_array ( Int  ent_dim,
std::string const &  name,
Read< T >  array 
)

Takes input of entity dimension, name of rcField, values of rcField, and stores the values in memory.

Member Data Documentation

◆ class_sets

ClassSets Omega_h::Mesh::class_sets

Stores the association of strings with classification info (id+dim) to support the Omega_h::ents_on_closure and Omega_h::nodes_on_closure APIs.

ClassSets are also used during conversion from and back to other data structures and files such as ADIOS2 and Exodus II to preserve the names of mesh entity sets.


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