From 0f8a4d327db43539cb44d1380530b6a2923c380f Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Sun, 23 Jan 2011 10:44:34 +0000 Subject: [PATCH] store the reference interface orientations in the RodContinuumComplex, where they should be [[Imported from SVN: r6830]] --- dirneucoupling.cc | 2 +- dune/gfe/coupling/rodcontinuumcomplex.hh | 7 ++++++- .../coupling/rodcontinuumsteklovpoincarestep.hh | 16 ++++++++-------- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/dirneucoupling.cc b/dirneucoupling.cc index ffbac0cb..cbcb5e53 100644 --- a/dirneucoupling.cc +++ b/dirneucoupling.cc @@ -344,6 +344,7 @@ int main (int argc, char *argv[]) try // Init interface value RigidBodyMotion<3> referenceInterface = rodX[0]; + complex.couplings_[std::make_pair("rod","continuum")].referenceInterface_ = referenceInterface; RigidBodyMotion<3> lambda = referenceInterface; FieldVector<double,3> lambdaForce(0); FieldVector<double,3> lambdaTorque(0); @@ -451,7 +452,6 @@ int main (int argc, char *argv[]) try preconditioner, alpha, damping, - referenceInterface, &rodAssembler, &rodLocalStiffness, &rodSolver, diff --git a/dune/gfe/coupling/rodcontinuumcomplex.hh b/dune/gfe/coupling/rodcontinuumcomplex.hh index ee7cded9..4b784f10 100644 --- a/dune/gfe/coupling/rodcontinuumcomplex.hh +++ b/dune/gfe/coupling/rodcontinuumcomplex.hh @@ -16,6 +16,8 @@ template <class RodGrid, class ContinuumGrid> class RodContinuumComplex { dune_static_assert(RodGrid::dimension==1, "The RodGrid has to be one-dimensional!"); + + static const int dim = ContinuumGrid::dimension; typedef std::vector<RigidBodyMotion<3> > RodConfiguration; @@ -25,8 +27,11 @@ class RodContinuumComplex struct Coupling { LeafBoundaryPatch<RodGrid> rodInterfaceBoundary_; - + LeafBoundaryPatch<ContinuumGrid> continuumInterfaceBoundary_; + + /** \brief The orientation of the interface in the reference configuration */ + RigidBodyMotion<dim> referenceInterface_; }; /** \brief Holds all data for a rod subproblem */ diff --git a/dune/gfe/coupling/rodcontinuumsteklovpoincarestep.hh b/dune/gfe/coupling/rodcontinuumsteklovpoincarestep.hh index a3701fb9..98bf409e 100644 --- a/dune/gfe/coupling/rodcontinuumsteklovpoincarestep.hh +++ b/dune/gfe/coupling/rodcontinuumsteklovpoincarestep.hh @@ -279,7 +279,6 @@ public: const std::string& preconditioner, const Dune::array<double,2>& alpha, double richardsonDamping, - const RigidBodyMotion<3>& referenceInterface, RodAssembler<typename RodGridType::LeafGridView,3>* rodAssembler, RodLocalStiffness<typename RodGridType::LeafGridView,double>* rodLocalStiffness, RiemannianTrustRegionSolver<RodGridType,RigidBodyMotion<3> >* rodSolver, @@ -293,8 +292,7 @@ public: : complex_(complex), preconditioner_(preconditioner), alpha_(alpha), - richardsonDamping_(richardsonDamping), - referenceInterface_(referenceInterface) + richardsonDamping_(richardsonDamping) { rods_["rod"].assembler_ = rodAssembler; rods_["rod"].localStiffness_ = rodLocalStiffness; @@ -343,7 +341,6 @@ private: ////////////////////////////////////////////////////////////////// // Data members related to the rod problems ////////////////////////////////////////////////////////////////// - RigidBodyMotion<dim> referenceInterface_; struct RodData { @@ -536,9 +533,10 @@ continuumDirichletToNeumannMap(const std::string& continuumName, const std::pair<std::string,std::string>& couplingName = it->first; // Turn \lambda \in TSE(3) into a Dirichlet value for the continuum - const LeafBoundaryPatch<ContinuumGridType>& foo = complex_.coupling(couplingName).continuumInterfaceBoundary_; -#warning ReferenceInterface not properly set - setRotation(foo, x3d, referenceInterface_, it->second); + const LeafBoundaryPatch<ContinuumGridType>& interfaceBoundary = complex_.coupling(couplingName).continuumInterfaceBoundary_; + const RigidBodyMotion<dim>& referenceInterface = complex_.coupling(couplingName).referenceInterface_; + + setRotation(interfaceBoundary, x3d, referenceInterface, it->second); } @@ -579,9 +577,11 @@ continuumDirichletToNeumannMap(const std::string& continuumName, const std::pair<std::string,std::string>& couplingName = it->first; /** \todo Is referenceInterface.r the correct center of rotation? */ + const RigidBodyMotion<dim>& referenceInterface = complex_.coupling(couplingName).referenceInterface_; + computeTotalForceAndTorque(complex_.coupling(couplingName).continuumInterfaceBoundary_, residual, - referenceInterface_.r, + referenceInterface.r, continuumForce, continuumTorque); result[couplingName][0] = continuumForce[0]; -- GitLab