6
6
#include " axom/klee/Geometry.hpp"
7
7
8
8
#include " axom/klee/GeometryOperators.hpp"
9
+ #include " conduit_blueprint_mesh.hpp"
9
10
10
11
#include < utility>
11
12
12
13
namespace axom
13
14
{
14
15
namespace klee
15
16
{
16
- bool operator ==(const TransformableGeometryProperties & lhs,
17
- const TransformableGeometryProperties & rhs)
17
+ bool operator ==(const TransformableGeometryProperties& lhs,
18
+ const TransformableGeometryProperties& rhs)
18
19
{
19
20
return lhs.dimensions == rhs.dimensions && lhs.units == rhs.units ;
20
21
}
21
22
22
- Geometry::Geometry (const TransformableGeometryProperties & startProperties,
23
+ Geometry::Geometry (const TransformableGeometryProperties& startProperties,
23
24
std::string format,
24
25
std::string path,
25
26
std::shared_ptr<GeometryOperator const > operator_)
26
27
: m_startProperties(startProperties)
27
28
, m_format(std::move(format))
28
29
, m_path(std::move(path))
30
+ , m_levelOfRefinement(0 )
29
31
, m_operator(std::move(operator_))
30
32
{ }
31
33
34
+ Geometry::Geometry (const TransformableGeometryProperties& startProperties,
35
+ const axom::sidre::Group* simplexMeshGroup,
36
+ const std::string& topology,
37
+ std::shared_ptr<GeometryOperator const > operator_)
38
+ : m_startProperties(startProperties)
39
+ , m_format(" blueprint-tets" )
40
+ , m_path()
41
+ , m_meshGroup(simplexMeshGroup)
42
+ , m_topology(topology)
43
+ , m_levelOfRefinement(0 )
44
+ , m_operator(std::move(operator_))
45
+ { }
46
+
47
+ Geometry::Geometry (const TransformableGeometryProperties& startProperties,
48
+ const axom::primal::Tetrahedron<double , 3 >& tet,
49
+ std::shared_ptr<GeometryOperator const > operator_)
50
+ : m_startProperties(startProperties)
51
+ , m_format(" tet3D" )
52
+ , m_path()
53
+ , m_meshGroup(nullptr )
54
+ , m_topology()
55
+ , m_tet(tet)
56
+ , m_levelOfRefinement(0 )
57
+ , m_operator(std::move(operator_))
58
+ { }
59
+
60
+ Geometry::Geometry (const TransformableGeometryProperties& startProperties,
61
+ const axom::primal::Hexahedron<double , 3 >& hex,
62
+ std::shared_ptr<GeometryOperator const > operator_)
63
+ : m_startProperties(startProperties)
64
+ , m_format(" hex3D" )
65
+ , m_path()
66
+ , m_meshGroup(nullptr )
67
+ , m_topology()
68
+ , m_hex(hex)
69
+ , m_levelOfRefinement(0 )
70
+ , m_operator(std::move(operator_))
71
+ { }
72
+
73
+ Geometry::Geometry (const TransformableGeometryProperties& startProperties,
74
+ const Sphere3D& sphere,
75
+ axom::IndexType levelOfRefinement,
76
+ std::shared_ptr<GeometryOperator const > operator_)
77
+ : m_startProperties(startProperties)
78
+ , m_format(" sphere3D" )
79
+ , m_path()
80
+ , m_meshGroup(nullptr )
81
+ , m_topology()
82
+ , m_sphere(sphere)
83
+ , m_levelOfRefinement(levelOfRefinement)
84
+ , m_operator(std::move(operator_))
85
+ { }
86
+
87
+ Geometry::Geometry (const TransformableGeometryProperties& startProperties,
88
+ const axom::Array<double , 2 >& discreteFunction,
89
+ const Point3D& vorBase,
90
+ const Vector3D& vorDirection,
91
+ axom::IndexType levelOfRefinement,
92
+ std::shared_ptr<GeometryOperator const > operator_)
93
+ : m_startProperties(startProperties)
94
+ , m_format(" vor3D" )
95
+ , m_path()
96
+ , m_meshGroup(nullptr )
97
+ , m_topology()
98
+ , m_sphere()
99
+ , m_discreteFunction(discreteFunction)
100
+ , m_vorBase(vorBase)
101
+ , m_vorDirection(vorDirection)
102
+ , m_levelOfRefinement(levelOfRefinement)
103
+ , m_operator(std::move(operator_))
104
+ { }
105
+
106
+ Geometry::Geometry (const TransformableGeometryProperties& startProperties,
107
+ const axom::primal::Plane<double , 3 >& plane,
108
+ std::shared_ptr<GeometryOperator const > operator_)
109
+ : m_startProperties(startProperties)
110
+ , m_format(" plane3D" )
111
+ , m_path()
112
+ , m_meshGroup(nullptr )
113
+ , m_topology()
114
+ , m_plane(plane)
115
+ , m_levelOfRefinement(0 )
116
+ , m_operator(std::move(operator_))
117
+ { }
118
+
119
+ bool Geometry::hasGeometry () const
120
+ {
121
+ bool isInMemory = m_format == " blueprint-tets" || m_format == " sphere3D" ||
122
+ m_format == " tet3D" || m_format == " hex3D" || m_format == " plane3D" ||
123
+ m_format == " cone3D" || m_format == " cylinder3D" ;
124
+ if (isInMemory)
125
+ {
126
+ return true ;
127
+ }
128
+ return !m_path.empty ();
129
+ }
130
+
32
131
TransformableGeometryProperties Geometry::getEndProperties () const
33
132
{
34
133
if (m_operator)
@@ -38,5 +137,27 @@ TransformableGeometryProperties Geometry::getEndProperties() const
38
137
return m_startProperties;
39
138
}
40
139
140
+ const axom::sidre::Group* Geometry::getBlueprintMesh () const
141
+ {
142
+ SLIC_ASSERT_MSG (
143
+ m_meshGroup,
144
+ axom::fmt::format (
145
+ " The Geometry format '{}' is not specified "
146
+ " as a blueprint mesh and/or has not been converted into one." ,
147
+ m_format));
148
+ return m_meshGroup;
149
+ }
150
+
151
+ const std::string& Geometry::getBlueprintTopology () const
152
+ {
153
+ SLIC_ASSERT_MSG (
154
+ m_meshGroup,
155
+ axom::fmt::format (
156
+ " The Geometry format '{}' is not specified "
157
+ " as a blueprint mesh and/or has not been converted into one." ,
158
+ m_format));
159
+ return m_topology;
160
+ }
161
+
41
162
} // namespace klee
42
163
} // namespace axom
0 commit comments