Mesh Oriented datABase  (version 5.6.0)
An array-based unstructured mesh library
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::Interface * get_interface ()
 
ErrorCode LoadNativeMesh (std::string filename, moab::EntityHandle &meshset, std::vector< int > &metadata, const char *readopts=0)
 

Protected Attributes

Interface * m_interface
 

Detailed Description

Definition at line 31 of file Remapper.hpp.

Member Enumeration Documentation

◆ IntersectionContext

Enumerator
DEFAULT 
SourceMesh 
TargetMesh 
OverlapMesh 
CoveringMesh 

Definition at line 50 of file Remapper.hpp.

51  {
52  DEFAULT = -1, // default context
53  SourceMesh = 0, // source mesh
54  TargetMesh = 1, // target mesh
55  OverlapMesh = 2, // overlap/intersection mesh
56  CoveringMesh = 3, // source mesh covering target mesh
57  };

Constructor & Destructor Documentation

◆ Remapper()

moab::Remapper::Remapper ( moab::Interface *  mbInt)
inline

Definition at line 37 of file Remapper.hpp.

37  : m_interface( mbInt )
38 #endif
39  {
40  }

◆ ~Remapper()

virtual moab::Remapper::~Remapper ( )
inlinevirtual

Definition at line 42 of file Remapper.hpp.

43  {
44 #ifdef MOAB_HAVE_MPI
45  m_pcomm = NULL;
46 #endif
47  m_interface = NULL;
48  }

References m_interface.

Member Function Documentation

◆ get_interface()

moab::Interface* moab::Remapper::get_interface ( )
inline

Definition at line 59 of file Remapper.hpp.

60  {
61  return m_interface;
62  }

References m_interface.

Referenced by moab::TempestOnlineMap::TempestOnlineMap().

◆ LoadNativeMesh()

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

Definition at line 74 of file Remapper.hpp.

78  {
79 #ifdef MOAB_HAVE_MPI
80  std::string opts = "";
81  if( readopts )
82  {
83  if( opts.size() )
84  opts = opts + ";" + std::string( readopts );
85  else
86  opts = std::string( readopts );
87  }
88 
89  if( !m_pcomm->rank() ) std::cout << "Reading file (" << filename << ") with options = [" << opts << "]\n";
90 #else
91  const std::string opts = std::string( ( readopts ? readopts : "" ) );
92  std::cout << "Reading file (" << filename << ") with options = [" << opts << "]\n";
93 #endif
94  MB_CHK_ERR( m_interface->load_file( filename.c_str(), &meshset, opts.c_str() ) );
95 
96  Tag rectilinearTag;
97  ErrorCode rval = m_interface->tag_get_handle( "ClimateMetadata", rectilinearTag );
98 
99  if( rval != MB_FAILURE && rval != MB_TAG_NOT_FOUND && rval != MB_ALREADY_ALLOCATED &&
100  rectilinearTag != nullptr )
101  {
102  int dimSizes[3];
103  EntityHandle rootset = 0;
104  rval = m_interface->tag_get_data( rectilinearTag, &rootset, 1,
105  dimSizes ); // MB_CHK_SET_ERR( rval, "Error geting tag data" );
106  metadata.clear();
107  metadata.push_back( dimSizes[0] );
108  metadata.push_back( dimSizes[1] );
109  metadata.push_back( dimSizes[2] );
110  }
111 
112  return MB_SUCCESS;
113  }

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 anonymous_namespace{mbtempest.cpp}::handleOverlapMOAB(), and main().

Member Data Documentation

◆ m_interface


The documentation for this class was generated from the following file: