diff --git a/dune/gfe/rodassembler.cc b/dune/gfe/rodassembler.cc index 87f6eb5195cb38403b05566efae8092b52aacb56..89a94c64ae92e395dc16c0d1fce62009217c68a7 100644 --- a/dune/gfe/rodassembler.cc +++ b/dune/gfe/rodassembler.cc @@ -141,10 +141,9 @@ getStress(const std::vector<RigidBodyMotion<3> >& sol, template <class GridView> template <class PatchGridView> -Dune::FieldVector<double,3> RodAssembler<GridView,3>:: +Dune::FieldVector<double,6> RodAssembler<GridView,3>:: getResultantForce(const BoundaryPatchBase<PatchGridView>& boundary, - const std::vector<RigidBodyMotion<3> >& sol, - Dune::FieldVector<double,3>& canonicalTorque) const + const std::vector<RigidBodyMotion<3> >& sol) const { using namespace Dune; @@ -157,7 +156,7 @@ getResultantForce(const BoundaryPatchBase<PatchGridView>& boundary, DUNE_THROW(Exception, "Solution vector doesn't match the grid!"); FieldVector<double,3> canonicalStress(0); - canonicalTorque = 0; + FieldVector<double,3> canonicalTorque(0); // Loop over the given boundary typename BoundaryPatchBase<PatchGridView>::iterator it = boundary.begin(); @@ -210,7 +209,13 @@ getResultantForce(const BoundaryPatchBase<PatchGridView>& boundary, } - return canonicalStress; + Dune::FieldVector<double,6> result; + for (int i=0; i<3; i++) { + result[i] = canonicalStress[i]; + result[i+3] = canonicalTorque[i]; + } + + return result; } diff --git a/dune/gfe/rodassembler.hh b/dune/gfe/rodassembler.hh index c8db8c616dafccce97ae71d1ad8ed934a2301236..640736a8406662de0ba514a6d69545cb28434fa9 100644 --- a/dune/gfe/rodassembler.hh +++ b/dune/gfe/rodassembler.hh @@ -79,9 +79,8 @@ public: \note Linear run-time in the size of the grid */ template <class PatchGridView> - Dune::FieldVector<double,3> getResultantForce(const BoundaryPatchBase<PatchGridView>& boundary, - const std::vector<RigidBodyMotion<3> >& sol, - Dune::FieldVector<double,3>& canonicalTorque) const; + Dune::FieldVector<double,6> getResultantForce(const BoundaryPatchBase<PatchGridView>& boundary, + const std::vector<RigidBodyMotion<3> >& sol) const; }; // end class