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
101 std::string strOutputType,
102 const GenerateOfflineMapAlgorithmOptions& mapOptions,
103 const std::string& srcDofTagName =
"GLOBAL_ID",
104 const std::string& tgtDofTagName =
"GLOBAL_ID" );
115 const std::vector< int >& tgt_dof_ids,
116 std::vector< double >& areaA,
118 std::vector< double >& areaB,
125 const std::map< std::string, std::string >& attrMap );
178 const DataArray3D< double >& dataGLLJacobian );
185 const DataArray3D< double >& dataGLLJacobian,
188 bool fNoConservation );
195 const DataArray3D< double >& dataGLLJacobian,
196 const DataArray1D< double >& dataGLLNodalArea,
200 bool fNoConservation );
207 const DataArray3D< double >& dataGLLJacobianIn,
208 const DataArray3D< int >& dataGLLNodesOut,
209 const DataArray3D< double >& dataGLLJacobianOut,
210 const DataArray1D< double >& dataNodalAreaOut,
216 bool fNoConservation );
223 const DataArray3D< double >& dataGLLJacobianIn,
224 const DataArray3D< int >& dataGLLNodesOut,
225 const DataArray3D< double >& dataGLLJacobianOut,
226 const DataArray1D< double >& dataNodalAreaOut,
231 bool fContinuousOut );
238 #ifdef MOAB_HAVE_EIGEN3
239 void copy_tempest_sparsemat_to_eigen3();
246 const std::map< std::string, std::string >& attrMap );
277 bool isSrcContinuous,
278 DataArray3D< int >* srcdataGLLNodes,
279 DataArray3D< int >* srcdataGLLNodesSrc,
282 bool isTgtContinuous,
283 DataArray3D< int >* tgtdataGLLNodes );
294 std::vector< double >& dataOutDouble,
296 int caasIteration = 0,
297 double mismatch = 0.0 );
309 bool useMOABAdjacencies =
true,
310 Mesh* trMesh =
nullptr );
312 #ifdef MOAB_HAVE_EIGEN3
314 typedef Eigen::Matrix< double, 1, Eigen::Dynamic > WeightDRowVector;
315 typedef Eigen::Matrix< double, Eigen::Dynamic, 1 > WeightDColVector;
316 typedef Eigen::SparseVector< double > WeightSVector;
317 typedef Eigen::SparseMatrix< double, Eigen::RowMajor > WeightRMatrix;
318 typedef Eigen::SparseMatrix< double, Eigen::ColMajor > WeightCMatrix;
320 typedef WeightDRowVector WeightRowVector;
321 typedef WeightDColVector WeightColVector;
322 typedef WeightRMatrix WeightMatrix;
328 WeightMatrix& GetWeightMatrix();
333 WeightRowVector& GetRowVector();
338 WeightColVector& GetColVector();
410 bool transpose =
false,
412 double default_projection = 0.0 );
423 const std::string& solnName,
427 std::string cloneSolnName =
"" );
436 std::map< std::string, double >& metrics,
444 ids_of_interest.push_back( *it + 1 );
454 ids_of_interest.push_back( *it + 1 );
469 template <
typename SparseMatrixType >
475 std::vector< double >& dataLowerBound,
476 std::vector< double >& dataUpperBound,
479 std::vector< double >& dataCorrectedField,
480 std::vector< double >& dataLowerBound,
481 std::vector< double >& dataUpperBound,
482 std::vector< double >& dMassDefect );
491 std::vector< double >& tgtVals,
492 bool transpose =
false );
495 int rearrange_arrays_by_dofs(
const std::vector< unsigned int >& gdofmap,
496 DataArray1D< double >& vecFaceArea,
497 DataArray1D< double >& dCenterLon,
498 DataArray1D< double >& dCenterLat,
499 DataArray2D< double >& dVertexLat,
500 DataArray2D< double >& dVertexLon,
501 std::vector< int >& masks,
512 #ifdef MOAB_HAVE_EIGEN3
514 WeightMatrix m_weightMatrix;
515 WeightRowVector m_rowVector;
516 WeightColVector m_colVector;
567 return row_gdofmap[localRowID];
572 return globalRowDoF + 1;
578 return col_gdofmap[localColID];
583 return globalColDoF + 1;
589 return m_nDofsPEl_Src;
596 return m_nDofsPEl_Dest;
607 m_nDofsPEl_Dest = nt;
611 #ifdef MOAB_HAVE_EIGEN3
615 return m_weightMatrix.cols();
622 return m_weightMatrix.rows();
629 return m_weightMatrix.cols();
636 return m_weightMatrix.rows();
641 inline moab::TempestOnlineMap::WeightMatrix& moab::TempestOnlineMap::GetWeightMatrix()
643 assert( m_weightMatrix.rows() != 0 && m_weightMatrix.cols() != 0 );
644 return m_weightMatrix;
649 inline moab::TempestOnlineMap::WeightRowVector& moab::TempestOnlineMap::GetRowVector()
651 assert( m_rowVector.size() != 0 );
657 inline moab::TempestOnlineMap::WeightColVector& moab::TempestOnlineMap::GetColVector()
659 assert( m_colVector.size() != 0 );