Mesh Oriented datABase  (version 5.5.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::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

◆ IntersectionContext

Enumerator
DEFAULT 
SourceMesh 
TargetMesh 
OverlapMesh 
CoveringMesh 

Definition at line 57 of file Remapper.hpp.

58  {
59  DEFAULT = -1,
60  SourceMesh = 0,
61  TargetMesh = 1,
62  OverlapMesh = 2,
63  CoveringMesh = 3
64  };

Constructor & Destructor Documentation

◆ Remapper()

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

Definition at line 44 of file Remapper.hpp.

44  : m_interface( mbInt )
45 #endif
46  {
47  }

◆ ~Remapper()

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

Definition at line 49 of file Remapper.hpp.

50  {
51 #ifdef MOAB_HAVE_MPI
52  m_pcomm = NULL;
53 #endif
54  m_interface = NULL;
55  }

References m_interface.

Member Function Documentation

◆ get_interface()

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

Definition at line 66 of file Remapper.hpp.

67  {
68  return m_interface;
69  }

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 78 of file Remapper.hpp.

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

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().

Member Data Documentation

◆ m_interface


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