From 7c7e7b885ed121aee00ee99b75f94d5532f0ae75 Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@dune-project.org> Date: Tue, 21 Feb 2006 17:39:04 +0000 Subject: [PATCH] NewGeometryType --> GeometryType [[Imported from SVN: r4149]] --- grid/alu3dgrid/indexsets.hh | 4 ++-- grid/common/defaultindexsets.hh | 10 +++++----- grid/common/leafindexset.hh | 10 +++++----- grid/common/refinement.hh | 16 ++++++++-------- grid/common/sizecache.hh | 16 ++++++++-------- grid/common/virtualrefinement.hh | 10 +++++----- io/visual/grapegriddisplay.hh | 2 +- quadrature/fixedorder.hh | 2 +- 8 files changed, 35 insertions(+), 35 deletions(-) diff --git a/grid/alu3dgrid/indexsets.hh b/grid/alu3dgrid/indexsets.hh index 8fe22546e..9c6c5221d 100644 --- a/grid/alu3dgrid/indexsets.hh +++ b/grid/alu3dgrid/indexsets.hh @@ -78,7 +78,7 @@ namespace Dune { //! return size of indexset, i.e. maxindex+1 //! for given type, if type is not exisiting within grid 0 is returned - int size ( int codim , NewGeometryType type ) const + int size ( int codim , GeometryType type ) const { assert( grid_.geomTypes(codim).size() == 1 ); if( type != grid_.geomTypes(codim)[0] ) return 0; @@ -94,7 +94,7 @@ namespace Dune { } //! deliver all geometry types used in this grid - const std::vector<NewGeometryType>& geomTypes (int codim) const + const std::vector<GeometryType>& geomTypes (int codim) const { return grid_.geomTypes(codim); } diff --git a/grid/common/defaultindexsets.hh b/grid/common/defaultindexsets.hh index 8a20e9d6f..60e58a78b 100644 --- a/grid/common/defaultindexsets.hh +++ b/grid/common/defaultindexsets.hh @@ -201,7 +201,7 @@ namespace Dune { IndexSetWrapper(const IndexSetWrapper<IndexSetImp> & s) : set_(s.set_) {} //! return size of set for codim - int size ( int codim , NewGeometryType type ) const + int size ( int codim , GeometryType type ) const { return set_.size(codim,type); } @@ -210,7 +210,7 @@ namespace Dune { int size ( int codim ) const { int s = 0; - const std::vector< NewGeometryType > & types = set_.geomTypes(codim); + const std::vector< GeometryType > & types = set_.geomTypes(codim); for(unsigned int i=0; i<types.size(); i++) s += set_.size(codim,types[i]); return s; @@ -231,7 +231,7 @@ namespace Dune { } //! wrap geomTypes method of set - const std::vector< NewGeometryType > & geomTypes (int codim) const + const std::vector< GeometryType > & geomTypes (int codim) const { return set_.geomTypes(codim); } @@ -431,7 +431,7 @@ namespace Dune { //! return size of IndexSet for a given level and codim //! this method is to be revised - int size ( int codim , NewGeometryType type ) const + int size ( int codim , GeometryType type ) const { return size_[codim]; } @@ -470,7 +470,7 @@ namespace Dune { } //! deliver all geometry types used in this grid - const std::vector<NewGeometryType>& geomTypes (int codim) const + const std::vector<GeometryType>& geomTypes (int codim) const { return grid_.geomTypes(codim); } diff --git a/grid/common/leafindexset.hh b/grid/common/leafindexset.hh index bfa7887da..4b5bcc258 100644 --- a/grid/common/leafindexset.hh +++ b/grid/common/leafindexset.hh @@ -376,7 +376,7 @@ namespace Dune { template <class AdLeafSet, int codim > struct CountElements { - static inline int count (const AdLeafSet & ls , int cd, NewGeometryType type ) + static inline int count (const AdLeafSet & ls , int cd, GeometryType type ) { if( cd == codim ) { @@ -391,7 +391,7 @@ namespace Dune { template <class AdLeafSet> struct CountElements<AdLeafSet,0> { - static inline int count (const AdLeafSet & ls , int cd, NewGeometryType type ) + static inline int count (const AdLeafSet & ls , int cd, GeometryType type ) { enum { codim = 0 }; if( cd == codim ) @@ -676,7 +676,7 @@ namespace Dune { } //! return size of grid entities per level and codim - int size ( int codim , NewGeometryType type ) const + int size ( int codim , GeometryType type ) const { if( !codimUsed_[codim] ) { @@ -694,7 +694,7 @@ namespace Dune { } //! returns vector with geometry tpyes this index set has indices for - const std::vector <NewGeometryType> & geomTypes (int codim) const + const std::vector <GeometryType> & geomTypes (int codim) const { return hIndexSet_.geomTypes(codim); } @@ -1020,7 +1020,7 @@ namespace Dune { //! count elements by iterating over grid and compare //! entities of given codim with given type template <int codim> - int countElements( NewGeometryType type ) const + int countElements( GeometryType type ) const { typedef typename Traits :: template Codim <codim> :: template Partition<All_Partition> :: Iterator IteratorType; diff --git a/grid/common/refinement.hh b/grid/common/refinement.hh index da000f1ef..2615dc82e 100644 --- a/grid/common/refinement.hh +++ b/grid/common/refinement.hh @@ -68,7 +68,7 @@ <!--===================================--> @code - template<NewGeometryType::BasicType geometryType, class CoordType, NewGeometryType::BasicType coerceTo, int dimension> + template<GeometryType::BasicType geometryType, class CoordType, GeometryType::BasicType coerceTo, int dimension> class Refinement { public: @@ -99,7 +99,7 @@ support some additional methods: @code - template<NewGeometryType::BasicType geometryType, class CoordType, NewGeometryType::BasicType coerceTo, int dimension> + template<GeometryType::BasicType geometryType, class CoordType, GeometryType::BasicType coerceTo, int dimension> class VertexIterator { public: @@ -109,7 +109,7 @@ Refinement::CoordVector coords() const; } - template<NewGeometryType::BasicType geometryType, class CoordType, NewGeometryType::BasicType coerceTo, int dimension> + template<GeometryType::BasicType geometryType, class CoordType, GeometryType::BasicType coerceTo, int dimension> class ElementIterator { public: @@ -135,7 +135,7 @@ //#include <dune/grid/common/refinement/hcube.cc> // Get yourself the Refinement you need: - typedef Refinement<NewGeometryType::cube, SGrid<2, 2>::ctype, NewGeometryType::cube, 2> MyRefinement; + typedef Refinement<GeometryType::cube, SGrid<2, 2>::ctype, GeometryType::cube, 2> MyRefinement; int main() { @@ -194,23 +194,23 @@ namespace Dune::RefinementImp { // the "dim" template parameter is ignored, since the dimension can be infered template<class CoordType> - struct Traits<NewGeometryType::sphere, CoordType, NewGeometryType::cube, 2> { + struct Traits<GeometryType::sphere, CoordType, GeometryType::cube, 2> { typedef SquaringTheCircle::RefinementImp<CoordType> Imp; }; // we're only implementing this for dim=2 template<class CoordType> - struct Traits<NewGeometryType::sphere, CoordType, NewGeometryType::cube, 2> { + struct Traits<GeometryType::sphere, CoordType, GeometryType::cube, 2> { typedef SquaringTheCircle::RefinementImp<CoordType> Imp; }; template<class CoordType> - struct Traits<NewGeometryType::circle, CoordType, NewGeometryType::cube, 2> { + struct Traits<GeometryType::circle, CoordType, GeometryType::cube, 2> { typedef SquaringTheCircle::RefinementImp<CoordType> Imp; }; template<class CoordType> - struct Traits<NewGeometryType::sphere, CoordType, NewGeometryType::quadrilateral, 2> { + struct Traits<GeometryType::sphere, CoordType, GeometryType::quadrilateral, 2> { typedef SquaringTheCircle::RefinementImp<CoordType> Imp; }; } diff --git a/grid/common/sizecache.hh b/grid/common/sizecache.hh index 418852ab1..6dcec8def 100644 --- a/grid/common/sizecache.hh +++ b/grid/common/sizecache.hh @@ -135,7 +135,7 @@ namespace Dune { } //! number of entities per level, codim and geometry type in this process - int size (int level, int codim, NewGeometryType type) const + int size (int level, int codim, GeometryType type) const { // if isSimplex true, then this is a simplex counting one if( (isSimplex_) && (isSimplex_ != type.isSimplex()) ) return 0; @@ -158,7 +158,7 @@ namespace Dune { }; //! number of leaf entities per codim and geometry type in this process - int size (int codim, NewGeometryType type) const + int size (int codim, GeometryType type) const { // if isSimplex true, then this is a simplex counting one if( (isSimplex_) && (isSimplex_ != type.isSimplex()) ) return 0; @@ -175,7 +175,7 @@ namespace Dune { LevelIterator it = grid_.template lbegin<codim> (level); LevelIterator end = grid_.template lend<codim> (level); - NewGeometryType type (((isSimplex_) ? NewGeometryType::simplex : NewGeometryType::cube ),dim-codim); + GeometryType type (((isSimplex_) ? GeometryType::simplex : GeometryType::cube ),dim-codim); assert( type.isCube() == isCube_ ); if( notWorry_ ) return countElements(it,end,type); return countElements(it,end); @@ -187,7 +187,7 @@ namespace Dune { typedef typename GridType::template Codim<codim> :: LeafIterator LeafIterator; LeafIterator it = grid_.template leafbegin<codim> (); LeafIterator end = grid_.template leafend<codim> (); - NewGeometryType type (((isSimplex_) ? NewGeometryType::simplex : NewGeometryType::cube ),dim-codim); + GeometryType type (((isSimplex_) ? GeometryType::simplex : GeometryType::cube ),dim-codim); assert( type.isCube() == isCube_ ); if( notWorry_ ) return countElements(it,end,type); return countElements(it,end); @@ -196,7 +196,7 @@ namespace Dune { // counts entities with given type for given iterator template <class IteratorType> int countElements(IteratorType & it, const IteratorType & end , - const NewGeometryType & type ) const + const GeometryType & type ) const { int count = 0; if((type.isSimplex()) || (type.isCube())) @@ -238,7 +238,7 @@ namespace Dune { { // check that used grid only has simplex and/or cube as geomTypes // to be revised - const std::vector<NewGeometryType> & geomTypes = grid.geomTypes(0); + const std::vector<GeometryType> & geomTypes = grid.geomTypes(0); int found = 0; int others = 0; for(unsigned int i=0; i<geomTypes.size(); i++) @@ -270,7 +270,7 @@ namespace Dune { } //! number of entities per level, codim and geometry type in this process - int size (int level, int codim, NewGeometryType type) const + int size (int level, int codim, GeometryType type) const { if( type.isSimplex()) return simplexSize_.size(level,codim); if( type.isCube() ) return cubeSize_(level,codim); @@ -287,7 +287,7 @@ namespace Dune { }; //! number of leaf entities per codim and geometry type in this process - int size (int codim, NewGeometryType type) const + int size (int codim, GeometryType type) const { if( type.isSimplex() ) return simplexSize_.size(codim); if( type.isCube() ) return cubeSize_(codim); diff --git a/grid/common/virtualrefinement.hh b/grid/common/virtualrefinement.hh index 71ae04fad..f07738e39 100644 --- a/grid/common/virtualrefinement.hh +++ b/grid/common/virtualrefinement.hh @@ -140,7 +140,7 @@ @code template<int dimension, class CoordType> - VirtualRefinement<dimension, CoordType> &buildRefinement(NewGeometryType geometryType, NewGeometryType coerceTo); + VirtualRefinement<dimension, CoordType> &buildRefinement(GeometryType geometryType, GeometryType coerceTo); @endcode It is expected that you know the dimension and the coordinate type @@ -208,7 +208,7 @@ refinementvirtual.cc. - <strong>Layer 4</strong> defines function buildRefinement(geometryType, coerceTo), which returns the right - refinement for a runtime-determined NewGeometryType. It is also + refinement for a runtime-determined GeometryType. It is also located in refinementvirtual.cc @section Implementation @@ -252,7 +252,7 @@ The template function buildRefinement() has to be specialized for each dimension. It makes no sense to test for - geometryType==NewGeometryType::prism when dimension==2. But this + geometryType==GeometryType::prism when dimension==2. But this way we run into a limitation of C++: we can't do partial function specialisation. @@ -356,8 +356,8 @@ namespace Dune { template<int dimension, class CoordType> VirtualRefinement<dimension, CoordType> & - buildRefinement(NewGeometryType geometryType, - NewGeometryType coerceTo); + buildRefinement(GeometryType geometryType, + GeometryType coerceTo); } // namespace Dune diff --git a/io/visual/grapegriddisplay.hh b/io/visual/grapegriddisplay.hh index a92351c33..aa5197f03 100644 --- a/io/visual/grapegriddisplay.hh +++ b/io/visual/grapegriddisplay.hh @@ -205,7 +205,7 @@ namespace Dune , g_unknown = GrapeInterface_three_three::gr_unknown}; //! convert dune geometry types to grape geometry types with numbers - static inline GRAPE_ElementType convertToGrapeType ( NewGeometryType type , int dim ) + static inline GRAPE_ElementType convertToGrapeType ( GeometryType type , int dim ) { if(dim < 3) { diff --git a/quadrature/fixedorder.hh b/quadrature/fixedorder.hh index a904afe06..3929e0602 100644 --- a/quadrature/fixedorder.hh +++ b/quadrature/fixedorder.hh @@ -159,7 +159,7 @@ namespace Dune { public: //! Constructor building the quadrature - QuadratureOld ( int id , NewGeometryType eltype, int polOrd ) : + QuadratureOld ( int id , GeometryType eltype, int polOrd ) : order_ ( polOrd ) , eltype_ ( eltype ) { switch ( eltype_ ) -- GitLab