diff --git a/dune/gfe/coupling/rodcontinuumsteklovpoincarestep.hh b/dune/gfe/coupling/rodcontinuumsteklovpoincarestep.hh index 3a1f7657f257148dd97765c707e196155b8338bf..7d84359d6985e4b998503ed0244b49c146b7c02b 100644 --- a/dune/gfe/coupling/rodcontinuumsteklovpoincarestep.hh +++ b/dune/gfe/coupling/rodcontinuumsteklovpoincarestep.hh @@ -37,7 +37,7 @@ class RodContinuumSteklovPoincareStep public: - /** \brief Constructor */ + /** \brief Constructor for a complex with one rod and one continuum */ RodContinuumSteklovPoincareStep(const RodContinuumComplex<RodGridType,ContinuumGridType>& complex, const std::string& preconditioner, const Dune::array<double,2>& alpha, @@ -67,7 +67,69 @@ public: mergeRodDirichletAndCouplingBoundaries(); mergeContinuumDirichletAndCouplingBoundaries(); } - + + /** \brief Constructor for a general complex */ + RodContinuumSteklovPoincareStep(const RodContinuumComplex<RodGridType,ContinuumGridType>& complex, + const std::string& preconditioner, + const Dune::array<double,2>& alpha, + double richardsonDamping, + const std::map<std::string,RodAssembler<typename RodGridType::LeafGridView,3>*>& rodAssembler, + const std::map<std::string,RodLocalStiffness<typename RodGridType::LeafGridView,double>*>& rodLocalStiffness, + const std::map<std::string,RiemannianTrustRegionSolver<RodGridType,RigidBodyMotion<3> >*>& rodSolver, + const std::map<std::string,const MatrixType*>& stiffnessMatrix3d, + const std::map<std::string, const Dune::shared_ptr< ::LoopSolver<VectorType> > >& solver, + const std::map<std::string,LinearLocalAssembler<ContinuumGridType, + ContinuumLocalFiniteElement, + ContinuumLocalFiniteElement, + Dune::FieldMatrix<double,dim,dim> >*>& localAssembler) + : complex_(complex), + preconditioner_(preconditioner), + alpha_(alpha), + richardsonDamping_(richardsonDamping) + { + /////////////////////////////////////////////////////////////////////////////////// + // Rod-related data + /////////////////////////////////////////////////////////////////////////////////// + for (typename std::map<std::string,RodAssembler<typename RodGridType::LeafGridView,3>*>::const_iterator it = rodAssembler.begin(); + it != rodAssembler.end(); + ++it) + rods_[it->first].assembler_ = it->second; + + for (typename std::map<std::string,RodLocalStiffness<typename RodGridType::LeafGridView,double>*>::const_iterator it = rodLocalStiffness.begin(); + it != rodLocalStiffness.end(); + ++it) + rods_[it->first].localStiffness_ = it->second; + + for (typename std::map<std::string,RiemannianTrustRegionSolver<RodGridType,RigidBodyMotion<3> >*>::const_iterator it = rodSolver.begin(); + it != rodSolver.end(); + ++it) + rods_[it->first].solver_ = it->second; + + /////////////////////////////////////////////////////////////////////////////////// + // Continuum-related data + /////////////////////////////////////////////////////////////////////////////////// + for (typename std::map<std::string,const MatrixType*>::const_iterator it = stiffnessMatrix3d.begin(); + it != stiffnessMatrix3d.end(); + ++it) + continua_[it->first].stiffnessMatrix_ = it->second; + + for (typename std::map<std::string,const Dune::shared_ptr< ::LoopSolver<VectorType> > >::const_iterator it = solver.begin(); + it != solver.end(); + ++it) + continua_[it->first].solver_ = it->second; + + for (typename std::map<std::string,LinearLocalAssembler<ContinuumGridType, + ContinuumLocalFiniteElement, + ContinuumLocalFiniteElement, + Dune::FieldMatrix<double,dim,dim> >*>::const_iterator it = localAssembler.begin(); + it != localAssembler.end(); + ++it) + continua_[it->first].localAssembler_ = it->second; + + mergeRodDirichletAndCouplingBoundaries(); + mergeContinuumDirichletAndCouplingBoundaries(); + } + void mergeRodDirichletAndCouplingBoundaries(); void mergeContinuumDirichletAndCouplingBoundaries();