MOAB: Mesh Oriented datABase  (version 5.2.1)
moab::ReadUtilIface Class Reference

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.
virtual ~ReadUtilIface ()
 Destructor.
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
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
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.
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
virtual ErrorCode get_ordered_vertices (EntityHandle *bound_ents, int *sense, int num_bound, int dim, EntityHandle *bound_verts, EntityType &etype)=0
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.
virtual ErrorCode assign_ids (Tag id_tag, const EntityHandle *ents, size_t num_ents, int start=0)=0
virtual ErrorCode create_gather_set (EntityHandle &gather_set)=0
 Create a new gather set with tag GATHER_SET.
virtual ErrorCode get_gather_set (EntityHandle &gather_set)=0
 Get entity handle of an existing gather set.

Static Public Member Functions

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

Detailed Description

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

Examples:
DirectAccessNoHoles.cpp, DirectAccessWithHoles.cpp, and ExtrudePoly.cpp.

Definition at line 30 of file ReadUtilIface.hpp.


Constructor & Destructor Documentation

Constructor.

Definition at line 34 of file ReadUtilIface.hpp.

{}
virtual moab::ReadUtilIface::~ReadUtilIface ( ) [inline, virtual]

Destructor.

Definition at line 37 of file ReadUtilIface.hpp.

{}

Member Function Documentation

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.

virtual ErrorCode moab::ReadUtilIface::create_entity_sets ( EntityID  num_sets,
const unsigned *  set_flags,
EntityID  preffered_start_id,
EntityHandle actual_start_handle 
) [pure virtual]
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::NCHelperHOMME::create_mesh().

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(), and gather_related_test().

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.

Examples:
DirectAccessNoHoles.cpp, DirectAccessWithHoles.cpp, and ExtrudePoly.cpp.

Referenced by moab::ReadVtk::allocate_elements(), moab::MeshGeneration::BrickInstance(), moab::TempestRemapper::convert_tempest_mesh_private(), create_3dtri_ucd_sequences(), create_coarse_mesh(), moab::ReadCGNS::create_elements(), moab::ReadGmsh::create_elements(), moab::ReadMCNP5::create_elements(), create_elements_block(), create_fine_mesh(), moab::NestedRefine::create_hm_storage_single_level(), moab::NCHelperDomain::create_mesh(), moab::NCHelperHOMME::create_mesh(), create_mesh_no_holes(), create_mesh_with_holes(), create_regular_mesh(), IntxUtilsCSLAM::create_span_quads(), 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::ReadTemplate::read_elements(), moab::ReadNCDF::read_elements(), moab::Tqdcfr::read_elements(), moab::ReadHDF5::read_elems(), moab::ReadHDF5::read_node_adj_elems(), ReadTriangleOutput(), test_coords_connect_iterate(), test_linear_tet(), test_write_invalid_elem(), testB(), and testE().

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

Get entity handle of an existing gather set.

Implemented in moab::ReadUtil.

Referenced by gather_one_cell_var(), test_gather_onevar(), and test_read_parallel().

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.

Examples:
DirectAccessNoHoles.cpp, and DirectAccessWithHoles.cpp.

Referenced by moab::ReadVtk::allocate_vertices(), moab::MeshGeneration::BrickInstance(), moab::TempestRemapper::convert_tempest_mesh_private(), create_3dtri_ucd_sequences(), create_coarse_mesh(), moab::NestedRefine::create_hm_storage_single_level(), moab::ReadABAQUS::create_instance_of_part(), moab::NCHelperDomain::create_mesh(), moab::NCHelperHOMME::create_mesh(), create_mesh_no_holes(), create_mesh_with_holes(), create_regular_mesh(), IntxUtilsCSLAM::create_span_quads(), moab::ReadIDEAS::create_vertices(), moab::ReadMCNP5::create_vertices(), moab::Core::create_vertices(), create_vertices_block(), moab::IntxUtils::deep_copy_set_with_quads(), moab::ReadCGNS::load_file(), moab::ReadGmsh::load_file(), moab::ReadSmf::load_file(), moab::ReadNASTRAN::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::ReadNCDF::read_nodes(), moab::ReadHDF5::read_nodes(), moab::Tqdcfr::read_nodes(), moab::ReadTemplate::read_vertices(), moab::ReadCCMIO::read_vertices(), ReadTriangleOutput(), test_write_invalid_elem(), testB(), and testE().

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().

void moab::ReadUtilIface::reorder ( const int *  order,
EntityHandle conn,
int  num_elem,
int  node_per_elem 
) [inline, static]

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 133 of file ReadUtilIface.hpp.

References node_per_elem.

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

{
    std::vector< EntityHandle > elem( node_per_elem );
    EntityHandle* const end = conn + num_elem * node_per_elem;
    while( conn != end )
    {
        std::copy( conn, conn + node_per_elem, elem.begin() );
        for( int j = 0; j < node_per_elem; ++j )
            conn[order[j]] = elem[j];
        conn += node_per_elem;
    }
}
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::MeshGeneration::BrickInstance(), moab::TempestRemapper::convert_tempest_mesh_private(), moab::ReadCGNS::create_elements(), moab::ReadGmsh::create_elements(), create_fine_mesh(), create_regular_mesh(), moab::IntxUtils::deep_copy_set_with_quads(), iMOAB_CreateElements(), moab::ReadSmf::load_file(), moab::ReadSTL::load_file(), moab::ReadTemplate::read_elements(), moab::ReadNCDF::read_elements(), moab::Tqdcfr::read_elements(), moab::ReadHDF5::read_elems(), moab::ReadHDF5::read_node_adj_elems(), test_adjacencies(), testB(), testE(), moab::ParallelComm::unpack_entities(), moab::ReadHDF5::update_connectivity(), moab::ReadVtk::vtk_create_structured_elems(), and moab::ReadVtk::vtk_read_unstructured_grid().

List of all members.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines