1#ifndef __DUNE_ACFEM_SOLVER_SELECTOR_HH__
2#define __DUNE_ACFEM_SOLVER_SELECTOR_HH__
5#include <dune/fem/operator/linear/istloperator.hh>
6#include <dune/fem/solver/istlsolver.hh>
7#include <dune/fem/operator/linear/petscoperator.hh>
8#include <dune/fem/solver/petscsolver.hh>
9#include <dune/fem/operator/linear/spoperator.hh>
10#include <dune/fem/solver/cginverseoperator.hh>
12#include "../models/modelinterface.hh"
15# define HAVE_PETSC false
18# define WANT_PETSC false
21# define HAVE_DUNE_ISTL false
24# define WANT_ISTL false
51 static const Family family =
52 ((HAVE_DUNE_ISTL && WANT_ISTL)
54 : ((HAVE_PETSC && WANT_PETSC)
88 template<
class DiscreteFunctionType,
class OperatorParts, SolverFamily::Family family = SolverFamily::family>
93 static_assert(family != SolverFamily::FEM ||
95 "No non-linear or indefinite problems with bare Dune::Fem CG solver");
97 template<SolverFamily::Family fam,
bool dummy = false>
98 struct OperatorSelector;
100#if HAVE_DUNE_ISTL && WANT_ISTL
105 Fem::ISTLLinearOperator<DiscreteFunctionType, DiscreteFunctionType>
111 typename std::conditional<
113 typename std::conditional<
115 Fem::ISTLCGOp<DiscreteFunctionType, LinearOperatorType>,
116 Fem::ISTLMINResOp<DiscreteFunctionType, LinearOperatorType> >::type,
117 Fem::ISTLGMResOp<DiscreteFunctionType, LinearOperatorType>
119 LinearInverseOperatorType;
123#if HAVE_PETSC && WANT_PETSC
128 Fem::PetscLinearOperator<DiscreteFunctionType, DiscreteFunctionType>
133 Fem::PetscInverseOperator<DiscreteFunctionType, LinearOperatorType>
134 LinearInverseOperatorType;
142 Fem::SparseRowLinearOperator<DiscreteFunctionType, DiscreteFunctionType>
145 Fem::CGInverseOperator<DiscreteFunctionType>
146 LinearInverseOperatorType;
149 typedef typename OperatorSelector<family>::LinearOperatorType LinearOperatorType;
150 typedef typename OperatorSelector<family>::LinearInverseOperatorType LinearInverseOperatorType;
Interface class for second order elliptic models.
Definition: operatorparts.hh:92
@ isSymmetric
Define to true for the symmetric case.
Definition: operatorparts.hh:120
@ isSemiDefinite
Define to true for the non-indefinite case (non trivial kernel is allowed).
Definition: operatorparts.hh:121
Define some symbolic constants for SolverSelector and "parse" some preprocessort defines.
Definition: solverselector.hh:39
Select one appropriate (linear) solver depending on whether the model is symmetric and/or semidefinit...
Definition: solverselector.hh:90