KASKADE 7 development version
Public Types | Public Member Functions | List of all members
Kaskade::DirectSolver< Domain_, Range_ > Class Template Reference

More...

#include <direct.hh>

Detailed Description

template<class Domain_, class Range_>
class Kaskade::DirectSolver< Domain_, Range_ >

Dune::InverseOperator and Dune::Preconditioner interface for direct solvers.

This keeps a factorization during the lifetime of the object, however, due to shared data, efficient copying is possible.

Definition at line 98 of file direct.hh.

Inheritance diagram for Kaskade::DirectSolver< Domain_, Range_ >:

Public Types

typedef DirectSolver_Detail::ScalarType< Domain_ >::type Scalar
 
typedef Domain_ Domain
 
typedef Range_ Range
 

Public Member Functions

 DirectSolver ()
 Default constructor. More...
 
 DirectSolver (DirectSolver< Domain, Range > const &ds)=default
 Copy constructor. More...
 
template<class GOP , int firstRow, int lastRow, int firstCol, int lastCol>
 DirectSolver (AssembledGalerkinOperator< GOP, firstRow, lastRow, firstCol, lastCol > const &A, DirectType directType=DirectType::UMFPACK, FactorizationOptions options=FactorizationOptions())
 Constructs a direct solver from an assembled linear operator. More...
 
template<class AssembledGOP >
 DirectSolver (AssembledGOP const &A, DirectType directType, MatrixProperties properties)
 Constructs a direct solver from an assembled linear operator. More...
 
template<class FieldType >
 DirectSolver (MatrixAsTriplet< FieldType > const &A, DirectType directType=DirectType::UMFPACK, FactorizationOptions options=FactorizationOptions())
 Constructs a direct solver from a triplet matrix. More...
 
template<class FieldType >
 DirectSolver (MatrixAsTriplet< FieldType > const &A, DirectType directType, MatrixProperties properties)
 Constructs a direct solver from a triplet matrix. More...
 
template<class FieldType >
 DirectSolver (Dune::BCRSMatrix< Dune::FieldMatrix< FieldType, 1, 1 > > const &A, DirectType directType=DirectType::UMFPACK, MatrixProperties properties=MatrixProperties::GENERAL)
 Constructs a direct solver from a BCRS matrix. A copy of the linear operator is held internally, thus the linear operator object is better not too large. More...
 
template<class FieldType , int n, int m, class Index >
 DirectSolver (NumaBCRSMatrix< Dune::FieldMatrix< FieldType, n, m >, Index > const &A, DirectType directType, MatrixProperties properties)
 Constructs a direct solver from a NumaBCRS matrix. A copy of the linear operator is held internally, thus the linear operator object is better not too large. More...
 
template<class FieldType , int n, int m, class Index >
 DirectSolver (NumaBCRSMatrix< Dune::FieldMatrix< FieldType, n, m >, Index > const &A, DirectType directType=DirectType::UMFPACK, FactorizationOptions options=FactorizationOptions())
 Constructs a direct solver from a NumaBCRS matrix. A copy of the linear operator is held internally, thus the linear operator object is better not too large. More...
 
virtual void pre (Domain &, Range &)
 unused More...
 
virtual void post (Domain &)
 unused More...
 
virtual Dune::SolverCategory::Category category () const override
 returns the category of the operator More...
 
Solution

These methods apply the inverse operators, i.e. they solve the linear system. We provide several different interfaces such as Dune::InverseOperator and Dune::Preconditioner and some more (in particular const methods) for convenience. All the methods do essentially the same - they solve the system.

virtual void apply (Domain &x, Range &b, Dune::InverseOperatorResult &res)
 Solves the system for the given right hand side b. More...
 
void apply (Domain &x, Range &b, Dune::InverseOperatorResult &res) const
 Solves the system for the given right hand side b. More...
 
virtual void apply (Domain &x, Range &b, double reduction, Dune::InverseOperatorResult &res)
 Solves the system for the given right hand side b. More...
 
void apply (Domain &x, Range const &b, double reduction, Dune::InverseOperatorResult &res) const
 Solves the system for the given right hand side b. More...
 
void apply (std::vector< Scalar > &v, double, Dune::InverseOperatorResult &res) const
 The input vector v contains the rhs. It will be overwritten by the solution. More...
 
virtual void apply (std::vector< Scalar > &v) const
 Solves the system \( Ax = b \). More...
 
virtual void apply (Domain &x, Range const &b)
 Solves the system for the given right hand side b. More...
 
virtual void apply (Domain &x, Range const &b) const
 Solves the system for the given right hand side b. More...
 

Member Typedef Documentation

◆ Domain

template<class Domain_ , class Range_ >
typedef Domain_ Kaskade::DirectSolver< Domain_, Range_ >::Domain

Definition at line 103 of file direct.hh.

◆ Range

