Mesh Oriented datABase
(version 5.4.1)
Array-based unstructured mesh datastructure
|
#include "iMesh.h"
#include "MBiMesh.hpp"
#include "moab/Forward.hpp"
#include <cstring>
#include <cstdlib>
#include <cstdio>
Go to the source code of this file.
Classes | |
class | iMeshArrayManager |
Defines | |
#define | PP_CAT_(a, b) a##b |
#define | PP_CAT(a, b) PP_CAT_( a, b ) |
#define | RETURN(CODE) |
#define | ERROR(CODE, MSG) |
#define | CHKERR(CODE, MSG) |
#define | CHKENUM(VAL, TYPE, ERR) |
#define | CHKTAGTYPE(TAG, TYPE) |
#define | CHKNONEMPTY() |
#define | ALLOC_CHECK_ARRAY(array, this_size) |
#define | ALLOC_CHECK_TAG_ARRAY(array, this_size) |
#define | KEEP_ARRAY(array) array##_manager.keep_array() |
#define | ALLOC_CHECK_ARRAY_NOFAIL(array, this_size) |
Functions | |
static bool | iMesh_isError (int code) |
static bool | iMesh_isError (ErrorCode code) |
int | compare_no_case (const char *str1, const char *str2, size_t n) |
std::string | filter_options (const char *begin, const char *end) |
Variables | |
const iMesh_EntityTopology | tstt_topology_table [MBMAXTYPE+1] |
const iBase_EntityType | tstt_type_table [MBMAXTYPE+1] |
const EntityType | mb_topology_table [MBMAXTYPE+1] |
const DataType | mb_data_type_table [iBase_TagValueType_MAX+1] |
const iBase_TagValueType | tstt_data_type_table [MB_MAX_DATA_TYPE+1] |
const iBase_ErrorType | iBase_ERROR_MAP [MB_FAILURE+1] |
#define ALLOC_CHECK_ARRAY | ( | array, | |
this_size | |||
) |
iMeshArrayManager array##_manager( instance, reinterpret_cast< void** >( array ), *( array##_allocated ), \ *( array##_size ), this_size, sizeof( **( array ) ), err ); \ if( iBase_SUCCESS != *err ) return
Definition at line 98 of file iMesh_MOAB.hpp.
Referenced by iMesh_createVtxArr(), iMesh_getEntArr2ndAdj(), iMesh_getEntArrAdj(), iMesh_getVtxArrCoords(), iMeshP_getAdjEntities(), iMeshP_getEntOwnerPartArr(), iMeshP_getEntStatusArr(), iMeshP_getNumPartNborsArr(), iMeshP_getPartHandlesFromPartsIdsArr(), iMeshP_getPartIdsFromPartHandlesArr(), iMeshP_getPartNborsArr(), iMeshP_getRankOfPartArr(), iMeshP_isEntOwnerArr(), iRel_getEntArrEntArrRelation(), iRel_getEntArrSetArrRelation(), iRel_getEntArrSetIterArrRelation(), iRel_getSetArrEntArrRelation(), and iRel_getSetArrSetArrRelation().
#define ALLOC_CHECK_ARRAY_NOFAIL | ( | array, | |
this_size | |||
) |
ALLOC_CHECK_ARRAY( array, this_size ); \ KEEP_ARRAY( array )
Definition at line 112 of file iMesh_MOAB.hpp.
Referenced by iMesh_createEntArr(), iMesh_getAdjTable(), iMesh_getAllEntSetTags(), iMesh_getAllIfaceTags(), iMesh_getAllTags(), iMesh_getChldn(), iMesh_getEntArr2ndAdj(), iMesh_getEntArrTopo(), iMesh_getEntArrType(), iMesh_getEntitiesRec(), iMesh_getEntsByTagsRec(), iMesh_getEntSets(), iMesh_getEntSetsByTagsRec(), iMesh_getNextEntArrIter(), iMesh_getPrnts(), iMesh_isEntArrContained(), iMeshP_getCopies(), iMeshP_getCopyParts(), iMeshP_getPartitions(), iMeshP_getPartNborsArr(), iMeshP_getPartsOnRank(), and iRel_findPairs().
#define ALLOC_CHECK_TAG_ARRAY | ( | array, | |
this_size | |||
) |
iMeshArrayManager array##_manager( instance, reinterpret_cast< void** >( array ), *( array##_allocated ), \ *( array##_size ), this_size, 1, err ); \ if( iBase_SUCCESS != *err ) return
Definition at line 103 of file iMesh_MOAB.hpp.
Referenced by iMesh_getArrData(), and iMesh_getEntSetData().
#define CHKENUM | ( | VAL, | |
TYPE, | |||
ERR | |||
) |
do \ { \ if( ( VAL ) < PP_CAT( TYPE, _MIN ) || ( VAL ) > PP_CAT( TYPE, _MAX ) ) \ ERROR( ( ERR ), "Invalid enumeration value" ); \ } while( false )
Definition at line 65 of file iMesh_MOAB.hpp.
Referenced by iMesh_createTagWithOptions(), iMesh_getEntArr2ndAdj(), iMesh_getEntitiesRec(), iMesh_getEntsByTagsRec(), iMesh_getNumOfTopoRec(), iMesh_getNumOfTypeRec(), iMesh_initEntArrIterRec(), and iMesh_setVtxArrCoords().
#define CHKERR | ( | CODE, | |
MSG | |||
) |
do \ { \ if( iMesh_isError( ( CODE ) ) ) ERROR( ( CODE ), ( MSG ) ); \ } while( false )
Definition at line 59 of file iMesh_MOAB.hpp.
#define CHKNONEMPTY | ( | ) |
do \ { \ int count, result; \ iMesh_getNumOfType( instance, 0, iBase_ALL_TYPES, &count, &result ); \ CHKERR( result, "Couldn't get number of entities" ); \ if( count == 0 ) ERROR( iBase_INVALID_ENTITY_HANDLE, "Invalid entity handle: mesh is empty" ); \ } while( false )
Definition at line 86 of file iMesh_MOAB.hpp.
Referenced by iMesh_getArrData(), iMesh_rmvArrTag(), iMesh_setArrData(), and iMesh_setEntSetEHData().
#define CHKTAGTYPE | ( | TAG, | |
TYPE | |||
) |
do \ { \ int type, result; \ iMesh_getTagType( instance, ( TAG ), &type, &result ); \ CHKERR( result, "Couldn't get tag data type" ); \ if( ( type == iBase_ENTITY_HANDLE && ( TYPE ) == iBase_ENTITY_SET_HANDLE ) || \ ( type == iBase_ENTITY_SET_HANDLE && ( TYPE ) == iBase_ENTITY_HANDLE ) ) \ break; \ if( type != ( TYPE ) ) ERROR( iBase_INVALID_TAG_HANDLE, "Invalid tag data type" ); \ } while( false )
Definition at line 74 of file iMesh_MOAB.hpp.
Referenced by iMesh_getDblArrData(), iMesh_getDblData(), iMesh_getEHArrData(), iMesh_getEHData(), iMesh_getEntSetDblData(), iMesh_getEntSetEHData(), iMesh_getEntSetESHData(), iMesh_getEntSetIntData(), iMesh_getESHArrData(), iMesh_getESHData(), iMesh_getIntArrData(), iMesh_getIntData(), iMesh_setDblArrData(), iMesh_setDblData(), iMesh_setEHArrData(), iMesh_setEHData(), iMesh_setEntSetDblData(), iMesh_setEntSetEHData(), iMesh_setEntSetESHData(), iMesh_setEntSetIntData(), iMesh_setESHArrData(), iMesh_setESHData(), iMesh_setIntArrData(), and iMesh_setIntData().
#define ERROR | ( | CODE, | |
MSG | |||
) |
do \ { \ *err = MBIMESHI->set_last_error( ( CODE ), ( MSG ) ); \ return; \ } while( false )
Definition at line 52 of file iMesh_MOAB.hpp.
Referenced by iMeshArrayManager::iMeshArrayManager().
#define KEEP_ARRAY | ( | array | ) | array##_manager.keep_array() |
Definition at line 108 of file iMesh_MOAB.hpp.
Referenced by iMesh_createVtxArr(), iMesh_getArrData(), iMesh_getEntArr2ndAdj(), iMesh_getEntArrAdj(), iMesh_getEntSetData(), iMesh_getVtxArrCoords(), iMeshP_getAdjEntities(), iMeshP_getEntOwnerPartArr(), iMeshP_getEntStatusArr(), iMeshP_getNumPartNborsArr(), iMeshP_getPartHandlesFromPartsIdsArr(), iMeshP_getPartIdsFromPartHandlesArr(), iMeshP_getPartNborsArr(), iMeshP_getRankOfPartArr(), iMeshP_isEntOwnerArr(), iRel_getEntArrEntArrRelation(), iRel_getEntArrSetArrRelation(), iRel_getEntArrSetIterArrRelation(), iRel_getSetArrEntArrRelation(), and iRel_getSetArrSetArrRelation().
Definition at line 43 of file iMesh_MOAB.hpp.
#define PP_CAT_ | ( | a, | |
b | |||
) | a##b |
Definition at line 42 of file iMesh_MOAB.hpp.
#define RETURN | ( | CODE | ) |
do \ { \ *err = MBIMESHI->set_last_error( ( CODE ), "" ); \ return; \ } while( false )
Definition at line 45 of file iMesh_MOAB.hpp.
Referenced by iMeshArrayManager::iMeshArrayManager().
int compare_no_case | ( | const char * | str1, |
const char * | str2, | ||
size_t | n | ||
) | [inline] |
Definition at line 167 of file iMesh_MOAB.hpp.
Referenced by filter_options().
{ for( size_t i = 1; i != n && *str1 && toupper( *str1 ) == toupper( *str2 ); ++i, ++str1, ++str2 ) ; return toupper( *str2 ) - toupper( *str1 ); }
std::string filter_options | ( | const char * | begin, |
const char * | end | ||
) | [inline] |
Definition at line 175 of file iMesh_MOAB.hpp.
References compare_no_case(), and moab::GeomUtil::first().
Referenced by iMesh_createTagWithOptions(), iMesh_load(), iMesh_newMesh(), and iMesh_save().
{ const char* opt_begin = begin; const char* opt_end = begin; std::string filtered; bool first = true; while( opt_end != end ) { opt_end = std::find( opt_begin, end, ' ' ); if( opt_end - opt_begin >= 5 && compare_no_case( opt_begin, "moab:", 5 ) == 0 ) { if( !first ) filtered.push_back( ';' ); first = false; filtered.append( opt_begin + 5, opt_end ); } opt_begin = opt_end + 1; } return filtered; }
static bool iMesh_isError | ( | int | code | ) | [inline, static] |
Definition at line 33 of file iMesh_MOAB.hpp.
References iBase_SUCCESS.
{ return ( iBase_SUCCESS != code ); }
static bool iMesh_isError | ( | ErrorCode | code | ) | [inline, static] |
Definition at line 37 of file iMesh_MOAB.hpp.
References MB_SUCCESS.
{ return ( MB_SUCCESS != code ); }
const iBase_ErrorType iBase_ERROR_MAP[MB_FAILURE+1] |
Definition at line 29 of file iMesh_MOAB.hpp.
Definition at line 89 of file iMesh_MOAB.cpp.
Referenced by iMesh_createTagWithOptions().
const EntityType mb_topology_table[MBMAXTYPE+1] |
Definition at line 85 of file iMesh_MOAB.cpp.
Referenced by get_entities(), iMesh_createEnt(), iMesh_createEntArr(), iMesh_getEntitiesRec(), iMesh_getEntsByTagsRec(), iMesh_getNumOfTopoRec(), iMesh_initEntArrIterRec(), iMesh_MBCNType(), iMeshP_pushTags(), and MBIter< Container >::reset().
const iBase_TagValueType tstt_data_type_table[MB_MAX_DATA_TYPE+1] |
Definition at line 93 of file iMesh_MOAB.cpp.
Referenced by iMesh_getTagType().
Definition at line 51 of file iMesh_MOAB.cpp.
Referenced by iMesh_getEntArrTopo(), and iMesh_getEntTopo().
const iBase_EntityType tstt_type_table[MBMAXTYPE+1] |
Definition at line 68 of file iMesh_MOAB.cpp.
Referenced by iMesh_getEntArrType(), and iMesh_getEntType().