8 #ifndef _TEMPESTONLINEMAP_H_
9 #define _TEMPESTONLINEMAP_H_
12 #ifndef MOAB_HAVE_TEMPESTREMAP
13 #error Re-configure with TempestRemap
19 #pragma GCC diagnostic push
20 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
21 #pragma GCC diagnostic ignored "-Wunused-variable"
22 #include "OfflineMap.h"
24 #ifdef MOAB_HAVE_EIGEN3
25 #include <Eigen/Sparse>
28 #include <unordered_set>
30 #pragma GCC diagnostic pop
34 #if !defined( RECTANGULAR_TRUNCATION ) && !defined( TRIANGULAR_TRUNCATION )
35 #define RECTANGULAR_TRUNCATION
92 std::string strOutputType,
93 const GenerateOfflineMapAlgorithmOptions& mapOptions,
94 const std::string& srcDofTagName =
"GLOBAL_ID",
95 const std::string& tgtDofTagName =
"GLOBAL_ID" );
106 const std::vector< int >& owned_dof_ids,
107 bool row_major_ownership =
true );
113 const std::map< std::string, std::string >& attrMap );
163 const DataArray3D< double >& dataGLLJacobian );
170 const DataArray3D< double >& dataGLLJacobian,
173 bool fNoConservation );
180 const DataArray3D< double >& dataGLLJacobian,
181 const DataArray1D< double >& dataGLLNodalArea,
185 bool fNoConservation );
192 const DataArray3D< double >& dataGLLJacobianIn,
193 const DataArray3D< int >& dataGLLNodesOut,
194 const DataArray3D< double >& dataGLLJacobianOut,
195 const DataArray1D< double >& dataNodalAreaOut,
201 bool fNoConservation );
208 const DataArray3D< double >& dataGLLJacobianIn,
209 const DataArray3D< int >& dataGLLNodesOut,
210 const DataArray3D< double >& dataGLLJacobianOut,
211 const DataArray1D< double >& dataNodalAreaOut,
216 bool fContinuousOut );
223 #ifdef MOAB_HAVE_EIGEN3
224 void copy_tempest_sparsemat_to_eigen3();
231 const std::map< std::string, std::string >& attrMap );
262 bool isSrcContinuous,
263 DataArray3D< int >* srcdataGLLNodes,
264 DataArray3D< int >* srcdataGLLNodesSrc,
267 bool isTgtContinuous,
268 DataArray3D< int >* tgtdataGLLNodes );
279 std::vector< double >& dataOutDouble,
281 int caasIteration = 0,
282 double mismatch = 0.0 );
294 bool useMOABAdjacencies =
true,
295 Mesh* trMesh =
nullptr );
297 #ifdef MOAB_HAVE_EIGEN3
299 typedef Eigen::Matrix< double, 1, Eigen::Dynamic > WeightDRowVector;
300 typedef Eigen::Matrix< double, Eigen::Dynamic, 1 > WeightDColVector;
301 typedef Eigen::SparseVector< double > WeightSVector;
302 typedef Eigen::SparseMatrix< double, Eigen::RowMajor > WeightRMatrix;
303 typedef Eigen::SparseMatrix< double, Eigen::ColMajor > WeightCMatrix;
305 typedef WeightDRowVector WeightRowVector;
306 typedef WeightDColVector WeightColVector;
307 typedef WeightRMatrix WeightMatrix;
313 WeightMatrix& GetWeightMatrix();
318 WeightRowVector& GetRowVector();
323 WeightColVector& GetColVector();
395 bool transpose =
false,
397 double default_projection = 0.0);
408 const std::string& solnName,
412 std::string cloneSolnName =
"" );
421 std::map< std::string, double >& metrics,
429 ids_of_interest.push_back( *it + 1 );
439 ids_of_interest.push_back( *it + 1 );
457 std::vector< double >& dataLowerBound,
458 std::vector< double >& dataUpperBound,
461 std::vector< double >& dataCorrectedField,
462 std::vector< double >& dataLowerBound,
463 std::vector< double >& dataUpperBound,
464 std::vector< double >& dMassDefect );
473 std::vector< double >& tgtVals,
474 bool transpose =
false );
477 int rearrange_arrays_by_dofs(
const std::vector< unsigned int >& gdofmap,
478 DataArray1D< double >& vecFaceArea,
479 DataArray1D< double >& dCenterLon,
480 DataArray1D< double >& dCenterLat,
481 DataArray2D< double >& dVertexLat,
482 DataArray2D< double >& dVertexLon,
483 std::vector< int >& masks,
494 #ifdef MOAB_HAVE_EIGEN3
496 WeightMatrix m_weightMatrix;
497 WeightRowVector m_rowVector;
498 WeightColVector m_colVector;
549 return row_gdofmap[localRowID];
554 return globalRowDoF + 1;
560 return col_gdofmap[localColID];
565 return globalColDoF + 1;
571 return m_nDofsPEl_Src;
578 return m_nDofsPEl_Dest;
589 m_nDofsPEl_Dest = nt;
593 #ifdef MOAB_HAVE_EIGEN3
597 return m_weightMatrix.cols();
604 return m_weightMatrix.rows();
611 return m_weightMatrix.cols();
618 return m_weightMatrix.rows();
623 inline moab::TempestOnlineMap::WeightMatrix& moab::TempestOnlineMap::GetWeightMatrix()
625 assert( m_weightMatrix.rows() != 0 && m_weightMatrix.cols() != 0 );
626 return m_weightMatrix;
631 inline moab::TempestOnlineMap::WeightRowVector& moab::TempestOnlineMap::GetRowVector()
633 assert( m_rowVector.size() != 0 );
639 inline moab::TempestOnlineMap::WeightColVector& moab::TempestOnlineMap::GetColVector()
641 assert( m_colVector.size() != 0 );