![]() |
Mesh Oriented datABase
(version 5.4.1)
Array-based unstructured mesh datastructure
|
#include <Remapper.hpp>
Public Types | |
enum | IntersectionContext { DEFAULT = -1, SourceMesh = 0, TargetMesh = 1, OverlapMesh = 2, CoveringMesh = 3 } |
Public Member Functions | |
Remapper (moab::Interface *mbInt) | |
virtual | ~Remapper () |
moab::Interface * | get_interface () |
ErrorCode | LoadNativeMesh (std::string filename, moab::EntityHandle &meshset, std::vector< int > &metadata, const char *readopts=0) |
Protected Attributes | |
Interface * | m_interface |
Definition at line 38 of file Remapper.hpp.
Definition at line 57 of file Remapper.hpp.
{
DEFAULT = -1,
SourceMesh = 0,
TargetMesh = 1,
OverlapMesh = 2,
CoveringMesh = 3
};
moab::Remapper::Remapper | ( | moab::Interface * | mbInt | ) | [inline] |
Definition at line 44 of file Remapper.hpp.
: m_interface( mbInt )
#endif
{
}
virtual moab::Remapper::~Remapper | ( | ) | [inline, virtual] |
Definition at line 49 of file Remapper.hpp.
References m_interface.
{
#ifdef MOAB_HAVE_MPI
m_pcomm = NULL;
#endif
m_interface = NULL;
}
moab::Interface* moab::Remapper::get_interface | ( | ) | [inline] |
Definition at line 66 of file Remapper.hpp.
References m_interface.
Referenced by moab::TempestOnlineMap::TempestOnlineMap().
{
return m_interface;
}
ErrorCode moab::Remapper::LoadNativeMesh | ( | std::string | filename, |
moab::EntityHandle & | meshset, | ||
std::vector< int > & | metadata, | ||
const char * | readopts = 0 |
||
) | [inline] |
Definition at line 78 of file Remapper.hpp.
References ErrorCode, moab::Interface::load_file(), m_interface, MB_ALREADY_ALLOCATED, MB_CHK_ERR, MB_SUCCESS, MB_TAG_NOT_FOUND, moab::Interface::tag_get_data(), and moab::Interface::tag_get_handle().
Referenced by CreateTempestMesh(), and main().
{
#ifdef MOAB_HAVE_MPI
size_t lastindex = filename.find_last_of( "." );
std::string extension = filename.substr( lastindex + 1, filename.size() );
std::string opts = "";
if( m_pcomm->size() > 1 )
{
if( extension != "h5m" )
opts = std::string( "PARALLEL=BCAST_DELETE;PARTITION=TRIVIAL;PARALLEL_RESOLVE_SHARED_ENTS" );
else
opts = std::string( "PARALLEL=READ_PART;PARTITION=PARALLEL_PARTITION;PARALLEL_"
"RESOLVE_SHARED_ENTS" );
}
if( readopts )
{
if( opts.size() )
opts = opts + ";" + std::string( readopts );
else
opts = std::string( readopts );
}
if( !m_pcomm->rank() ) std::cout << "Reading file (" << filename << ") with options = [" << opts << "]\n";
#else
const std::string opts = std::string( ( readopts ? readopts : "" ) );
std::cout << "Reading file (" << filename << ") with options = [" << opts << "]\n";
#endif
moab::ErrorCode rval = m_interface->load_file( filename.c_str(), &meshset, opts.c_str() );MB_CHK_ERR( rval );
Tag rectilinearTag;
rval = m_interface->tag_get_handle( "ClimateMetadata", rectilinearTag );
if( rval != MB_FAILURE && rval != MB_TAG_NOT_FOUND && rval != MB_ALREADY_ALLOCATED &&
rectilinearTag != nullptr )
{
int dimSizes[3];
moab::EntityHandle rootset = 0;
rval = m_interface->tag_get_data( rectilinearTag, &rootset, 1,
dimSizes ); // MB_CHK_SET_ERR( rval, "Error geting tag data" );
metadata.clear();
metadata.push_back( dimSizes[0] );
metadata.push_back( dimSizes[1] );
metadata.push_back( dimSizes[2] );
// printf( "Mesh metadata: %d, %d, %d\n", metadata[0], metadata[1], metadata[2] );
}
return MB_SUCCESS;
}
Interface* moab::Remapper::m_interface [protected] |
Definition at line 133 of file Remapper.hpp.
Referenced by moab::TempestRemapper::assign_vertex_element_IDs(), moab::TempestRemapper::ComputeGlobalLocalMaps(), moab::TempestRemapper::ComputeOverlapMesh(), moab::TempestRemapper::ConstructCoveringSet(), moab::TempestRemapper::convert_mesh_to_tempest_private(), moab::TempestRemapper::convert_overlap_mesh_sorted_by_source(), moab::TempestRemapper::convert_tempest_mesh_private(), moab::TempestRemapper::GenerateMeshMetadata(), get_interface(), moab::TempestRemapper::GetIMasks(), moab::TempestRemapper::initialize(), LoadNativeMesh(), and ~Remapper().