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
31 #define EIGEN_DEFAULT_TO_ROW_MAJOR
32 #define EIGEN_RUNTIME_NO_MALLOC
34 #include <Eigen/Sparse>
37 #include <unordered_set>
39 #pragma GCC diagnostic pop
43 #if !defined( RECTANGULAR_TRUNCATION ) && !defined( TRIANGULAR_TRUNCATION )
44 #define RECTANGULAR_TRUNCATION
66 #pragma diag_suppress partial_override
108 std::string strOutputType,
109 const GenerateOfflineMapAlgorithmOptions& mapOptions,
110 const std::string& srcDofTagName =
"GLOBAL_ID",
111 const std::string& tgtDofTagName =
"GLOBAL_ID" );
122 const std::vector< int >& tgt_dof_ids,
124 std::vector< double >& areaA,
126 std::vector< double >& areaB,
133 const std::map< std::string, std::string >& attrMap );
186 const DataArray3D< double >& dataGLLJacobian );
193 const DataArray3D< double >& dataGLLJacobian,
196 bool fNoConservation );
203 const DataArray3D< double >& dataGLLJacobian,
204 const DataArray1D< double >& dataGLLNodalArea,
208 bool fNoConservation );
215 const DataArray3D< double >& dataGLLJacobianIn,
216 const DataArray3D< int >& dataGLLNodesOut,
217 const DataArray3D< double >& dataGLLJacobianOut,
218 const DataArray1D< double >& dataNodalAreaOut,
224 bool fNoConservation );
231 const DataArray3D< double >& dataGLLJacobianIn,
232 const DataArray3D< int >& dataGLLNodesOut,
233 const DataArray3D< double >& dataGLLJacobianOut,
234 const DataArray1D< double >& dataNodalAreaOut,
239 bool fContinuousOut );
246 #ifdef MOAB_HAVE_EIGEN3
247 void copy_tempest_sparsemat_to_eigen3();
254 const std::map< std::string, std::string >& attrMap );
285 bool isSrcContinuous,
286 DataArray3D< int >* srcdataGLLNodes,
287 DataArray3D< int >* srcdataGLLNodesSrc,
290 bool isTgtContinuous,
291 DataArray3D< int >* tgtdataGLLNodes );
302 std::vector< double >& dataOutDouble,
304 int caasIteration = 0,
305 double mismatch = 0.0 );
316 const Range& entities,
317 bool useMOABAdjacencies =
true,
318 Mesh* trMesh =
nullptr );
320 #ifdef MOAB_HAVE_EIGEN3
322 typedef Eigen::Matrix< double, 1, Eigen::Dynamic > WeightDRowVector;
323 typedef Eigen::Matrix< double, Eigen::Dynamic, 1 > WeightDColVector;
324 typedef Eigen::SparseVector< double > WeightSVector;
325 typedef Eigen::SparseMatrix< double, Eigen::RowMajor > WeightRMatrix;
326 typedef Eigen::SparseMatrix< double, Eigen::ColMajor > WeightCMatrix;
328 typedef WeightDRowVector WeightRowVector;
329 typedef WeightDColVector WeightColVector;
330 typedef WeightRMatrix WeightMatrix;
336 WeightMatrix& GetWeightMatrix();
341 WeightRowVector& GetRowVector();
346 WeightColVector& GetColVector();
418 bool transpose =
false,
420 double default_projection = 0.0 );
445 const std::string& solnName,
449 std::string cloneSolnName =
"" );
458 std::map< std::string, double >& metrics,
466 ids_of_interest.push_back( *it + 1 );
504 template <
typename SparseMatrixType >
509 void CAASLimiter( std::vector< double >& dataCorrectedField,
510 std::vector< double >& dataLowerBound,
511 std::vector< double >& dataUpperBound,
514 std::vector< double >& dataCorrectedField,
515 std::vector< double >& dataLowerBound,
516 std::vector< double >& dataUpperBound,
517 std::vector< double >& dMassDefect );
526 std::vector< double >& tgtVals,
527 bool transpose =
false );
530 int rearrange_arrays_by_dofs(
const std::vector< unsigned int >& gdofmap,
531 DataArray1D< double >& vecFaceArea,
532 DataArray1D< double >& dCenterLon,
533 DataArray1D< double >& dCenterLat,
534 DataArray2D< double >& dVertexLat,
535 DataArray2D< double >& dVertexLon,
536 std::vector< int >& masks,
547 #ifdef MOAB_HAVE_EIGEN3
549 int num_rows, num_cols;
550 WeightMatrix m_weightMatrix;
551 WeightRowVector m_rowVector;
552 WeightColVector m_colVector;
604 #pragma diag_default partial_override
611 return row_gdofmap[localRowID];
616 return globalRowDoF + 1;
622 return col_gdofmap[localColID];
627 return globalColDoF + 1;
633 return m_nDofsPEl_Src;
640 return m_nDofsPEl_Dest;
651 m_nDofsPEl_Dest = nt;
655 #ifdef MOAB_HAVE_EIGEN3
659 return m_weightMatrix.cols();
666 return m_weightMatrix.rows();
673 return m_weightMatrix.cols();
680 return m_weightMatrix.rows();
685 inline moab::TempestOnlineMap::WeightMatrix& moab::TempestOnlineMap::GetWeightMatrix()
687 assert( m_weightMatrix.rows() != 0 && m_weightMatrix.cols() != 0 );
688 return m_weightMatrix;
693 inline moab::TempestOnlineMap::WeightRowVector& moab::TempestOnlineMap::GetRowVector()
695 assert( m_rowVector.size() != 0 );
701 inline moab::TempestOnlineMap::WeightColVector& moab::TempestOnlineMap::GetColVector()
703 assert( m_colVector.size() != 0 );