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 , SourceMeshWithGhosts = 4 , TargetMeshWithGhosts = 5
}
 

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, int order=1)
 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, int nLayers=0)
 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=nullptr)
 
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...
 
void ResetMeshSet (Remapper::IntersectionContext ctx, moab::EntityHandle meshSet)
 reconstruct mesh, used now only for IO; need a better solution maybe 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
 
moab::EntityHandle m_source_set_with_ghosts
 
moab::EntityHandle m_target_set_with_ghosts
 
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 102 of file TempestRemapper.cpp.

103 {
104  this->clear();
105 }

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

1030 {
1031  assert( idtag );
1032 
1033  ErrorCode rval;
1034  Range entities;
1035  rval = m_interface->get_entities_by_dimension( this_set, dimension, entities );MB_CHK_SET_ERR( rval, "Failed to get entities" );
1036 
1037  if( entities.size() == 0 ) return moab::MB_SUCCESS;
1038 
1039  int idoffset = start_id;
1040  std::vector< int > gid( entities.size() );
1041  for( unsigned i = 0; i < entities.size(); ++i )
1042  gid[i] = idoffset++;
1043 
1044  rval = m_interface->tag_set_data( idtag, entities, &gid[0] );MB_CHK_ERR( rval );
1045 
1046  return moab::MB_SUCCESS;
1047 }

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

108 {
109  // destroy all meshes
110  if( m_source )
111  {
112  delete m_source;
113  m_source = nullptr;
114  }
115  if( m_target )
116  {
117  delete m_target;
118  m_target = nullptr;
119  }
120  if( m_overlap )
121  {
122  delete m_overlap;
123  m_overlap = nullptr;
124  }
125  if( m_covering_source && size > 1 )
126  {
127  delete m_covering_source;
128  m_covering_source = nullptr;
129  }
130 
131  point_cloud_source = false;
132  point_cloud_target = false;
133 
141  gid_to_lid_src.clear();
142  gid_to_lid_tgt.clear();
143  gid_to_lid_covsrc.clear();
144  lid_to_gid_src.clear();
145  lid_to_gid_tgt.clear();
146  lid_to_gid_covsrc.clear();
147 
148  return MB_SUCCESS;
149 }

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

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

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,
int  nLayers = 0 
)

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

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

References augment_overlap_set(), moab::Range::begin(), ComputeGlobalLocalMaps(), convert_overlap_mesh_sorted_by_source(), moab::AEntityFactory::create_vert_elem_adjacencies(), dbgprint, moab::Range::empty(), moab::Range::end(), moab::Range::erase(), ErrorCode, moab::Skinner::find_skin(), moab::IntxUtils::fix_degenerate_quads(), moab::AEntityFactory::get_adjacencies(), moab::MeshTopoUtil::get_bridge_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_target, m_target_set, mb, MB_CHK_ERR, MB_CHK_SET_ERR, MB_SUCCESS, mbintx, moab::Range::merge(), 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,
int  order = 1 
)

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

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

References moab::Interface::add_entities(), moab::AdaptiveKDTree::build_tree(), moab::Interface::create_meshset(), ErrorCode, moab::Intx2Mesh::FindMaxEdges(), moab::IntxAreaUtils::GaussQuadrature, 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_set_with_ghosts, 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(), rank, 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(), moab::tolerance, and moab::Interface::write_file().

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

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

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(), ConvertMeshToTempest(), and ResetMeshSet().

◆ convert_overlap_mesh_sorted_by_source()

ErrorCode moab::TempestRemapper::convert_overlap_mesh_sorted_by_source ( )
private

Definition at line 745 of file TempestRemapper.cpp.

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

References moab::Range::begin(), moab::Range::clear(), 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::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 256 of file TempestRemapper.cpp.

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

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

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

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

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

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

1063 {
1064  Mesh csMesh;
1065  int err;
1066  moab::ErrorCode rval;
1067 
1068  const int csResolution = std::sqrt( ntot_elements / 6.0 );
1069 
1070  if( csResolution * csResolution * 6 != ntot_elements ) return MB_INVALID_SIZE;
1071 
1072  // Create a temporary Cubed-Sphere mesh
1073  // NOTE: This will not work for RRM grids. Need to run HOMME for that case anyway
1074  err = GenerateCSMesh( csMesh, csResolution, "", "NetCDF4" );MB_CHK_SET_ERR( err ? MB_FAILURE : MB_SUCCESS, "Failed to generate CS mesh through TempestRemap" );
1075 
1076  rval = this->GenerateMeshMetadata( csMesh, ntot_elements, ents, secondary_ents, dofTagName, nP );MB_CHK_SET_ERR( rval, "Failed in call to GenerateMeshMetadata" );
1077 
1078  return moab::MB_SUCCESS;
1079 }

References ErrorCode, GenerateMeshMetadata(), MB_CHK_SET_ERR, MB_INVALID_SIZE, 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 1081 of file TempestRemapper.cpp.

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

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 591 of file TempestRemapper.hpp.

592 {
593  return m_covering_source;
594 }

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 596 of file TempestRemapper.hpp.

597 {
598  return m_covering_source_set;
599 }

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 601 of file TempestRemapper.hpp.

602 {
603  switch( ctx )
604  {
606  return lid_to_gid_src[localID];
608  return lid_to_gid_tgt[localID];
610  return lid_to_gid_covsrc[localID];
613  case Remapper::DEFAULT:
614  default:
615  return -1;
616  }
617 }

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, moab::Remapper::SourceMeshWithGhosts, 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 2196 of file TempestRemapper.cpp.

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

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 619 of file TempestRemapper.hpp.

620 {
621  switch( ctx )
622  {
624  return gid_to_lid_src[globalID];
626  return gid_to_lid_tgt[globalID];
628  return gid_to_lid_covsrc[globalID];
629  case Remapper::DEFAULT:
632  default:
633  return -1;
634  }
635 }

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, moab::Remapper::SourceMeshWithGhosts, 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 349 of file TempestRemapper.hpp.

350 {
351  switch( ctx )
352  {
354  return m_source;
356  return m_target;
358  return m_overlap;
360  return m_covering_source;
361  case Remapper::DEFAULT: // Remapper::SourceMeshWithGhosts does not need one
362  default:
363  return NULL;
364  }
365 }

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 468 of file TempestRemapper.hpp.

469 {
470  switch( ctx )
471  {
473  return m_source_entities;
475  return m_target_entities;
477  return m_overlap_entities;
480  case Remapper::DEFAULT:
481  default:
482  MB_SET_ERR_RET_VAL( "Invalid context passed to GetMeshSet", m_overlap_entities );
483  }
484 }

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 486 of file TempestRemapper.hpp.

487 {
488  switch( ctx )
489  {
491  return m_source_entities;
493  return m_target_entities;
495  return m_overlap_entities;
498  case Remapper::DEFAULT:
499  default:
500  MB_SET_ERR_RET_VAL( "Invalid context passed to GetMeshSet", m_overlap_entities );
501  }
502 }

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 424 of file TempestRemapper.hpp.

425 {
426  switch( ctx )
427  {
429  return m_source_set;
431  return m_target_set;
433  return m_overlap_set;
435  return m_covering_source_set;
440  case Remapper::DEFAULT:
441  default:
442  MB_SET_ERR_RET_VAL( "Invalid context passed to GetMeshSet", m_overlap_set );
443  }
444 }

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

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 446 of file TempestRemapper.hpp.

447 {
448  switch( ctx )
449  {
451  return m_source_set;
453  return m_target_set;
455  return m_overlap_set;
457  return m_covering_source_set;
462  case Remapper::DEFAULT:
463  default:
464  MB_SET_ERR_RET_VAL( "Invalid context passed to GetMeshSet", m_overlap_set );
465  }
466 }

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

◆ GetMeshType()

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

Get the mesh type corresponding to the intersection context

Definition at line 575 of file TempestRemapper.hpp.

576 {
577  switch( ctx )
578  {
580  return m_source_type;
582  return m_target_type;
584  return m_overlap_type;
585  case Remapper::DEFAULT: // not need yet case Remapper::SourceMeshWithGhosts
586  default:
588  }
589 }

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 504 of file TempestRemapper.hpp.

505 {
506  switch( ctx )
507  {
509  return m_source_vertices;
511  return m_target_vertices;
514  case Remapper::DEFAULT:
515  default:
516  MB_SET_ERR_RET_VAL( "Invalid context passed to GetMeshSet", m_source_vertices );
517  }
518 }

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 520 of file TempestRemapper.hpp.

521 {
522  switch( ctx )
523  {
525  return m_source_vertices;
527  return m_target_vertices;
530  case Remapper::DEFAULT:
531  default:
532  MB_SET_ERR_RET_VAL( "Invalid context passed to GetMeshSet", m_source_vertices );
533  }
534 }

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

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

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

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

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_source_set_with_ghosts, 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 178 of file TempestRemapper.cpp.

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

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

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

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

◆ ResetMeshSet()

void moab::TempestRemapper::ResetMeshSet ( Remapper::IntersectionContext  ctx,
moab::EntityHandle  meshSet 
)
inline

reconstruct mesh, used now only for IO; need a better solution maybe

Definition at line 397 of file TempestRemapper.hpp.

398 {
399  switch( ctx )
400  {
402  delete m_source;
403  m_source = new Mesh;
404  m_source_set = meshSet;
406  m_source->CalculateFaceAreas( false ); // fInputConcave is false ?
407  break;
409  // not needed yet
410  break;
412  // not needed yet
413  break;
415  // not needed yet
416  break;
417  case Remapper::DEFAULT:
418  default:
419  break;
420  }
421 }

References convert_mesh_to_tempest_private(), moab::Remapper::CoveringMesh, moab::Remapper::DEFAULT, m_source, m_source_entities, m_source_set, m_source_vertices, moab::Remapper::OverlapMesh, moab::Remapper::SourceMesh, and moab::Remapper::TargetMesh.

