3#ifndef DUNE_ALU3DGRIDFACEUTILITY_HH
4#define DUNE_ALU3DGRIDFACEUTILITY_HH
6#include <dune/geometry/referenceelements.hh>
9#include "alu3dinclude.hh"
21 inline alu3d_ctype (&fieldVector2alu3d_ctype ( FieldVector< alu3d_ctype, dim > &val ))[ dim ]
23 return ((alu3d_ctype (&)[dim])(*( &(val[0])) ));
28 inline const alu3d_ctype (&fieldVector2alu3d_ctype (
const FieldVector< alu3d_ctype, dim > &val ))[ dim ]
30 return ((
const alu3d_ctype (&)[dim])(*( &(val[0])) ) );
41 template< ALU3dGr
idElementType type,
class Comm >
42 class ALU3dGridFaceInfo
44 typedef ALU3dImplTraits< type, Comm > ImplTraits;
46 typedef typename ImplTraits::HasFaceType HasFaceType;
48 enum ConformanceState {CONFORMING, REFINED_INNER, REFINED_OUTER, UNDEFINED };
50 typedef typename ImplTraits::GEOFaceType GEOFaceType;
51 typedef typename ImplTraits::GEOElementType GEOElementType;
52 typedef typename ImplTraits::GEOPeriodicType GEOPeriodicType;
53 typedef typename ImplTraits::IMPLElementType IMPLElementType;
54 typedef typename ImplTraits::GhostPairType GhostPairType;
55 typedef typename ImplTraits::BNDFaceType BNDFaceType;
59 ALU3dGridFaceInfo(
const bool conformingRefinement,
const bool ghostCellsEnabled );
60 void updateFaceInfo(
const GEOFaceType& face,
int innerLevel,
int innerTwist);
68 ALU3dGridFaceInfo(
const GEOFaceType& face,
int innerTwist);
69 ALU3dGridFaceInfo(
const ALU3dGridFaceInfo &orig);
75 bool isElementLike()
const;
78 bool innerBoundary()
const;
84 bool outerBoundary()
const;
87 bool boundary()
const;
90 bool neighbor()
const ;
94 bool ghostBoundary ()
const;
97 const GEOFaceType& face()
const;
99 const GEOElementType& innerEntity()
const;
102 const GEOElementType& outerEntity()
const;
105 const BNDFaceType& innerFace()
const;
108 const BNDFaceType& boundaryFace()
const;
111 int innerTwist()
const;
113 int outerTwist()
const;
116 int duneTwist(
const int faceIdx,
const int aluTwist)
const;
119 int innerALUFaceIndex()
const;
121 int outerALUFaceIndex()
const;
123 int outsideLevel()
const;
126 int segmentIndex()
const;
129 int boundaryId()
const;
132 ConformanceState conformanceState()
const;
135 bool parallel()
const {
136 return ! Conversion< Comm, No_Comm > :: sameType ;
140 bool conformingRefinement ()
const {
return conformingRefinement_; }
144 ConformanceState getConformanceState(
const int innerLevel)
const;
147 const ALU3dGridFaceInfo &
148 operator=(
const ALU3dGridFaceInfo &orig);
153 const GEOFaceType* face_;
154 const HasFaceType* innerElement_;
155 const HasFaceType* outerElement_;
157 int innerFaceNumber_;
158 int outerFaceNumber_;
166 enum boundary_t { noBoundary = 0,
167 periodicBoundary = 1,
168 innerGhostBoundary = 2,
170 outerGhostBoundary = 4};
174 ConformanceState conformanceState_;
175 const bool conformingRefinement_ ;
176 const bool ghostCellsEnabled_ ;
183 template< ALU3dGr
idElementType type,
class Comm >
184 struct ALU3dGridSurfaceMappingFactory;
186 template<
class Comm >
187 struct ALU3dGridSurfaceMappingFactory< tetra, Comm >
191 typedef ALU3DSPACE LinearSurfaceMapping SurfaceMappingType;
192 typedef typename ALU3dGridFaceInfo< tetra, Comm >::GEOFaceType GEOFaceType;
194 static const int numVerticesPerFace = EntityCount< tetra >::numVerticesPerFace;
196 typedef FieldMatrix< alu3d_ctype, numVerticesPerFace, 3 > CoordinateType;
199 SurfaceMappingType *buildSurfaceMapping (
const CoordinateType &coords )
const;
201 SurfaceMappingType *buildSurfaceMapping (
const GEOFaceType &face )
const;
204 template<
class Comm >
205 struct ALU3dGridSurfaceMappingFactory< hexa, Comm >
207 typedef BilinearSurfaceMapping SurfaceMappingType;
208 typedef typename ALU3dGridFaceInfo< hexa, Comm >::GEOFaceType GEOFaceType;
210 static const int numVerticesPerFace = EntityCount< hexa >::numVerticesPerFace;
212 typedef FieldMatrix< alu3d_ctype, numVerticesPerFace, 3 > CoordinateType;
215 SurfaceMappingType *buildSurfaceMapping (
const CoordinateType &coords )
const;
217 SurfaceMappingType *buildSurfaceMapping (
const GEOFaceType &face )
const;
227 template< ALU3dGr
idElementType type,
class Comm >
229 :
public ALU3dGridSurfaceMappingFactory< type, Comm >
231 typedef ALU3dGridSurfaceMappingFactory< type, Comm > Base;
248 enum SideIdentifier { INNER, OUTER };
249 enum { dimworld = 3 };
250 enum { numVerticesPerFace =
251 EntityCount<type>::numVerticesPerFace };
259 typedef typename ALU3dGridFaceInfo< type, Comm >::GEOFaceType GEOFaceType;
262 typedef ALU3dGridFaceInfo< type, Comm > ConnectorType;
281 void generateLocalGeometries()
const;
283 int globalVertexIndex(
const int duneFaceIndex,
285 const int duneFaceVertexIndex)
const;
287 void referenceElementCoordinatesRefined(SideIdentifier side,
289 void referenceElementCoordinatesUnrefined(SideIdentifier side,
294 const ConnectorType& connector_;
299 mutable bool generatedGlobal_;
300 mutable bool generatedLocal_;
304 return (type == tetra) ?
309 inline static const ReferenceFaceType& getReferenceFace()
311 return (type == tetra) ?
313 ReferenceFaceContainerType :: cube();
319 template<
class Comm >
329 typedef typename ALU3dGridFaceInfo< tetra, Comm >::GEOFaceType GEOFaceType;
331 typedef ALU3dGridFaceInfo< tetra, Comm > ConnectorType;
343 template <
class GeometryImp>
351 using Base::connector_;
358 mutable bool normalUp2Date_;
363 template<
class Comm >
373 typedef typename ALU3dGridFaceInfo< hexa, Comm >::GEOFaceType GEOFaceType;
376 typedef ALU3dGridFaceInfo< hexa, Comm > ConnectorType;
388 template <
class GeometryImp>
396 using Base::connector_;
406 mutable bool mappingGlobalUp2Date_;
411#include "faceutility_imp.cc"
Definition: faceutility.hh:230
void resetFaceGeom()
reset status of faceGeomInfo
Definition: faceutility.hh:366
void buildGlobalGeom(GeometryImp &geo) const
update global geometry
void resetFaceGeom()
reset status of faceGeomInfo
Definition: faceutility.hh:322
void buildGlobalGeom(GeometryImp &geo) const
update global geometry
void resetFaceGeom()
reset status of faceGeomInfo
Definition: topology.hh:41
Definition: topology.hh:126
A dense n x m matrix.
Definition: fmatrix.hh:67
This class provides access to geometric and topological properties of a reference element.
Definition: referenceelements.hh:55
A bilinear surface mapping.
Definition: mappings.hh:90
Dune namespace.
Definition: alignment.hh:10
Class providing access to the singletons of the reference elements.
Definition: referenceelements.hh:479
static const ReferenceElement< ctype, dim > & simplex()
get simplex reference elements
Definition: referenceelements.hh:490