mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #963 from blattms/allow-amg-with-matrix-block
Specialize direct solver for Dune::MatrixBlock.
This commit is contained in:
commit
5517b8a3f3
@ -122,6 +122,50 @@ struct MatrixDimension< MatrixBlock< Scalar, n, m > >
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
#if HAVE_UMFPACK
|
||||
|
||||
/// \brief UMFPack specialization for MatrixBlock to make AMG happy
|
||||
///
|
||||
/// Without this the empty default implementation would be used.
|
||||
template<typename T, typename A, int n, int m>
|
||||
class UMFPack<BCRSMatrix<MatrixBlock<T,n,m>, A> >
|
||||
: public UMFPack<BCRSMatrix<FieldMatrix<T,n,m>, A> >
|
||||
{
|
||||
typedef UMFPack<BCRSMatrix<FieldMatrix<T,n,m>, A> > Base;
|
||||
typedef BCRSMatrix<FieldMatrix<T,n,m>, A> Matrix;
|
||||
|
||||
public:
|
||||
typedef BCRSMatrix<MatrixBlock<T,n,m>, A> RealMatrix;
|
||||
|
||||
UMFPack(const RealMatrix& matrix, int verbose, bool)
|
||||
: Base(reinterpret_cast<const Matrix&>(matrix), verbose)
|
||||
{}
|
||||
};
|
||||
#endif
|
||||
|
||||
#if HAVE_SUPERLU
|
||||
|
||||
/// \brief SuperLU specialization for MatrixBlock to make AMG happy
|
||||
///
|
||||
/// Without this the empty default implementation would be used.
|
||||
template<typename T, typename A, int n, int m>
|
||||
class SuperLU<BCRSMatrix<MatrixBlock<T,n,m>, A> >
|
||||
: public SuperLU<BCRSMatrix<FieldMatrix<T,n,m>, A> >
|
||||
{
|
||||
typedef SuperLU<BCRSMatrix<FieldMatrix<T,n,m>, A> > Base;
|
||||
typedef BCRSMatrix<FieldMatrix<T,n,m>, A> Matrix;
|
||||
|
||||
public:
|
||||
typedef BCRSMatrix<MatrixBlock<T,n,m>, A> RealMatrix;
|
||||
|
||||
SuperLU(const RealMatrix& matrix, int verbose, bool reuse=true)
|
||||
: Base(reinterpret_cast<const Matrix&>(matrix), verbose, reuse)
|
||||
{}
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
} // end namespace Dune
|
||||
|
||||
namespace Opm
|
||||
|
Loading…
Reference in New Issue
Block a user