Skip to content
Snippets Groups Projects
solverfactory.hh 2.37 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>

podlesny's avatar
.  
podlesny committed
//#include <dune/contact/estimators/hierarchiccontactestimator.hh>
#include <dune/contact/solvers/nsnewtonmgstep.hh>
podlesny's avatar
podlesny committed
#include <dune/contact/solvers/nsnewtoncontacttransfer.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

podlesny's avatar
.  
podlesny committed
template <class DeformedGridTEMPLATE, class NonlinearityTEMPLATE, class MatrixType, class VectorType>
podlesny's avatar
.  
podlesny committed
class SolverFactory {
podlesny's avatar
.  
podlesny committed
//protected:
//  const size_t dim = DeformedGrid::dimension;
podlesny's avatar
.  
podlesny committed
public:
  using Matrix = MatrixType;
  using Vector = VectorType;
podlesny's avatar
.  
podlesny committed
  using DeformedGrid = DeformedGridTEMPLATE;
podlesny's avatar
.  
podlesny committed
  using Nonlinearity = NonlinearityTEMPLATE;
podlesny's avatar
.  
podlesny committed

podlesny's avatar
.  
podlesny committed
public:
  using Step = Dune::Contact::NonSmoothNewtonMGStep<MatrixType, VectorType>;
podlesny's avatar
podlesny committed
  using TransferOperator = Dune::Contact::NonSmoothNewtonContactTransfer<VectorType>;
podlesny's avatar
.  
podlesny committed

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

  std::shared_ptr<Step> getStep();

  const Dune::Contact::NBodyAssembler<DeformedGrid, VectorType>& getNBodyAssembler() const {
podlesny's avatar
.  
podlesny committed
    return nBodyAssembler_;
  }

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

  ProjectedBlockGSStep<MatrixType, VectorType> baseSolverStep_;
  EnergyNorm<MatrixType, VectorType> baseEnergyNorm_;
  LoopSolver<VectorType> baseSolver_;
  ProjectedBlockGSStep<MatrixType, VectorType> presmoother_;
  ProjectedBlockGSStep<MatrixType, VectorType> postsmoother_;
  std::shared_ptr<Step> multigridStep_;

podlesny's avatar
podlesny committed
  std::vector<std::shared_ptr<TransferOperator>> transferOperators_;
podlesny's avatar
.  
podlesny committed
};
#endif