Mesh Oriented datABase  (version 5.4.1)
Array-based unstructured mesh datastructure
moab::Remapper Class Reference

#include <Remapper.hpp>

+ Inheritance diagram for moab::Remapper:
+ Collaboration diagram for moab::Remapper:

Public Types

enum  IntersectionContext {
  DEFAULT = -1, SourceMesh = 0, TargetMesh = 1, OverlapMesh = 2,
  CoveringMesh = 3
}

Public Member Functions

 Remapper (moab::Interface *mbInt)
virtual ~Remapper ()
moab::Interfaceget_interface ()
ErrorCode LoadNativeMesh (std::string filename, moab::EntityHandle &meshset, std::vector< int > &metadata, const char *readopts=0)

Protected Attributes

Interfacem_interface

Detailed Description

Definition at line 38 of file Remapper.hpp.


Member Enumeration Documentation

Enumerator:
DEFAULT 
SourceMesh 
TargetMesh 
OverlapMesh 
CoveringMesh 

Definition at line 57 of file Remapper.hpp.

    {
        DEFAULT      = -1,
        SourceMesh   = 0,
        TargetMesh   = 1,
        OverlapMesh  = 2,
        CoveringMesh = 3
    };

Constructor & Destructor Documentation

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;
    }

Member Function Documentation

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;
    }

Member Data Documentation

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