template<class Domain_ , class Range_ >
typedef Range_ Kaskade::DirectSolver< Domain_, Range_ >::Range

Definition at line 104 of file direct.hh.

◆ Scalar

template<class Domain_ , class Range_ >
typedef DirectSolver_Detail::ScalarType<Domain_>::type Kaskade::DirectSolver< Domain_, Range_ >::Scalar

Definition at line 102 of file direct.hh.

Constructor & Destructor Documentation

◆ DirectSolver() [1/9]

template<class Domain_ , class Range_ >
Kaskade::DirectSolver< Domain_, Range_ >::DirectSolver ( )
inline

Default constructor.

A default constructed DirectSolver implements a (pretty useless) zero operator.

Definition at line 111 of file direct.hh.

◆ DirectSolver() [2/9]

template<class Domain_ , class Range_ >
Kaskade::DirectSolver< Domain_, Range_ >::DirectSolver ( DirectSolver< Domain, Range > const &  ds)
default

Copy constructor.

The copy shares the factorization with the source.

◆ DirectSolver() [3/9]

template<class Domain_ , class Range_ >
template<class GOP , int firstRow, int lastRow, int firstCol, int lastCol>
Kaskade::DirectSolver< Domain_, Range_ >::DirectSolver ( AssembledGalerkinOperator< GOP, firstRow, lastRow, firstCol, lastCol > const &  A,
DirectType  directType = DirectType::UMFPACK,
FactorizationOptions  options = FactorizationOptions() 
)
inlineexplicit

Constructs a direct solver from an assembled linear operator.

A copy of the linear operator is held internally, thus the linear operator object is better not too large.

Definition at line 127 of file direct.hh.

◆ DirectSolver() [4/9]

template<class Domain_ , class Range_ >
template<class AssembledGOP >
Kaskade::DirectSolver< Domain_, Range_ >::DirectSolver ( AssembledGOP const &  A,
DirectType  directType,
MatrixProperties  properties 
)
inlineexplicit

Constructs a direct solver from an assembled linear operator.

Deprecated:

Definition at line 142 of file direct.hh.

◆ DirectSolver() [5/9]

template<class Domain_ , class Range_ >
template<class FieldType >
Kaskade::DirectSolver< Domain_, Range_ >::DirectSolver ( MatrixAsTriplet< FieldType > const &  A,
DirectType  directType = DirectType::UMFPACK,
FactorizationOptions  options = FactorizationOptions() 
)
inlineexplicit

Constructs a direct solver from a triplet matrix.

Definition at line 153 of file direct.hh.

◆ DirectSolver() [6/9]

template<class Domain_ , class Range_ >
template<class FieldType >
Kaskade::DirectSolver< Domain_, Range_ >::DirectSolver ( MatrixAsTriplet< FieldType > const &  A,
DirectType  directType,
MatrixProperties  properties 
)
inlineexplicit

Constructs a direct solver from a triplet matrix.

Deprecated:

Definition at line 169 of file direct.hh.

◆ DirectSolver() [7/9]

template<class Domain_ , class Range_ >
template<class FieldType >
Kaskade::DirectSolver< Domain_, Range_ >::DirectSolver ( Dune::BCRSMatrix< Dune::FieldMatrix< FieldType, 1, 1 > > const &  A,
DirectType  directType = DirectType::UMFPACK,
MatrixProperties  properties = MatrixProperties::GENERAL 
)
inlineexplicit

Constructs a direct solver from a BCRS matrix. A copy of the linear operator is held internally, thus the linear operator object is better not too large.

Definition at line 181 of file direct.hh.

◆ DirectSolver() [8/9]

template<class Domain_ , class Range_ >
template<class FieldType , int n, int m, class Index >
Kaskade::DirectSolver< Domain_, Range_ >::DirectSolver ( NumaBCRSMatrix< Dune::FieldMatrix< FieldType, n, m >, Index > const &  A,
DirectType  directType,
MatrixProperties  properties 
)
inlineexplicit

Constructs a direct solver from a NumaBCRS matrix. A copy of the linear operator is held internally, thus the linear operator object is better not too large.

Warning: Don't use this if block size is greater than 1, DirectType is MUMPS and the blocks on the diagonal are not diagonal, since MUMPS requires that only the lower triangle of the matrix is given. Todo: Throw exception in this case?

Definition at line 200 of file direct.hh.

◆ DirectSolver() [9/9]

template<class Domain_ , class Range_ >
template<class FieldType , int n, int m, class Index >
Kaskade::DirectSolver< Domain_, Range_ >::DirectSolver ( NumaBCRSMatrix< Dune::FieldMatrix< FieldType, n, m >, Index > const &  A,
DirectType  directType = DirectType::UMFPACK,
FactorizationOptions  options = FactorizationOptions() 
)
inlineexplicit

