dune-grid 2.9.0
albertagrid/entityseed.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
4// vi: set et ts=4 sw=2 sts=2:
5#ifndef DUNE_ALBERTA_ENTITYSEED_HH
6#define DUNE_ALBERTA_ENTITYSEED_HH
7
10
11namespace Dune
12{
13
14 // Internal Forward Declarations
15 // -----------------------------
16
17 template< int codim, class Grid >
19
20
21
22 // External Forward Declarations
23 // -----------------------------
24
25 template< int dim, int dimworld >
26 class AlbertaGrid;
27
28
29
30#if HAVE_ALBERTA
31
32 // AlbertaGridEntitySeed (for higher codimension)
33 // ----------------------------------------------
34
35 template< int codim, int dim, int dimworld >
36 class AlbertaGridEntitySeed< codim, const AlbertaGrid< dim, dimworld > >
37 {
38 public:
40
41 static const int codimension = codim;
42 static const int dimension = dim;
43 static const int mydimension = dimension - codimension;
44 static const int dimensionworld = dimworld;
45
48 typedef typename ElementInfo::Seed Seed;
49
50 typedef typename Grid::template Codim< codimension >::Entity Entity;
51
53 {}
54
55 AlbertaGridEntitySeed ( const ElementInfo &elementInfo, int subEntity )
56 : seed_( elementInfo.seed() ),
57 subEntity_( subEntity )
58 {}
59
60 bool isValid () const
61 {
62 return seed_.isValid();
63 }
64
65 ElementInfo elementInfo ( const MeshPointer &mesh ) const { return ElementInfo( mesh, seed_ ); }
66 int subEntity () const { return subEntity_; }
67
68 private:
69 Seed seed_;
70 int subEntity_;
71 };
72
73
74
75 // AlbertaGridEntitySeed (for codimension 0)
76 // -----------------------------------------
77
78 template< int dim, int dimworld >
79 class AlbertaGridEntitySeed< 0, const AlbertaGrid< dim, dimworld > >
80 {
81 public:
83
84 static const int codimension = 0;
85 static const int dimension = dim;
86 static const int mydimension = dimension - codimension;
87 static const int dimensionworld = dimworld;
88
91 typedef typename ElementInfo::Seed Seed;
92
93 typedef typename Grid::template Codim< codimension >::Entity Entity;
94
96 {}
97
98 explicit AlbertaGridEntitySeed ( const ElementInfo &elementInfo )
99 : seed_( elementInfo.seed() )
100 {}
101
102 bool isValid () const
103 {
104 return seed_.isValid();
105 }
106
107 ElementInfo elementInfo ( const MeshPointer &mesh ) const { return ElementInfo( mesh, seed_ ); }
108 int subEntity () const { return 0; }
109
110 private:
111 Seed seed_;
112 };
113
114#endif // #if HAVE_ALBERTA
115
116} // end namespace Dune
117
118#endif // #ifndef DUNE_ALBERTA_ENTITYSEED_HH
provides a wrapper for ALBERTA's mesh structure
provides a wrapper for ALBERTA's el_info structure
Include standard header files.
Definition: agrid.hh:60
[ provides Dune::Grid ]
Definition: agrid.hh:109
Definition: albertagrid/entityseed.hh:18
ElementInfo elementInfo(const MeshPointer &mesh) const
Definition: albertagrid/entityseed.hh:65
AlbertaGridEntitySeed(const ElementInfo &elementInfo, int subEntity)
Definition: albertagrid/entityseed.hh:55
Alberta::ElementInfo< dimension > ElementInfo
Definition: albertagrid/entityseed.hh:47
Grid::template Codim< codimension >::Entity Entity
Definition: albertagrid/entityseed.hh:50
Alberta::MeshPointer< dimension > MeshPointer
Definition: albertagrid/entityseed.hh:46
AlbertaGrid< dim, dimworld > Grid
Definition: albertagrid/entityseed.hh:39
ElementInfo::Seed Seed
Definition: albertagrid/entityseed.hh:48
int subEntity() const
Definition: albertagrid/entityseed.hh:66
bool isValid() const
Definition: albertagrid/entityseed.hh:60
AlbertaGrid< dim, dimworld > Grid
Definition: albertagrid/entityseed.hh:82
Alberta::MeshPointer< dimension > MeshPointer
Definition: albertagrid/entityseed.hh:89
AlbertaGridEntitySeed(const ElementInfo &elementInfo)
Definition: albertagrid/entityseed.hh:98
Alberta::ElementInfo< dimension > ElementInfo
Definition: albertagrid/entityseed.hh:90
Grid::template Codim< codimension >::Entity Entity
Definition: albertagrid/entityseed.hh:93
AlbertaGridEntitySeed()
Definition: albertagrid/entityseed.hh:95
bool isValid() const
Definition: albertagrid/entityseed.hh:102
int subEntity() const
Definition: albertagrid/entityseed.hh:108
ElementInfo::Seed Seed
Definition: albertagrid/entityseed.hh:91
ElementInfo elementInfo(const MeshPointer &mesh) const
Definition: albertagrid/entityseed.hh:107