Fabric class for PETSc solvers. More...

#include <PETScFabric.hh>

Inheritance diagram for concepts::PETScFabric:
concepts::SolverFabric< Real >

Public Member Functions

virtual Operator< Real > * operator() ()=0
 Creates a linear solver from matrix. More...
 
virtual Operator< Real > * operator() (Operator< Real > &matrix)
 
virtual Operator< Real > * operator() (Operator< Real > &matrix)=0
 
 PETScFabric (const Real maxeps, const std::string ksptype, const std::string pctype=std::string("none"))
 Constructor. More...
 
 ~PETScFabric ()
 

Protected Member Functions

virtual std::ostream & info (std::ostream &os) const
 

Private Attributes

const std::string ksptype_
 Type of Krylov Subspace Solver. More...
 
const Real maxeps_
 Maximal residual. More...
 
const std::string pctype_
 Type of preconditioner. More...
 
std::list< concepts::PETScMat * > petscmat_
 Created auxiliary PETSc Matrices. More...
 

Detailed Description

Fabric class for PETSc solvers.

Creates a PETScMat if Operator is not a PETScMat and a preconditioner is desired. This may have severe disadvantages:

  • It is always memory inefficent.
  • It may be O(n^2) slow, if Operator is not Matrix, LiCo, LiCoI or Compose
  • It may cause a segmentation fault if the fabric goes out of scope before any of the solvers created like this. Make sure this does not happen.
Author
Christoph Winkelmann, 2004

Definition at line 30 of file PETScFabric.hh.

Constructor & Destructor Documentation

◆ PETScFabric()

concepts::PETScFabric::PETScFabric ( const Real  maxeps,
const std::string  ksptype,
const std::string  pctype = std::string("none") 
)
inline

Constructor.

Parameters
maxepsMaximal residual
ksptypeType of Krylov Subspace Solver
pctypeType of preconditioner

Definition at line 37 of file PETScFabric.hh.

◆ ~PETScFabric()

concepts::PETScFabric::~PETScFabric ( )
inline

Definition at line 56 of file PETScFabric.hh.

Member Function Documentation

◆ info()

virtual std::ostream& concepts::PETScFabric::info ( std::ostream &  os) const
inlineprotectedvirtual

Definition at line 63 of file PETScFabric.hh.

◆ operator()() [1/3]

virtual Operator<Real >* concepts::SolverFabric< Real >::operator() ( )
pure virtualinherited

Creates a linear solver from matrix.

The caller is responsible for the deletion of the delivered object.

Returns
Reference to the linear solver

Implemented in concepts::UmfpackFabric, concepts::SuperLUFabric< F >, concepts::MumpsOverlapFabric< F >, and concepts::MumpsFabric< F >.

◆ operator()() [2/3]

virtual Operator<Real>* concepts::PETScFabric::operator() ( Operator< Real > &  matrix)
inlinevirtual

Definition at line 40 of file PETScFabric.hh.

◆ operator()() [3/3]

virtual Operator<Real >* concepts::SolverFabric< Real >::operator() ( Operator< F > &  matrix)
pure virtualinherited

Member Data Documentation

◆ ksptype_

const std::string concepts::PETScFabric::ksptype_
private

Type of Krylov Subspace Solver.

Definition at line 71 of file PETScFabric.hh.

◆ maxeps_

const Real concepts::PETScFabric::maxeps_
private

Maximal residual.

Definition at line 69 of file PETScFabric.hh.

◆ pctype_

const std::string concepts::PETScFabric::pctype_
private

Type of preconditioner.

Definition at line 73 of file PETScFabric.hh.

◆ petscmat_

std::list<concepts::PETScMat*> concepts::PETScFabric::petscmat_
private

Created auxiliary PETSc Matrices.

Definition at line 75 of file PETScFabric.hh.


The documentation for this class was generated from the following file:
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich