#ifndef SOLVER_FACTORY_HH #define SOLVER_FACTORY_HH #include <dune/common/bitsetvector.hh> #include <dune/common/parametertree.hh> #include <dune/solvers/iterationsteps/multigridstep.hh> #include <dune/solvers/iterationsteps/truncatedblockgsstep.hh> #include <dune/solvers/norms/energynorm.hh> #include <dune/solvers/solvers/loopsolver.hh> #include <dune/tnnmg/iterationsteps/genericnonlineargs.hh> #include <dune/solvers/transferoperators/compressedmultigridtransfer.hh> #include <dune/tnnmg/iterationsteps/tnnmgstep.hh> template <int dim, class BlockProblemTypeTEMPLATE, class GridType> class SolverFactory { public: using BlockProblemType = BlockProblemTypeTEMPLATE; using ConvexProblemType = typename BlockProblemType::ConvexProblemType; using VectorType = typename BlockProblemType::VectorType; using MatrixType = typename BlockProblemType::MatrixType; private: using NonlinearSmootherType = GenericNonlinearGS<BlockProblemType>; using SolverType = TruncatedNonsmoothNewtonMultigrid<BlockProblemType, NonlinearSmootherType>; public: SolverFactory(Dune::ParameterTree const &parset, int refinements, GridType const &grid, Dune::BitSetVector<dim> const &ignoreNodes); ~SolverFactory(); SolverType *getSolver(); private: TruncatedBlockGSStep<MatrixType, VectorType> linearBaseSolverStep; EnergyNorm<MatrixType, VectorType> baseEnergyNorm; LoopSolver<VectorType> linearBaseSolver; TruncatedBlockGSStep<MatrixType, VectorType> linearPresmoother; TruncatedBlockGSStep<MatrixType, VectorType> linearPostsmoother; MultigridStep<MatrixType, VectorType> linearIterationStep; std::vector<CompressedMultigridTransfer<VectorType> *> transferOperators; NonlinearSmootherType nonlinearSmoother; SolverType *multigridStep; }; #endif