Mesh Oriented datABase  (version 5.5.0)
An array-based unstructured mesh library
moab::TempestRemapper Class Reference

#include <TempestRemapper.hpp>

+ Inheritance diagram for moab::TempestRemapper:
+ Collaboration diagram for moab::TempestRemapper:

Public Types

enum  TempestMeshType {
  DEFAULT = -1 , CS = 0 , RLL = 1 , ICO = 2 ,
  ICOD = 3 , OVERLAP_FILES = 4 , OVERLAP_MEMORY = 5 , OVERLAP_MOAB = 6
}
 
- Public Types inherited from moab::Remapper
enum  IntersectionContext {
  DEFAULT = -1 , SourceMesh = 0 , TargetMesh = 1 , OverlapMesh = 2 ,
  CoveringMesh = 3
}
 

Public Member Functions

 TempestRemapper (moab::Interface *mbInt, bool offlineMode=false)
 
virtual ~TempestRemapper ()
 
virtual ErrorCode initialize (bool initialize_fsets=true)
 Initialize the TempestRemapper object internal datastructures including the mesh sets and TempestRemap mesh references. More...
 
virtual ErrorCode clear ()
 Deallocate and clear any memory initialized in the TempestRemapper object More...
 
moab::ErrorCode GenerateMesh (Remapper::IntersectionContext ctx, TempestMeshType type)
 Generate a mesh in memory of given type (CS/RLL/ICO/MPAS(structured)) and store it under the context specified by the user. More...
 
moab::ErrorCode LoadMesh (Remapper::IntersectionContext ctx, std::string inputFilename, TempestMeshType type)
 Load a mesh from disk of given type and store it under the context specified by the user. More...
 
moab::ErrorCode ConstructCoveringSet (double tolerance=1e-8, double radius_src=1.0, double radius_tgt=1.0, double boxeps=0.1, bool regional_mesh=false, bool gnomonic=true)
 Construct a source covering mesh such that it completely encompasses the target grid in parallel. This operation is critical to ensure that the parallel advancing-front intersection algorithm can the intersection mesh only locally without any process communication. More...
 
moab::ErrorCode ComputeOverlapMesh (bool kdtree_search=true, bool use_tempest=false)
 Compute the intersection mesh between the source and target grids that have been instantiated in the Remapper. This function invokes the parallel advancing-front intersection algorithm internally for spherical meshes and can handle arbitrary unstructured grids (CS, RLL, ICO, MPAS) with and without holes. More...
 
moab::ErrorCode ConvertTempestMesh (Remapper::IntersectionContext ctx)
 Convert the TempestRemap mesh object to a corresponding MOAB mesh representation according to the intersection context. More...
 
moab::ErrorCode ConvertMeshToTempest (Remapper::IntersectionContext ctx)
 Convert the MOAB mesh representation to a corresponding TempestRemap mesh object according to the intersection context. More...
 
Mesh * GetMesh (Remapper::IntersectionContext ctx)
 Get the TempestRemap mesh object according to the intersection context. More...
 
void SetMesh (Remapper::IntersectionContext ctx, Mesh *mesh, bool overwrite=true)
 Set the TempestRemap mesh object according to the intersection context. More...
 
void SetMeshSet (Remapper::IntersectionContext ctx, moab::EntityHandle mset, moab::Range &entities)
 
Mesh * GetCoveringMesh ()
 Get the covering mesh (TempestRemap) object. More...
 
moab::EntityHandleGetMeshSet (Remapper::IntersectionContext ctx)
 Get the MOAB mesh set corresponding to the intersection context. More...
 
moab::EntityHandle GetMeshSet (Remapper::IntersectionContext ctx) const
 Const overload. Get the MOAB mesh set corresponding to the intersection context. More...
 
moab::RangeGetMeshEntities (Remapper::IntersectionContext ctx)
 Get the mesh element entities corresponding to the intersection context. More...
 
const moab::RangeGetMeshEntities (Remapper::IntersectionContext ctx) const
 Const overload. Get the mesh element entities corresponding to the intersection context. More...
 
moab::RangeGetMeshVertices (Remapper::IntersectionContext ctx)
 Get the mesh vertices corresponding to the intersection context. Useful for point-cloud meshes More...
 
const moab::RangeGetMeshVertices (Remapper::IntersectionContext ctx) const
 Const overload. Get the mesh vertices corresponding to the intersection context. Useful for point-cloud meshes. More...
 
moab::EntityHandleGetCoveringSet ()
 Get access to the underlying source covering set if available. Else return the source set. More...
 
void SetMeshType (Remapper::IntersectionContext ctx, const std::vector< int > &metadata)
 Set the mesh type corresponding to the intersection context More...
 
TempestMeshType GetMeshType (Remapper::IntersectionContext ctx) const
 Get the mesh type corresponding to the intersection context More...
 
int GetGlobalID (Remapper::IntersectionContext ctx, int localID)
 Get the global ID corresponding to the local entity ID according to the context (source, target, intersection) More...
 
int GetLocalID (Remapper::IntersectionContext ctx, int globalID)
 Get the local ID corresponding to the global entity ID according to the context (source, target, intersection) More...
 
moab::ErrorCode WriteTempestIntersectionMesh (std::string strOutputFileName, const bool fAllParallel, const bool fInputConcave, const bool fOutputConcave)
 Gather the overlap mesh and asssociated source/target data and write it out to disk using the TempestRemap output interface. This information can then be used with the "GenerateOfflineMap" tool in TempestRemap as needed. More...
 
moab::ErrorCode GenerateCSMeshMetadata (const int ntot_elements, moab::Range &entities, moab::Range *secondary_entities, const std::string &dofTagName, int nP)
 Generate the necessary metadata and specifically the GLL node numbering for DoFs for a CS mesh. This negates the need for running external code like HOMME to output the numbering needed for computing maps. The functionality is used through the mbconvert tool to compute processor-invariant Global DoF IDs at GLL nodes. More...
 
moab::ErrorCode GenerateMeshMetadata (Mesh &mesh, const int ntot_elements, moab::Range &entities, moab::Range *secondary_entities, const std::string dofTagName, int nP)
 Generate the necessary metadata for DoF node numbering in a given mesh. Currently, only the functionality to generate numbering on CS grids is supported. More...
 
moab::ErrorCode ComputeGlobalLocalMaps ()
 Compute the local and global IDs for elements in source/target/coverage meshes. More...
 
moab::ErrorCode GetOverlapAugmentedEntities (moab::Range &sharedGhostEntities)
 Get all the ghosted overlap entities that were accumulated to enable conservation in parallel More...
 
moab::ErrorCode assign_vertex_element_IDs (Tag idtag, EntityHandle this_set, const int dimension=2, const int start_id=1)
 Internal method to assign vertex and element global IDs if one does not exist already More...
 
ErrorCode GetIMasks (Remapper::IntersectionContext ctx, std::vector< int > &masks)
 Get the masks that could have been defined. More...
 
- Public Member Functions inherited from moab::Remapper
 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)
 

Public Attributes

const bool offlineWorkflow
 
bool meshValidate
 
bool constructEdgeMap
 

Static Public Attributes

static const bool verbose = true
 

Private Member Functions

moab::ErrorCode convert_overlap_mesh_sorted_by_source ()
 
moab::ErrorCode load_tempest_mesh_private (std::string inputFilename, Mesh **tempest_mesh)
 
moab::ErrorCode convert_mesh_to_tempest_private (Mesh *mesh, moab::EntityHandle meshset, moab::Range &entities, moab::Range *pverts)
 
moab::ErrorCode convert_tempest_mesh_private (TempestMeshType type, Mesh *mesh, moab::EntityHandle &meshset, moab::Range &entities, moab::Range *vertices)
 
moab::ErrorCode augment_overlap_set ()
 

Private Attributes

Mesh * m_source
 
TempestMeshType m_source_type
 
moab::Range m_source_entities
 
moab::Range m_source_vertices
 
moab::EntityHandle m_source_set
 
int max_source_edges
 
bool point_cloud_source
 
std::vector< int > m_source_metadata
 
Mesh * m_target
 
TempestMeshType m_target_type
 
moab::Range m_target_entities
 
moab::Range m_target_vertices
 
moab::EntityHandle m_target_set
 
int max_target_edges
 
bool point_cloud_target
 
std::vector< int > m_target_metadata
 
Mesh * m_overlap
 
TempestMeshType m_overlap_type
 
moab::Range m_overlap_entities
 
moab::EntityHandle m_overlap_set
 
std::vector< std::pair< int, int > > m_sorted_overlap_order
 
moab::Intx2MeshOnSpherembintx
 
Mesh * m_covering_source
 
moab::EntityHandle m_covering_source_set
 
moab::Range m_covering_source_entities
 
moab::Range m_covering_source_vertices
 
std::map< int, int > gid_to_lid_src
 
std::map< int, int > gid_to_lid_covsrc
 
std::map< int, int > gid_to_lid_tgt
 
std::map< int, int > lid_to_gid_src
 
std::map< int, int > lid_to_gid_covsrc
 
std::map< int, int > lid_to_gid_tgt
 
IntxAreaUtils::AreaMethod m_area_method
 
bool rrmgrids
 
bool is_parallel
 
bool is_root
 
int rank
 
int size
 

Friends

class TempestOnlineMap
 

Additional Inherited Members

- Protected Attributes inherited from moab::Remapper
Interfacem_interface
 

Detailed Description

Definition at line 36 of file TempestRemapper.hpp.

Member Enumeration Documentation

◆ TempestMeshType

Enumerator
DEFAULT 
CS 
RLL 
ICO 
ICOD 
OVERLAP_FILES 
OVERLAP_MEMORY 
OVERLAP_MOAB 

Definition at line 54 of file TempestRemapper.hpp.

55  {
56  DEFAULT = -1,
57  CS = 0,
58  RLL = 1,
59  ICO = 2,
60  ICOD = 3,
61  OVERLAP_FILES = 4,
62  OVERLAP_MEMORY = 5,
63  OVERLAP_MOAB = 6
64  };

Constructor & Destructor Documentation

◆ TempestRemapper()

moab::TempestRemapper::TempestRemapper ( moab::Interface mbInt,
bool  offlineMode = false 
)
inline

Definition at line 43 of file TempestRemapper.hpp.

44  : Remapper( mbInt ),
45 #endif
46  offlineWorkflow( offlineMode ), meshValidate( false ), constructEdgeMap( false ), m_source_type( DEFAULT ),
48  {
49  }

◆ ~TempestRemapper()

moab::TempestRemapper::~TempestRemapper ( )
virtual

Definition at line 96 of file TempestRemapper.cpp.

97 {
98  this->clear();
99 }

References clear().

Member Function Documentation

◆ assign_vertex_element_IDs()

ErrorCode moab::TempestRemapper::assign_vertex_element_IDs ( Tag  idtag,
EntityHandle  this_set,
const int  dimension = 2,
const int  start_id = 1 
)

Internal method to assign vertex and element global IDs if one does not exist already

Definition at line 1009 of file TempestRemapper.cpp.

1013 {
1014  assert( idtag );
1015 
1016  ErrorCode rval;
1017  Range entities;
1018  rval = m_interface->get_entities_by_dimension( this_set, dimension, entities );MB_CHK_SET_ERR( rval, "Failed to get entities" );
1019 
1020  if( entities.size() == 0 ) return moab::MB_SUCCESS;
1021 
1022  int idoffset = start_id;
1023  std::vector< int > gid( entities.size() );
1024  for( unsigned i = 0; i < entities.size(); ++i )
1025  gid[i] = idoffset++;
1026 
1027  rval = m_interface->tag_set_data( idtag, entities, &gid[0] );MB_CHK_ERR( rval );
1028 
1029  return moab::MB_SUCCESS;
1030 }

References entities, ErrorCode, moab::Interface::get_entities_by_dimension(), moab::Remapper::m_interface, MB_CHK_ERR, MB_CHK_SET_ERR, MB_SUCCESS, and moab::Interface::tag_set_data().

Referenced by ComputeOverlapMesh(), and main().

◆ augment_overlap_set()

moab::ErrorCode moab::TempestRemapper::augment_overlap_set ( )
private

Referenced by ComputeOverlapMesh().

◆ clear()

ErrorCode moab::TempestRemapper::clear ( )
virtual

Deallocate and clear any memory initialized in the TempestRemapper object

Definition at line 101 of file TempestRemapper.cpp.

102 {
103  // destroy all meshes
104  if( m_source )
105  {
106  delete m_source;
107  m_source = nullptr;
108  }
109  if( m_target )
110  {
111  delete m_target;
112  m_target = nullptr;
113  }
114  if( m_overlap )
115  {
116  delete m_overlap;
117  m_overlap = nullptr;
118  }
119  if( m_covering_source && size > 1 )
120  {
121  delete m_covering_source;
122  m_covering_source = nullptr;
123  }
124 
125  point_cloud_source = false;
126  point_cloud_target = false;
127 
135  gid_to_lid_src.clear();
136  gid_to_lid_tgt.clear();
137  gid_to_lid_covsrc.clear();
138  lid_to_gid_src.clear();
139  lid_to_gid_tgt.clear();
140  lid_to_gid_covsrc.clear();
141 
142  return MB_SUCCESS;
143 }

References moab::Range::clear(), gid_to_lid_covsrc, gid_to_lid_src, gid_to_lid_tgt, lid_to_gid_covsrc, lid_to_gid_src, lid_to_gid_tgt, m_covering_source, m_covering_source_entities, m_covering_source_vertices, m_overlap, m_overlap_entities, m_source, m_source_entities, m_source_vertices, m_target, m_target_entities, m_target_vertices, MB_SUCCESS, point_cloud_source, point_cloud_target, and size.

Referenced by main(), and ~TempestRemapper().

◆ ComputeGlobalLocalMaps()

ErrorCode moab::TempestRemapper::ComputeGlobalLocalMaps ( )

Compute the local and global IDs for elements in source/target/coverage meshes.

Definition at line 863 of file TempestRemapper.cpp.

864 {
865  ErrorCode rval;
866 
867  if( 0 == m_covering_source )
868  {
869  m_covering_source = new Mesh();
871  &m_covering_source_vertices );MB_CHK_SET_ERR( rval, "Can't convert source Tempest mesh" );
872 
873  // std::cout << "ComputeGlobalLocalMaps: " << rank << ", "
874  // << " covering entities = [" << m_covering_source_vertices.size() << ", "
875  // << m_covering_source_entities.size() << "]\n";
876  }
877 #ifdef VERBOSE
878  m_covering_source->Write( std::string( "coverage_TR_p" + std::to_string( rank ) + ".g" ) );
879  m_target->Write( std::string( "target_TR_p" + std::to_string( rank ) + ".g" ) );
880 #endif
881  gid_to_lid_src.clear();
882  lid_to_gid_src.clear();
883  gid_to_lid_covsrc.clear();
884  lid_to_gid_covsrc.clear();
885  gid_to_lid_tgt.clear();
886  lid_to_gid_tgt.clear();
887  {
888  Tag gidtag = m_interface->globalId_tag();
889 
890  std::vector< int > gids;
891  if( point_cloud_source )
892  {
893  gids.resize( m_covering_source_vertices.size(), -1 );
894  rval = m_interface->tag_get_data( gidtag, m_covering_source_vertices, &gids[0] );MB_CHK_ERR( rval );
895  }
896  else
897  {
898  gids.resize( m_covering_source_entities.size(), -1 );
899  rval = m_interface->tag_get_data( gidtag, m_covering_source_entities, &gids[0] );MB_CHK_ERR( rval );
900  }
901  for( unsigned ie = 0; ie < gids.size(); ++ie )
902  {
903  gid_to_lid_covsrc[gids[ie]] = ie;
904  lid_to_gid_covsrc[ie] = gids[ie];
905  }
906 
907  if( point_cloud_source )
908  {
909  gids.resize( m_source_vertices.size(), -1 );
910  rval = m_interface->tag_get_data( gidtag, m_source_vertices, &gids[0] );MB_CHK_ERR( rval );
911  }
912  else
913  {
914  gids.resize( m_source_entities.size(), -1 );
915  rval = m_interface->tag_get_data( gidtag, m_source_entities, &gids[0] );MB_CHK_ERR( rval );
916  }
917  for( unsigned ie = 0; ie < gids.size(); ++ie )
918  {
919  gid_to_lid_src[gids[ie]] = ie;
920  lid_to_gid_src[ie] = gids[ie];
921  }
922 
923  if( point_cloud_target )
924  {
925  gids.resize( m_target_vertices.size(), -1 );
926  rval = m_interface->tag_get_data( gidtag, m_target_vertices, &gids[0] );MB_CHK_ERR( rval );
927  }
928  else
929  {
930  gids.resize( m_target_entities.size(), -1 );
931  rval = m_interface->tag_get_data( gidtag, m_target_entities, &gids[0] );MB_CHK_ERR( rval );
932  }
933  for( unsigned ie = 0; ie < gids.size(); ++ie )
934  {
935  gid_to_lid_tgt[gids[ie]] = ie;
936  lid_to_gid_tgt[ie] = gids[ie];
937  }
938  }
939 
940  return MB_SUCCESS;
941 }

References convert_mesh_to_tempest_private(), ErrorCode, gid_to_lid_covsrc, gid_to_lid_src, gid_to_lid_tgt, moab::Interface::globalId_tag(), lid_to_gid_covsrc, lid_to_gid_src, lid_to_gid_tgt, m_covering_source, m_covering_source_entities, m_covering_source_set, m_covering_source_vertices, moab::Remapper::m_interface, m_source_entities, m_source_vertices, m_target, m_target_entities, m_target_vertices, MB_CHK_ERR, MB_CHK_SET_ERR, MB_SUCCESS, point_cloud_source, point_cloud_target, rank, moab::Range::size(), and moab::Interface::tag_get_data().

Referenced by ComputeOverlapMesh().

◆ ComputeOverlapMesh()

ErrorCode moab::TempestRemapper::ComputeOverlapMesh ( bool  kdtree_search = true,
bool  use_tempest = false 
)

Compute the intersection mesh between the source and target grids that have been instantiated in the Remapper. This function invokes the parallel advancing-front intersection algorithm internally for spherical meshes and can handle arbitrary unstructured grids (CS, RLL, ICO, MPAS) with and without holes.

Definition at line 1355 of file TempestRemapper.cpp.

1356 {
1357  ErrorCode rval;
1358  const bool outputEnabled = ( this->rank == 0 );
1359  moab::DebugOutput dbgprint( std::cout, this->rank, 0 );
1360  dbgprint.set_prefix( "[ComputeOverlapMesh]: " );
1361 
1362  // const double radius = 1.0 /*2.0*acos(-1.0)*/;
1363  // const double boxeps = 0.1;
1364  // Create the intersection on the sphere object and set up necessary parameters
1365 
1366  // First, split based on whether to use Tempest or MOAB
1367  // If Tempest
1368  // 1) Check for valid Mesh and pointers to objects for source/target
1369  // 2) Invoke GenerateOverlapWithMeshes routine from Tempest library
1370  // If MOAB
1371  // 1) Check for valid source and target meshsets (and entities)
1372  // 2) Build processor bounding boxes and construct a covering set
1373  // 3) Perform intersection between the source (covering) and target entities
1374  if( use_tempest )
1375  {
1376  // Now let us construct the overlap mesh, by calling TempestRemap interface directly
1377  // For the overlap method, choose between: "fuzzy", "exact" or "mixed"
1378  assert( m_source != nullptr );
1379  assert( m_target != nullptr );
1380  if( m_overlap != nullptr ) delete m_overlap;
1381  m_overlap = new Mesh();
1382  bool concaveMeshA = false, concaveMeshB = false;
1383  int err = GenerateOverlapWithMeshes( *m_covering_source, *m_target, *m_overlap, "" /*outFilename*/, "Netcdf4",
1384  "exact", concaveMeshA, concaveMeshB, false );
1385  if( err )
1386  {
1387  MB_CHK_SET_ERR( MB_FAILURE, "TempestRemap: Can't compute the intersection of meshes on the sphere" );
1388  }
1389  }
1390  else
1391  {
1392  Tag gidtag = m_interface->globalId_tag();
1393  moab::EntityHandle subrange[2];
1394  int gid[2];
1395  if( m_source_entities.size() > 1 )
1396  { // Let us do some sanity checking to fix ID if they have are setup incorrectly
1397  subrange[0] = m_source_entities[0];
1398  subrange[1] = m_source_entities[1];
1399  rval = m_interface->tag_get_data( gidtag, subrange, 2, gid );MB_CHK_ERR( rval );
1400 
1401  // Check if we need to impose Global ID numbering for vertices and elements. This may be
1402  // needed if we load the meshes from exodus or some other formats that may not have a
1403  // numbering forced.
1404  if( gid[0] + gid[1] == 0 ) // this implies first two elements have GID = 0
1405  {
1406 #ifdef MOAB_HAVE_MPI
1407  rval = m_pcomm->assign_global_ids( m_source_set, 2, 1, false, true, false );MB_CHK_ERR( rval );
1408 #else
1409  rval = this->assign_vertex_element_IDs( gidtag, m_source_set, 2, 1 );MB_CHK_ERR( rval );
1410 #endif
1411  }
1412  }
1413  if( m_target_entities.size() > 1 )
1414  {
1415  subrange[0] = m_target_entities[0];
1416  subrange[1] = m_target_entities[1];
1417  rval = m_interface->tag_get_data( gidtag, subrange, 2, gid );MB_CHK_ERR( rval );
1418 
1419  // Check if we need to impose Global ID numbering for vertices and elements. This may be
1420  // needed if we load the meshes from exodus or some other formats that may not have a
1421  // numbering forced.
1422  if( gid[0] + gid[1] == 0 ) // this implies first two elements have GID = 0
1423  {
1424 #ifdef MOAB_HAVE_MPI
1425  rval = m_pcomm->assign_global_ids( m_target_set, 2, 1, false, true, false );MB_CHK_ERR( rval );
1426 #else
1427  rval = this->assign_vertex_element_IDs( gidtag, m_target_set, 2, 1 );MB_CHK_ERR( rval );
1428 #endif
1429  }
1430  }
1431 
1432  // Now perform the actual parallel intersection between the source and the target meshes
1433  if( kdtree_search )
1434  {
1435  if( outputEnabled ) dbgprint.printf( 0, "Computing intersection mesh with the Kd-tree search algorithm" );
1436  rval = mbintx->intersect_meshes_kdtree( m_covering_source_set, m_target_set, m_overlap_set );MB_CHK_SET_ERR( rval, "Can't compute the intersection of meshes on the sphere with brute-force" );
1437  }
1438  else
1439  {
1440  if( outputEnabled )
1441  dbgprint.printf( 0, "Computing intersection mesh with the advancing-front propagation algorithm" );
1442  rval = mbintx->intersect_meshes( m_covering_source_set, m_target_set, m_overlap_set );MB_CHK_SET_ERR( rval, "Can't compute the intersection of meshes on the sphere" );
1443  }
1444 
1445 #ifdef MOAB_HAVE_MPI
1446  if( is_parallel || rrmgrids )
1447  {
1448 #ifdef VERBOSE
1449  std::stringstream ffc, fft, ffo;
1450  ffc << "cover_" << rank << ".h5m";
1451  fft << "target_" << rank << ".h5m";
1452  ffo << "intx_" << rank << ".h5m";
1453  rval = m_interface->write_mesh( ffc.str().c_str(), &m_covering_source_set, 1 );MB_CHK_ERR( rval );
1454  rval = m_interface->write_mesh( fft.str().c_str(), &m_target_set, 1 );MB_CHK_ERR( rval );
1455  rval = m_interface->write_mesh( ffo.str().c_str(), &m_overlap_set, 1 );MB_CHK_ERR( rval );
1456 #endif
1457  // because we do not want to work with elements in coverage set that do not participate
1458  // in intersection, remove them from the coverage set we will not delete them yet, just
1459  // remove from the set !
1460  if( !point_cloud_target )
1461  {
1462  Range covEnts;
1464  Tag gidtag = m_interface->globalId_tag();
1465 
1466  std::map< int, int > loc_gid_to_lid_covsrc;
1467  std::vector< int > gids( covEnts.size(), -1 );
1468  rval = m_interface->tag_get_data( gidtag, covEnts, &gids[0] );MB_CHK_ERR( rval );
1469  for( unsigned ie = 0; ie < gids.size(); ++ie )
1470  {
1471  loc_gid_to_lid_covsrc[gids[ie]] = ie;
1472  }
1473 
1474  Range intxCov, intxCells;
1475  Tag srcParentTag;
1476  rval = m_interface->tag_get_handle( "SourceParent", srcParentTag );MB_CHK_ERR( rval );
1477  rval = m_interface->get_entities_by_dimension( m_overlap_set, 2, intxCells );MB_CHK_ERR( rval );
1478  for( Range::iterator it = intxCells.begin(); it != intxCells.end(); it++ )
1479  {
1480  EntityHandle intxCell = *it;
1481  int srcParent = -1;
1482  rval = m_interface->tag_get_data( srcParentTag, &intxCell, 1, &srcParent );MB_CHK_ERR( rval );
1483  // if (is_root) std::cout << "Found intersecting element: " << srcParent << ",
1484  // " << gid_to_lid_covsrc[srcParent] << "\n";
1485  assert( srcParent >= 0 );
1486  intxCov.insert( covEnts[loc_gid_to_lid_covsrc[srcParent]] );
1487  }
1488 
1489  Range notNeededCovCells = moab::subtract( covEnts, intxCov );
1490 
1491  // now let us get only the covering entities that participate in intersection mesh
1492  covEnts = moab::subtract( covEnts, notNeededCovCells );
1493 
1494  // in order for getting 1-ring neighborhood, we need to be sure that the adjacencies are updated (created)
1495  if( false )
1496  {
1497  // update all adjacency list
1498  Core* mb = dynamic_cast< Core* >( m_interface );
1499  AEntityFactory* adj_fact = mb->a_entity_factory();
1500  if( !adj_fact->vert_elem_adjacencies() )
1501  adj_fact->create_vert_elem_adjacencies();
1502  else
1503  {
1504  for( Range::iterator it = covEnts.begin(); it != covEnts.end(); ++it )
1505  {
1506  EntityHandle eh = *it;
1507  const EntityHandle* conn = nullptr;
1508  int num_nodes = 0;
1509  rval = mb->get_connectivity( eh, conn, num_nodes );MB_CHK_ERR( rval );
1510  adj_fact->notify_create_entity( eh, conn, num_nodes );
1511  }
1512  }
1513 
1514  // next, for elements on the edge of the partition, get one ring adjacencies
1515  Skinner skinner( mb );
1516  Range skin;
1517  rval = skinner.find_skin( m_covering_source_set, covEnts, false, skin );MB_CHK_SET_ERR( rval, "Unable to find skin" );
1518  for( Range::iterator it = skin.begin(); it != skin.end(); ++it )
1519  {
1520  const EntityHandle* conn = nullptr;
1521  int len = 0;
1522  rval = mb->get_connectivity( *it, conn, len, false );MB_CHK_ERR( rval );
1523  for( int ie = 0; ie < len; ++ie )
1524  {
1525  std::vector< EntityHandle > adjacent_entities;
1526  rval = adj_fact->get_adjacencies( conn[ie], 2, false, adjacent_entities );MB_CHK_ERR( rval );
1527  for( auto ent : adjacent_entities )
1528  notNeededCovCells.erase( ent ); // ent is part of the 1-ring neighborhood
1529  }
1530  }
1531 
1532  rval = m_interface->write_mesh(
1533  std::string( "sourcecoveragemesh_p" + std::to_string( rank ) + ".h5m" ).c_str(),
1534  &m_covering_source_set, 1 );MB_CHK_ERR( rval );
1535  }
1536 
1537  // remove now from coverage set the cells that are not needed
1538  // rval = m_interface->remove_entities( m_covering_source_set, notNeededCovCells );MB_CHK_ERR( rval );
1539 
1540  // Need to loop over covEnts now and ensure at least N-rings are available dependign on whether bilinear (1) or
1541  // high order FV (p) methods are being used for map generation. For bilinear/FV(1): need 1 ring, and for FV(p)
1542  // need p=ring neighborhood to recover exact conservation and consistency wrt serial/parallel.
1543 #ifdef VERBOSE
1544  std::cout << " total participating elements in the covering set: " << intxCov.size() << "\n";
1545  std::cout << " remove from coverage set elements that are not intersected: " << notNeededCovCells.size()
1546  << "\n";
1547 #endif
1548  if( size > 1 )
1549  {
1550  // some source elements cover multiple target partitions; the conservation logic
1551  // requires to know all overlap elements for a source element; they need to be
1552  // communicated from the other target partitions
1553  //
1554  // so first we have to identify source (coverage) elements that cover multiple
1555  // target partitions
1556 
1557  // we will then mark the source, we will need to migrate the overlap elements
1558  // that cover this to the original source for the source element; then
1559  // distribute the overlap elements to all processors that have the coverage mesh
1560  // used
1561 
1562  rval = augment_overlap_set();MB_CHK_ERR( rval );
1563  }
1564  }
1565  }
1566 #endif
1567 
1568  // Fix any inconsistencies in the overlap mesh
1569  {
1570  IntxAreaUtils areaAdaptor;
1572  rval = areaAdaptor.positive_orientation( m_interface, m_overlap_set, 1.0 /*radius*/ );MB_CHK_ERR( rval );
1573  }
1574 
1575  // Now let us re-convert the MOAB mesh back to Tempest representation
1576  rval = this->ComputeGlobalLocalMaps();MB_CHK_ERR( rval );
1577 
1578  rval = this->convert_overlap_mesh_sorted_by_source();MB_CHK_ERR( rval );
1579 
1580  // free the memory
1581  delete mbintx;
1582  }
1583 
1584  return MB_SUCCESS;
1585 }

