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,
117 std::vector< double >& areaA,
119 std::vector< double >& areaB,
126 const std::map< std::string, std::string >& attrMap );
179 const DataArray3D< double >& dataGLLJacobian );
186 const DataArray3D< double >& dataGLLJacobian,
189 bool fNoConservation );
196 const DataArray3D< double >& dataGLLJacobian,
197 const DataArray1D< double >& dataGLLNodalArea,
201 bool fNoConservation );
208 const DataArray3D< double >& dataGLLJacobianIn,
209 const DataArray3D< int >& dataGLLNodesOut,
210 const DataArray3D< double >& dataGLLJacobianOut,
211 const DataArray1D< double >& dataNodalAreaOut,
217 bool fNoConservation );
224 const DataArray3D< double >& dataGLLJacobianIn,
225 const DataArray3D< int >& dataGLLNodesOut,
226 const DataArray3D< double >& dataGLLJacobianOut,
227 const DataArray1D< double >& dataNodalAreaOut,
232 bool fContinuousOut );
239 #ifdef MOAB_HAVE_EIGEN3
240 void copy_tempest_sparsemat_to_eigen3();
247 const std::map< std::string, std::string >& attrMap );
278 bool isSrcContinuous,
279 DataArray3D< int >* srcdataGLLNodes,
280 DataArray3D< int >* srcdataGLLNodesSrc,
283 bool isTgtContinuous,
284 DataArray3D< int >* tgtdataGLLNodes );
295 std::vector< double >& dataOutDouble,
297 int caasIteration = 0,
298 double mismatch = 0.0 );
310 bool useMOABAdjacencies =
true,
311 Mesh* trMesh =
nullptr );
313 #ifdef MOAB_HAVE_EIGEN3
315 typedef Eigen::Matrix< double, 1, Eigen::Dynamic > WeightDRowVector;
316 typedef Eigen::Matrix< double, Eigen::Dynamic, 1 > WeightDColVector;
317 typedef Eigen::SparseVector< double > WeightSVector;
318 typedef Eigen::SparseMatrix< double, Eigen::RowMajor > WeightRMatrix;
319 typedef Eigen::SparseMatrix< double, Eigen::ColMajor > WeightCMatrix;
321 typedef WeightDRowVector WeightRowVector;
322 typedef WeightDColVector WeightColVector;
323 typedef WeightRMatrix WeightMatrix;
329 WeightMatrix& GetWeightMatrix();
334 WeightRowVector& GetRowVector();
339 WeightColVector& GetColVector();
411 bool transpose =
false,
413 double default_projection = 0.0 );
424 const std::string& solnName,
428 std::string cloneSolnName =
"" );
437 std::map< std::string, double >& metrics,
445 ids_of_interest.push_back( *it + 1 );
460 template <
typename SparseMatrixType >
466 std::vector< double >& dataLowerBound,
467 std::vector< double >& dataUpperBound,
470 std::vector< double >& dataCorrectedField,
471 std::vector< double >& dataLowerBound,
472 std::vector< double >& dataUpperBound,
473 std::vector< double >& dMassDefect );
482 std::vector< double >& tgtVals,
483 bool transpose =
false );
486 int rearrange_arrays_by_dofs(
const std::vector< unsigned int >& gdofmap,
487 DataArray1D< double >& vecFaceArea,
488 DataArray1D< double >& dCenterLon,
489 DataArray1D< double >& dCenterLat,
490 DataArray2D< double >& dVertexLat,
491 DataArray2D< double >& dVertexLon,
492 std::vector< int >& masks,
503 #ifdef MOAB_HAVE_EIGEN3
505 int num_rows, num_cols;
506 WeightMatrix m_weightMatrix;
507 WeightRowVector m_rowVector;
508 WeightColVector m_colVector;
559 return row_gdofmap[localRowID];
564 return globalRowDoF + 1;
570 return col_gdofmap[localColID];
575 return globalColDoF + 1;
581 return m_nDofsPEl_Src;
588 return m_nDofsPEl_Dest;
599 m_nDofsPEl_Dest = nt;
603 #ifdef MOAB_HAVE_EIGEN3
607 return m_weightMatrix.cols();
614 return m_weightMatrix.rows();
621 return m_weightMatrix.cols();
628 return m_weightMatrix.rows();
633 inline moab::TempestOnlineMap::WeightMatrix& moab::TempestOnlineMap::GetWeightMatrix()
635 assert( m_weightMatrix.rows() != 0 && m_weightMatrix.cols() != 0 );
636 return m_weightMatrix;
641 inline moab::TempestOnlineMap::WeightRowVector& moab::TempestOnlineMap::GetRowVector()
643 assert( m_rowVector.size() != 0 );
649 inline moab::TempestOnlineMap::WeightColVector& moab::TempestOnlineMap::GetColVector()
651 assert( m_colVector.size() != 0 );