From c6612d31f4d5e1337bf06553b8ca18459d706105 Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Mon, 8 Mar 2010 14:00:26 +0000 Subject: [PATCH] remove Neumann boundary data code. Neumann problems are not always conservative --> I need to do some more thinking [[Imported from SVN: r5687]] --- src/rodassembler.cc | 37 ------------------------------------- src/rodassembler.hh | 25 +------------------------ 2 files changed, 1 insertion(+), 61 deletions(-) diff --git a/src/rodassembler.cc b/src/rodassembler.cc index c89266ca..e769bf69 100644 --- a/src/rodassembler.cc +++ b/src/rodassembler.cc @@ -52,43 +52,6 @@ assembleGradient(const std::vector<RigidBodyMotion<3> >& sol, } - // /////////////////////////////////////////////////////////////////////// - // Add the contributions of the Neumann data. Since the boundary is - // zero-dimensional these are not integrals but simply values - // added at the first and last vertex. - // \todo We use again that the numbering goes from left to right! - // /////////////////////////////////////////////////////////////////////// - for (int i=0; i<3; i++) { - grad[0][i] += leftNeumannForce_[i]; - grad[0][i+3] += leftNeumannTorque_[i]; - grad[grad.size()-1][i] += rightNeumannForce_[i]; - grad[grad.size()-1][i+3] += rightNeumannTorque_[i]; - } - -} - - -template <class GridView> -double RodAssembler<GridView>:: -computeEnergy(const std::vector<RigidBodyMotion<3> >& sol) const -{ - double energy = GeodesicFEAssembler<GridView,RigidBodyMotion<3> >::computeEnergy(sol); - - // /////////////////////////////////////////////////////////////////////// - // Add the contributions of the Neumann data. Since the boundary is - // zero-dimensional these are not integrals but simply values - // added at the first and last vertex. - // \todo We use again that the numbering goes from left to right! - // /////////////////////////////////////////////////////////////////////// - - energy += sol[0].r * leftNeumannForce_; - //energy += Rotation<3,double>::expInv(sol[0].q) * leftNeumannTorque_; - - energy += sol.back().r * rightNeumannForce_; - //energy += Rotation<3,double>::expInv(sol.back().q) * rightNeumannTorque_; - - return energy; - } diff --git a/src/rodassembler.hh b/src/rodassembler.hh index 6f275383..e27ddd37 100644 --- a/src/rodassembler.hh +++ b/src/rodassembler.hh @@ -37,20 +37,11 @@ class RodAssembler : public GeodesicFEAssembler<GridView, RigidBodyMotion<3> > public: GridView gridView_; - protected: - Dune::FieldVector<double, 3> leftNeumannForce_; - Dune::FieldVector<double, 3> leftNeumannTorque_; - Dune::FieldVector<double, 3> rightNeumannForce_; - Dune::FieldVector<double, 3> rightNeumannTorque_; - - public: - //! ??? RodAssembler(const GridView &gridView, RodLocalStiffness<GridView,double>* localStiffness) : GeodesicFEAssembler<GridView, RigidBodyMotion<3> >(gridView,localStiffness), - gridView_(gridView), - leftNeumannForce_(0), leftNeumannTorque_(0), rightNeumannForce_(0), rightNeumannTorque_(0) + gridView_(gridView) { std::vector<RigidBodyMotion<3> > referenceConfiguration(gridView.size(gridDim)); @@ -70,23 +61,9 @@ class RodAssembler : public GeodesicFEAssembler<GridView, RigidBodyMotion<3> > dynamic_cast<RodLocalStiffness<GridView, double>* >(this->localStiffness_)->setReferenceConfiguration(referenceConfiguration); } - void setNeumannData(const Dune::FieldVector<double, 3>& leftForce, - const Dune::FieldVector<double, 3>& leftTorque, - const Dune::FieldVector<double, 3>& rightForce, - const Dune::FieldVector<double, 3>& rightTorque) - { - leftNeumannForce_ = leftForce; - leftNeumannTorque_ = leftTorque; - rightNeumannForce_ = rightForce; - rightNeumannTorque_ = rightTorque; - } - void assembleGradient(const std::vector<RigidBodyMotion<3> >& sol, Dune::BlockVector<Dune::FieldVector<double, blocksize> >& grad) const; - /** \brief Compute the energy of a deformation state */ - double computeEnergy(const std::vector<RigidBodyMotion<3> >& sol) const; - void getStrain(const std::vector<RigidBodyMotion<3> >& sol, Dune::BlockVector<Dune::FieldVector<double, blocksize> >& strain) const; -- GitLab