Mesh Oriented datABase  (version 5.5.1)
An array-based unstructured mesh library
moab::ReadUtilIface Class Referenceabstract

Interface implemented in MOAB which provides memory for mesh reading utilities. More...

#include <ReadUtilIface.hpp>

+ Inheritance diagram for moab::ReadUtilIface:

Public Member Functions

 ReadUtilIface ()
 Constructor. More...
 
virtual ~ReadUtilIface ()
 Destructor. More...
 
virtual ErrorCode get_node_coords (const int num_arrays, const int num_nodes, const int preferred_start_id, EntityHandle &actual_start_handle, std::vector< double * > &arrays, const int sequence_size=-1)=0
 Given a requested number of vertices and number of coordinates, returns memory space which will be used to store vertex coordinates and information about what handles those new vertices are assigned; allows direct read of coordinate data into memory. More...
 
virtual ErrorCode get_element_connect (const int num_elements, const int verts_per_element, const EntityType mdb_type, const int preferred_start_id, EntityHandle &actual_start_handle, EntityHandle *&array, int sequence_size=-1)=0
 Given requested number of elements, element type, and number of elements, returns pointer to memory space allocated to store connectivity of those elements; allows direct read of connectivity data into memory. More...
 
virtual ErrorCode gather_related_ents (Range &partition, Range &related_ents, EntityHandle *file_set=NULL)=0
 Gather entities related to those in the partition Gather entities related to those in the input partition. Related means down-adjacent to, contained in, etc. More...
 
virtual ErrorCode create_entity_sets (EntityID num_sets, const unsigned *set_flags, EntityID preffered_start_id, EntityHandle &actual_start_handle)=0
 
virtual ErrorCode update_adjacencies (const EntityHandle start_handle, const int number_elements, const int number_vertices_per_element, const EntityHandle *conn_array)=0
 Update adjacencies Given information about new elements, adjacency information will be updated in MOAB. Think of this function as a way of Readers telling MOAB what elements are new because we aren't using the Interface to create elements. More...
 
virtual ErrorCode get_ordered_vertices (EntityHandle *bound_ents, int *sense, int num_bound, int dim, EntityHandle *bound_verts, EntityType &etype)=0
 Given an ordered list of bounding entities and the sense of those entities, return an ordered list of vertices. More...
 
virtual ErrorCode assign_ids (Tag id_tag, const Range &ents, int start=0)=0
 Assign sequential IDS to entities in range and store IDs in tag. More...
 
virtual ErrorCode assign_ids (Tag id_tag, const EntityHandle *ents, size_t num_ents, int start=0)=0
 Assign to each entity in an array the ID that is its position in the array plus the value of 'start'. For any non-zero handles in the array, store the ID value in the passed tag. More...
 
virtual ErrorCode create_gather_set (EntityHandle &gather_set)=0
 Create a new gather set with tag GATHER_SET. More...
 
virtual ErrorCode get_gather_set (EntityHandle &gather_set)=0
 Get entity handle of an existing gather set. More...
 

Static Public Member Functions

static void reorder (const int *order, EntityHandle *conn, int num_elem, int node_per_elem)
 Re-order incoming element connectivity. More...
 

Detailed Description

Interface implemented in MOAB which provides memory for mesh reading utilities.

Examples
ComputeTriDual.cpp.

Definition at line 30 of file ReadUtilIface.hpp.

Constructor & Destructor Documentation

◆ ReadUtilIface()

moab::ReadUtilIface::ReadUtilIface ( )
inline

Constructor.

Definition at line 34 of file ReadUtilIface.hpp.

34 {}

◆ ~ReadUtilIface()

virtual moab::ReadUtilIface::~ReadUtilIface ( )
inlinevirtual

Destructor.

Definition at line 37 of file ReadUtilIface.hpp.

37 {}

Member Function Documentation

◆ assign_ids() [1/2]

virtual ErrorCode moab::ReadUtilIface::assign_ids ( Tag  id_tag,
const EntityHandle ents,
size_t  num_ents,
int  start = 0 
)
pure virtual

Assign to each entity in an array the ID that is its position in the array plus the value of 'start'. For any non-zero handles in the array, store the ID value in the passed tag.

Implemented in moab::ReadUtil.

◆ assign_ids() [2/2]

◆ create_entity_sets()

virtual ErrorCode moab::ReadUtilIface::create_entity_sets ( EntityID  num_sets,
const unsigned *  set_flags,
EntityID  preffered_start_id,
EntityHandle actual_start_handle 
)
pure virtual

◆ create_gather_set()

virtual ErrorCode moab::ReadUtilIface::create_gather_set ( EntityHandle gather_set)
pure virtual

Create a new gather set with tag GATHER_SET.

Implemented in moab::ReadUtil.

Referenced by moab::NCHelperGCRM::create_mesh(), moab::NCHelperHOMME::create_mesh(), and moab::NCHelperMPAS::create_mesh().

◆ gather_related_ents()

virtual ErrorCode moab::ReadUtilIface::gather_related_ents ( Range partition,
Range related_ents,
EntityHandle file_set = NULL 
)
pure virtual

Gather entities related to those in the partition Gather entities related to those in the input partition. Related means down-adjacent to, contained in, etc.

Parameters
partitionEntities for which to gather related entities
related_entsRelated entities
file_setIf non-NULL, entity sets contained in this set will be checked; otherwise, all sets in the instance will be checked

Implemented in moab::ReadUtil.

Referenced by moab::ReadParallel::delete_nonlocal_entities().

◆ get_element_connect()

virtual ErrorCode moab::ReadUtilIface::get_element_connect ( const int  num_elements,
const int  verts_per_element,
const EntityType  mdb_type,
const int  preferred_start_id,
EntityHandle actual_start_handle,
EntityHandle *&  array,
int  sequence_size = -1 
)
pure virtual

Given requested number of elements, element type, and number of elements, returns pointer to memory space allocated to store connectivity of those elements; allows direct read of connectivity data into memory.

Parameters
num_elementsNumber of elements being requested
verts_per_elementNumber of vertices per element (incl. higher-order nodes)
mdb_typeElement type
preferred_start_idPreferred integer id for first element
actual_start_handleActual integer id for first element (returned)
arrayPointer to memory allocated for storing connectivity for these elements
sequence_sizeIf specified, allocate this sequence size instead of SequenceManager::DEFAULT_VERTEX_SEQUENCE_SIZE
Returns
status Success/failure of this call

Implemented in moab::ReadUtil.

Referenced by moab::ReadVtk::allocate_elements(), moab::ReadMCNP5::create_elements(), moab::ReadCGNS::create_elements(), moab::ReadGmsh::create_elements(), moab::NCHelperMPAS::create_gather_set_cells(), moab::NCHelperGCRM::create_gather_set_edges(), moab::NCHelperMPAS::create_gather_set_edges(), moab::NestedRefine::create_hm_storage_single_level(), moab::NCHelperESMF::create_local_cells(), moab::NCHelperMPAS::create_local_cells(), moab::NCHelperGCRM::create_local_edges(), moab::NCHelperMPAS::create_local_edges(), moab::NCHelperDomain::create_mesh(), moab::NCHelperHOMME::create_mesh(), moab::NCHelperScrip::create_mesh(), create_mesh_no_holes(), create_mesh_with_holes(), moab::NCHelperGCRM::create_padded_gather_set_cells(), moab::NCHelperMPAS::create_padded_gather_set_cells(), moab::NCHelperESMF::create_padded_local_cells(), moab::NCHelperGCRM::create_padded_local_cells(), moab::NCHelperMPAS::create_padded_local_cells(), moab::SpectralMeshTool::create_spectral_elems(), moab::IntxUtils::deep_copy_set_with_quads(), iMOAB_CreateElements(), moab::ReadSmf::load_file(), moab::ReadSTL::load_file(), moab::ReadSms::load_file_impl(), main(), moab::ReadDamsel::process_ent_info(), moab::ReadTetGen::read_elem_file(), moab::ReadABAQUS::read_element_list(), moab::ReadNCDF::read_elements(), moab::ReadTemplate::read_elements(), moab::Tqdcfr::read_elements(), moab::ReadHDF5::read_elems(), and moab::ReadHDF5::read_node_adj_elems().

◆ get_gather_set()

virtual ErrorCode moab::ReadUtilIface::get_gather_set ( EntityHandle gather_set)
pure virtual

Get entity handle of an existing gather set.

Implemented in moab::ReadUtil.

◆ get_node_coords()

virtual ErrorCode moab::ReadUtilIface::get_node_coords ( const int  num_arrays,
const int  num_nodes,
const int  preferred_start_id,
EntityHandle actual_start_handle,
std::vector< double * > &  arrays,
const int  sequence_size = -1 
)
pure virtual

Given a requested number of vertices and number of coordinates, returns memory space which will be used to store vertex coordinates and information about what handles those new vertices are assigned; allows direct read of coordinate data into memory.

Parameters
num_arraysNumber of node position arrays requested
num_nodesNumber of nodes
preferred_start_idPreferred integer id starting value
actual_start_handleActual starting id value
arraysSTL vector of double*'s, point to memory storage to be used for these vertices
sequence_sizeIf specified, allocate this sequence size instead of SequenceManager::DEFAULT_VERTEX_SEQUENCE_SIZE
Returns
status Success/failure of this call

Implemented in moab::ReadUtil.

Referenced by moab::ReadVtk::allocate_vertices(), moab::NCHelperGCRM::create_gather_set_vertices(), moab::NCHelperMPAS::create_gather_set_vertices(), moab::NestedRefine::create_hm_storage_single_level(), moab::ReadABAQUS::create_instance_of_part(), moab::NCHelperESMF::create_local_vertices(), moab::NCHelperGCRM::create_local_vertices(), moab::NCHelperMPAS::create_local_vertices(), moab::NCHelperDomain::create_mesh(), moab::NCHelperHOMME::create_mesh(), moab::NCHelperScrip::create_mesh(), create_mesh_no_holes(), create_mesh_with_holes(), moab::Core::create_vertices(), moab::ReadIDEAS::create_vertices(), moab::ReadMCNP5::create_vertices(), moab::IntxUtils::deep_copy_set_with_quads(), moab::ReadCGNS::load_file(), moab::ReadGmsh::load_file(), moab::ReadNASTRAN::load_file(), moab::ReadSmf::load_file(), moab::ReadSTL::load_file(), moab::ReadSms::load_file_impl(), moab::ReadDamsel::process_ent_info(), moab::ReadTetGen::read_node_file(), moab::ReadABAQUS::read_node_list(), moab::ReadHDF5::read_nodes(), moab::ReadNCDF::read_nodes(), moab::Tqdcfr::read_nodes(), moab::ReadCCMIO::read_vertices(), and moab::ReadTemplate::read_vertices().

◆ get_ordered_vertices()

virtual ErrorCode moab::ReadUtilIface::get_ordered_vertices ( EntityHandle bound_ents,
int *  sense,
int  num_bound,
int  dim,
EntityHandle bound_verts,
EntityType &  etype 
)
pure virtual

Given an ordered list of bounding entities and the sense of those entities, return an ordered list of vertices.

Implemented in moab::ReadUtil.

Referenced by moab::ReadSms::load_file_impl().

◆ reorder()

void moab::ReadUtilIface::reorder ( const int *  order,
EntityHandle conn,
int  num_elem,
int  node_per_elem 
)
inlinestatic

Re-order incoming element connectivity.

Permute the connectivity of each element such that the node order is that of MBCN rather than the target file format.

Parameters
orderThe permutation to use. Must be an array of 'node_per_elem' integers and be a permutation of the values [0..node_per_elem-1]. Such that for a single element: mbcn_conn[order[i]] == target_conn[i]
connThe connectivity array to re-order
num_elemThe number of elements in the connectivity array
node_per_elemThe number of nodes in each element's connectivity list.

Definition at line 147 of file ReadUtilIface.hpp.

148 {
149  std::vector< EntityHandle > elem( node_per_elem );
150  EntityHandle* const end = conn + num_elem * node_per_elem;
151  while( conn != end )
152  {
153  std::copy( conn, conn + node_per_elem, elem.begin() );
154  for( int j = 0; j < node_per_elem; ++j )
155  conn[order[j]] = elem[j];
156  conn += node_per_elem;
157  }
158 }

Referenced by moab::ReadNCDF::read_elements().

◆ update_adjacencies()

virtual ErrorCode moab::ReadUtilIface::update_adjacencies ( const EntityHandle  start_handle,
const int  number_elements,
const int  number_vertices_per_element,
const EntityHandle conn_array 
)
pure virtual

Update adjacencies Given information about new elements, adjacency information will be updated in MOAB. Think of this function as a way of Readers telling MOAB what elements are new because we aren't using the Interface to create elements.

Parameters
start_handleHandle of first new element
number_elementsNumber of new elements
number_vertices_per_elementNumber of vertices in each new element
conn_arrayConnectivity of new elements
Returns
status Success/failure of this call

Implemented in moab::ReadUtil.

Referenced by moab::ReadCGNS::create_elements(), moab::ReadGmsh::create_elements(), moab::IntxUtils::deep_copy_set_with_quads(), iMOAB_CreateElements(), moab::ReadSmf::load_file(), moab::ReadSTL::load_file(), moab::ReadNCDF::read_elements(), moab::ReadTemplate::read_elements(), moab::Tqdcfr::read_elements(), moab::ReadHDF5::read_elems(), moab::ReadHDF5::read_node_adj_elems(), moab::ParallelComm::unpack_entities(), moab::ReadHDF5::update_connectivity(), moab::ReadVtk::vtk_create_structured_elems(), and moab::ReadVtk::vtk_read_unstructured_grid().


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