Mesh Oriented datABase  (version 5.5.1)
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 1012 of file TempestRemapper.cpp.

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

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

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 1358 of file TempestRemapper.cpp.

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

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 1226 of file TempestRemapper.cpp.

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

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->RemoveCoincidentNodes( false );
852  m_overlap->RemoveZeroEdges();
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 1044 of file TempestRemapper.cpp.

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

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 1070 of file TempestRemapper.cpp.

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

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 2200 of file TempestRemapper.cpp.

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

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 983 of file TempestRemapper.cpp.

986 {
987 
988  if( ctx == Remapper::SourceMesh ) // should not be used
989  {
991  m_source_set = mset;
992  }
993  else if( ctx == Remapper::TargetMesh )
994  {
996  m_target_set = mset;
997  }
998  else if( ctx == Remapper::CoveringMesh )
999  {
1001  m_covering_source_set = mset;
1002  }
1003  else
1004  {
1005  // some error
1006  }
1007  return;
1008 }

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 948 of file TempestRemapper.cpp.

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

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: