Skip to content
Snippets Groups Projects
Commit 5f43cf3f authored by Oliver Sander's avatar Oliver Sander
Browse files

Simplification: merge the two classes that implement element facets in 3d into one

Previously, the implementation of UGGrid entities for facets of 3d elements
consisted of two classes: UGGridEntity<1,3>, a specialization of the generic
implementation class for UGGrid entities, and UGFaceEntity, a special
implementation class for the codim-1 case in 3d.  There was never a real
reason for this separation into two classes, and this patch does away
with it.  This leads to a minor code simplification.

Note: The same separation into two classes holds for grid edges, and there is
a reason.  The UGEdgeEntity class, which contains the actual implementation,
serves for *two* cases: UGGridEntity<1,2> and UGGridEntity<2,3>.
C++ partial specialization rules apparently do not allow to merge all of this
into one class.
parent 8c77c433
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -400,13 +400,14 @@ namespace Dune {
};
/*! \brief UGGrid face entity
/*! \brief UGGrid face entity in 3d grids
* \ingroup UGGrid
*/
template<int dim, class GridImp>
class UGFaceEntity
template<class GridImp>
class UGGridEntity<1,3,GridImp>
{
enum {codim = 1};
enum {dim = 3};
typedef typename GridImp::ctype UGCtype;
typedef typename GridImp::Traits::template Codim<codim>::GeometryImpl GeometryImpl;
......@@ -415,12 +416,12 @@ namespace Dune {
typedef typename GridImp::template Codim<codim>::Geometry Geometry;
UGFaceEntity()
UGGridEntity()
: target_(nullptr)
, gridImp_(nullptr)
{}
UGFaceEntity(typename UG_NS<dim>::template Entity<codim>::T* target, const GridImp* gridImp)
UGGridEntity(typename UG_NS<dim>::template Entity<codim>::T* target, const GridImp* gridImp)
{
setToTarget(target,gridImp);
}
......@@ -525,7 +526,7 @@ namespace Dune {
}
//! equality
bool equals(const UGFaceEntity& other) const
bool equals(const UGGridEntity& other) const
{
return getTarget() == other.getTarget();
}
......@@ -542,25 +543,6 @@ protected:
const GridImp* gridImp_;
};
/*! \brief Specialization for faces in 3D
* \ingroup UGGrid
*/
template<class GridImp>
class UGGridEntity<1,3,GridImp>
: public UGFaceEntity<3,GridImp>
{
public:
UGGridEntity()
{}
UGGridEntity(typename UG_NS<3>::template Entity<1>::T* target, const GridImp* gridImp)
: UGFaceEntity<3,GridImp>(target,gridImp)
{}
};
//***********************
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment