Commit a69d4b0f authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#1053 Operator FromVertexMatching: keep the matrix pattern in storage.

parent 59aa117c
...@@ -134,7 +134,10 @@ namespace HappyHeart ...@@ -134,7 +134,10 @@ namespace HappyHeart
})); }));
Wrappers::Petsc::MatrixPattern matrix_pattern(non_zero_pattern_per_line); matrix_pattern_ = std::make_unique<Wrappers::Petsc::MatrixPattern>(non_zero_pattern_per_line);
decltype(auto) matrix_pattern = GetMatrixPattern();
auto& interpolation_matrix = *interpolation_matrix_; auto& interpolation_matrix = *interpolation_matrix_;
const auto& mpi = source.GetFEltSpace().MpiHappyHeart(); const auto& mpi = source.GetFEltSpace().MpiHappyHeart();
......
...@@ -134,6 +134,14 @@ namespace HappyHeart ...@@ -134,6 +134,14 @@ namespace HappyHeart
//! Access to interpolation matrix. //! Access to interpolation matrix.
const GlobalMatrix& GetInterpolationMatrix() const noexcept; const GlobalMatrix& GetInterpolationMatrix() const noexcept;
/*!
* \brief Pattern of the matrix.
*
* \note It is stored for the sake of tests; otherwise it could be dropped once the interpolation
* matrix is created/
*/
const Wrappers::Petsc::MatrixPattern& GetMatrixPattern() const noexcept;
private: private:
...@@ -152,6 +160,14 @@ namespace HappyHeart ...@@ -152,6 +160,14 @@ namespace HappyHeart
//! Global matrix used for the interpolation. //! Global matrix used for the interpolation.
GlobalMatrix::unique_ptr interpolation_matrix_ = nullptr; GlobalMatrix::unique_ptr interpolation_matrix_ = nullptr;
/*!
* \brief Pattern of the matrix.
*
* \note It is stored for the sake of tests; otherwise it could be dropped once the interpolation
* matrix is created/
*/
Wrappers::Petsc::MatrixPattern::const_unique_ptr matrix_pattern_ = nullptr;
}; };
......
...@@ -38,6 +38,13 @@ namespace HappyHeart ...@@ -38,6 +38,13 @@ namespace HappyHeart
assert(!(!interpolation_matrix_)); assert(!(!interpolation_matrix_));
return *interpolation_matrix_; return *interpolation_matrix_;
} }
inline const Wrappers::Petsc::MatrixPattern& FromVertexMatching::GetMatrixPattern() const noexcept
{
assert(!(!matrix_pattern_));
return *matrix_pattern_;
}
} // namespace NonConformInterpolatorNS } // namespace NonConformInterpolatorNS
......
...@@ -118,8 +118,6 @@ namespace HappyHeart ...@@ -118,8 +118,6 @@ namespace HappyHeart
//! jCSR part of the CSR pattern (see iCSR_ for more details). //! jCSR part of the CSR pattern (see iCSR_ for more details).
std::vector<PetscInt> jCSR_; std::vector<PetscInt> jCSR_;
}; };
} // namespace Petsc } // namespace Petsc
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment