moab
|
Interface implemented in MOAB which provides memory for mesh reading utilities. More...
#include <ReadUtilIface.hpp>
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 | report_error (const std::string &error)=0 |
virtual ErrorCode | report_error (const char *error,...) MB_PRINTF(1)=0 |
overloaded report_error behaves like the above | |
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 incomming element connectivity. |
Interface implemented in MOAB which provides memory for mesh reading utilities.
Definition at line 29 of file ReadUtilIface.hpp.
moab::ReadUtilIface::ReadUtilIface | ( | ) | [inline] |
virtual moab::ReadUtilIface::~ReadUtilIface | ( | ) | [inline, virtual] |
virtual ErrorCode moab::ReadUtilIface::assign_ids | ( | Tag | id_tag, |
const Range & | ents, | ||
int | start = 0 |
||
) | [pure virtual] |
Assign sequential IDS to entities in range and store IDs in tag.
Implemented in moab::ReadUtil.
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] |
Implemented in moab::ReadUtil.
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.
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.
partition | Entities for which to gather related entities |
related_ents | Related entities |
file_set | If non-NULL, entity sets contained in this set will be checked; otherwise, all sets in the instance will be checked |
Implemented in moab::ReadUtil.
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
num_elements | Number of elements being requested |
verts_per_element | Number of vertices per element (incl. higher-order nodes) |
mdb_type | Element type |
preferred_start_id | Preferred integer id for first element |
actual_start_handle | Actual integer id for first element (returned) |
array | Pointer to memory allocated for storing connectivity for these elements |
sequence_size | If specified, allocate this sequence size instead of SequenceManager::DEFAULT_VERTEX_SEQUENCE_SIZE |
Implemented in moab::ReadUtil.
virtual ErrorCode moab::ReadUtilIface::get_gather_set | ( | EntityHandle & | gather_set | ) | [pure virtual] |
Get entity handle of an existing gather set.
Implemented in moab::ReadUtil.
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
num_arrays | Number of node position arrays requested |
num_nodes | Number of nodes |
preferred_start_id | Preferred integer id starting value |
actual_start_handle | Actual starting id value |
arrays | STL vector of double*'s, point to memory storage to be used for these vertices |
sequence_size | If specified, allocate this sequence size instead of SequenceManager::DEFAULT_VERTEX_SEQUENCE_SIZE |
Implemented in moab::ReadUtil.
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.
void moab::ReadUtilIface::reorder | ( | const int * | order, |
EntityHandle * | conn, | ||
int | num_elem, | ||
int | node_per_elem | ||
) | [inline, static] |
Re-order incomming element connectivity.
Permute the connectivity of each element such that the node order is that of MBCN rather than the target file format.
order | The 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] |
conn | The connectivty array to re-order |
num_elem | The number of elements in the connectivity array |
node_per_elem | The number of nodes in each element's connectivity list. |
Definition at line 169 of file ReadUtilIface.hpp.
{ 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::report_error | ( | const std::string & | error | ) | [pure virtual] |
if an error occured when reading the mesh, report it to MOAB it makes sense to have this as long as Interface has a load_mesh function
Implemented in moab::ReadUtil.
virtual ErrorCode moab::ReadUtilIface::report_error | ( | const char * | error, |
... | |||
) | [pure virtual] |
overloaded report_error behaves like the above
Implemented in moab::ReadUtil.
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.
start_handle | Handle of first new element |
number_elements | Number of new elements |
number_vertices_per_element | Number of vertices in each new element |
conn_array | Connectivity of new elements |
Implemented in moab::ReadUtil.