References assign_vertex_element_IDs(), augment_overlap_set(), moab::Range::begin(), ComputeGlobalLocalMaps(), convert_overlap_mesh_sorted_by_source(), moab::AEntityFactory::create_vert_elem_adjacencies(), dbgprint, moab::Range::end(), moab::Range::erase(), ErrorCode, moab::Skinner::find_skin(), moab::IntxUtils::fix_degenerate_quads(), moab::AEntityFactory::get_adjacencies(), moab::Interface::get_entities_by_dimension(), moab::Interface::globalId_tag(), moab::Range::insert(), moab::Intx2Mesh::intersect_meshes(), moab::Intx2Mesh::intersect_meshes_kdtree(), is_parallel, m_covering_source, m_covering_source_set, moab::Remapper::m_interface, m_overlap, m_overlap_set, m_source, m_source_entities, m_source_set, m_target, m_target_entities, m_target_set, mb, MB_CHK_ERR, MB_CHK_SET_ERR, MB_SUCCESS, mbintx, moab::AEntityFactory::notify_create_entity(), point_cloud_target, moab::IntxAreaUtils::positive_orientation(), rank, rrmgrids, moab::DebugOutput::set_prefix(), moab::Range::size(), size, moab::subtract(), moab::Interface::tag_get_data(), moab::Interface::tag_get_handle(), moab::AEntityFactory::vert_elem_adjacencies(), and moab::Interface::write_mesh().

Referenced by main().

◆ ConstructCoveringSet()

ErrorCode moab::TempestRemapper::ConstructCoveringSet ( double  tolerance = 1e-8,
double  radius_src = 1.0,
double  radius_tgt = 1.0,
double  boxeps = 0.1,
bool  regional_mesh = false,
bool  gnomonic = true 
)

Construct a source covering mesh such that it completely encompasses the target grid in parallel. This operation is critical to ensure that the parallel advancing-front intersection algorithm can the intersection mesh only locally without any process communication.

Definition at line 1223 of file TempestRemapper.cpp.

1229 {
1230  ErrorCode rval;
1231 
1232  rrmgrids = regional_mesh;
1233  moab::Range local_verts;
1234 
1235  // Initialize intersection context
1237 
1239  mbintx->set_radius_source_mesh( radius_src );
1240  mbintx->set_radius_destination_mesh( radius_tgt );
1241  mbintx->set_box_error( boxeps );
1242 #ifdef MOAB_HAVE_MPI
1243  mbintx->set_parallel_comm( m_pcomm );
1244 #endif
1245 
1246  // compute the maxiumum edges in elements comprising source and target mesh
1248 
1251 
1252  // Note: lots of communication possible, if mesh is distributed very differently
1253 #ifdef MOAB_HAVE_MPI
1254  if( is_parallel )
1255  {
1256  rval = mbintx->build_processor_euler_boxes( m_target_set, local_verts, gnomonic );MB_CHK_ERR( rval );
1257 
1258  rval = m_interface->create_meshset( moab::MESHSET_SET, m_covering_source_set );MB_CHK_SET_ERR( rval, "Can't create new set" );
1259 
1260  rval = mbintx->construct_covering_set( m_source_set, m_covering_source_set, gnomonic );MB_CHK_ERR( rval );
1261  }
1262  else
1263  {
1264 #endif
1265  if( rrmgrids )
1266  {
1267  rval = m_interface->create_meshset( moab::MESHSET_SET, m_covering_source_set );MB_CHK_SET_ERR( rval, "Can't create new set" );
1268 
1269  double tolerance = 1e-6, btolerance = 1e-3;
1271  moab::Range targetVerts;
1272 
1273  rval = m_interface->get_connectivity( m_target_entities, targetVerts, true );MB_CHK_ERR( rval );
1274 
1275  rval = tree.build_tree( m_source_entities, &m_source_set );MB_CHK_ERR( rval );
1276 
1277  for( unsigned ie = 0; ie < targetVerts.size(); ++ie )
1278  {
1279  EntityHandle el = targetVerts[ie], leaf;
1280  double point[3];
1281 
1282  // Get the element centroid to be queried
1283  rval = m_interface->get_coords( &el, 1, point );MB_CHK_ERR( rval );
1284 
1285  // Search for the closest source element in the master mesh corresponding
1286  // to the target element centroid in the slave mesh
1287  rval = tree.point_search( point, leaf, tolerance, btolerance );MB_CHK_ERR( rval );
1288 
1289  if( leaf == 0 )
1290  {
1291  leaf = m_source_set; // no hint
1292  }
1293 
1294  std::vector< moab::EntityHandle > leaf_elems;
1295  // We only care about the dimension that the user specified.
1296  // MOAB partitions are ordered by elements anyway.
1297  rval = m_interface->get_entities_by_dimension( leaf, 2, leaf_elems );MB_CHK_ERR( rval );
1298 
1299  if( !leaf_elems.size() )
1300  {
1301  // std::cout << ie << ": " << " No leaf elements found." << std::endl;
1302  continue;
1303  }
1304 
1305  // Now get the master element centroids so that we can compute
1306  // the minimum distance to the target point
1307  std::vector< double > centroids( leaf_elems.size() * 3 );
1308  rval = m_interface->get_coords( &leaf_elems[0], leaf_elems.size(), &centroids[0] );MB_CHK_ERR( rval );
1309 
1310  double dist = 1e5;
1311  int pinelem = -1;
1312  for( size_t il = 0; il < leaf_elems.size(); ++il )
1313  {
1314  const double* centroid = &centroids[il * 3];
1315  const double locdist = std::pow( point[0] - centroid[0], 2 ) +
1316  std::pow( point[1] - centroid[1], 2 ) +
1317  std::pow( point[2] - centroid[2], 2 );
1318 
1319  if( locdist < dist )
1320  {
1321  dist = locdist;
1322  pinelem = il;
1323  m_covering_source_entities.insert( leaf_elems[il] );
1324  }
1325  }
1326 
1327  if( pinelem < 0 )
1328  {
1329  std::cout << ie
1330  << ": [Error] - Could not find a minimum distance within the leaf "
1331  "nodes. Dist = "
1332  << dist << std::endl;
1333  }
1334  }
1335  // rval = tree.reset_tree();MB_CHK_ERR(rval);
1336  std::cout << "[INFO] - Total covering source entities = " << m_covering_source_entities.size() << std::endl;
1338  }
1339  else
1340  {
1343  m_covering_source_entities = m_source_entities; // this is a tempest mesh object; careful about
1344  // incrementing the reference?
1345  m_covering_source_vertices = m_source_vertices; // this is a tempest mesh object; careful about
1346  // incrementing the reference?
1347  }
1348 #ifdef MOAB_HAVE_MPI
1349  }
1350 #endif
1351 
1352  return rval;
1353 }

References moab::Interface::add_entities(), moab::AdaptiveKDTree::build_tree(), moab::Interface::create_meshset(), ErrorCode, moab::Intx2Mesh::FindMaxEdges(), moab::Interface::get_connectivity(), moab::Interface::get_coords(), moab::Interface::get_entities_by_dimension(), moab::Range::insert(), is_parallel, m_covering_source, m_covering_source_entities, m_covering_source_set, m_covering_source_vertices, moab::Remapper::m_interface, m_source, m_source_entities, m_source_set, m_source_vertices, m_target_entities, m_target_set, moab::Intx2Mesh::max_edges_1, moab::Intx2Mesh::max_edges_2, max_source_edges, max_target_edges, MB_CHK_ERR, MB_CHK_SET_ERR, mbintx, MESHSET_SET, moab::AdaptiveKDTree::point_search(), rrmgrids, moab::Intx2Mesh::set_box_error(), moab::Intx2Mesh::set_error_tolerance(), moab::Intx2MeshOnSphere::set_radius_destination_mesh(), moab::Intx2MeshOnSphere::set_radius_source_mesh(), moab::Range::size(), and moab::tolerance.

Referenced by main().

◆ convert_mesh_to_tempest_private()

ErrorCode moab::TempestRemapper::convert_mesh_to_tempest_private ( Mesh *  mesh,
moab::EntityHandle  meshset,
moab::Range entities,
moab::Range pverts 
)
private

Definition at line 580 of file TempestRemapper.cpp.

584 {
585  ErrorCode rval;
586  Range verts;
587 
588  NodeVector& nodes = mesh->nodes;
589  FaceVector& faces = mesh->faces;
590 
591  elems.clear();
592  rval = m_interface->get_entities_by_dimension( mesh_set, 2, elems );MB_CHK_ERR( rval );
593 
594  const size_t nelems = elems.size();
595 
596  // resize the number of elements in Tempest mesh
597  faces.resize( nelems );
598 
599  // let us now get the vertices from all the elements
600  rval = m_interface->get_connectivity( elems, verts );MB_CHK_ERR( rval );
601  if( verts.size() == 0 )
602  {
603  rval = m_interface->get_entities_by_dimension( mesh_set, 0, verts );MB_CHK_ERR( rval );
604  }
605  // assert(verts.size() > 0); // If not, this may be an invalid mesh ! possible for unbalanced loads
606 
607  std::map< EntityHandle, int > indxMap;
608  bool useRange = true;
609  if( verts.compactness() > 0.01 )
610  {
611  int j = 0;
612  for( Range::iterator it = verts.begin(); it != verts.end(); it++ )
613  indxMap[*it] = j++;
614  useRange = false;
615  }
616 
617  std::vector< int > globIds( nelems );
618 
620  rval = m_interface->tag_get_data( gid, elems, &globIds[0] );MB_CHK_ERR( rval );
621  // initialize original index locations
622  std::vector< size_t > sortedIdx( nelems );
623  std::iota( sortedIdx.begin(), sortedIdx.end(), 0 );
624  // sort indexes based on comparing values in v, using std::stable_sort instead of std::sort
625  // to avoid unnecessary index re-orderings when v contains elements of equal values
626  std::sort( sortedIdx.begin(), sortedIdx.end(),
627  [&globIds]( size_t i1, size_t i2 ) { return globIds[i1] < globIds[i2]; } );
628 
629  for( unsigned iface = 0; iface < nelems; ++iface )
630  {
631  Face& face = faces[iface];
632  EntityHandle ehandle = ( offlineWorkflow ? elems[sortedIdx[iface]] : elems[iface] );
633 
634  // get the connectivity for each edge
635  const EntityHandle* connectface;
636  int nnodesf;
637  rval = m_interface->get_connectivity( ehandle, connectface, nnodesf );MB_CHK_ERR( rval );
638  // account for padded polygons
639  while( connectface[nnodesf - 2] == connectface[nnodesf - 1] && nnodesf > 3 )
640  nnodesf--;
641 
642  face.edges.resize( nnodesf );
643  for( int iverts = 0; iverts < nnodesf; ++iverts )
644  {
645  int indx = ( useRange ? verts.index( connectface[iverts] ) : indxMap[connectface[iverts]] );
646  assert( indx >= 0 );
647  face.SetNode( iverts, indx );
648  }
649  }
650 
651  unsigned nnodes = verts.size();
652  nodes.resize( nnodes );
653 
654  // Set the data for the vertices
655  std::vector< double > coordx( nnodes ), coordy( nnodes ), coordz( nnodes );
656  rval = m_interface->get_coords( verts, &coordx[0], &coordy[0], &coordz[0] );MB_CHK_ERR( rval );
657  for( unsigned inode = 0; inode < nnodes; ++inode )
658  {
659  Node& node = nodes[inode];
660  node.x = coordx[inode];
661  node.y = coordy[inode];
662  node.z = coordz[inode];
663  }
664  coordx.clear();
665  coordy.clear();
666  coordz.clear();
667 
668  mesh->RemoveZeroEdges();
669  mesh->RemoveCoincidentNodes();
670 
671  // Generate reverse node array and edge map
672  if( constructEdgeMap ) mesh->ConstructEdgeMap( false );
673  // mesh->ConstructReverseNodeArray();
674 
675  // mesh->Validate();
676 
677  if( pverts )
678  {
679  pverts->clear();
680  *pverts = verts;
681  }
682  verts.clear();
683 
684  return MB_SUCCESS;
685 }

References moab::Range::begin(), moab::Range::clear(), moab::Range::compactness(), constructEdgeMap, moab::Range::end(), ErrorCode, moab::Interface::get_connectivity(), moab::Interface::get_coords(), moab::Interface::get_entities_by_dimension(), moab::Interface::globalId_tag(), iface, moab::Range::index(), moab::Remapper::m_interface, MB_CHK_ERR, MB_SUCCESS, offlineWorkflow, moab::Range::size(), and moab::Interface::tag_get_data().

Referenced by ComputeGlobalLocalMaps(), and ConvertMeshToTempest().

◆ convert_overlap_mesh_sorted_by_source()

ErrorCode moab::TempestRemapper::convert_overlap_mesh_sorted_by_source ( )
private

Definition at line 737 of file TempestRemapper.cpp.

738 {
739  ErrorCode rval;
740 
743 
744  // Allocate for the overlap mesh
745  if( !m_overlap ) m_overlap = new Mesh();
746 
747  size_t n_overlap_entitites = m_overlap_entities.size();
748 
749  std::vector< std::pair< int, int > > sorted_overlap_order( n_overlap_entitites );
750  {
751  Tag srcParentTag, tgtParentTag;
752  rval = m_interface->tag_get_handle( "SourceParent", srcParentTag );MB_CHK_ERR( rval );
753  rval = m_interface->tag_get_handle( "TargetParent", tgtParentTag );MB_CHK_ERR( rval );
754  // Overlap mesh: resize the source and target connection arrays
755  m_overlap->vecTargetFaceIx.resize( n_overlap_entitites );
756  m_overlap->vecSourceFaceIx.resize( n_overlap_entitites );
757 
758  // Overlap mesh: resize the source and target connection arrays
759  std::vector< int > rbids_src( n_overlap_entitites ), rbids_tgt( n_overlap_entitites );
760  rval = m_interface->tag_get_data( srcParentTag, m_overlap_entities, &rbids_src[0] );MB_CHK_ERR( rval );
761  rval = m_interface->tag_get_data( tgtParentTag, m_overlap_entities, &rbids_tgt[0] );MB_CHK_ERR( rval );
762  for( size_t ix = 0; ix < n_overlap_entitites; ++ix )
763  {
764  sorted_overlap_order[ix].first =
765  ( gid_to_lid_covsrc.size() ? gid_to_lid_covsrc[rbids_src[ix]] : rbids_src[ix] );
766  sorted_overlap_order[ix].second = ix;
767  }
768  std::sort( sorted_overlap_order.begin(), sorted_overlap_order.end(), IntPairComparator );
769  // sorted_overlap_order[ie].second , ie=0,nOverlap-1 is the order such that overlap elems
770  // are ordered by source parent
771 
772  std::vector< int > ghFlags;
773  if( is_parallel && size > 1 )
774  {
775  Tag ghostTag;
776  ghFlags.resize( n_overlap_entitites );
777  rval = m_interface->tag_get_handle( "ORIG_PROC", ghostTag );MB_CHK_ERR( rval );
778  rval = m_interface->tag_get_data( ghostTag, m_overlap_entities, &ghFlags[0] );MB_CHK_ERR( rval );
779  }
780  for( unsigned ie = 0; ie < n_overlap_entitites; ++ie )
781  {
782  int ix = sorted_overlap_order[ie].second; // original index of the element
783  m_overlap->vecSourceFaceIx[ie] =
784  ( gid_to_lid_covsrc.size() ? gid_to_lid_covsrc[rbids_src[ix]] : rbids_src[ix] - 1 );
785  if( is_parallel && size > 1 && ghFlags[ix] >= 0 ) // it means it is a ghost overlap element
786  m_overlap->vecTargetFaceIx[ie] = -1; // this should not participate in smat!
787  else
788  m_overlap->vecTargetFaceIx[ie] =
789  ( gid_to_lid_tgt.size() ? gid_to_lid_tgt[rbids_tgt[ix]] : rbids_tgt[ix] - 1 );
790  }
791  }
792 
793  FaceVector& faces = m_overlap->faces;
794  faces.resize( n_overlap_entitites );
795 
796  Range verts;
797  // let us now get the vertices from all the elements
798  rval = m_interface->get_connectivity( m_overlap_entities, verts );MB_CHK_ERR( rval );
799  // std::cout << "Vertices size = " << verts.size() << " , psize = " << verts.psize() << ",
800  // compactness = " << verts.compactness() << std::endl;
801 
802  std::map< EntityHandle, int > indxMap;
803  bool useRange = true;
804  if( verts.compactness() > 0.01 )
805  {
806  int j = 0;
807  for( Range::iterator it = verts.begin(); it != verts.end(); ++it )
808  indxMap[*it] = j++;
809  useRange = false;
810  }
811 
812  for( unsigned ifac = 0; ifac < m_overlap_entities.size(); ++ifac )
813  {
814  const unsigned iface = sorted_overlap_order[ifac].second;
815  Face& face = faces[ifac];
817 
818  // get the connectivity for each edge
819  const EntityHandle* connectface;
820  int nnodesf;
821  rval = m_interface->get_connectivity( ehandle, connectface, nnodesf );MB_CHK_ERR( rval );
822 
823  face.edges.resize( nnodesf );
824  for( int iverts = 0; iverts < nnodesf; ++iverts )
825  {
826  int indx = ( useRange ? verts.index( connectface[iverts] ) : indxMap[connectface[iverts]] );
827  assert( indx >= 0 );
828  face.SetNode( iverts, indx );
829  }
830  }
831 
832  unsigned nnodes = verts.size();
833  NodeVector& nodes = m_overlap->nodes;
834  nodes.resize( nnodes );
835 
836  // Set the data for the vertices
837  std::vector< double > coordx( nnodes ), coordy( nnodes ), coordz( nnodes );
838  rval = m_interface->get_coords( verts, &coordx[0], &coordy[0], &coordz[0] );MB_CHK_ERR( rval );
839  for( unsigned inode = 0; inode < nnodes; ++inode )
840  {
841  Node& node = nodes[inode];
842  node.x = coordx[inode];
843  node.y = coordy[inode];
844  node.z = coordz[inode];
845  }
846  coordx.clear();
847  coordy.clear();
848  coordz.clear();
849  verts.clear();
850 
851  m_overlap->RemoveZeroEdges();
852  m_overlap->RemoveCoincidentNodes( false );
853 
854  // Generate reverse node array and edge map
855  // if ( constructEdgeMap ) m_overlap->ConstructEdgeMap(false);
856  // m_overlap->ConstructReverseNodeArray();
857 
858  // m_overlap->Validate();
859  return MB_SUCCESS;
860 }

References moab::Range::begin(), moab::Range::clear(), moab::Range::compactness(), moab::Range::end(), ErrorCode, moab::Interface::get_connectivity(), moab::Interface::get_coords(), moab::Interface::get_entities_by_dimension(), gid_to_lid_covsrc, gid_to_lid_tgt, iface, moab::Range::index(), moab::IntPairComparator(), is_parallel, moab::Remapper::m_interface, m_overlap, m_overlap_entities, m_overlap_set, MB_CHK_ERR, MB_SUCCESS, moab::Range::size(), size, moab::Interface::tag_get_data(), and moab::Interface::tag_get_handle().

Referenced by ComputeOverlapMesh(), and ConvertMeshToTempest().

◆ convert_tempest_mesh_private()

ErrorCode moab::TempestRemapper::convert_tempest_mesh_private ( TempestMeshType  type,
Mesh *  mesh,
moab::EntityHandle meshset,
moab::Range entities,
moab::Range vertices 
)
private

Definition at line 250 of file TempestRemapper.cpp.

255 {
256  ErrorCode rval;
257 
258  const bool outputEnabled = ( TempestRemapper::verbose && is_root );
259  const NodeVector& nodes = mesh->nodes;
260  const FaceVector& faces = mesh->faces;
261 
262  moab::DebugOutput dbgprint( std::cout, this->rank, 0 );
263  dbgprint.set_prefix( "[TempestToMOAB]: " );
264 
265  ReadUtilIface* iface;
266  rval = m_interface->query_interface( iface );MB_CHK_SET_ERR( rval, "Can't get reader interface" );
267 
268  Tag gidTag = m_interface->globalId_tag();
269 
270  // Set the data for the vertices
271  std::vector< double* > arrays;
272  std::vector< int > gidsv( nodes.size() );
273  EntityHandle startv;
274  rval = iface->get_node_coords( 3, nodes.size(), 0, startv, arrays );MB_CHK_SET_ERR( rval, "Can't get node coords" );
275  for( unsigned iverts = 0; iverts < nodes.size(); ++iverts )
276  {
277  const Node& node = nodes[iverts];
278  arrays[0][iverts] = node.x;
279  arrays[1][iverts] = node.y;
280  arrays[2][iverts] = node.z;
281  gidsv[iverts] = iverts + 1;
282  }
283  Range mbverts( startv, startv + nodes.size() - 1 );
284  rval = m_interface->add_entities( mesh_set, mbverts );MB_CHK_SET_ERR( rval, "Can't add entities" );
285  rval = m_interface->tag_set_data( gidTag, mbverts, &gidsv[0] );MB_CHK_SET_ERR( rval, "Can't set global_id tag" );
286 
287  gidsv.clear();
288  entities.clear();
289 
290  Tag srcParentTag, tgtParentTag;
291  std::vector< int > srcParent( faces.size(), -1 ), tgtParent( faces.size(), -1 );
292  std::vector< int > gidse( faces.size(), -1 );
293  bool storeParentInfo = ( mesh->vecSourceFaceIx.size() > 0 );
294 
295  if( storeParentInfo )
296  {
297  int defaultInt = -1;
298  rval = m_interface->tag_get_handle( "TargetParent", 1, MB_TYPE_INTEGER, tgtParentTag,
299  MB_TAG_DENSE | MB_TAG_CREAT, &defaultInt );MB_CHK_SET_ERR( rval, "can't create positive tag" );
300 
301  rval = m_interface->tag_get_handle( "SourceParent", 1, MB_TYPE_INTEGER, srcParentTag,
302  MB_TAG_DENSE | MB_TAG_CREAT, &defaultInt );MB_CHK_SET_ERR( rval, "can't create negative tag" );
303  }
304 
305  // Let us first perform a full pass assuming arbitrary polygons. This is especially true for
306  // overlap meshes.
307  // 1. We do a first pass over faces, decipher edge size and group into categories based on
308  // element type
309  // 2. Next we loop over type, and add blocks of elements into MOAB
310  // 3. For each block within the loop, also update the connectivity of elements.
311  {
312  if( outputEnabled )
313  dbgprint.printf( 0, "..Mesh size: Nodes [%zu] Elements [%zu].\n", nodes.size(), faces.size() );
314  std::vector< EntityHandle > mbcells( faces.size() );
315  unsigned ntris = 0, nquads = 0, npolys = 0;
316  std::vector< EntityHandle > conn( 16 );
317 
318  for( unsigned ifaces = 0; ifaces < faces.size(); ++ifaces )
319  {
320  const Face& face = faces[ifaces];
321  const unsigned num_v_per_elem = face.edges.size();
322 
323  for( unsigned iedges = 0; iedges < num_v_per_elem; ++iedges )
324  {
325  conn[iedges] = startv + face.edges[iedges].node[0];
326  }
327 
328  switch( num_v_per_elem )
329  {
330  case 3:
331  // if( outputEnabled )
332  // dbgprint.printf( 0, "....Block %d: Triangular Elements [%u].\n", iBlock++, nPolys[iType] );
333  rval = m_interface->create_element( MBTRI, &conn[0], num_v_per_elem, mbcells[ifaces] );MB_CHK_SET_ERR( rval, "Can't get element connectivity" );
334  ntris++;
335  break;
336  case 4:
337  // if( outputEnabled )
338  // dbgprint.printf( 0, "....Block %d: Quadrilateral Elements [%u].\n", iBlock++, nPolys[iType] );
339  rval = m_interface->create_element( MBQUAD, &conn[0], num_v_per_elem, mbcells[ifaces] );MB_CHK_SET_ERR( rval, "Can't get element connectivity" );
340  nquads++;
341  break;
342  default:
343  // if( outputEnabled )
344  // dbgprint.printf( 0, "....Block %d: Polygonal [%u] Elements [%u].\n", iBlock++, iType,
345  // nPolys[iType] );
346  rval = m_interface->create_element( MBPOLYGON, &conn[0], num_v_per_elem, mbcells[ifaces] );MB_CHK_SET_ERR( rval, "Can't get element connectivity" );
347  npolys++;
348  break;
349  }
350 
351  gidse[ifaces] = ifaces + 1;
352 
353  if( storeParentInfo )
354  {
355  srcParent[ifaces] = mesh->vecSourceFaceIx[ifaces] + 1;
356  tgtParent[ifaces] = mesh->vecTargetFaceIx[ifaces] + 1;
357  }
358  }
359 
360  if( ntris ) dbgprint.printf( 0, "....Triangular Elements [%u].\n", ntris );
361  if( nquads ) dbgprint.printf( 0, "....Quadrangular Elements [%u].\n", nquads );
362  if( npolys ) dbgprint.printf( 0, "....Polygonal Elements [%u].\n", npolys );
363 
364  rval = m_interface->add_entities( mesh_set, &mbcells[0], mbcells.size() );MB_CHK_SET_ERR( rval, "Could not add entities" );
365 
366  rval = m_interface->tag_set_data( gidTag, &mbcells[0], mbcells.size(), &gidse[0] );MB_CHK_SET_ERR( rval, "Can't set global_id tag" );
367  if( storeParentInfo )
368  {
369  rval = m_interface->tag_set_data( srcParentTag, &mbcells[0], mbcells.size(), &srcParent[0] );MB_CHK_SET_ERR( rval, "Can't set tag data" );
370  rval = m_interface->tag_set_data( tgtParentTag, &mbcells[0], mbcells.size(), &tgtParent[0] );MB_CHK_SET_ERR( rval, "Can't set tag data" );
371  }
372 
373  // insert from mbcells to entities to preserve ordering
374  std::copy( mbcells.begin(), mbcells.end(), range_inserter( entities ) );
375  }
376 
377  if( vertices ) *vertices = mbverts;
378 
379  return MB_SUCCESS;
380 }

References moab::Interface::add_entities(), moab::Interface::create_element(), dbgprint, entities, ErrorCode, moab::Interface::globalId_tag(), iface, is_root, moab::Remapper::m_interface, MB_CHK_SET_ERR, MB_SUCCESS, MB_TAG_CREAT, MB_TAG_DENSE, MB_TYPE_INTEGER, MBPOLYGON, MBQUAD, MBTRI, moab::Interface::query_interface(), rank, moab::DebugOutput::set_prefix(), moab::Interface::tag_get_handle(), moab::Interface::tag_set_data(), and verbose.

Referenced by ConvertTempestMesh().

◆ ConvertMeshToTempest()

ErrorCode moab::TempestRemapper::ConvertMeshToTempest ( Remapper::IntersectionContext  ctx)

Convert the MOAB mesh representation to a corresponding TempestRemap mesh object according to the intersection context.

Definition at line 541 of file TempestRemapper.cpp.

542 {
543  ErrorCode rval;
544  const bool outputEnabled = ( TempestRemapper::verbose && is_root );
545 
546  moab::DebugOutput dbgprint( std::cout, this->rank, 0 );
547  dbgprint.set_prefix( "[MOABToTempest]: " );
548 
549  if( ctx == Remapper::SourceMesh )
550  {
551  if( !m_source ) m_source = new Mesh();
552  if( outputEnabled ) dbgprint.printf( 0, "Converting (source) MOAB to TempestRemap Mesh representation ...\n" );
553  rval = convert_mesh_to_tempest_private( m_source, m_source_set, m_source_entities, &m_source_vertices );MB_CHK_SET_ERR( rval, "Can't convert source mesh to Tempest" );
554  if( m_source_entities.size() == 0 && m_source_vertices.size() != 0 )
555  {
556  this->point_cloud_source = true;
557  }
558  }
559  else if( ctx == Remapper::TargetMesh )
560  {
561  if( !m_target ) m_target = new Mesh();
562  if( outputEnabled ) dbgprint.printf( 0, "Converting (target) MOAB to TempestRemap Mesh representation ...\n" );
563  rval = convert_mesh_to_tempest_private( m_target, m_target_set, m_target_entities, &m_target_vertices );MB_CHK_SET_ERR( rval, "Can't convert target mesh to Tempest" );
564  if( m_target_entities.size() == 0 && m_target_vertices.size() != 0 ) this->point_cloud_target = true;
565  }
566  else if( ctx == Remapper::OverlapMesh ) // Overlap mesh
567  {
568  if( !m_overlap ) m_overlap = new Mesh();
569  if( outputEnabled ) dbgprint.printf( 0, "Converting (overlap) MOAB to TempestRemap Mesh representation ...\n" );
570  rval = convert_overlap_mesh_sorted_by_source();MB_CHK_SET_ERR( rval, "Can't convert overlap mesh to Tempest" );
571  }
572  else
573  {
574  MB_CHK_SET_ERR( MB_FAILURE, "Invalid IntersectionContext context provided" );
575  }
576 
577  return rval;
578 }

References convert_mesh_to_tempest_private(), convert_overlap_mesh_sorted_by_source(), dbgprint, ErrorCode, is_root, m_overlap, m_source, m_source_entities, m_source_set, m_source_vertices, m_target, m_target_entities, m_target_set, m_target_vertices, MB_CHK_SET_ERR, moab::Remapper::OverlapMesh, point_cloud_source, point_cloud_target, rank, moab::DebugOutput::set_prefix(), moab::Range::size(), moab::Remapper::SourceMesh, moab::Remapper::TargetMesh, and verbose.

Referenced by CreateTempestMesh(), and main().

◆ ConvertTempestMesh()

ErrorCode moab::TempestRemapper::ConvertTempestMesh ( Remapper::IntersectionContext  ctx)

Convert the TempestRemap mesh object to a corresponding MOAB mesh representation according to the intersection context.

Definition at line 221 of file TempestRemapper.cpp.

222 {
223  const bool outputEnabled = ( TempestRemapper::verbose && is_root );
224  if( ctx == Remapper::SourceMesh )
225  {
226  if( outputEnabled ) std::cout << "Converting (source) TempestRemap Mesh object to MOAB representation ...\n";
229  }
230  else if( ctx == Remapper::TargetMesh )
231  {
232  if( outputEnabled ) std::cout << "Converting (target) TempestRemap Mesh object to MOAB representation ...\n";
235  }
236  else if( ctx != Remapper::DEFAULT )
237  {
238  if( outputEnabled ) std::cout << "Converting (overlap) TempestRemap Mesh object to MOAB representation ...\n";
240  }
241  else
242  {
243  MB_CHK_SET_ERR( MB_FAILURE, "Invalid IntersectionContext context provided" );
244  }
245 }

References convert_tempest_mesh_private(), moab::Remapper::DEFAULT, is_root, m_overlap, m_overlap_entities, m_overlap_set, m_overlap_type, m_source, m_source_entities, m_source_set, m_source_type, m_source_vertices, m_target, m_target_entities, m_target_set, m_target_type, m_target_vertices, MB_CHK_SET_ERR, moab::Remapper::SourceMesh, moab::Remapper::TargetMesh, and verbose.

Referenced by main().

◆ GenerateCSMeshMetadata()

ErrorCode moab::TempestRemapper::GenerateCSMeshMetadata ( const int  ntot_elements,
moab::Range entities,
moab::Range secondary_entities,
const std::string &  dofTagName,
int  nP 
)

Generate the necessary metadata and specifically the GLL node numbering for DoFs for a CS mesh. This negates the need for running external code like HOMME to output the numbering needed for computing maps. The functionality is used through the mbconvert tool to compute processor-invariant Global DoF IDs at GLL nodes.

Definition at line 1041 of file TempestRemapper.cpp.

1046 {
1047  Mesh csMesh;
1048  int err;
1049  moab::ErrorCode rval;
1050 
1051  const int res = std::sqrt( ntot_elements / 6 );
1052 
1053  // create a temporary CS mesh
1054  // NOTE: This will not work for RRM grids. Need to run HOMME for that case anyway
1055  err = GenerateCSMesh( csMesh, res, "", "NetCDF4" );
1056  if( err )
1057  {
1058  MB_CHK_SET_ERR( MB_FAILURE, "Failed to generate CS mesh through TempestRemap" );
1059  ;
1060  }
1061 
1062  rval = this->GenerateMeshMetadata( csMesh, ntot_elements, ents, secondary_ents, dofTagName, nP );MB_CHK_SET_ERR( rval, "Failed in call to GenerateMeshMetadata" );
1063 
1064  return moab::MB_SUCCESS;
1065 }

References ErrorCode, GenerateMeshMetadata(), MB_CHK_SET_ERR, and MB_SUCCESS.

◆ GenerateMesh()

moab::ErrorCode moab::TempestRemapper::GenerateMesh ( Remapper::IntersectionContext  ctx,
TempestMeshType  type 
)

Generate a mesh in memory of given type (CS/RLL/ICO/MPAS(structured)) and store it under the context specified by the user.

◆ GenerateMeshMetadata()

ErrorCode moab::TempestRemapper::GenerateMeshMetadata ( Mesh &  mesh,
const int  ntot_elements,
moab::Range entities,
moab::Range secondary_entities,
const std::string  dofTagName,
int  nP 
)

Generate the necessary metadata for DoF node numbering in a given mesh. Currently, only the functionality to generate numbering on CS grids is supported.