◆ 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 367 of file TempestRemapper.hpp.

368 {
369  switch( ctx )
370  {
372  if( !overwrite && m_source ) return;
373  if( overwrite && m_source ) delete m_source;
374  m_source = mesh;
375  break;
377  if( !overwrite && m_target ) return;
378  if( overwrite && m_target ) delete m_target;
379  m_target = mesh;
380  break;
382  if( !overwrite && m_overlap ) return;
383  if( overwrite && m_overlap ) delete m_overlap;
384  m_overlap = mesh;
385  break;
387  if( !overwrite && m_covering_source ) return;
388  if( overwrite && m_covering_source ) delete m_covering_source;
389  m_covering_source = mesh;
390  break;
391  case Remapper::DEFAULT: // Remapper::SourceMeshWithGhosts does not need one
392  default:
393  break;
394  }
395 }

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 = nullptr 
)

Definition at line 988 of file TempestRemapper.cpp.

991 {
992 
993  if( ctx == Remapper::SourceMesh ) // should not be used
994  {
995  m_source_set = mset;
997  }
998  else if( ctx == Remapper::TargetMesh )
999  {
1000  m_target_set = mset;
1002  }
1003  else if( ctx == Remapper::CoveringMesh )
1004  {
1005  m_covering_source_set = mset;
1007  }
1008  else if( ctx == Remapper::SourceMeshWithGhosts )
1009  {
1010  m_source_set_with_ghosts = mset; // entities not used
1011  }
1012  else if( ctx == Remapper::TargetMeshWithGhosts )
1013  {
1014  m_target_set_with_ghosts = mset; // entities not used
1015  }
1016  else
1017  {
1018  // nothing to do really..
1019  return;
1020  }
1021 }

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

Referenced by CreateTempestMesh().

◆ 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 536 of file TempestRemapper.hpp.

537 {
538  switch( ctx )
539  {
541  m_source_type = static_cast< moab::TempestRemapper::TempestMeshType >( metadata[0] );
542  if( metadata[0] == 1 ) // RLL mesh
543  {
544  m_source_metadata.resize( 2 );
545  m_source_metadata[0] = metadata[1];
546  m_source_metadata[1] = metadata[2];
547  }
548  else
549  {
550  m_source_metadata.resize( 1 );
551  m_source_metadata[0] = metadata[1];
552  }
553  break;
555  m_target_type = static_cast< moab::TempestRemapper::TempestMeshType >( metadata[0] );
556  if( metadata[0] == 1 ) // RLL mesh
557  {
558  m_target_metadata.resize( 2 );
559  m_target_metadata[0] = metadata[1];
560  m_target_metadata[1] = metadata[2];
561  }
562  else
563  {
564  m_target_metadata.resize( 1 );
565  m_target_metadata[0] = metadata[1];
566  }
567  break;
570  default:
571  break;
572  }
573 }

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

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

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 333 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 334 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 334 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 334 of file TempestRemapper.hpp.

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

◆ m_area_method

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

Definition at line 336 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 318 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 321 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 304 of file TempestRemapper.hpp.

Referenced by SetMeshType().

◆ m_source_set

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

◆ m_source_set_with_ghosts

moab::EntityHandle moab::TempestRemapper::m_source_set_with_ghosts
private

Definition at line 340 of file TempestRemapper.hpp.

Referenced by ConstructCoveringSet(), GetMeshSet(), initialize(), and SetMeshSet().

◆ m_source_type

TempestMeshType moab::TempestRemapper::m_source_type
private

Definition at line 298 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

moab::Range moab::TempestRemapper::m_target_entities
private

◆ m_target_metadata

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

Definition at line 314 of file TempestRemapper.hpp.

Referenced by SetMeshType().

◆ m_target_set

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

◆ m_target_set_with_ghosts

moab::EntityHandle moab::TempestRemapper::m_target_set_with_ghosts
private

Definition at line 341 of file TempestRemapper.hpp.

Referenced by GetMeshSet(), and SetMeshSet().

◆ m_target_type

TempestMeshType moab::TempestRemapper::m_target_type
private

Definition at line 308 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 302 of file TempestRemapper.hpp.

Referenced by ConstructCoveringSet().

◆ max_target_edges

int moab::TempestRemapper::max_target_edges
private

Definition at line 312 of file TempestRemapper.hpp.

Referenced by ConstructCoveringSet().

◆ mbintx

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

Definition at line 324 of file TempestRemapper.hpp.

Referenced by ComputeOverlapMesh(), and ConstructCoveringSet().

◆ meshValidate

bool moab::TempestRemapper::meshValidate

Definition at line 271 of file TempestRemapper.hpp.

Referenced by load_tempest_mesh_private(), and main().

◆ offlineWorkflow

const bool moab::TempestRemapper::offlineWorkflow

Definition at line 270 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 343 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: