-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathpyWrap.cpp
More file actions
464 lines (429 loc) · 21.4 KB
/
Copy pathpyWrap.cpp
File metadata and controls
464 lines (429 loc) · 21.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
/*
This file is used to generate the python module of viennals.
It uses pybind11 to create the modules.
All necessary headers are included here and the interface
of the classes which should be exposed defined
*/
#include "pyWrap.hpp"
#include <pybind11/native_enum.h>
// define trampoline classes for interface functions
// ALSO NEED TO ADD TRAMPOLINE CLASSES FOR CLASSES
// WHICH HOLD REFERENCES TO INTERFACE(ABSTRACT) CLASSES
// BASE CLASS WRAPPERS
// lsVelocityField only defines interface and has no functionality
class PylsVelocityField : public VelocityField<T> {
typedef std::array<T, 3> vectorType;
using VelocityField<T>::VelocityField;
public:
T getScalarVelocity(const vectorType &coordinate, int material,
const vectorType &normalVector,
unsigned long pointId) override {
PYBIND11_OVERLOAD(T, VelocityField<T>, getScalarVelocity, coordinate,
material, normalVector, pointId);
}
vectorType getVectorVelocity(const vectorType &coordinate, int material,
const vectorType &normalVector,
unsigned long pointId) override {
PYBIND11_OVERLOAD(vectorType, VelocityField<T>, getVectorVelocity,
coordinate, material, normalVector, pointId);
}
};
// module specification
PYBIND11_MODULE(VIENNALS_MODULE_NAME, module) {
module.doc() =
"ViennaLS is a header-only C++ level set library developed for high "
"performance topography and semiconductor process simulations. The main "
"design goals are simplicity and efficiency, tailored towards scientific "
"simulations. ViennaLS can also be used for visualization applications, "
"although this is not the main design target.";
// set version string of python module
module.attr("__version__") = versionString();
module.attr("version") = versionString();
// wrap omp_set_num_threads to control number of threads
module.def("setNumThreads", &omp_set_num_threads);
// --------- Logger ---------
py::enum_<LogLevel>(module, "LogLevel", py::module_local())
.value("ERROR", LogLevel::ERROR)
.value("WARNING", LogLevel::WARNING)
.value("INFO", LogLevel::INFO)
.value("INTERMEDIATE", LogLevel::INTERMEDIATE)
.value("TIMING", LogLevel::TIMING)
.value("DEBUG", LogLevel::DEBUG);
py::class_<Logger, SmartPointer<Logger>>(module, "Logger", py::module_local())
.def_static("setLogLevel", &Logger::setLogLevel)
.def_static("getLogLevel", &Logger::getLogLevel)
.def_static("setLogFile", &Logger::setLogFile)
.def_static("appendToLogFile", &Logger::appendToLogFile)
.def_static("closeLogFile", &Logger::closeLogFile)
.def_static("getInstance", &Logger::getInstance,
py::return_value_policy::reference)
.def("addDebug", &Logger::addDebug)
.def("addTiming", (Logger & (Logger::*)(const std::string &, double)) &
Logger::addTiming)
.def("addTiming",
(Logger & (Logger::*)(const std::string &, double, double)) &
Logger::addTiming)
.def("addInfo", &Logger::addInfo)
.def("addWarning", &Logger::addWarning)
.def("addError", &Logger::addError, py::arg("s"),
py::arg("shouldAbort") = true)
.def("print", [](Logger &instance) { instance.print(std::cout); });
// ------ ENUMS ------
py::native_enum<SpatialSchemeEnum>(module, "SpatialSchemeEnum",
"enum.IntEnum")
.value("ENGQUIST_OSHER_1ST_ORDER",
SpatialSchemeEnum::ENGQUIST_OSHER_1ST_ORDER)
.value("ENGQUIST_OSHER_2ND_ORDER",
SpatialSchemeEnum::ENGQUIST_OSHER_2ND_ORDER)
.value("LAX_FRIEDRICHS_1ST_ORDER",
SpatialSchemeEnum::LAX_FRIEDRICHS_1ST_ORDER)
.value("LAX_FRIEDRICHS_2ND_ORDER",
SpatialSchemeEnum::LAX_FRIEDRICHS_2ND_ORDER)
.value("LOCAL_LAX_FRIEDRICHS_ANALYTICAL_1ST_ORDER",
SpatialSchemeEnum::LOCAL_LAX_FRIEDRICHS_ANALYTICAL_1ST_ORDER)
.value("LOCAL_LOCAL_LAX_FRIEDRICHS_1ST_ORDER",
SpatialSchemeEnum::LOCAL_LOCAL_LAX_FRIEDRICHS_1ST_ORDER)
.value("LOCAL_LOCAL_LAX_FRIEDRICHS_2ND_ORDER",
SpatialSchemeEnum::LOCAL_LOCAL_LAX_FRIEDRICHS_2ND_ORDER)
.value("LOCAL_LAX_FRIEDRICHS_1ST_ORDER",
SpatialSchemeEnum::LOCAL_LAX_FRIEDRICHS_1ST_ORDER)
.value("LOCAL_LAX_FRIEDRICHS_2ND_ORDER",
SpatialSchemeEnum::LOCAL_LAX_FRIEDRICHS_2ND_ORDER)
.value("STENCIL_LOCAL_LAX_FRIEDRICHS_1ST_ORDER",
SpatialSchemeEnum::STENCIL_LOCAL_LAX_FRIEDRICHS_1ST_ORDER)
.value("WENO_3RD_ORDER", SpatialSchemeEnum::WENO_3RD_ORDER)
.value("WENO_5TH_ORDER", SpatialSchemeEnum::WENO_5TH_ORDER)
.finalize();
module.attr("IntegrationSchemeEnum") =
module.attr("SpatialSchemeEnum"); // IntegrationSchemeEnum is deprecated
py::native_enum<TemporalSchemeEnum>(module, "TemporalSchemeEnum",
"enum.IntEnum")
.value("FORWARD_EULER", TemporalSchemeEnum::FORWARD_EULER)
.value("RUNGE_KUTTA_2ND_ORDER", TemporalSchemeEnum::RUNGE_KUTTA_2ND_ORDER)
.value("RUNGE_KUTTA_3RD_ORDER", TemporalSchemeEnum::RUNGE_KUTTA_3RD_ORDER)
.finalize();
py::native_enum<BooleanOperationEnum>(module, "BooleanOperationEnum",
"enum.IntEnum")
.value("INTERSECT", BooleanOperationEnum::INTERSECT)
.value("UNION", BooleanOperationEnum::UNION)
.value("RELATIVE_COMPLEMENT", BooleanOperationEnum::RELATIVE_COMPLEMENT)
.value("INVERT", BooleanOperationEnum::INVERT)
.finalize();
py::native_enum<CurvatureEnum>(module, "CurvatureEnum", "enum.IntEnum")
.value("MEAN_CURVATURE", CurvatureEnum::MEAN_CURVATURE)
.value("GAUSSIAN_CURVATURE", CurvatureEnum::GAUSSIAN_CURVATURE)
.value("MEAN_AND_GAUSSIAN_CURVATURE",
CurvatureEnum::MEAN_AND_GAUSSIAN_CURVATURE)
.finalize();
py::native_enum<FeatureDetectionEnum>(module, "FeatureDetectionEnum",
"enum.IntEnum")
.value("CURVATURE", FeatureDetectionEnum::CURVATURE)
.value("NORMALS_ANGLE", FeatureDetectionEnum::NORMALS_ANGLE)
.finalize();
py::native_enum<NormalCalculationMethodEnum>(
module, "NormalCalculationMethodEnum", "enum.IntEnum")
.value("CENTRAL_DIFFERENCES",
NormalCalculationMethodEnum::CENTRAL_DIFFERENCES)
.value("ONE_SIDED_MIN_MOD",
NormalCalculationMethodEnum::ONE_SIDED_MIN_MOD)
.finalize();
py::native_enum<BoundaryConditionEnum>(module, "BoundaryConditionEnum",
"enum.IntEnum")
.value("REFLECTIVE_BOUNDARY", BoundaryConditionEnum::REFLECTIVE_BOUNDARY)
.value("INFINITE_BOUNDARY", BoundaryConditionEnum::INFINITE_BOUNDARY)
.value("PERIODIC_BOUNDARY", BoundaryConditionEnum::PERIODIC_BOUNDARY)
.value("POS_INFINITE_BOUNDARY",
BoundaryConditionEnum::POS_INFINITE_BOUNDARY)
.value("NEG_INFINITE_BOUNDARY",
BoundaryConditionEnum::NEG_INFINITE_BOUNDARY)
.finalize();
py::native_enum<FileFormatEnum>(module, "FileFormatEnum", "enum.IntEnum")
.value("VTK_LEGACY", FileFormatEnum::VTK_LEGACY)
.value("VTP", FileFormatEnum::VTP)
.value("VTU", FileFormatEnum::VTU)
.finalize();
py::native_enum<VoidTopSurfaceEnum>(module, "VoidTopSurfaceEnum",
"enum.IntEnum")
.value("LEX_LOWEST", VoidTopSurfaceEnum::LEX_LOWEST)
.value("LEX_HIGHEST", VoidTopSurfaceEnum::LEX_HIGHEST)
.value("LARGEST", VoidTopSurfaceEnum::LARGEST)
.value("SMALLEST", VoidTopSurfaceEnum::SMALLEST)
.finalize();
py::native_enum<TransformEnum>(module, "TransformEnum", "enum.IntEnum")
.value("TRANSLATION", TransformEnum::TRANSLATION)
.value("ROTATION", TransformEnum::ROTATION)
.value("SCALE", TransformEnum::SCALE)
.finalize();
// ---------- MESH CLASSES ----------
// PointData
py::class_<PointData<T>, SmartPointer<PointData<T>>>(module, "PointData")
// constructors
.def(py::init(&SmartPointer<PointData<T>>::New<>))
// methods
.def("insertNextScalarData",
(void(PointData<T>::*)(const PointData<T>::ScalarDataType &,
const std::string &)) &
PointData<T>::insertNextScalarData,
py::arg("scalars"), py::arg("label") = "Scalars")
.def("insertNextVectorData",
(void(PointData<T>::*)(const PointData<T>::VectorDataType &,
const std::string &)) &
PointData<T>::insertNextVectorData,
py::arg("vectors"), py::arg("label") = "Vectors")
.def("getScalarDataSize", &PointData<T>::getScalarDataSize)
.def("getVectorDataSize", &PointData<T>::getVectorDataSize)
.def("getScalarData",
(PointData<T>::ScalarDataType * (PointData<T>::*)(int)) &
PointData<T>::getScalarData)
.def("getScalarData", (PointData<T>::ScalarDataType *
(PointData<T>::*)(const std::string &, bool)) &
PointData<T>::getScalarData)
.def("getScalarDataLabel", &PointData<T>::getScalarDataLabel)
.def("getVectorData",
(PointData<T>::VectorDataType * (PointData<T>::*)(int)) &
PointData<T>::getVectorData)
.def("getVectorData", (PointData<T>::VectorDataType *
(PointData<T>::*)(const std::string &, bool)) &
PointData<T>::getVectorData)
.def("getVectorDataLabel", &PointData<T>::getVectorDataLabel);
// Mesh
py::class_<Mesh<T>, SmartPointer<Mesh<T>>>(module, "Mesh")
// constructors
.def(py::init(&SmartPointer<Mesh<T>>::New<>))
// methods
.def("getNodes",
(std::vector<std::array<T, 3>> & (Mesh<T>::*)()) & Mesh<T>::getNodes,
"Get all nodes of the mesh as a list.")
.def("getVerticies",
(std::vector<std::array<unsigned, 1>> & (Mesh<T>::*)()) &
Mesh<T>::getElements<1>,
"Get a list of verticies of the mesh.")
.def("getLines",
(std::vector<std::array<unsigned, 2>> & (Mesh<T>::*)()) &
Mesh<T>::getElements<2>,
"Get a list of lines of the mesh.")
.def("getTriangles",
(std::vector<std::array<unsigned, 3>> & (Mesh<T>::*)()) &
Mesh<T>::getElements<3>,
"Get a list of triangles of the mesh.")
.def("getTetras",
(std::vector<std::array<unsigned, 4>> & (Mesh<T>::*)()) &
Mesh<T>::getElements<4>,
"Get a list of tetrahedrons of the mesh.")
.def("getHexas",
(std::vector<std::array<unsigned, 8>> & (Mesh<T>::*)()) &
Mesh<T>::getElements<8>,
"Get a list of hexahedrons of the mesh.")
.def("getPointData",
(PointData<T> & (Mesh<T>::*)()) & Mesh<T>::getPointData,
py::return_value_policy::reference_internal,
"Return a reference to the point data of the mesh.")
.def("getCellData",
(PointData<T> & (Mesh<T>::*)()) & Mesh<T>::getCellData,
py::return_value_policy::reference_internal,
"Return a reference to the cell data of the mesh.")
.def("insertNextNode", &Mesh<T>::insertNextNode,
"Insert a node in the mesh.")
.def("insertNextVertex", &Mesh<T>::insertNextVertex,
"Insert a vertex in the mesh.")
.def("insertNextLine", &Mesh<T>::insertNextLine,
"Insert a line in the mesh.")
.def("insertNextTriangle", &Mesh<T>::insertNextTriangle,
"Insert a triangle in the mesh.")
.def("insertNextTetra", &Mesh<T>::insertNextTetra,
"Insert a tetrahedron in the mesh.")
.def("insertNextHexa", &Mesh<T>::insertNextHexa,
"Insert a hexahedron in the mesh.")
.def("removeDuplicateNodes", &Mesh<T>::removeDuplicateNodes,
"Remove exactly equal nodes and remap mesh elements, preserving "
"first-occurrence order and the first node's point data. Nodes "
"containing NaNs remain distinct. Cell data is unchanged.")
.def("append", &Mesh<T>::append, "Append another mesh to this mesh.")
.def("print", &Mesh<T>::print, "Print basic information about the mesh.")
.def("clear", &Mesh<T>::clear, "Clear all data in the mesh.");
// TransformMesh
py::class_<TransformMesh<T>, SmartPointer<TransformMesh<T>>>(module,
"TransformMesh")
// constructors
.def(py::init([](SmartPointer<Mesh<T>> &mesh, TransformEnum op,
Vec3D<T> vec, double angle) {
return SmartPointer<TransformMesh<T>>::New(mesh, op, vec, angle);
}),
py::arg("mesh"), py::arg("transform") = TransformEnum::TRANSLATION,
py::arg("transformVector") = Vec3D<T>{0., 0., 0.},
py::arg("angle") = 0.)
// methods
.def("apply", &TransformMesh<T>::apply, "Apply the transformation.");
// VTKReader
py::class_<VTKReader<T>, SmartPointer<VTKReader<T>>>(module, "VTKReader")
// constructors
.def(py::init(&SmartPointer<VTKReader<T>>::New<>))
.def(py::init(&SmartPointer<VTKReader<T>>::New<SmartPointer<Mesh<T>> &>))
.def(py::init(&SmartPointer<VTKReader<T>>::New<SmartPointer<Mesh<T>> &,
std::string>))
.def(py::init([](SmartPointer<Mesh<T>> &mesh, FileFormatEnum format,
std::string s) {
return SmartPointer<VTKReader<T>>::New(mesh, format, s);
}))
// methods
.def("setMesh", &VTKReader<T>::setMesh, "Set the mesh to read into.")
.def("setFileFormat", &VTKReader<T>::setFileFormat,
"Set the file format of the file to be read.")
.def("setFileName", &VTKReader<T>::setFileName,
"Set the name of the input file.")
.def("getMetaData", &VTKReader<T>::getMetaData,
"Get the metadata from the file.")
.def("apply", &VTKReader<T>::apply, "Read the mesh.");
// VTKWriter
py::class_<VTKWriter<T>, SmartPointer<VTKWriter<T>>>(module, "VTKWriter")
// constructors
.def(py::init(&SmartPointer<VTKWriter<T>>::New<>))
.def(py::init(&SmartPointer<VTKWriter<T>>::New<SmartPointer<Mesh<T>> &>))
.def(py::init(&SmartPointer<VTKWriter<T>>::New<SmartPointer<Mesh<T>> &,
std::string>))
.def(py::init([](SmartPointer<Mesh<T>> &mesh, FileFormatEnum format,
std::string s) {
return SmartPointer<VTKWriter<T>>::New(mesh, format, s);
}))
// methods
.def("setMesh", &VTKWriter<T>::setMesh, "Set the mesh to output.")
.def("setFileFormat", &VTKWriter<T>::setFileFormat,
"Set the file format, the mesh should be written to.")
.def("setFileName", &VTKWriter<T>::setFileName,
"Set the name of the output file.")
.def("setMetaData", &VTKWriter<T>::setMetaData,
"Set the metadata to be written to the file.")
.def(
"addMetaData",
py::overload_cast<const std::string &, T>(&VTKWriter<T>::addMetaData),
"Add a single metadata entry to the file.")
.def("addMetaData",
py::overload_cast<const std::string &, const std::vector<T> &>(
&VTKWriter<T>::addMetaData),
"Add a single metadata entry to the file.")
.def("addMetaData",
py::overload_cast<
const std::unordered_map<std::string, std::vector<T>> &>(
&VTKWriter<T>::addMetaData),
"Add metadata to the file.")
.def("apply", &VTKWriter<T>::apply, "Write the mesh.");
#ifdef VIENNALS_VTK_RENDERING
// VTK Renderer
py::class_<VTKRenderWindow<T>, SmartPointer<VTKRenderWindow<T>>>(
module, "VTKRenderWindow")
// constructors
.def(py::init(&SmartPointer<VTKRenderWindow<T>>::New<>))
.def(py::init(
&SmartPointer<VTKRenderWindow<T>>::New<SmartPointer<Mesh<T>> &>))
// methods
.def("setMesh", &VTKRenderWindow<T>::setMesh,
"Add a mesh to the renderer.")
// .def("setVolumeMesh", &VTKRenderWindow<T>::setVolumeMesh,
// "Add a volume mesh to the renderer.")
// .def("enable2DMode", &VTKRenderWindow<T>::enable2DMode,
// "Enable 2D mode for rendering.")
.def("render", &VTKRenderWindow<T>::render, "Render the added meshes.");
#endif
// --------------- OTHER CLASSES ----------------
// MaterialMap
py::class_<MaterialMap, SmartPointer<MaterialMap>>(module, "MaterialMap")
// constructors
.def(py::init(&SmartPointer<MaterialMap>::New<>))
// methods
.def("insertNextMaterial", &MaterialMap::insertNextMaterial,
"Insert a new material into the map.")
.def("setMaterialId", &MaterialMap::setMaterialId)
.def("getNumberOfLayers", &MaterialMap::getNumberOfLayers,
"Get the number of level-sets in the material map.")
.def("getNumberOfMaterials", &MaterialMap::getNumberOfMaterials)
.def("getMaterialId", &MaterialMap::getMaterialId)
.def("isValidIndex", &MaterialMap::isValidIndex)
.def("clear", &MaterialMap::clear)
.def("reserve", &MaterialMap::reserve)
.def("hasMaterial", &MaterialMap::hasMaterial)
.def("getMaterials", &MaterialMap::getMaterials,
"Get a list of all materials in the map.")
.def("getMaterialMap", &MaterialMap::getMaterialMap,
"Get the material map.");
// VelocityField
py::class_<VelocityField<T>, SmartPointer<VelocityField<T>>,
PylsVelocityField>(module, "VelocityField")
// constructors
.def(py::init<>())
// methods
.def("getScalarVelocity", &VelocityField<T>::getScalarVelocity,
"Return the scalar velocity for a point of material at coordinate "
"with normal vector normal.")
.def("getVectorVelocity", &VelocityField<T>::getVectorVelocity,
"Return the vector velocity for a point of material at coordinate "
"with normal vector normal.")
.def("getDissipationAlpha", &VelocityField<T>::getDissipationAlpha,
"Return the analytical dissipation alpha value if the "
"lsLocalLaxFriedrichsAnalytical scheme is used for advection.");
bindOxidationSharedTypes(module);
// ---------- MAIN API ----------
// Submodule for 2D
auto m2 = module.def_submodule("d2", "2D bindings");
m2.attr("__name__") = "viennals.d2";
m2.attr("__package__") = "viennals";
bindApi<2>(m2);
// Submodule for 3D
auto m3 = module.def_submodule("d3", "3D bindings");
m3.attr("__name__") = "viennals.d3";
m3.attr("__package__") = "viennals";
bindApi<3>(m3);
// SLICE AND EXTRUDE (requires declaration of Domain)
// Slice
py::class_<Slice<T>, SmartPointer<Slice<T>>>(module, "Slice")
// constructors
.def(py::init(&SmartPointer<Slice<T>>::New<>))
.def(py::init(
&SmartPointer<Slice<T>>::New<SmartPointer<Domain<T, 3>> &,
SmartPointer<Domain<T, 2>> &, int, T>))
.def(py::init(
&SmartPointer<Slice<T>>::New<SmartPointer<Domain<T, 3>> &, int, T>))
// methods
.def("setSourceLevelSet", &Slice<T>::setSourceLevelSet,
"Set the 3D source level set from which to extract the slice.")
.def("setSliceLevelSet", &Slice<T>::setSliceLevelSet,
"Set the 2D level set where the extracted slice will be stored.")
.def("setSliceDimension", &Slice<T>::setSliceDimension,
"Set the dimension along which to slice (0=x, 1=y, 2=z).")
.def("setSlicePosition", &Slice<T>::setSlicePosition,
"Set the position along the slice dimension where to extract the "
"slice.")
.def("setWritePath", &Slice<T>::setWritePath,
"Set the path where the slice should be written to.")
.def("getSliceLevelSet", &Slice<T>::getSliceLevelSet,
"Get the 2D slice level set after extraction.")
.def("setReflectX", &Slice<T>::setReflectX,
"Set whether to reflect all x-coordinates in the resulting slice.")
.def("apply", &Slice<T>::apply,
"Extract the 2D slice from the 3D domain.");
// Extrude
py::class_<Extrude<T>, SmartPointer<Extrude<T>>>(module, "Extrude")
// constructors
.def(py::init(&SmartPointer<Extrude<T>>::New<>))
.def(py::init(
&SmartPointer<Extrude<T>>::New<
SmartPointer<Domain<T, 2>> &, SmartPointer<Domain<T, 3>> &,
std::array<T, 2>, int, std::array<BoundaryConditionEnum, 3>>))
// methods
.def("setInputLevelSet", &Extrude<T>::setInputLevelSet,
"Set 2D input Level Set")
.def("setOutputLevelSet", &Extrude<T>::setOutputLevelSet,
"Set 3D output Level Set")
.def("setExtent", &Extrude<T>::setExtent,
"Set the extent in the extruded dimension")
.def("setExtrusionAxis", &Extrude<T>::setExtrusionAxis,
"Set the axis in which to extrude (0=x, 1=y, 2=z).")
.def("setBoundaryConditions",
py::overload_cast<std::array<BoundaryConditionEnum, 3>>(
&Extrude<T>::setBoundaryConditions),
"Set the boundary conditions in the 3D extruded domain.")
.def("setBoundaryConditions",
py::overload_cast<BoundaryConditionEnum *>(
&Extrude<T>::setBoundaryConditions),
"Set the boundary conditions in the 3D extruded domain.")
.def("apply", &Extrude<T>::apply, "Perform extrusion.");
}