Definition at line 1067 of file TempestRemapper.cpp.

1073 {
1074  moab::ErrorCode rval;
1075 
1076  Tag dofTag;
1077  bool created = false;
1078  rval = m_interface->tag_get_handle( dofTagName.c_str(), nP * nP, MB_TYPE_INTEGER, dofTag,
1079  MB_TAG_DENSE | MB_TAG_CREAT, 0, &created );MB_CHK_SET_ERR( rval, "Failed creating DoF tag" );
1080 
1081  // Number of Faces
1082  int nElements = static_cast< int >( csMesh.faces.size() );
1083 
1084  if( nElements != ntot_elements ) return MB_INVALID_SIZE;
1085 
1086  // Initialize data structures
1087  DataArray3D< int > dataGLLnodes;
1088  dataGLLnodes.Allocate( nP, nP, nElements );
1089 
1090  std::map< Node, int > mapNodes;
1091  std::map< Node, moab::EntityHandle > mapLocalMBNodes;
1092 
1093  // GLL Quadrature nodes
1094  DataArray1D< double > dG;
1095  DataArray1D< double > dW;
1096  GaussLobattoQuadrature::GetPoints( nP, 0.0, 1.0, dG, dW );
1097 
1098  moab::Range entities( ents );
1099  if( secondary_ents ) entities.insert( secondary_ents->begin(), secondary_ents->end() );
1100  double elcoords[3];
1101  for( unsigned iel = 0; iel < entities.size(); ++iel )
1102  {
1103  EntityHandle eh = entities[iel];
1104  rval = m_interface->get_coords( &eh, 1, elcoords );
1105  Node elCentroid( elcoords[0], elcoords[1], elcoords[2] );
1106  mapLocalMBNodes.insert( std::pair< Node, moab::EntityHandle >( elCentroid, eh ) );
1107  }
1108 
1109  // Build a Kd-tree for local mesh (nearest neighbor searches)
1110  // Loop over all elements in CS-Mesh
1111  // Then find if current centroid is in an element
1112  // If yes - then let us compute the DoF numbering and set to tag data
1113  // If no - then compute DoF numbering BUT DO NOT SET to tag data
1114  // continue
1115  int* dofIDs = new int[nP * nP];
1116 
1117  // Write metadata
1118  for( int k = 0; k < nElements; k++ )
1119  {
1120  const Face& face = csMesh.faces[k];
1121  const NodeVector& nodes = csMesh.nodes;
1122 
1123  if( face.edges.size() != 4 )
1124  {
1125  _EXCEPTIONT( "Mesh must only contain quadrilateral elements" );
1126  }
1127 
1128  Node centroid;
1129  centroid.x = centroid.y = centroid.z = 0.0;
1130  for( unsigned l = 0; l < face.edges.size(); ++l )
1131  {
1132  centroid.x += nodes[face[l]].x;
1133  centroid.y += nodes[face[l]].y;
1134  centroid.z += nodes[face[l]].z;
1135  }
1136  const double factor = 1.0 / face.edges.size();
1137  centroid.x *= factor;
1138  centroid.y *= factor;
1139  centroid.z *= factor;
1140 
1141  bool locElem = false;
1142  EntityHandle current_eh;
1143  if( mapLocalMBNodes.find( centroid ) != mapLocalMBNodes.end() )
1144  {
1145  locElem = true;
1146  current_eh = mapLocalMBNodes[centroid];
1147  }
1148 
1149  for( int j = 0; j < nP; j++ )
1150  {
1151  for( int i = 0; i < nP; i++ )
1152  {
1153  // Get local map vectors
1154  Node nodeGLL;
1155  Node dDx1G;
1156  Node dDx2G;
1157 
1158  // ApplyLocalMap(
1159  // face,
1160  // nodevec,
1161  // dG[i],
1162  // dG[j],
1163  // nodeGLL,
1164  // dDx1G,
1165  // dDx2G);
1166  const double& dAlpha = dG[i];
1167  const double& dBeta = dG[j];
1168 
1169  // Calculate nodal locations on the plane
1170  double dXc = nodes[face[0]].x * ( 1.0 - dAlpha ) * ( 1.0 - dBeta ) +
1171  nodes[face[1]].x * dAlpha * ( 1.0 - dBeta ) + nodes[face[2]].x * dAlpha * dBeta +
1172  nodes[face[3]].x * ( 1.0 - dAlpha ) * dBeta;
1173 
1174  double dYc = nodes[face[0]].y * ( 1.0 - dAlpha ) * ( 1.0 - dBeta ) +
1175  nodes[face[1]].y * dAlpha * ( 1.0 - dBeta ) + nodes[face[2]].y * dAlpha * dBeta +
1176  nodes[face[3]].y * ( 1.0 - dAlpha ) * dBeta;
1177 
1178  double dZc = nodes[face[0]].z * ( 1.0 - dAlpha ) * ( 1.0 - dBeta ) +
1179  nodes[face[1]].z * dAlpha * ( 1.0 - dBeta ) + nodes[face[2]].z * dAlpha * dBeta +
1180  nodes[face[3]].z * ( 1.0 - dAlpha ) * dBeta;
1181 
1182  double dR = sqrt( dXc * dXc + dYc * dYc + dZc * dZc );
1183 
1184  // Mapped node location
1185  nodeGLL.x = dXc / dR;
1186  nodeGLL.y = dYc / dR;
1187  nodeGLL.z = dZc / dR;
1188 
1189  // Determine if this is a unique Node
1190  std::map< Node, int >::const_iterator iter = mapNodes.find( nodeGLL );
1191  if( iter == mapNodes.end() )
1192  {
1193  // Insert new unique node into map
1194  int ixNode = static_cast< int >( mapNodes.size() );
1195  mapNodes.insert( std::pair< Node, int >( nodeGLL, ixNode ) );
1196  dataGLLnodes[j][i][k] = ixNode + 1;
1197  }
1198  else
1199  {
1200  dataGLLnodes[j][i][k] = iter->second + 1;
1201  }
1202 
1203  dofIDs[j * nP + i] = dataGLLnodes[j][i][k];
1204  }
1205  }
1206 
1207  if( locElem )
1208  {
1209  rval = m_interface->tag_set_data( dofTag, &current_eh, 1, dofIDs );MB_CHK_SET_ERR( rval, "Failed to tag_set_data for DoFs" );
1210  }
1211  }
1212 
1213  // clear memory
1214  delete[] dofIDs;
1215  mapLocalMBNodes.clear();
1216  mapNodes.clear();
1217 
1218  return moab::MB_SUCCESS;
1219 }

References moab::Range::begin(), moab::Range::end(), entities, ErrorCode, moab::Interface::get_coords(), moab::Remapper::m_interface, MB_CHK_SET_ERR, MB_INVALID_SIZE, MB_SUCCESS, MB_TAG_CREAT, MB_TAG_DENSE, MB_TYPE_INTEGER, moab::Interface::tag_get_handle(), and moab::Interface::tag_set_data().

Referenced by GenerateCSMeshMetadata(), and main().

◆ GetCoveringMesh()

Mesh * moab::TempestRemapper::GetCoveringMesh ( )
inline

Get the covering mesh (TempestRemap) object.

Definition at line 545 of file TempestRemapper.hpp.

546 {
547  return m_covering_source;
548 }

References m_covering_source.

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

◆ GetCoveringSet()

moab::EntityHandle & moab::TempestRemapper::GetCoveringSet ( )
inline

Get access to the underlying source covering set if available. Else return the source set.

Definition at line 550 of file TempestRemapper.hpp.

551 {
552  return m_covering_source_set;
553 }

References m_covering_source_set.

◆ GetGlobalID()

int moab::TempestRemapper::GetGlobalID ( Remapper::IntersectionContext  ctx,
int  localID 
)
inline

Get the global ID corresponding to the local entity ID according to the context (source, target, intersection)

Definition at line 555 of file TempestRemapper.hpp.

556 {
557  switch( ctx )
558  {
560  return lid_to_gid_src[localID];
562  return lid_to_gid_tgt[localID];
564  return lid_to_gid_covsrc[localID];
566  case Remapper::DEFAULT:
567  default:
568  return -1;
569  }
570 }

References moab::Remapper::CoveringMesh, moab::Remapper::DEFAULT, lid_to_gid_covsrc, lid_to_gid_src, lid_to_gid_tgt, moab::Remapper::OverlapMesh, moab::Remapper::SourceMesh, and moab::Remapper::TargetMesh.

◆ GetIMasks()

ErrorCode moab::TempestRemapper::GetIMasks ( Remapper::IntersectionContext  ctx,
std::vector< int > &  masks 
)

Get the masks that could have been defined.

Definition at line 2197 of file TempestRemapper.cpp.

2198 {
2199  Tag maskTag;
2200  // it should have been created already, if not, we might have a problem
2201  int def_val = 1;
2202  ErrorCode rval =
2203  m_interface->tag_get_handle( "GRID_IMASK", 1, MB_TYPE_INTEGER, maskTag, MB_TAG_DENSE | MB_TAG_CREAT, &def_val );MB_CHK_SET_ERR( rval, "Trouble creating GRID_IMASK tag" );
2204 
2205  switch( ctx )
2206  {
2207  case Remapper::SourceMesh: {
2208  if( point_cloud_source )
2209  {
2210  masks.resize( m_source_vertices.size() );
2211  rval = m_interface->tag_get_data( maskTag, m_source_vertices, &masks[0] );MB_CHK_SET_ERR( rval, "Trouble getting GRID_IMASK tag" );
2212  }
2213  else
2214  {
2215  masks.resize( m_source_entities.size() );
2216  rval = m_interface->tag_get_data( maskTag, m_source_entities, &masks[0] );MB_CHK_SET_ERR( rval, "Trouble getting GRID_IMASK tag" );
2217  }
2218  return MB_SUCCESS;
2219  }
2220  case Remapper::TargetMesh: {
2221  if( point_cloud_target )
2222  {
2223  masks.resize( m_target_vertices.size() );
2224  rval = m_interface->tag_get_data( maskTag, m_target_vertices, &masks[0] );MB_CHK_SET_ERR( rval, "Trouble getting GRID_IMASK tag" );
2225  }
2226  else
2227  {
2228  masks.resize( m_target_entities.size() );
2229  rval = m_interface->tag_get_data( maskTag, m_target_entities, &masks[0] );MB_CHK_SET_ERR( rval, "Trouble getting GRID_IMASK tag" );
2230  }
2231  return MB_SUCCESS;
2232  }
2234  case Remapper::OverlapMesh:
2235  default:
2236  return MB_SUCCESS;
2237  }
2238 }

References moab::Remapper::CoveringMesh, ErrorCode, moab::Remapper::m_interface, m_source_entities, m_source_vertices, m_target_entities, m_target_vertices, MB_CHK_SET_ERR, MB_SUCCESS, MB_TAG_CREAT, MB_TAG_DENSE, MB_TYPE_INTEGER, moab::Remapper::OverlapMesh, point_cloud_source, point_cloud_target, moab::Range::size(), moab::Remapper::SourceMesh, moab::Interface::tag_get_data(), moab::Interface::tag_get_handle(), and moab::Remapper::TargetMesh.

◆ GetLocalID()

int moab::TempestRemapper::GetLocalID ( Remapper::IntersectionContext  ctx,
int  globalID 
)
inline

Get the local ID corresponding to the global entity ID according to the context (source, target, intersection)

Definition at line 572 of file TempestRemapper.hpp.

573 {
574  switch( ctx )
575  {
577  return gid_to_lid_src[globalID];
579  return gid_to_lid_tgt[globalID];
581  return gid_to_lid_covsrc[globalID];
582  case Remapper::DEFAULT:
584  default:
585  return -1;
586  }
587 }

References moab::Remapper::CoveringMesh, moab::Remapper::DEFAULT, gid_to_lid_covsrc, gid_to_lid_src, gid_to_lid_tgt, moab::Remapper::OverlapMesh, moab::Remapper::SourceMesh, and moab::Remapper::TargetMesh.

◆ GetMesh()

Mesh * moab::TempestRemapper::GetMesh ( Remapper::IntersectionContext  ctx)
inline

Get the TempestRemap mesh object according to the intersection context.

Definition at line 338 of file TempestRemapper.hpp.

339 {
340  switch( ctx )
341  {
343  return m_source;
345  return m_target;
347  return m_overlap;
349  return m_covering_source;
350  case Remapper::DEFAULT:
351  default:
352  return NULL;
353  }
354 }

References moab::Remapper::CoveringMesh, moab::Remapper::DEFAULT, m_covering_source, m_overlap, m_source, m_target, moab::Remapper::OverlapMesh, moab::Remapper::SourceMesh, and moab::Remapper::TargetMesh.

Referenced by CreateTempestMesh(), main(), and moab::TempestOnlineMap::TempestOnlineMap().

◆ GetMeshEntities() [1/2]

moab::Range & moab::TempestRemapper::GetMeshEntities ( Remapper::IntersectionContext  ctx)
inline

Get the mesh element entities corresponding to the intersection context.

Definition at line 422 of file TempestRemapper.hpp.

423 {
424  switch( ctx )
425  {
427  return m_source_entities;
429  return m_target_entities;
431  return m_overlap_entities;
434  case Remapper::DEFAULT:
435  default:
436  MB_SET_ERR_RET_VAL( "Invalid context passed to GetMeshSet", m_overlap_entities );
437  }
438 }

References moab::Remapper::CoveringMesh, moab::Remapper::DEFAULT, m_covering_source_entities, m_overlap_entities, m_source_entities, m_target_entities, MB_SET_ERR_RET_VAL, moab::Remapper::OverlapMesh, moab::Remapper::SourceMesh, and moab::Remapper::TargetMesh.

Referenced by main().

◆ GetMeshEntities() [2/2]

const moab::Range & moab::TempestRemapper::GetMeshEntities ( Remapper::IntersectionContext  ctx) const
inline

Const overload. Get the mesh element entities corresponding to the intersection context.

Definition at line 440 of file TempestRemapper.hpp.

441 {
442  switch( ctx )
443  {
445  return m_source_entities;
447  return m_target_entities;
449  return m_overlap_entities;
452  case Remapper::DEFAULT:
453  default:
454  MB_SET_ERR_RET_VAL( "Invalid context passed to GetMeshSet", m_overlap_entities );
455  }
456 }

References moab::Remapper::CoveringMesh, moab::Remapper::DEFAULT, m_covering_source_entities, m_overlap_entities, m_source_entities, m_target_entities, MB_SET_ERR_RET_VAL, moab::Remapper::OverlapMesh, moab::Remapper::SourceMesh, and moab::Remapper::TargetMesh.

◆ GetMeshSet() [1/2]

moab::EntityHandle & moab::TempestRemapper::GetMeshSet ( Remapper::IntersectionContext  ctx)
inline

Get the MOAB mesh set corresponding to the intersection context.

Definition at line 386 of file TempestRemapper.hpp.

387 {
388  switch( ctx )
389  {
391  return m_source_set;
393  return m_target_set;
395  return m_overlap_set;
397  return m_covering_source_set;
398  case Remapper::DEFAULT:
399  default:
400  MB_SET_ERR_RET_VAL( "Invalid context passed to GetMeshSet", m_overlap_set );
401  }
402 }

References moab::Remapper::CoveringMesh, moab::Remapper::DEFAULT, m_covering_source_set, m_overlap_set, m_source_set, m_target_set, MB_SET_ERR_RET_VAL, moab::Remapper::OverlapMesh, moab::Remapper::SourceMesh, and moab::Remapper::TargetMesh.

Referenced by CreateTempestMesh(), and main().

◆ GetMeshSet() [2/2]

moab::EntityHandle moab::TempestRemapper::GetMeshSet ( Remapper::IntersectionContext  ctx) const
inline

Const overload. Get the MOAB mesh set corresponding to the intersection context.

Definition at line 404 of file TempestRemapper.hpp.

405 {
406  switch( ctx )
407  {
409  return m_source_set;
411  return m_target_set;
413  return m_overlap_set;
415  return m_covering_source_set;
416  case Remapper::DEFAULT:
417  default:
418  MB_SET_ERR_RET_VAL( "Invalid context passed to GetMeshSet", m_overlap_set );
419  }
420 }

References moab::Remapper::CoveringMesh, moab::Remapper::DEFAULT, m_covering_source_set, m_overlap_set, m_source_set, m_target_set, MB_SET_ERR_RET_VAL, moab::Remapper::OverlapMesh, moab::Remapper::SourceMesh, and moab::Remapper::TargetMesh.

◆ GetMeshType()

TempestRemapper::TempestMeshType moab::TempestRemapper::GetMeshType ( Remapper::IntersectionContext  ctx) const
inline

Get the mesh type corresponding to the intersection context

Definition at line 529 of file TempestRemapper.hpp.

530 {
531  switch( ctx )
532  {
534  return m_source_type;
536  return m_target_type;
538  return m_overlap_type;
539  case Remapper::DEFAULT:
540  default:
542  }
543 }

References moab::Remapper::DEFAULT, DEFAULT, m_overlap_type, m_source_type, m_target_type, moab::Remapper::OverlapMesh, moab::Remapper::SourceMesh, and moab::Remapper::TargetMesh.

◆ GetMeshVertices() [1/2]

moab::Range & moab::TempestRemapper::GetMeshVertices ( Remapper::IntersectionContext  ctx)
inline

Get the mesh vertices corresponding to the intersection context. Useful for point-cloud meshes

Definition at line 458 of file TempestRemapper.hpp.

459 {
460  switch( ctx )
461  {
463  return m_source_vertices;
465  return m_target_vertices;
468  case Remapper::DEFAULT:
469  default:
470  MB_SET_ERR_RET_VAL( "Invalid context passed to GetMeshSet", m_source_vertices );
471  }
472 }

References moab::Remapper::CoveringMesh, moab::Remapper::DEFAULT, m_covering_source_vertices, m_source_vertices, m_target_vertices, MB_SET_ERR_RET_VAL, moab::Remapper::SourceMesh, and moab::Remapper::TargetMesh.

Referenced by main().

◆ GetMeshVertices() [2/2]

const moab::Range & moab::TempestRemapper::GetMeshVertices ( Remapper::IntersectionContext  ctx) const
inline

Const overload. Get the mesh vertices corresponding to the intersection context. Useful for point-cloud meshes.

Definition at line 474 of file TempestRemapper.hpp.

475 {
476  switch( ctx )
477  {
479  return m_source_vertices;
481  return m_target_vertices;
484  case Remapper::DEFAULT:
485  default:
486  MB_SET_ERR_RET_VAL( "Invalid context passed to GetMeshSet", m_source_vertices );
487  }
488 }

References moab::Remapper::CoveringMesh, moab::Remapper::DEFAULT, m_covering_source_vertices, m_source_vertices, m_target_vertices, MB_SET_ERR_RET_VAL, moab::Remapper::SourceMesh, and moab::Remapper::TargetMesh.

◆ GetOverlapAugmentedEntities()

moab::ErrorCode moab::TempestRemapper::GetOverlapAugmentedEntities ( moab::Range sharedGhostEntities)

Get all the ghosted overlap entities that were accumulated to enable conservation in parallel

Definition at line 697 of file TempestRemapper.cpp.

698 {
699  sharedGhostEntities.clear();
700 #ifdef MOAB_HAVE_MPI
701  moab::ErrorCode rval;
702 
703  // Remove entities in the intersection mesh that are part of the ghosted overlap
704  if( is_parallel && size > 1 )
705  {
706  moab::Range allents;
707  rval = m_interface->get_entities_by_dimension( m_overlap_set, 2, allents );MB_CHK_SET_ERR( rval, "Getting entities dim 2 failed" );
708 
709  moab::Range sharedents;
710  moab::Tag ghostTag;
711  std::vector< int > ghFlags( allents.size() );
712  rval = m_interface->tag_get_handle( "ORIG_PROC", ghostTag );MB_CHK_ERR( rval );
713  rval = m_interface->tag_get_data( ghostTag, allents, &ghFlags[0] );MB_CHK_ERR( rval );
714  for( unsigned i = 0; i < allents.size(); ++i )
715  if( ghFlags[i] >= 0 ) // it means it is a ghost overlap element
716  sharedents.insert( allents[i] ); // this should not participate in smat!
717 
718  allents = subtract( allents, sharedents );
719 
720  // Get connectivity from all ghosted elements and filter out
721  // the vertices that are not owned
722  moab::Range ownedverts, sharedverts;
723  rval = m_interface->get_connectivity( allents, ownedverts );MB_CHK_SET_ERR( rval, "Deleting entities dim 0 failed" );
724  rval = m_interface->get_connectivity( sharedents, sharedverts );MB_CHK_SET_ERR( rval, "Deleting entities dim 0 failed" );
725  sharedverts = subtract( sharedverts, ownedverts );
726  // rval = m_interface->remove_entities(m_overlap_set, sharedents);MB_CHK_SET_ERR(rval,
727  // "Deleting entities dim 2 failed"); rval = m_interface->remove_entities(m_overlap_set,
728  // sharedverts);MB_CHK_SET_ERR(rval, "Deleting entities dim 0 failed");
729 
730  sharedGhostEntities.merge( sharedents );
731  // sharedGhostEntities.merge(sharedverts);
732  }
733 #endif
734  return moab::MB_SUCCESS;
735 }

References moab::Range::clear(), ErrorCode, moab::Range::insert(), MB_CHK_ERR, MB_CHK_SET_ERR, MB_SUCCESS, moab::Range::merge(), size, moab::Range::size(), and moab::subtract().

Referenced by main().

◆ initialize()

ErrorCode moab::TempestRemapper::initialize ( bool  initialize_fsets = true)
virtual

Initialize the TempestRemapper object internal datastructures including the mesh sets and TempestRemap mesh references.

Definition at line 49 of file TempestRemapper.cpp.

50 {
51  ErrorCode rval;
52  if( initialize_fsets )
53  {
54  rval = m_interface->create_meshset( moab::MESHSET_SET, m_source_set );MB_CHK_SET_ERR( rval, "Can't create new set" );
55  rval = m_interface->create_meshset( moab::MESHSET_SET, m_target_set );MB_CHK_SET_ERR( rval, "Can't create new set" );
56  rval = m_interface->create_meshset( moab::MESHSET_SET, m_overlap_set );MB_CHK_SET_ERR( rval, "Can't create new set" );
57  }
58  else
59  {
60  m_source_set = 0;
61  m_target_set = 0;
62  m_overlap_set = 0;
63  }
64 
65  is_parallel = false;
66  is_root = true;
67  rank = 0;
68  size = 1;
69 #ifdef MOAB_HAVE_MPI
70  int flagInit;
71  MPI_Initialized( &flagInit );
72  if( flagInit )
73  {
74  assert( m_pcomm != nullptr );
75  rank = m_pcomm->rank();
76  size = m_pcomm->size();
77  is_root = ( rank == 0 );
78  is_parallel = ( size > 1 );
79  // is_parallel = true;
80  }
81 #endif
82 
83  m_source = nullptr;
84  m_target = nullptr;
85  m_overlap = nullptr;
86  m_covering_source = nullptr;
87 
88  point_cloud_source = false;
89  point_cloud_target = false;
90 
91  return MB_SUCCESS;
92 }

References moab::Interface::create_meshset(), ErrorCode, is_parallel, is_root, m_covering_source, moab::Remapper::m_interface, m_overlap, m_overlap_set, m_source, m_source_set, m_target, m_target_set, MB_CHK_SET_ERR, MB_SUCCESS, MESHSET_SET, point_cloud_source, point_cloud_target, rank, and size.

Referenced by main().

◆ load_tempest_mesh_private()

ErrorCode moab::TempestRemapper::load_tempest_mesh_private ( std::string  inputFilename,
Mesh **  tempest_mesh 
)
private

Definition at line 172 of file TempestRemapper.cpp.

173 {
174  const bool outputEnabled = ( TempestRemapper::verbose && is_root );
175  if( outputEnabled ) std::cout << "\nLoading TempestRemap Mesh object from file = " << inputFilename << " ...\n";
176 
177  {
178  NcError error( NcError::silent_nonfatal );
179 
180  try
181  {
182  // Load input mesh
183  if( outputEnabled ) std::cout << "Loading mesh ...\n";
184  Mesh* mesh = new Mesh( inputFilename );
185  mesh->RemoveZeroEdges();
186  if( outputEnabled ) std::cout << "----------------\n";
187 
188  // Validate mesh
189  if( meshValidate )
190  {
191  if( outputEnabled ) std::cout << "Validating mesh ...\n";
192  mesh->Validate();
193  if( outputEnabled ) std::cout << "-------------------\n";
194  }
195 
196  // Construct the edge map on the mesh
197  if( constructEdgeMap )
198  {
199  if( outputEnabled ) std::cout << "Constructing edge map on mesh ...\n";
200  mesh->ConstructEdgeMap( false );
201  if( outputEnabled ) std::cout << "---------------------------------\n";
202  }
203 
204  if( tempest_mesh ) *tempest_mesh = mesh;
205  }
206  catch( Exception& e )
207  {
208  std::cout << "TempestRemap ERROR: " << e.ToString() << "\n";
209  return MB_FAILURE;
210  }
211  catch( ... )
212  {
213  return MB_FAILURE;
214  }
215  }
216  return MB_SUCCESS;
217 }

