DUNE-FEM (unstable)

defaultgridpartentity.hh
1#ifndef DUNE_FEM_GRIDPART_COMMON_DEFAULTGRIDPARTENTITY_HH
2#define DUNE_FEM_GRIDPART_COMMON_DEFAULTGRIDPARTENTITY_HH
3
4#include <type_traits>
5
7
8#include <dune/grid/common/entity.hh>
9#include <dune/grid/common/gridenums.hh>
10
11namespace Dune
12{
13
14 namespace Fem
15 {
16
17 // DefaultGridPartEntity
18 // ---------------------
19
20 template< int codim, int dim, class GridFamily >
21 class DefaultGridPartEntity
22 {
23 protected:
24 typedef typename std::remove_const< GridFamily >::type::Traits Traits;
25
26 public:
27 static const int codimension = codim;
28 static const int dimension = dim;
29 static const int mydimension = dimension - codimension;
30
31 int level () const
32 {
33 DUNE_THROW( InvalidStateException, "Trying to access hierarchy information from a grid part." );
34 }
35 };
36
37
38
39 // DefaultGridPartEntity for codimension 0
40 // ---------------------------------------
41
42 template< int dim, class GridFamily >
43 class DefaultGridPartEntity< 0, dim, GridFamily >
44 {
45 protected:
46 typedef typename std::remove_const< GridFamily >::type::Traits Traits;
47
48 public:
49 static const int codimension = 0;
50 static const int dimension = dim;
51 static const int mydimension = dimension - codimension;
52
53 typedef typename Traits::template Codim< codimension >::LocalGeometry LocalGeometry;
54 typedef typename Traits::template Codim< codimension >::Entity Entity;
55
56 typedef typename Traits::HierarchicIterator HierarchicIterator;
57
58 int level () const
59 {
60 DUNE_THROW( InvalidStateException, "Trying to access hierarchy information from a grid part." );
61 }
62
63 bool isLeaf () const
64 {
65 DUNE_THROW( InvalidStateException, "Trying to access hierarchy information from a grid part." );
66 }
67
68 Entity father () const
69 {
70 DUNE_THROW( InvalidStateException, "Trying to access hierarchy information from a grid part." );
71 }
72
73 bool hasFather () const
74 {
75 DUNE_THROW( InvalidStateException, "Trying to access hierarchy information from a grid part." );
76 }
77
78 const LocalGeometry &geometryInFather () const
79 {
80 DUNE_THROW( InvalidStateException, "Trying to access hierarchy information from a grid part." );
81 }
82
83 HierarchicIterator hbegin ( int maxLevel ) const
84 {
85 DUNE_THROW( InvalidStateException, "Trying to access hierarchy information from a grid part." );
86 }
87
88 HierarchicIterator hend ( int maxLevel ) const
89 {
90 DUNE_THROW( InvalidStateException, "Trying to access hierarchy information from a grid part." );
91 }
92
93 bool isRegular () const
94 {
95 DUNE_THROW( InvalidStateException, "Trying to access hierarchy information from a grid part." );
96 }
97
98 bool isNew () const
99 {
100 DUNE_THROW( InvalidStateException, "Trying to access hierarchy information from a grid part." );
101 }
102
103 bool mightVanish () const
104 {
105 DUNE_THROW( InvalidStateException, "Trying to access hierarchy information from a grid part." );
106 }
107 };
108
109 } // namespace Fem
110
111} // namespace Dune
112
113#endif // #ifndef DUNE_FEM_GRIDPART_COMMON_DEFAULTGRIDPARTENTITY_HH
A few common exception classes.
#define DUNE_THROW(E, m)
Definition: exceptions.hh:218
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 27, 22:29, 2024)