24template <
typename MatVec,
typename... Args>
26 std::size_t&
id, std::map<MatVec*, std::size_t>& used_map, Args&&... args)
31 std::forward<Args>(args)...)
34 return {res.first->first,
true};
37template <
typename... Args>
39 std::size_t&
id, Args&&... args)
62 "The given matrix has not been found. Cannot release it. "
72template <
typename... Args>
74 std::size_t&
id, Args&&... args)
127 "The given vector has not been found. Cannot release it. "
142 "There are still {:d} global matrices in use."
143 " This might be an indicator of a possible waste of memory.",
149 "There are still {:d} global vectors in use."
150 " This might be an indicator of a possible waste of memory.",
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
Global vector based on Eigen vector.
std::pair< GlobalVector *, bool > getVector_(std::size_t &id, Args &&... args)
void releaseVector(GlobalVector const &x) override
GlobalVector & getVector(std::size_t &id) override
Get an uninitialized vector with the given id.
std::pair< GlobalMatrix *, bool > getMatrix_(std::size_t &id, Args &&... args)
std::map< GlobalMatrix *, std::size_t > _used_matrices
std::pair< MatVec *, bool > get_(std::size_t &id, std::map< MatVec *, std::size_t > &used_map, Args &&... args)
GlobalMatrix & getMatrix(std::size_t &id) override
Get an uninitialized matrix with the given id.
~SimpleMatrixVectorProvider() override
std::map< GlobalVector *, std::size_t > _used_vectors
void releaseMatrix(GlobalMatrix const &A) override
void copy(PETScVector const &x, PETScVector &y)