Dune Core Modules (2.8.0)

deprecated_topology.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_DEPRECATED_TOPOLOGY_HH
4#define DUNE_DEPRECATED_TOPOLOGY_HH
5
6 namespace Impl
7 {
8
9 // Basic Topology Types
10 // --------------------
11
12 // PointDeprecationHelper can be used to prevent a deprecation warning for Point
13 struct PointDeprecationHelper
14 {
15 static const unsigned int dimension = 0;
16 static const unsigned int numCorners = 1;
17
18 static const unsigned int id = 0;
19
20 static std::string name () { return "p"; }
21 };
22
23 using Point [[deprecated("Use GeometryTypes::vertex instead.")]] = PointDeprecationHelper;
24
25
26 template< class BaseTopology >
27 struct [[deprecated("Use GeometryTypes::prismaticExtension(GeometryType gt) instead.")]] Prism
28 {
29 static const unsigned int dimension = BaseTopology::dimension + 1;
30 static const unsigned int numCorners = 2 * BaseTopology::numCorners;
31
32 static const unsigned int id = BaseTopology::id | ((unsigned int)prismConstruction << (dimension-1));
33
34 static std::string name () { return BaseTopology::name() + "l"; }
35 };
36
37
38 template< class BaseTopology >
39 struct [[deprecated("Use GeometryTypes::conicalExtension(GeometryType gt) instead.")]] Pyramid
40 {
41 static const unsigned int dimension = BaseTopology::dimension + 1;
42 static const unsigned int numCorners = BaseTopology::numCorners + 1;
43
44 static const unsigned int id = BaseTopology::id | ((unsigned int)pyramidConstruction << (dimension-1));
45
46 static std::string name () { return BaseTopology::name() + "o"; }
47 };
48
49
50
51 // Properties of Topologies
52 // ------------------------
53
54 template< class Topology >
55 struct [[deprecated("Use GeometryType::isSimplex() instead.")]] IsSimplex
56 : public std::integral_constant< bool, (Topology::id >> 1) == 0 >
57 {};
58
59 template< class Topology >
60 struct [[deprecated("Use GeometryType::isCube() instead.")]] IsCube
61 : public std::integral_constant< bool, (Topology::id | 1) == (1 << Topology::dimension) - 1 >
62 {};
63
76 [[deprecated("Use GeometryType::isPrismatic() or GeometryType::isConical() instead.")]]
77 inline static bool isTopology ( TopologyConstruction construction, unsigned int topologyId, int dim, int codim = 0 ) noexcept
78 {
79 assert( (dim > 0) && (topologyId < numTopologies( dim )) );
80 assert( (0 <= codim) && (codim <= dim) );
81 return (codim >= (dim-1)) || (((topologyId >> (dim-codim-1)) & 1) == (unsigned int)construction);
82 }
83
84
85 // SimplexTopology
86 // ---------------
87
88 template< unsigned int dim >
89 struct [[deprecated("Use GeometryTypes::simplex(dim) instead.")]] SimplexTopology
90 {
91 typedef Pyramid< typename SimplexTopology< dim-1 >::type > type;
92 };
93
94 template<>
95 struct [[deprecated("Use GeometryTypes::simplex(dim) instead.")]] SimplexTopology< 0 >
96 {
97 typedef Point type;
98 };
99
100
101
102 // CubeTopology
103 // ------------
104
105 template< unsigned int dim >
106 struct [[deprecated("Use GeometryTypes::cube(dim) instead.")]] CubeTopology
107 {
108 typedef Prism< typename CubeTopology< dim-1 >::type > type;
109 };
110
111 template<>
112 struct [[deprecated("Use GeometryTypes::simplex(dim) instead.")]] CubeTopology< 0 >
113 {
114 typedef Point type;
115 };
116
117
118
119 // PyramidTopology
120 // ---------------
121
122 template< unsigned int dim >
123 struct [[deprecated]] PyramidTopology
124 {
125 typedef Pyramid< typename CubeTopology< dim-1 >::type > type;
126 };
127
128
129
130 // PrismTopology
131 // -------------
132
133 template< unsigned int dim >
134 struct [[deprecated]] PrismTopology
135 {
136 typedef Prism< typename SimplexTopology< dim-1 >::type > type;
137 };
138
139
140
141
142 // IfTopology
143 // ----------
144
145 template< template< class > class Operation, int dim, class Topology = PointDeprecationHelper >
146 struct [[deprecated("Use IfGeometryType instead.")]] IfTopology
147 {
148 template< class... Args >
149 static auto apply ( unsigned int topologyId, Args &&... args )
150 {
151 if( topologyId & 1 )
152 return IfTopology< Operation, dim-1, Prism< Topology > >::apply( topologyId >> 1, std::forward< Args >( args )... );
153 else
154 return IfTopology< Operation, dim-1, Pyramid< Topology > >::apply( topologyId >> 1, std::forward< Args >( args )... );
155 }
156 };
157
158 template< template< class > class Operation, class Topology >
159 struct [[deprecated("Use IfGeometryType instead.")]] IfTopology< Operation, 0, Topology >
160 {
161 template< class... Args >
162 static auto apply ([[maybe_unused]] unsigned int topologyId, Args &&... args)
163 {
164 return Operation< Topology >::apply( std::forward< Args >( args )... );
165 }
166 };
167
168 } // namespace Impl
169#endif
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:130
constexpr GeometryType prismaticExtension(const GeometryType &gt)
Return GeometryType of a prismatic construction with gt as base
Definition: type.hh:491
constexpr GeometryType conicalExtension(const GeometryType &gt)
Return GeometryType of a conical construction with gt as base
Definition: type.hh:485
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 13, 23:29, 2024)