References constructEdgeMap, moab::error(), is_root, MB_SUCCESS, meshValidate, and verbose.

Referenced by LoadMesh().

◆ LoadMesh()

ErrorCode moab::TempestRemapper::LoadMesh ( Remapper::IntersectionContext  ctx,
std::string  inputFilename,
TempestMeshType  type 
)

Load a mesh from disk of given type and store it under the context specified by the user.

Definition at line 147 of file TempestRemapper.cpp.

150 {
151  if( ctx == Remapper::SourceMesh )
152  {
153  m_source_type = type;
154  return load_tempest_mesh_private( inputFilename, &m_source );
155  }
156  else if( ctx == Remapper::TargetMesh )
157  {
158  m_target_type = type;
159  return load_tempest_mesh_private( inputFilename, &m_target );
160  }
161  else if( ctx != Remapper::DEFAULT )
162  {
163  m_overlap_type = type;
164  return load_tempest_mesh_private( inputFilename, &m_overlap );
165  }
166  else
167  {
168  MB_CHK_SET_ERR( MB_FAILURE, "Invalid IntersectionContext context provided" );
169  }
170 }

References moab::Remapper::DEFAULT, load_tempest_mesh_private(), m_overlap, m_overlap_type, m_source, m_source_type, m_target, m_target_type, MB_CHK_SET_ERR, moab::Remapper::SourceMesh, and moab::Remapper::TargetMesh.

Referenced by CreateTempestMesh(), and main().

◆ SetMesh()

void moab::TempestRemapper::SetMesh ( Remapper::IntersectionContext  ctx,
Mesh *  mesh,
bool  overwrite = true 
)
inline

Set the TempestRemap mesh object according to the intersection context.

Definition at line 356 of file TempestRemapper.hpp.

357 {
358  switch( ctx )
359  {
361  if( !overwrite && m_source ) return;
362  if( overwrite && m_source ) delete m_source;
363  m_source = mesh;
364  break;
366  if( !overwrite && m_target ) return;
367  if( overwrite && m_target ) delete m_target;
368  m_target = mesh;
369  break;
371  if( !overwrite && m_overlap ) return;
372  if( overwrite && m_overlap ) delete m_overlap;
373  m_overlap = mesh;
374  break;
376  if( !overwrite && m_covering_source ) return;
377  if( overwrite && m_covering_source ) delete m_covering_source;
378  m_covering_source = mesh;
379  break;
380  case Remapper::DEFAULT:
381  default:
382  break;
383  }
384 }

References moab::Remapper::CoveringMesh, moab::Remapper::DEFAULT, m_covering_source, m_overlap, m_source, m_target, moab::Remapper::OverlapMesh, moab::Remapper::SourceMesh, and moab::Remapper::TargetMesh.

Referenced by CreateTempestMesh().

◆ SetMeshSet()

void moab::TempestRemapper::SetMeshSet ( Remapper::IntersectionContext  ctx,
moab::EntityHandle  mset,
moab::Range entities 
)

Definition at line 980 of file TempestRemapper.cpp.

983 {
984 
985  if( ctx == Remapper::SourceMesh ) // should not be used
986  {
988  m_source_set = mset;
989  }
990  else if( ctx == Remapper::TargetMesh )
991  {
993  m_target_set = mset;
994  }
995  else if( ctx == Remapper::CoveringMesh )
996  {
998  m_covering_source_set = mset;
999  }
1000  else
1001  {
1002  // some error
1003  }
1004  return;
1005 }

References moab::Remapper::CoveringMesh, entities, m_covering_source_entities, m_covering_source_set, m_source_entities, m_source_set, m_target_entities, m_target_set, moab::Remapper::SourceMesh, and moab::Remapper::TargetMesh.

◆ SetMeshType()

void moab::TempestRemapper::SetMeshType ( Remapper::IntersectionContext  ctx,
const std::vector< int > &  metadata 
)
inline

Set the mesh type corresponding to the intersection context

Definition at line 490 of file TempestRemapper.hpp.

491 {
492  switch( ctx )
493  {
495  m_source_type = static_cast< moab::TempestRemapper::TempestMeshType >( metadata[0] );
496  if( metadata[0] == 1 ) // RLL mesh
497  {
498  m_source_metadata.resize( 2 );
499  m_source_metadata[0] = metadata[1];
500  m_source_metadata[1] = metadata[2];
501  }
502  else
503  {
504  m_source_metadata.resize( 1 );
505  m_source_metadata[0] = metadata[1];
506  }
507  break;
509  m_target_type = static_cast< moab::TempestRemapper::TempestMeshType >( metadata[0] );
510  if( metadata[0] == 1 ) // RLL mesh
511  {
512  m_target_metadata.resize( 2 );
513  m_target_metadata[0] = metadata[1];
514  m_target_metadata[1] = metadata[2];
515  }
516  else
517  {
518  m_target_metadata.resize( 1 );
519  m_target_metadata[0] = metadata[1];
520  }
521  break;
524  default:
525  break;
526  }
527 }

References m_overlap_type, m_source_metadata, m_source_type, m_target_metadata, m_target_type, OVERLAP_FILES, moab::Remapper::OverlapMesh, moab::Remapper::SourceMesh, and moab::Remapper::TargetMesh.

Referenced by CreateTempestMesh().

◆ WriteTempestIntersectionMesh()

moab::ErrorCode moab::TempestRemapper::WriteTempestIntersectionMesh ( std::string  strOutputFileName,
const bool  fAllParallel,
const bool  fInputConcave,
const bool  fOutputConcave 
)

Gather the overlap mesh and asssociated source/target data and write it out to disk using the TempestRemap output interface. This information can then be used with the "GenerateOfflineMap" tool in TempestRemap as needed.

Definition at line 945 of file TempestRemapper.cpp.

949 {
950  // Let us alos write out the TempestRemap equivalent so that we can do some verification checks
951  if( fAllParallel )
952  {
953  if( is_root && size == 1 )
954  {
955  this->m_source->CalculateFaceAreas( fInputConcave );
956  this->m_target->CalculateFaceAreas( fOutputConcave );
957  this->m_overlap->Write( strOutputFileName.c_str(), NcFile::Netcdf4 );
958  }
959  else
960  {
961  // Perform reduction and write from root processor
962  // if ( is_root )
963  // std::cout << "--- PARALLEL IMPLEMENTATION is NOT AVAILABLE yet ---\n";
964 
965  this->m_source->CalculateFaceAreas( fInputConcave );
966  this->m_covering_source->CalculateFaceAreas( fInputConcave );
967  this->m_target->CalculateFaceAreas( fOutputConcave );
968  this->m_overlap->Write( strOutputFileName.c_str(), NcFile::Netcdf4 );
969  }
970  }
971  else
972  {
973  this->m_source->CalculateFaceAreas( fInputConcave );
974  this->m_target->CalculateFaceAreas( fOutputConcave );
975  this->m_overlap->Write( strOutputFileName.c_str(), NcFile::Netcdf4 );
976  }
977 
978  return moab::MB_SUCCESS;
979 }

References MB_SUCCESS, and size.

Friends And Related Function Documentation

◆ TempestOnlineMap

friend class TempestOnlineMap
friend

Definition at line 66 of file TempestRemapper.hpp.

Member Data Documentation

◆ constructEdgeMap

bool moab::TempestRemapper::constructEdgeMap

◆ gid_to_lid_covsrc

std::map< int, int > moab::TempestRemapper::gid_to_lid_covsrc
private

◆ gid_to_lid_src

std::map< int, int > moab::TempestRemapper::gid_to_lid_src
private

Definition at line 327 of file TempestRemapper.hpp.

Referenced by clear(), ComputeGlobalLocalMaps(), and GetLocalID().

◆ gid_to_lid_tgt

std::map< int, int > moab::TempestRemapper::gid_to_lid_tgt
private

◆ is_parallel

bool moab::TempestRemapper::is_parallel
private

◆ is_root

◆ lid_to_gid_covsrc

std::map< int, int > moab::TempestRemapper::lid_to_gid_covsrc
private

Definition at line 328 of file TempestRemapper.hpp.

Referenced by clear(), ComputeGlobalLocalMaps(), and GetGlobalID().

◆ lid_to_gid_src

std::map< int, int > moab::TempestRemapper::lid_to_gid_src
private

Definition at line 328 of file TempestRemapper.hpp.

Referenced by clear(), ComputeGlobalLocalMaps(), and GetGlobalID().

◆ lid_to_gid_tgt

std::map< int, int > moab::TempestRemapper::lid_to_gid_tgt
private

Definition at line 328 of file TempestRemapper.hpp.

Referenced by clear(), ComputeGlobalLocalMaps(), and GetGlobalID().

◆ m_area_method

IntxAreaUtils::AreaMethod moab::TempestRemapper::m_area_method
private

Definition at line 330 of file TempestRemapper.hpp.

◆ m_covering_source

Mesh* moab::TempestRemapper::m_covering_source
private

◆ m_covering_source_entities

moab::Range moab::TempestRemapper::m_covering_source_entities
private

◆ m_covering_source_set

moab::EntityHandle moab::TempestRemapper::m_covering_source_set
private

◆ m_covering_source_vertices

moab::Range moab::TempestRemapper::m_covering_source_vertices
private

◆ m_overlap

Mesh* moab::TempestRemapper::m_overlap
private

◆ m_overlap_entities

moab::Range moab::TempestRemapper::m_overlap_entities
private

◆ m_overlap_set

moab::EntityHandle moab::TempestRemapper::m_overlap_set
private

◆ m_overlap_type

TempestMeshType moab::TempestRemapper::m_overlap_type
private

Definition at line 312 of file TempestRemapper.hpp.

Referenced by ConvertTempestMesh(), GetMeshType(), LoadMesh(), and SetMeshType().

◆ m_sorted_overlap_order

std::vector< std::pair< int, int > > moab::TempestRemapper::m_sorted_overlap_order
private

Definition at line 315 of file TempestRemapper.hpp.

◆ m_source

Mesh* moab::TempestRemapper::m_source
private

◆ m_source_entities

◆ m_source_metadata

std::vector< int > moab::TempestRemapper::m_source_metadata
private

Definition at line 298 of file TempestRemapper.hpp.

Referenced by SetMeshType().

◆ m_source_set

moab::EntityHandle moab::TempestRemapper::m_source_set
private

◆ m_source_type

TempestMeshType moab::TempestRemapper::m_source_type
private

Definition at line 292 of file TempestRemapper.hpp.

Referenced by ConvertTempestMesh(), GetMeshType(), LoadMesh(), and SetMeshType().

◆ m_source_vertices

moab::Range moab::TempestRemapper::m_source_vertices
private

◆ m_target

Mesh* moab::TempestRemapper::m_target
private

◆ m_target_entities

◆ m_target_metadata

std::vector< int > moab::TempestRemapper::m_target_metadata
private

Definition at line 308 of file TempestRemapper.hpp.

Referenced by SetMeshType().

◆ m_target_set

moab::EntityHandle moab::TempestRemapper::m_target_set
private

◆ m_target_type

TempestMeshType moab::TempestRemapper::m_target_type
private

Definition at line 302 of file TempestRemapper.hpp.

Referenced by ConvertTempestMesh(), GetMeshType(), LoadMesh(), and SetMeshType().

◆ m_target_vertices

moab::Range moab::TempestRemapper::m_target_vertices
private

◆ max_source_edges

int moab::TempestRemapper::max_source_edges
private

Definition at line 296 of file TempestRemapper.hpp.

Referenced by ConstructCoveringSet().

◆ max_target_edges

int moab::TempestRemapper::max_target_edges
private

Definition at line 306 of file TempestRemapper.hpp.

Referenced by ConstructCoveringSet().

◆ mbintx

moab::Intx2MeshOnSphere* moab::TempestRemapper::mbintx
private

Definition at line 318 of file TempestRemapper.hpp.

Referenced by ComputeOverlapMesh(), and ConstructCoveringSet().

◆ meshValidate

bool moab::TempestRemapper::meshValidate

Definition at line 265 of file TempestRemapper.hpp.

Referenced by load_tempest_mesh_private(), and main().

◆ offlineWorkflow

const bool moab::TempestRemapper::offlineWorkflow

Definition at line 264 of file TempestRemapper.hpp.

Referenced by convert_mesh_to_tempest_private().

◆ point_cloud_source

bool moab::TempestRemapper::point_cloud_source
private

◆ point_cloud_target

bool moab::TempestRemapper::point_cloud_target
private

◆ rank

◆ rrmgrids

bool moab::TempestRemapper::rrmgrids
private

Definition at line 332 of file TempestRemapper.hpp.

Referenced by ComputeOverlapMesh(), and ConstructCoveringSet().

◆ size

int moab::TempestRemapper::size
private

◆ verbose

const bool moab::TempestRemapper::verbose = true
static

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