8 #ifndef MATRIXCONTAINER_HPP_ 9 #define MATRIXCONTAINER_HPP_ 12 #include <Teuchos_ParameterList.hpp> 15 #include <lifev/core/LifeV.hpp> 17 #include <lifev/core/array/MatrixEpetra.hpp> 27 template<
typename KEYTYPE = std::string>
40 typedef typename Container::const_iterator
CIterator;
51 void setParameter (
const std::string& _name,
const T& par);
58 T
getParameter (
const std::string& _name,
const T& dpar)
const;
68 template<
typename KEYTYPE>
71 ASSERT_PRE (_matrix.get() != 0,
"Setting a null pointer to matrix");
72 ValuePair valuePair (_name, _matrix);
73 M_container.insert (valuePair);
76 template<
typename KEYTYPE>
79 CIterator it (M_container.find (_name) );
80 ASSERT_POS (it != M_container.end(),
"Matrix not found");
84 template<
typename KEYTYPE>
87 CIterator it (M_container.find (_name) );
88 ASSERT_POS (it != M_container.end(),
"Matrix not found");
89 return boost::shared_dynamic_cast<Epetra_CrsMatrix> (it->second->getMatrixPtr() );
97 M_pList->set (_name, par);
106 return M_pList->get (_name, dpar);
MatrixType_ptr getMatrix(const KeyType &_name) const
void set(const KeyType &_name, const MatrixType_ptr &_matrix)
Container M_container
map containing the matrices
void updateInverseJacobian(const UInt &iQuadPt)
std::shared_ptr< Epetra_CrsMatrix > MatrixRawType_ptr
MatrixRawType_ptr get(const KeyType &_name) const
std::shared_ptr< MatrixEpetra< double > > MatrixType_ptr
T getParameter(const std::string &_name, const T &dpar) const
MatrixContainer()
Empty constructor.
std::shared_ptr< Teuchos::ParameterList > M_pList
list for additional parameters
std::map< KeyType, MatrixType_ptr > Container
Container::value_type ValuePair
void setParameter(const std::string &_name, const T &par)