Skip to content
Snippets Groups Projects
solverfactory.hh 2.04 KiB
Newer Older
podlesny's avatar
.  
podlesny committed
#ifndef SRC_SPATIAL_SOLVING_SOLVERFACTORY_HH
#define SRC_SPATIAL_SOLVING_SOLVERFACTORY_HH

#include <dune/common/bitsetvector.hh>
#include <dune/common/parametertree.hh>

#include <dune/solvers/iterationsteps/multigridstep.hh>
#include <dune/solvers/iterationsteps/projectedblockgsstep.hh>
podlesny's avatar
.  
podlesny committed
#include <dune/solvers/norms/energynorm.hh>
#include <dune/solvers/solvers/loopsolver.hh>
//#include <dune/solvers/transferoperators/compressedmultigridtransfer.hh>
//#include <dune/tnnmg/iterationsteps/genericnonlineargs.hh>
podlesny's avatar
.  
podlesny committed
//#include <dune/tnnmg/iterationsteps/tnnmgstep.hh>
podlesny's avatar
.  
podlesny committed

podlesny's avatar
.  
podlesny committed
#include <dune/contact/assemblers/nbodyassembler.hh>

#include <dune/contact/estimators/hierarchiccontactestimator.hh>
#include <dune/contact/solvers/nsnewtonmgstep.hh>
#include <dune/contact/solvers/contacttransfer.hh>
#include <dune/contact/solvers/contactobsrestrict.hh>
#include <dune/contact/solvers/contacttransferoperatorassembler.hh>
#include <dune/contact/solvers/nsnewtoncontacttransfer.hh>

podlesny's avatar
.  
podlesny committed
#define USE_OLD_TNNMG //needed for old bisection.hh in tnnmg
podlesny's avatar
.  
podlesny committed

template <class DeformedGridTEMPLATE, class MatrixType, class VectorType>
podlesny's avatar
.  
podlesny committed
class SolverFactory {
protected:
  const size_t dim = DeformedGrid::dimension;

podlesny's avatar
.  
podlesny committed
public:
  using Vector = VectorType;
  using Matrix = MatrixType;
podlesny's avatar
.  
podlesny committed

podlesny's avatar
.  
podlesny committed
  using DeformedGrid = DeformedGridTEMPLATE;

podlesny's avatar
.  
podlesny committed
public:
  using Step = Dune::Contact::NonSmoothNewtonMGStep<Matrix, Vector>;
podlesny's avatar
.  
podlesny committed

podlesny's avatar
.  
podlesny committed
  SolverFactory(Dune::ParameterTree const &parset, const Dune::Contact::NBodyAssembler<DeformedGrid, Vector>& nBodyAssembler,
podlesny's avatar
.  
podlesny committed
                Dune::BitSetVector<dim> const &ignoreNodes);

  ~SolverFactory();

  std::shared_ptr<Step> getStep();

private:
podlesny's avatar
.  
podlesny committed
  const Dune::Contact::NBodyAssembler<DeformedGrid, Vector>& nBodyAssembler_;

  ProjectedBlockGSStep<Matrix, Vector> baseSolverStep_;
  EnergyNorm<Matrix, Vector> baseEnergyNorm_;
  LoopSolver<Vector> baseSolver_;

  ProjectedBlockGSStep<Matrix, Vector> presmoother_;
  ProjectedBlockGSStep<Matrix, Vector> postsmoother_;
  std::shared_ptr<Step> multigridStep_;

  std::vector<Dune::Contact::ContactMGTransfer<Vector>* > transferOperators_;
podlesny's avatar
.  
podlesny committed
};
#endif