Constructs a direct solver from a NumaBCRS matrix. A copy of the linear operator is held internally, thus the linear operator object is better not too large.

Warning: Don't use this if block size is greater than 1, DirectType is MUMPS and the blocks on the diagonal are not diagonal, since MUMPS requires that only the lower triangle of the matrix is given. Todo: Throw exception in this case?

Definition at line 217 of file direct.hh.

Member Function Documentation

◆ apply() [1/8]

template<class Domain_ , class Range_ >
virtual void Kaskade::DirectSolver< Domain_, Range_ >::apply ( Domain x,
Range b,
double  reduction,
Dune::InverseOperatorResult &  res 
)
inlinevirtual

Solves the system for the given right hand side b.

The provided right hand side b is not modified (except possibly via aliasing

  • x). This non-const method is provided just for interface compatibility with Dune::InverseOperator.

Definition at line 267 of file direct.hh.

◆ apply() [2/8]

template<class Domain_ , class Range_ >
virtual void Kaskade::DirectSolver< Domain_, Range_ >::apply ( Domain x,
Range b,
Dune::InverseOperatorResult &  res 
)
inlinevirtual

Solves the system for the given right hand side b.

The provided right hand side b is not modified (except possibly via aliasing x). This non-const method is provided just for interface compatibility with Dune::InverseOperator.

Definition at line 244 of file direct.hh.

Referenced by Kaskade::DirectSolver< Dune::FieldVector< S, n >, Dune::FieldVector< S, n > >::apply(), Kaskade::DirectSolver< Domain_, Range_ >::apply(), and Kaskade::DirectPreconditionerFloatWrapper< Domain, Range, SparseIndex >::apply().

◆ apply() [3/8]

template<class Domain_ , class Range_ >
void Kaskade::DirectSolver< Domain_, Range_ >::apply ( Domain x,
Range b,
Dune::InverseOperatorResult &  res 
) const
inline

Solves the system for the given right hand side b.

The provided right hand side b is not modified (except possibly via aliasing x).

Definition at line 255 of file direct.hh.

◆ apply() [4/8]

template<class Domain_ , class Range_ >
virtual void Kaskade::DirectSolver< Domain_, Range_ >::apply ( Domain x,
Range const &  b 
)
inlinevirtual

Solves the system for the given right hand side b.

The provided right hand side b is not modified (except possibly via aliasing x). This non-const method is provided just for interface compatibility with Dune::Preconditioner (virtual function).

Definition at line 342 of file direct.hh.

◆ apply() [5/8]

template<class Domain_ , class Range_ >
virtual void Kaskade::DirectSolver< Domain_, Range_ >::apply ( Domain x,
Range const &  b 
) const
inlinevirtual

Solves the system for the given right hand side b.

Definition at line 351 of file direct.hh.

◆ apply() [6/8]

template<class Domain_ , class Range_ >
void Kaskade::DirectSolver< Domain_, Range_ >::apply ( Domain x,
Range const &  b,
double  reduction,
Dune::InverseOperatorResult &  res 
) const
inline

Solves the system for the given right hand side b.

Definition at line 275 of file direct.hh.

◆ apply() [7/8]

template<class Domain_ , class Range_ >
virtual void Kaskade::DirectSolver< Domain_, Range_ >::apply ( std::vector< Scalar > &  v) const
inlinevirtual

Solves the system \( Ax = b \).

Parameters
[in,out]von entry, contains right hand side \( b \) on exit, contains the solution \( x \) v has to be large enough, at least the matrix size

Definition at line 319 of file direct.hh.

◆ apply() [8/8]

template<class Domain_ , class Range_ >
void Kaskade::DirectSolver< Domain_, Range_ >::apply ( std::vector< Scalar > &  v,
double  ,
Dune::InverseOperatorResult &  res 
) const
inline

The input vector v contains the rhs. It will be overwritten by the solution.

Definition at line 297 of file direct.hh.

◆ category()

template<class Domain_ , class Range_ >
virtual Dune::SolverCategory::Category Kaskade::DirectSolver< Domain_, Range_ >::category ( ) const
inlineoverridevirtual

returns the category of the operator

From the Dune doxygen documentation it is unclear what this is supposed to mean. We return a dummy here.

Definition at line 378 of file direct.hh.

◆ post()

template<class Domain_ , class Range_ >
virtual void Kaskade::DirectSolver< Domain_, Range_ >::post ( Domain )
inlinevirtual

unused

This method does exactly nothing, and is just present for interface conformity.

Definition at line 371 of file direct.hh.

◆ pre()

template<class Domain_ , class Range_ >
virtual void Kaskade::DirectSolver< Domain_, Range_ >::pre ( Domain ,
Range  
)
inlinevirtual

unused

This method does exactly nothing, and is just present for interface conformity.

Definition at line 364 of file direct.hh.


The documentation for this class was generated from the following file: