Dune Core Modules (2.8.0)

entityseed.hh
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_ALBERTA_ENTITYSEED_HH
4#define DUNE_ALBERTA_ENTITYSEED_HH
5
8
9namespace Dune
10{
11
12 // Internal Forward Declarations
13 // -----------------------------
14
15 template< int codim, class Grid >
16 class AlbertaGridEntitySeed;
17
18
19
20 // External Forward Declarations
21 // -----------------------------
22
23 template< int dim, int dimworld >
24 class AlbertaGrid;
25
26
27
28#if HAVE_ALBERTA
29
30 // AlbertaGridEntitySeed (for higher codimension)
31 // ----------------------------------------------
32
33 template< int codim, int dim, int dimworld >
34 class AlbertaGridEntitySeed< codim, const AlbertaGrid< dim, dimworld > >
35 {
36 public:
38
39 static const int codimension = codim;
40 static const int dimension = dim;
41 static const int mydimension = dimension - codimension;
42 static const int dimensionworld = dimworld;
43
44 typedef Alberta::MeshPointer< dimension > MeshPointer;
45 typedef Alberta::ElementInfo< dimension > ElementInfo;
46 typedef typename ElementInfo::Seed Seed;
47
48 typedef typename Grid::template Codim< codimension >::Entity Entity;
49
50 AlbertaGridEntitySeed ( )
51 {}
52
53 AlbertaGridEntitySeed ( const ElementInfo &elementInfo, int subEntity )
54 : seed_( elementInfo.seed() ),
55 subEntity_( subEntity )
56 {}
57
58 bool isValid () const
59 {
60 return seed_.isValid();
61 }
62
63 ElementInfo elementInfo ( const MeshPointer &mesh ) const { return ElementInfo( mesh, seed_ ); }
64 int subEntity () const { return subEntity_; }
65
66 private:
67 Seed seed_;
68 int subEntity_;
69 };
70
71
72
73 // AlbertaGridEntitySeed (for codimension 0)
74 // -----------------------------------------
75
76 template< int dim, int dimworld >
77 class AlbertaGridEntitySeed< 0, const AlbertaGrid< dim, dimworld > >
78 {
79 public:
81
82 static const int codimension = 0;
83 static const int dimension = dim;
84 static const int mydimension = dimension - codimension;
85 static const int dimensionworld = dimworld;
86
87 typedef Alberta::MeshPointer< dimension > MeshPointer;
88 typedef Alberta::ElementInfo< dimension > ElementInfo;
89 typedef typename ElementInfo::Seed Seed;
90
91 typedef typename Grid::template Codim< codimension >::Entity Entity;
92
93 AlbertaGridEntitySeed ( )
94 {}
95
96 explicit AlbertaGridEntitySeed ( const ElementInfo &elementInfo )
97 : seed_( elementInfo.seed() )
98 {}
99
100 bool isValid () const
101 {
102 return seed_.isValid();
103 }
104
105 ElementInfo elementInfo ( const MeshPointer &mesh ) const { return ElementInfo( mesh, seed_ ); }
106 int subEntity () const { return 0; }
107
108 private:
109 Seed seed_;
110 };
111
112#endif // #if HAVE_ALBERTA
113
114} // end namespace Dune
115
116#endif // #ifndef DUNE_ALBERTA_ENTITYSEED_HH
provides a wrapper for ALBERTA's el_info structure
provides a wrapper for ALBERTA's mesh structure
Dune namespace.
Definition: alignedallocator.hh:11
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 21, 23:30, 2024)