Skip to content
Snippets Groups Projects
Commit 4c6781d9 authored by Robert Klöfkorn's avatar Robert Klöfkorn
Browse files

changed template parameter from codim to cd, because this didn't work with

icc version 7.x. Now icc 7.x compiles dune again, which is necessary for
example on clusters where newer compilers are not installed (helics, etc.)

[[Imported from SVN: r2074]]
parent 9a48f901
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,7 @@ namespace Dune
digraph entity {
rankdir=LR;
node [ shape=record, fontname=Helvetica, fontsize=10, height=0.25 ];
Entity [ label="Dune::Entity\<codim,dim,GridImp,EntityImp\>"
Entity [ label="Dune::Entity\<cd,dim,GridImp,EntityImp\>"
style=filled, bgcolor=lightgrey
shape=record, URL="\ref Dune::Entity"];
Element [ label="Dune::Entity\<0,dim,GridImp,EntityImp\>"
......@@ -25,19 +25,19 @@ namespace Dune
Entity -> Element [ dirType="back", arrowType="open",
style="dashed"
fontname=Helvetica, fontsize=8,
label="codim=0" ];
label="cd=0" ];
Entity -> Vertex [ dirType="back", arrowType="open", style="dashed"
fontname=Helvetica, fontsize=8,
label="codim=dim" ];
label="cd=dim" ];
}
\enddot
@note @{
There a three versions of Dune::Entity. Two of them are
template specializations:
\li Dune::Entity<codim,dim,GridImp,EntityImp> (general version)
\li Dune::Entity<0,dim,GridImp,EntityImp> (Elements [codim=0])
\li Dune::Entity<dim,dim,GridImp,EntityImp> (Vertices [codim=dim])
\li Dune::Entity<cd,dim,GridImp,EntityImp> (general version)
\li Dune::Entity<0,dim,GridImp,EntityImp> (Elements [cd=0])
\li Dune::Entity<dim,dim,GridImp,EntityImp> (Vertices [cd=dim])
These template specializations also show differences in the interface.
\par
An Entity is only accessible via an Iterator
......@@ -61,19 +61,19 @@ namespace Dune
\ingroup GridInterface
*/
template<int codim, int dim, class GridImp, template<int,int,class> class EntityImp>
template<int cd, int dim, class GridImp, template<int,int,class> class EntityImp>
class Entity {
enum { dimworld = GridImp::dimensionworld };
typedef typename GridImp::ctype ct;
protected:
EntityImp<codim,dim,GridImp> realEntity;
EntityImp<cd,dim,GridImp> realEntity;
public:
/** The corresponding geometry type */
typedef typename GridImp::template codim<codim>::Geometry Geometry;
typedef typename GridImp::template codim<cd>::Geometry Geometry;
enum {
/** know your own codimension */
codimension=codim
codimension=cd
};
enum {
/** know the grid dimension */
......@@ -81,7 +81,7 @@ namespace Dune
};
enum {
/** know dimension of the entity */
mydimension=dim-codim
mydimension=dim-cd
};
enum {
/** know the dimension of world */
......@@ -109,7 +109,7 @@ namespace Dune
const Geometry& geometry () const { return realEntity.geometry(); }
//! Copy constructor from EntityImp
explicit Entity(const EntityImp<codim,dim,GridImp> & e) : realEntity(e) {};
explicit Entity(const EntityImp<cd,dim,GridImp> & e) : realEntity(e) {};
typedef typename RemoveConst<GridImp>::Type mutableGridImp;
......@@ -124,14 +124,14 @@ namespace Dune
*/
#ifdef __ICC
// for icc
friend EntityImp<codim,dim,GridImp>& mutableGridImp::template getRealEntity<>(typename GridImp::Traits::template codim<codim>::Entity& e );
friend const EntityImp<codim,dim,GridImp>& mutableGridImp::template getRealEntity<>(const typename GridImp::Traits::template codim<codim>::Entity& e ) const;
friend EntityImp<cd,dim,GridImp>& mutableGridImp::template getRealEntity<>(typename GridImp::Traits::template codim<cd>::Entity& e );
friend const EntityImp<cd,dim,GridImp>& mutableGridImp::template getRealEntity<>(const typename GridImp::Traits::template codim<cd>::Entity& e ) const;
#else
// for g++
template <int cd>
friend EntityImp<cd,dim,GridImp>& mutableGridImp::getRealEntity(typename GridImp::Traits::template codim<cd>::Entity& e );
template <int cd>
friend const EntityImp<cd,dim,GridImp>& mutableGridImp::getRealEntity(const typename GridImp::Traits::template codim<cd>::Entity& e ) const;
template <int cc>
friend EntityImp<cc,dim,GridImp>& mutableGridImp::getRealEntity(typename GridImp::Traits::template codim<cc>::Entity& e );
template <int cc>
friend const EntityImp<cc,dim,GridImp>& mutableGridImp::getRealEntity(const typename GridImp::Traits::template codim<cc>::Entity& e ) const;
#endif
protected:
......@@ -150,7 +150,7 @@ namespace Dune
digraph entity {
rankdir=LR;
node [ shape=record, fontname=Helvetica, fontsize=10, height=0.25 ];
Entity [ label="Dune::Entity\<codim,dim,GridImp,EntityImp\>"
Entity [ label="Dune::Entity\<cd,dim,GridImp,EntityImp\>"
shape=record, URL="\ref Dune::Entity"];
Element [ label="Dune::Entity\<0,dim,GridImp,EntityImp\>"
style=filled, bgcolor=lightgrey
......@@ -186,10 +186,10 @@ namespace Dune
friend const EntityImp<0,dim,GridImp>& mutableGridImp::template getRealEntity<>(const typename GridImp::Traits::template codim<0>::Entity& e ) const;
#else
// for g++
template <int cd>
friend EntityImp<cd,dim,GridImp>& mutableGridImp::getRealEntity(typename mutableGridImp::Traits::template codim<cd>::Entity& e );
template <int cd>
friend const EntityImp<cd,dim,GridImp>& mutableGridImp::getRealEntity(const typename mutableGridImp::Traits::template codim<cd>::Entity& e ) const;
template <int cc>
friend EntityImp<cc,dim,GridImp>& mutableGridImp::getRealEntity(typename mutableGridImp::Traits::template codim<cc>::Entity& e );
template <int cc>
friend const EntityImp<cc,dim,GridImp>& mutableGridImp::getRealEntity(const typename mutableGridImp::Traits::template codim<cc>::Entity& e ) const;
#endif
protected:
......@@ -403,7 +403,7 @@ namespace Dune
typedef typename RemoveConst<GridImp>::Type mutableGridImp;
/*
see the comment in Entity<codim,dim,GridImp,EntityImp>
see the comment in Entity<cd,dim,GridImp,EntityImp>
*/
#ifdef __ICC
// for icc
......@@ -411,10 +411,10 @@ namespace Dune
friend const EntityImp<dim,dim,GridImp>& mutableGridImp::template getRealEntity<>(const typename GridImp::Traits::template codim<dim>::Entity& e ) const;
#else
// for g++
template <int cd>
friend EntityImp<cd,dim,GridImp>& mutableGridImp::getRealEntity(typename GridImp::Traits::template codim<cd>::Entity& e );
template <int cd>
friend const EntityImp<cd,dim,GridImp>& mutableGridImp::getRealEntity(const typename GridImp::Traits::template codim<cd>::Entity& e ) const;
template <int cc>
friend EntityImp<cc,dim,GridImp>& mutableGridImp::getRealEntity(typename GridImp::Traits::template codim<cc>::Entity& e );
template <int cc>
friend const EntityImp<cc,dim,GridImp>& mutableGridImp::getRealEntity(const typename GridImp::Traits::template codim<cc>::Entity& e ) const;
#endif
protected:
......@@ -480,16 +480,16 @@ namespace Dune
@ingroup GridDevel
*/
template<int codim, int dim, class GridImp, template<int,int,class> class EntityImp>
template<int cd, int dim, class GridImp, template<int,int,class> class EntityImp>
class EntityInterface {
enum { dimworld = GridImp::dimensionworld };
typedef typename GridImp::ctype ct;
public:
typedef typename GridImp::template codim<codim>::Geometry Geometry;
typedef typename GridImp::template codim<cd>::Geometry Geometry;
//! know your own codimension
enum { codimension=codim };
enum { codimension=cd };
//! know your own dimension
enum { dimension=dim };
......@@ -503,7 +503,7 @@ namespace Dune
//! level of this entity
int level () const { return asImp().level(); }
//! index is unique and consecutive per level and codim used for access to degrees of freedom
//! index is unique and consecutive per level and cd used for access to degrees of freedom
int index () const { return asImp().index(); }
......@@ -519,14 +519,14 @@ namespace Dune
private:
//! Barton-Nackman trick
EntityImp<codim,dim,GridImp>& asImp () {return static_cast<EntityImp<codim,dim,GridImp>&>(*this);}
const EntityImp<codim,dim,GridImp>& asImp () const { return static_cast<const EntityImp<codim,dim,GridImp>&>(*this); }
EntityImp<cd,dim,GridImp>& asImp () {return static_cast<EntityImp<cd,dim,GridImp>&>(*this);}
const EntityImp<cd,dim,GridImp>& asImp () const { return static_cast<const EntityImp<cd,dim,GridImp>&>(*this); }
};
//********************************************************************
/**
@brief Interface Definition for EntityImp (Vertices [codim=dim])
@brief Interface Definition for EntityImp (Vertices [cd=dim])
@note
this specialization has an extended interface compared to the general case
......@@ -560,7 +560,7 @@ namespace Dune
//! level of this entity
int level () const { return asImp().level(); }
//! index is unique and consecutive per level and codim used for access to degrees of freedom
//! index is unique and consecutive per level and cd used for access to degrees of freedom
int index () const { return asImp().index(); }
//! return partition type attribute
......@@ -569,7 +569,7 @@ namespace Dune
//! geometry of this entity
const Geometry& geometry () const { return asImp().geometry(); }
/*! Intra-element access to entities of codimension cc > codim. Return number of entities
/*! Intra-element access to entities of codimension cc > cd. Return number of entities
with codimension cc.
*/
template<int cc> int count () const { return asImp().count<cc>(); }
......@@ -648,7 +648,7 @@ namespace Dune
//********************************************************************
/**
@brief Interface Definition for EntityImp (Vertices [codim=dim])
@brief Interface Definition for EntityImp (Vertices [cd=dim])
@note
this specialization has a reduced interface compared to the general case
......@@ -679,7 +679,7 @@ namespace Dune
//! level of this entity
int level () const { return asImp().level(); }
//! index is unique and consecutive per level and codim used for access to degrees of freedom
//! index is unique and consecutive per level and cd used for access to degrees of freedom
int index () const { return asImp().index(); }
//! return partition type attribute
......@@ -714,25 +714,25 @@ namespace Dune
the implemented interface which has to be done by the user.
@note this is the general version, but there are specializations
for codim=0 and codim=dim
for cd=0 and cd=dim
@ingroup GridDevel
*/
template<int codim, int dim, class GridImp, template<int,int,class> class EntityImp>
template<int cd, int dim, class GridImp, template<int,int,class> class EntityImp>
class EntityDefault
: public EntityInterface <codim,dim,GridImp,EntityImp>
: public EntityInterface <cd,dim,GridImp,EntityImp>
{
enum { dimworld = GridImp::dimensionworld };
typedef typename GridImp::ctype ct;
private:
//! Barton-Nackman trick
EntityImp<codim,dim,GridImp>& asImp () { return static_cast<EntityImp<codim,dim,GridImp>&>(*this); }
const EntityImp<codim,dim,GridImp>& asImp () const { return static_cast<const EntityImp<codim,dim,GridImp>&>(*this); }
EntityImp<cd,dim,GridImp>& asImp () { return static_cast<EntityImp<cd,dim,GridImp>&>(*this); }
const EntityImp<cd,dim,GridImp>& asImp () const { return static_cast<const EntityImp<cd,dim,GridImp>&>(*this); }
}; // end EntityDefault
//********************************************************************
/**
@brief Default Implementations for EntityImp (Elements [codim=0])
@brief Default Implementations for EntityImp (Elements [cd=0])
EntityDefault provides default implementations for Entity which uses
the implemented interface which has to be done by the user.
......@@ -784,7 +784,7 @@ namespace Dune
//********************************************************************
/**
@brief Default Implementations for EntityImp (Vertice [codim=dim])
@brief Default Implementations for EntityImp (Vertice [cd=dim])
EntityDefault provides default implementations for Entity which uses
the implemented interface which has to be done by the user.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment