diff --git a/dune/gfe/geodesicfeassembler.hh b/dune/gfe/geodesicfeassembler.hh index a76ffe7f324e331f46eff9dc65a25c279b296a5e..9f55c197080d3036bf99709b21f2bc0737dbd784 100644 --- a/dune/gfe/geodesicfeassembler.hh +++ b/dune/gfe/geodesicfeassembler.hh @@ -136,7 +136,7 @@ assembleMatrix(const std::vector<TargetSpace>& sol, for (int j=0; j<numOfBaseFct; j++ ) { int col = indexSet.subIndex(*it,j,gridDim); - matrix[row][col] += localStiffness_->mat(i,j); + matrix[row][col] += localStiffness_->A_[i][j]; } } diff --git a/dune/gfe/localgeodesicfestiffness.hh b/dune/gfe/localgeodesicfestiffness.hh index e64c34ee53ef0c0f50a9d28ba904627a925ffacd..18e9884c33e50397845914617a4500ba36815c78 100644 --- a/dune/gfe/localgeodesicfestiffness.hh +++ b/dune/gfe/localgeodesicfestiffness.hh @@ -6,14 +6,12 @@ #include <dune/istl/matrixindexset.hh> #include <dune/istl/matrix.hh> -#include "localstiffness.hh" #include "rigidbodymotion.hh" #include "unitvector.hh" #include "realtuple.hh" template<class GridView, class TargetSpace> class LocalGeodesicFEStiffness - : public Dune::LocalStiffness<GridView,double,TargetSpace::TangentVector::size> { // grid types @@ -94,6 +92,9 @@ public: virtual void assembleGradient(const Entity& element, const std::vector<TargetSpace>& solution, std::vector<Dune::FieldVector<double,blocksize> >& gradient) const; + + // assembled data + Dune::Matrix<Dune::FieldMatrix<double,blocksize,blocksize> > A_; }; @@ -292,7 +293,6 @@ assemble(const Entity& element, /** \brief Specialization for unit vectors */ template<class GridView, int dim> class LocalGeodesicFEStiffness <GridView,UnitVector<dim> > - : public Dune::LocalStiffness<GridView,double,UnitVector<dim>::EmbeddedTangentVector::size> { typedef UnitVector<dim> TargetSpace; @@ -334,6 +334,9 @@ public: virtual void assembleGradient(const Entity& element, const std::vector<TargetSpace>& solution, std::vector<Dune::FieldVector<double,blocksize> >& gradient) const; + + // assembled data + Dune::Matrix<Dune::FieldMatrix<double,blocksize,blocksize> > A_; }; @@ -389,15 +392,15 @@ assemble(const Entity& element, int nDofs = element.template count<gridDim>(); // Clear assemble data - this->setcurrentsize(nDofs); + A_.setSize(nDofs, nDofs); - this->A = 0; + A_ = 0; #if 1 #warning Dummy Hessian implementation for (int i=0; i<nDofs; i++) for (int j=0; j<blocksize; j++) - this->A[i][i][j][j] = 1; + A_[i][i][j][j] = 1; #else // /////////////////////////////////////////////////////////// diff --git a/dune/gfe/localstiffness.hh b/dune/gfe/localstiffness.hh deleted file mode 100644 index 377b849e9d9b0b6e92a5c218849d8899fd960f1a..0000000000000000000000000000000000000000 --- a/dune/gfe/localstiffness.hh +++ /dev/null @@ -1,136 +0,0 @@ -// $Id: localstiffness.hh 560 2009-06-10 09:32:22Z sander $ - -#ifndef DUNE_LOCALSTIFFNESS_HH -#define DUNE_LOCALSTIFFNESS_HH - -#include<iostream> -#include<vector> -#include<set> -#include<map> -#include<stdio.h> -#include<stdlib.h> - -#include<dune/common/timer.hh> -#include<dune/common/fvector.hh> -#include<dune/common/fmatrix.hh> -#include<dune/common/array.hh> -#include<dune/common/exceptions.hh> -#include<dune/common/geometrytype.hh> -#include<dune/grid/common/grid.hh> -#include<dune/istl/operators.hh> -#include<dune/istl/bvector.hh> -#include<dune/istl/matrix.hh> - -/** - * @file - * @brief defines a class for piecewise linear finite element functions - * @author Peter Bastian - */ - -/*! @defgroup DISC_Operators Operators - @ingroup DISC - @brief - - @section D1 Introduction - <!--=================--> - - To be written -*/ - -namespace Dune -{ - /** @addtogroup DISC_Operators - * - * @{ - */ - /** - * @brief base class for assembling local stiffness matrices - * - */ - - - /*! @brief Base class for local assemblers - - This class serves as a base class for local assemblers. It provides - space and access to the local stiffness matrix. The actual assembling is done - in a derived class via the virtual assemble method. - - \tparam GV A grid view type - \tparam RT The field type used in the elements of the stiffness matrix - \tparam m number of degrees of freedom per node (system size) - */ - template<class GV, class RT, int m> - class LocalStiffness - { - // grid types - typedef typename GV::Grid::ctype DT; - typedef typename GV::template Codim<0>::Entity Entity; - - public: - // types for matrics, vectors and boundary conditions - typedef FieldMatrix<RT,m,m> MBlockType; // one entry in the stiffness matrix - - virtual ~LocalStiffness () - { - } - - //! print contents of local stiffness matrix - void print (std::ostream& s, int width, int precision) - { - // set the output format - s.setf(std::ios_base::scientific, std::ios_base::floatfield); - int oldprec = s.precision(); - s.precision(precision); - - for (int i=0; i<currentsize(); i++) - { - s << "FEM"; // start a new row - s << " "; // space in front of each entry - s.width(4); // set width for counter - s << i; // number of first entry in a line - for (int j=0; j<currentsize(); j++) - { - s << " "; // space in front of each entry - s.width(width); // set width for each entry anew - s << mat(i,j); // yeah, the number ! - } - s << std::endl;// start a new line - } - - - // reset the output format - s.precision(oldprec); - s.setf(std::ios_base::fixed, std::ios_base::floatfield); - } - - //! access local stiffness matrix - /*! Access elements of the local stiffness matrix. Elements are - undefined without prior call to the assemble method. - */ - const MBlockType& mat (int i, int j) const - { - return A[i][j]; - } - - //! set the current size of the local stiffness matrix - void setcurrentsize (int s) - { - A.setSize(s,s); - } - - //! get the current size of the local stiffness matrix - int currentsize () - { - return A.N(); - } - - public: - // assembled data - Matrix<MBlockType> A; - - }; - - /** @} */ - -} -#endif