1#ifndef DUNE_ALUGRID_ALU3DINCLUDE_HH
2#define DUNE_ALUGRID_ALU3DINCLUDE_HH
7#define ALU3DSPACE ::ALUGrid::
9#include <dune/alugrid/common/declaration.hh>
11#include <dune/alugrid/impl/serial/gatherscatter.hh>
12#include <dune/alugrid/impl/serial/key.h>
13#include <dune/alugrid/impl/serial/myalloc.h>
14#include <dune/alugrid/impl/serial/serialize.h>
16#include <dune/alugrid/impl/parallel/mpAccess.h>
17#include <dune/alugrid/impl/parallel/gitter_pll_ldb.h>
19#include <dune/alugrid/impl/serial/gitter_sti.h>
21#include <dune/alugrid/impl/serial/gitter_hexa_top.h>
22#include <dune/alugrid/impl/serial/mapp_tetra_3d_ext.h>
23#include <dune/alugrid/impl/serial/gitter_tetra_top.h>
24#include <dune/alugrid/impl/serial/walk.h>
25#include <dune/alugrid/impl/serial/gitter_impl.h>
26#include <dune/alugrid/impl/serial/gitter_mgb.h>
27#include <dune/alugrid/impl/serial/key.h>
28#include <dune/alugrid/impl/serial/lock.h>
30#include <dune/alugrid/impl/duneinterface/gitter_dune_impl.h>
35 typedef Gitter::AdaptRestrictProlong AdaptRestrictProlongType;
37 static const int ProcessorBoundary_t = Gitter::hbndseg_STI::closure;
40 typedef GatherScatter GatherScatterType;
46#include <dune/alugrid/impl/parallel/gitter_pll_sti.h>
47#include <dune/alugrid/impl/parallel/gitter_pll_impl.h>
48#include <dune/alugrid/impl/parallel/gitter_pll_ldb.h>
49#include <dune/alugrid/impl/parallel/gitter_tetra_top_pll.h>
50#include <dune/alugrid/impl/parallel/gitter_hexa_top_pll.h>
51#include <dune/alugrid/impl/parallel/gitter_pll_mgb.h>
52#include <dune/alugrid/impl/duneinterface/gitter_dune_pll_impl.h>
56#include <dune/alugrid/impl/parallel/mpAccess_MPI.h>
60#include <dune/alugrid/3d/topology.hh>
68 typedef double alu3d_ctype;
74 template<
class Comm >
75 struct ALU3dBasicImplTraits;
78 struct ALU3dBasicImplTraits< ALUGridNoComm >
80 typedef ALU3DSPACE Gitter GitterType;
81 typedef ALU3DSPACE GitterDuneImpl GitterImplType;
83 typedef GitterType::helement_STI HElementType;
84 typedef GitterType::hface_STI HFaceType;
85 typedef GitterType::hedge_STI HEdgeType;
86 typedef GitterType::vertex_STI VertexType;
87 typedef GitterType::hbndseg_STI HBndSegType;
88 typedef GitterType::ghostpair_STI GhostPairType;
90 typedef HElementType PllElementType;
92 typedef GitterType::Geometric::hedge1_GEO GEOEdgeType;
95 template <
class BndFaceType>
96 static bool isGhost(
const BndFaceType* ghost )
103 struct ALU3dBasicImplTraits< ALUGridMPIComm >
105 typedef ALU3DSPACE GitterDunePll GitterType;
106 typedef ALU3DSPACE GitterDunePll GitterImplType;
108 typedef GitterType::helement_STI HElementType;
109 typedef GitterType::hface_STI HFaceType;
110 typedef GitterType::hedge_STI HEdgeType;
111 typedef GitterType::vertex_STI VertexType;
112 typedef GitterType::hbndseg_STI HBndSegType;
113 typedef GitterType::ghostpair_STI GhostPairType;
115 typedef ALU3DSPACE ElementPllXIF_t PllElementType;
117 typedef GitterType::Geometric::hedge1_GEO GEOEdgeType;
120 template <
class BndFaceType>
121 static bool isGhost(
const BndFaceType* ghost )
123 return ( ghost != 0 );
131 template< ALU3dGr
idElementType elType,
class Comm,
int dim,
int codim >
132 struct ALU3dCodimImplTraits;
134 template<
class Comm,
int dim>
135 struct ALU3dCodimImplTraits< tetra, Comm, dim, 0 >
137 typedef typename ALU3dBasicImplTraits< Comm >::GitterType GitterType;
138 typedef typename ALU3dBasicImplTraits< Comm >::GitterImplType GitterImplType;
141 typedef typename GitterType::Geometric::hasFace3 EntitySeedType;
142 typedef typename GitterImplType::Objects::tetra_IMPL ImplementationType;
143 typedef typename GitterType::hbndseg_STI GhostInterfaceType;
144 typedef typename GitterImplType::Objects::Hbnd3Default GhostImplementationType;
147 template<
class Comm,
int dim >
148 struct ALU3dCodimImplTraits< hexa, Comm, dim, 0 >
150 typedef typename ALU3dBasicImplTraits< Comm >::GitterType GitterType;
151 typedef typename ALU3dBasicImplTraits< Comm >::GitterImplType GitterImplType;
154 typedef typename GitterType::Geometric::hasFace4 EntitySeedType;
155 typedef typename GitterImplType::Objects::hexa_IMPL ImplementationType;
156 typedef typename GitterType::hbndseg_STI GhostInterfaceType;
157 typedef typename GitterImplType::Objects::Hbnd4Default GhostImplementationType;
160 template<
class Comm,
int dim >
161 struct ALU3dCodimImplTraits< tetra, Comm, dim, 1 >
163 typedef typename ALU3dBasicImplTraits< Comm >::GitterType GitterType;
167 typedef typename GitterType::Geometric::hface3_GEO ImplementationType;
170 template<
class Comm,
int dim >
171 struct ALU3dCodimImplTraits< hexa, Comm, dim, 1 >
173 typedef typename ALU3dBasicImplTraits< Comm >::GitterType GitterType;
177 typedef typename GitterType::Geometric::hface4_GEO ImplementationType;
180 template< ALU3dGr
idElementType elType,
class Comm >
181 struct ALU3dCodimImplTraits< elType, Comm, 3, 2 >
183 typedef typename ALU3dBasicImplTraits< Comm >::GitterType GitterType;
187 typedef typename GitterType::Geometric::hedge1_GEO ImplementationType;
191 template< ALU3dGr
idElementType elType,
class Comm >
192 struct ALU3dCodimImplTraits< elType, Comm, 2, 2 >
194 typedef typename ALU3dBasicImplTraits< Comm >::GitterType GitterType;
198 typedef typename GitterType::Geometric::VertexGeo ImplementationType;
201 template< ALU3dGr
idElementType elType,
class Comm >
202 struct ALU3dCodimImplTraits< elType, Comm, 3, 3 >
204 typedef typename ALU3dBasicImplTraits< Comm >::GitterType GitterType;
208 typedef typename GitterType::Geometric::VertexGeo ImplementationType;
212 template<
class MarkRuleType, ALU3dGr
idElementType elType >
213 struct ALU3dRefinementTraits {};
216 template<
class MarkRuleType >
217 struct ALU3dRefinementTraits < MarkRuleType, tetra >
220 enum { bisect_element_t = MarkRuleType::bisect };
221 enum { refine_element_t = MarkRuleType::regular };
222 enum { coarse_element_t = MarkRuleType::crs };
223 enum { nosplit_element_t = MarkRuleType::nosplit };
227 template<
class MarkRuleType >
228 struct ALU3dRefinementTraits < MarkRuleType, hexa >
231 enum { bisect_element_t = MarkRuleType::regular };
232 enum { refine_element_t = MarkRuleType::regular };
233 enum { coarse_element_t = MarkRuleType::crs };
234 enum { nosplit_element_t = MarkRuleType::nosplit };
241 template< ALU3dGr
idElementType elType,
class Comm >
242 struct ALU3dImplTraits;
244 template<
class Comm >
245 struct ALU3dImplTraits< tetra, Comm >
246 :
public ALU3dBasicImplTraits< Comm >
248 typedef typename ALU3dBasicImplTraits< Comm >::GitterType GitterType;
249 typedef typename ALU3dBasicImplTraits< Comm >::GitterImplType GitterImplType;
251 typedef typename GitterType::Geometric::hface3_GEO GEOFaceType;
252 typedef typename GitterType::Geometric::VertexGeo GEOVertexType;
253 typedef typename GitterImplType::Objects::tetra_IMPL IMPLElementType;
254 typedef typename GitterType::Geometric::tetra_GEO GEOElementType;
255 typedef typename GitterType::Geometric::periodic3_GEO GEOPeriodicType;
256 typedef typename GitterType::Geometric::hasFace3 HasFaceType;
257 typedef typename GitterType::Geometric::Hface3Rule HfaceRuleType;
258 typedef typename GitterImplType::Objects::Hbnd3Default BNDFaceType;
259 typedef typename GitterImplType::Objects::hbndseg3_IMPL ImplBndFaceType;
261 typedef typename GitterType::Geometric::TetraRule MarkRuleType;
263 struct RefinementRules
264 :
public ALU3dRefinementTraits<MarkRuleType, tetra>
267 typedef std::pair< GEOFaceType *, int > NeighbourFaceType;
268 typedef std::pair< HasFaceType *, int > NeighbourPairType;
270 template<
int dim,
int codim >
272 :
public ALU3dCodimImplTraits< tetra, Comm, dim, codim >
276 template <
class Elem>
277 static const GEOFaceType* getFace(
const Elem& elem,
const int aluFace )
279 return elem.myhface( aluFace );
283 template<
class Comm >
284 struct ALU3dImplTraits< hexa, Comm >
285 :
public ALU3dBasicImplTraits< Comm >
287 typedef typename ALU3dBasicImplTraits< Comm >::GitterType GitterType;
288 typedef typename ALU3dBasicImplTraits< Comm >::GitterImplType GitterImplType;
290 typedef typename GitterType::Geometric::hface4_GEO GEOFaceType;
291 typedef typename GitterType::Geometric::VertexGeo GEOVertexType;
292 typedef typename GitterImplType::Objects::hexa_IMPL IMPLElementType;
293 typedef typename GitterType::Geometric::hexa_GEO GEOElementType;
294 typedef typename GitterType::Geometric::periodic4_GEO GEOPeriodicType;
295 typedef typename GitterType::Geometric::hasFace4 HasFaceType;
296 typedef typename GitterType::Geometric::Hface4Rule HfaceRuleType;
297 typedef typename GitterImplType::Objects::Hbnd4Default BNDFaceType;
298 typedef typename GitterImplType::Objects::hbndseg4_IMPL ImplBndFaceType;
300 typedef typename GitterType::Geometric::HexaRule MarkRuleType;
302 struct RefinementRules
303 :
public ALU3dRefinementTraits<MarkRuleType, hexa>
306 typedef std::pair< GEOFaceType *, int > NeighbourFaceType;
307 typedef std::pair< HasFaceType *, int > NeighbourPairType;
309 template<
int dim,
int codim >
311 :
public ALU3dCodimImplTraits< hexa, Comm, dim, codim >
315 template <
class Elem>
316 static const GEOFaceType* getFace(
const Elem& elem,
const int aluFace )
318 return elem.myhface( aluFace );
326 template<
class Comm >
330 typedef typename ALU3dBasicImplTraits< Comm >::VertexType VertexType;
331 typedef std::vector< VertexType * > VertexListType;
332 typedef typename VertexListType::iterator IteratorType;
338 size_t size ()
const {
return vertexList_.size(); }
340 bool up2Date ()
const {
return up2Date_; }
341 void unsetUp2Date () { up2Date_ =
false; }
344 template <
class Gr
idType>
345 void setupVxList (
const GridType & grid,
int level);
347 IteratorType begin () {
return vertexList_.begin(); }
348 IteratorType end () {
return vertexList_.end(); }
350 VertexListType & getItemList() {
return vertexList_; }
356 VertexListType vertexList_;
362 template<
class Comm >
366 typedef typename ALU3dBasicImplTraits< Comm >::VertexType VertexType;
367 typedef std::pair< VertexType *, int > ItemType;
368 typedef std::vector< ItemType > VertexListType;
369 typedef typename VertexListType::iterator IteratorType;
375 size_t size ()
const {
return vertexList_.size(); }
377 bool up2Date ()
const {
return up2Date_; }
378 void unsetUp2Date () { up2Date_ =
false; }
381 template <
class Gr
idType>
382 void setupVxList (
const GridType & grid);
384 IteratorType begin () {
return vertexList_.begin(); }
385 IteratorType end () {
return vertexList_.end(); }
387 VertexListType & getItemList() {
return vertexList_; }
389 int getLevel (
const VertexType &
vertex )
const
391 const int idx =
vertex.getIndex();
392 alugrid_assert ( idx >= 0 );
393 alugrid_assert ( idx < (
int)size());
394 const ItemType & p = vertexList_[idx];
403 VertexListType vertexList_;
408 class ALU3dGridItemList
412 typedef std::vector < void * > ItemListType;
413 typedef ItemListType :: iterator IteratorType;
415 ALU3dGridItemList () : up2Date_(false) {}
417 size_t size ()
const {
return itemList_.size(); }
419 bool up2Date ()
const {
return up2Date_; }
420 void unsetUp2Date () { up2Date_ =
false; }
422 void markAsUp2Date() { up2Date_ =
true; }
424 IteratorType begin () {
return itemList_.begin(); }
425 IteratorType end () {
return itemList_.end(); }
427 ItemListType & getItemList() {
return itemList_; }
431 ItemListType itemList_;
434 typedef ALU3dGridItemList ALU3dGridItemListType;
440 template<
class Comm >
441 struct ALU3dGridFaceGetter
443 static const typename ALU3dImplTraits< tetra, Comm >::GEOFaceType *
444 getFace(
const typename ALU3dImplTraits< tetra, Comm >::GEOElementType& elem,
int index)
446 alugrid_assert (index >= 0 && index < 4);
450 static const typename ALU3dImplTraits< hexa, Comm >::GEOFaceType*
451 getFace(
const typename ALU3dImplTraits< hexa, Comm >::GEOElementType &elem,
int index )
453 alugrid_assert (index >= 0 && index < 6);
static int dune2aluFace(int index)
Maps face index from Dune onto ALU3dGrid reference element.
Definition: topology.cc:387
constexpr GeometryType vertex
GeometryType representing a vertex.
Definition: type.hh:506
Dune namespace.
Definition: alignedallocator.hh:13
Definition: alu3dinclude.hh:364
Definition: alu3dinclude.hh:328