From 85390b72441f9c79025a289b3bca6be65a7f56cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Kl=C3=B6fkorn?= <robertk@dune-project.org> Date: Fri, 18 Mar 2005 16:01:06 +0000 Subject: [PATCH] tmpSize in additionalSizeEstimate renamed and specialisation for dimRange = 1 and polOrd = 0. [[Imported from SVN: r1698]] --- fem/lagrangebase/lagrangemapper.hh | 92 ++++++++++++++++++++++++++++-- 1 file changed, 86 insertions(+), 6 deletions(-) diff --git a/fem/lagrangebase/lagrangemapper.hh b/fem/lagrangebase/lagrangemapper.hh index 8321f6848..cb0f90ecf 100644 --- a/fem/lagrangebase/lagrangemapper.hh +++ b/fem/lagrangebase/lagrangemapper.hh @@ -113,9 +113,9 @@ namespace Dune { } // is called once and calcs the insertion points too - int tmpSize() const + int additionalSizeEstimate () const { - return indexSet_.tmpSize(); + return indexSet_.additionalSizeEstimate(); } void calcInsertPoints () {}; @@ -199,9 +199,9 @@ namespace Dune { } // is called once and calcs the insertion points too - int tmpSize() const + int additionalSizeEstimate () const { - return indexSet_.tmpSize(); + return indexSet_.additionalSizeEstimate(); } void calcInsertPoints () {}; @@ -289,9 +289,9 @@ namespace Dune { } // is called once and calcs the insertion points too - int tmpSize() const + int additionalSizeEstimate () const { - return dimrange * indexSet_.tmpSize(); + return dimrange * indexSet_.additionalSizeEstimate(); } int numberOfDofs () const @@ -306,6 +306,86 @@ namespace Dune { } }; + template <class IndexSetImp> + class LagrangeMapper<IndexSetImp,0,1> + : public DofMapperDefault < LagrangeMapper <IndexSetImp,0,1> > + { + IndexSetImp & indexSet_; + // level of function space + int level_; + public: + typedef IndexSetImp IndexSetType; + + LagrangeMapper ( IndexSetType & is , int numDofs , int level) + : indexSet_ (is) , level_(level) {} + + // we have virtual function ==> virtual destructor + ~LagrangeMapper () {} + + //! return size of function space, here number of elements + int size () const + { + return indexSet_.size(level_,0); + } + + //! map Entity an local Dof number to global Dof number + //! for Lagrange with polOrd = 0 + template <class EntityType> + int mapToGlobal (EntityType &en, int localNum ) const + { + return indexSet_.template index<0> (en,localNum); + } + + //! for dof manager, to check whether it has to copy dof or not + bool indexNew (int num) + { + return indexSet_.template indexNew(num,0); + } + + //! return old index, for dof manager only + int oldIndex (int num) const + { + return indexSet_.oldIndex(num,0); + } + + //! return new index, for dof manager only + int newIndex (int num) const + { + return indexSet_.newIndex(num,0); + } + + //! return size of grid entities per level and codim + //! for dof mapper + int oldSize () const + { + // this index set works only for codim = 0 at the moment + return indexSet_.oldSize(level_,0); + } + + // is called once and calcs the insertion points too + int newSize() const + { + return this->size(); + } + + // is called once and calcs the insertion points too + int additionalSizeEstimate () const + { + return indexSet_.additionalSizeEstimate(); + } + + int numberOfDofs () const + { + return 1; + } + + //! calc the new insertion points + void calcInsertPoints () + { + // insertion point is 0 + } + }; + } // end namespace Dune #endif -- GitLab