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 );
487 template <
typename SparseMatrixType >
492 void CAASLimiter( std::vector< double >& dataCorrectedField,
493 std::vector< double >& dataLowerBound,
494 std::vector< double >& dataUpperBound,
497 std::vector< double >& dataCorrectedField,
498 std::vector< double >& dataLowerBound,
499 std::vector< double >& dataUpperBound,
500 std::vector< double >& dMassDefect );
509 std::vector< double >& tgtVals,
510 bool transpose =
false );
513 int rearrange_arrays_by_dofs(
const std::vector< unsigned int >& gdofmap,
514 DataArray1D< double >& vecFaceArea,
515 DataArray1D< double >& dCenterLon,
516 DataArray1D< double >& dCenterLat,
517 DataArray2D< double >& dVertexLat,
518 DataArray2D< double >& dVertexLon,
519 std::vector< int >& masks,
530 #ifdef MOAB_HAVE_EIGEN3
532 int num_rows, num_cols;
533 WeightMatrix m_weightMatrix;
534 WeightRowVector m_rowVector;
535 WeightColVector m_colVector;
582 #pragma diag_default partial_override
589 return row_gdofmap[localRowID];
594 return globalRowDoF + 1;
600 return col_gdofmap[localColID];
605 return globalColDoF + 1;
611 return m_nDofsPEl_Src;
618 return m_nDofsPEl_Dest;
629 m_nDofsPEl_Dest = nt;
633 #ifdef MOAB_HAVE_EIGEN3
637 return m_weightMatrix.cols();
644 return m_weightMatrix.rows();
651 return m_weightMatrix.cols();
658 return m_weightMatrix.rows();
663 inline moab::TempestOnlineMap::WeightMatrix& moab::TempestOnlineMap::GetWeightMatrix()
665 assert( m_weightMatrix.rows() != 0 && m_weightMatrix.cols() != 0 );
666 return m_weightMatrix;
671 inline moab::TempestOnlineMap::WeightRowVector& moab::TempestOnlineMap::GetRowVector()
673 assert( m_rowVector.size() != 0 );
679 inline moab::TempestOnlineMap::WeightColVector& moab::TempestOnlineMap::GetColVector()
681 assert( m_colVector.size() != 0 );