ViennaLS
Loading...
Searching...
No Matches
pyWrap.hpp
Go to the documentation of this file.
1#include <pybind11/functional.h>
2#include <pybind11/iostream.h>
3#include <pybind11/pybind11.h>
4#include <pybind11/stl.h>
5
6// all header files which define API functions
7#include <lsAdvect.hpp>
12#include <lsCheck.hpp>
13#include <lsCompareChamfer.hpp>
17#include <lsCompareVolume.hpp>
18#include <lsConvexHull.hpp>
19#include <lsDetectFeatures.hpp>
20#include <lsDomain.hpp>
21#include <lsExpand.hpp>
22#include <lsExtrude.hpp>
23#include <lsFileFormats.hpp>
24#include <lsFromMesh.hpp>
25#include <lsFromSurfaceMesh.hpp>
26#include <lsFromVolumeMesh.hpp>
27#include <lsGeometricAdvect.hpp>
29#include <lsGeometries.hpp>
30#include <lsMakeGeometry.hpp>
31#include <lsMarkVoidPoints.hpp>
32#include <lsMaterialMap.hpp>
33#include <lsMesh.hpp>
34#include <lsOxidation.hpp>
35#include <lsOxidationModel.hpp>
37#include <lsPrune.hpp>
38#include <lsReader.hpp>
39#include <lsReduce.hpp>
41#include <lsSlice.hpp>
42#include <lsToDiskMesh.hpp>
43#include <lsToHullMesh.hpp>
44#include <lsToMesh.hpp>
46#include <lsToSurfaceMesh.hpp>
47#include <lsToVoxelMesh.hpp>
48#include <lsTransformMesh.hpp>
49#include <lsVTKReader.hpp>
50#include <lsVTKRenderWindow.hpp>
51#include <lsVTKWriter.hpp>
52#include <lsVelocityField.hpp>
53#include <lsVersion.hpp>
55#include <lsWriter.hpp>
56
57#include <vcLogger.hpp>
58#include <vcSmartPointer.hpp>
59
60using namespace viennals;
61namespace py = pybind11;
62
63// always use double for python export
64typedef double T;
65
66PYBIND11_DECLARE_HOLDER_TYPE(TemplateType, SmartPointer<TemplateType>);
67
68// GeometricAdvectDistribution
69template <int D>
71 : public GeometricAdvectDistribution<T, D> {
72 typedef std::array<viennahrle::CoordType, 3> vectorType;
73 typedef std::array<viennahrle::CoordType, 6> boundsType;
74 typedef GeometricAdvectDistribution<T, D> ClassType;
76
77public:
78 bool isInside(const vectorType &initial, const vectorType &candidate,
79 double eps = 0.) const override {
80 PYBIND11_OVERLOAD(bool, ClassType, isInside, initial, candidate, eps);
81 }
82
83 T getSignedDistance(const vectorType &initial, const vectorType &candidate,
84 unsigned long initialPointId) const override {
85 PYBIND11_OVERLOAD_PURE(T, ClassType, getSignedDistance, initial, candidate,
86 initialPointId);
87 }
88
89 boundsType getBounds() const override {
90 PYBIND11_OVERLOAD_PURE(boundsType, ClassType, getBounds);
91 }
92};
93
94inline void bindOxidationSharedTypes(py::module &module) {
95 py::enum_<GpuMode>(module, "GpuMode", py::module_local())
96 .value("Cpu", GpuMode::Cpu)
97 .value("Gpu", GpuMode::Gpu)
98 .export_values();
99
100 py::enum_<GpuPreconditioner>(module, "GpuPreconditioner", py::module_local())
101 .value("Jacobi", GpuPreconditioner::Jacobi)
102 .value("ILU0", GpuPreconditioner::ILU0)
103 .export_values();
104
105 py::class_<OxidationParameters>(module, "OxidationParameters",
106 py::module_local())
107 .def(py::init<>())
108 .def_readwrite("diffusionCoefficient",
110 .def_readwrite("reactionRate", &OxidationParameters::reactionRate)
111 .def_readwrite("transferCoefficient",
113 .def_readwrite("equilibriumConcentration",
115 .def_readwrite("oxidantMoleculeDensity",
117 .def_readwrite("expansionCoefficient",
119 .def_readwrite("velocitySign", &OxidationParameters::velocitySign)
120 .def_readwrite("temperature", &OxidationParameters::temperature)
121 .def_readwrite("reactionActivationVolume",
123 .def_readwrite("referencePressure",
125 .def_readwrite("diffusionActivationVolume",
127 .def_readwrite("reactionRateRatio111",
129 .def_readwrite("crystalAxis", &OxidationParameters::crystalAxis)
130 .def_readwrite("maskTransferCoefficient",
132 .def_readwrite("maskConcentration",
134 .def_readwrite("minBoundaryDistance",
136 .def_readwrite("maxIterations", &OxidationParameters::maxIterations)
137 .def_readwrite("tolerance", &OxidationParameters::tolerance)
138 .def_readwrite("relaxation", &OxidationParameters::relaxation)
139 .def_readwrite("maxGridPoints", &OxidationParameters::maxGridPoints)
140 .def_readwrite("material", &OxidationParameters::material);
141
142 py::class_<OxidationPresets>(module, "OxidationPresets", py::module_local())
143 .def(py::init<>())
144 .def_static("wet1000CDealGrove100",
146 .def_static("oxideMechanics1000C", &OxidationPresets::oxideMechanics1000C)
147 .def_static("siliconNitrideMask1000C",
149
150 py::class_<OxidationDeformationParameters>(
151 module, "OxidationDeformationParameters", py::module_local())
152 .def(py::init<>())
153 .def_readwrite("viscosity", &OxidationDeformationParameters::viscosity)
154 .def_readwrite("bulkModulus",
156 .def_readwrite("ambientPressure",
158 .def_readwrite("pressureRelaxation",
160 .def_readwrite("pressureTolerance",
162 .def_readwrite(
163 "minMechanicsBoundaryDistance",
165 .def_readwrite("shearModulus",
167 .def_readwrite("stressRelaxationTime",
169 .def_readwrite("stressTimeStep",
171 .def_readwrite("harmonicIterations",
173 .def_readwrite("mechanicsIterations",
175 .def_readwrite("pressureIterations",
177 .def_readwrite("stokesIterations",
179 .def_readwrite("mechanicsTolerance",
181 .def_readwrite("stokesTolerance",
183 .def_readwrite("tolerance", &OxidationDeformationParameters::tolerance)
184 .def_readwrite("relaxation", &OxidationDeformationParameters::relaxation)
185 .def_readwrite("maxGridPoints",
187 .def_readwrite("material", &OxidationDeformationParameters::material);
188
189 py::class_<OxidationMaskParameters>(module, "OxidationMaskParameters",
190 py::module_local())
191 .def(py::init<>())
192 .def_readwrite("contactMode", &OxidationMaskParameters::contactMode)
193 .def_readwrite("temperature", &OxidationMaskParameters::temperature)
194 .def_readwrite("referenceTemperature",
196 .def_readwrite("referenceViscosity",
198 .def_readwrite("creepActivationEnergy",
200 .def_readwrite("poissonRatio", &OxidationMaskParameters::poissonRatio)
201 .def_readwrite("youngModulus", &OxidationMaskParameters::youngModulus)
202 .def_readwrite("unilateralContact",
204 .def_readwrite("relaxation", &OxidationMaskParameters::relaxation)
205 .def_readwrite("contactLoadRelaxation",
207 .def_readwrite("contactReleaseFraction",
209 .def_readwrite("multigridSmootherOmega",
211 .def_readwrite("tolerance", &OxidationMaskParameters::tolerance)
212 .def_readwrite("minBoundaryDistance",
214 .def_readwrite("maxIterations", &OxidationMaskParameters::maxIterations)
215 .def_readwrite("maxGridPoints", &OxidationMaskParameters::maxGridPoints)
216 .def_readwrite("material", &OxidationMaskParameters::material)
217 .def_readwrite("anchorBoundaryDirection",
219 .def_readwrite("anchorBoundarySide",
221 .def_readwrite("anchorBoundaryLayers",
223
224 py::class_<OxidationCouplingParameters>(module, "OxidationCouplingParameters",
225 py::module_local())
226 .def(py::init<>())
227 .def_readwrite("maxIterations",
229 .def_readwrite("tolerance", &OxidationCouplingParameters::tolerance)
230 .def_readwrite("relaxation", &OxidationCouplingParameters::relaxation);
231
232 py::class_<LOCOSConservationDiagnostics<T>>(
233 module, "LOCOSConservationDiagnostics", py::module_local())
234 .def(py::init<>())
235 .def_readwrite("siliconRecession",
237 .def_readwrite("ambientLift",
239 .def_readwrite("expectedAmbientLift",
241 .def_readwrite("ambientLiftRatio",
243 .def_readwrite("relativeError",
245 .def_readwrite("samples", &LOCOSConservationDiagnostics<T>::samples);
246}
247
248template <int D> void bindApi(py::module &module) {
249 // Also wrap hrleGrid so it can be used to create new LevelSets
250 py::class_<viennahrle::Grid<D>>(module, "hrleGrid");
251
252 // Domain
253 py::class_<Domain<T, D>, SmartPointer<Domain<T, D>>>(module, "Domain")
254 // constructors
255 .def(py::init(&SmartPointer<Domain<T, D>>::template New<>))
256 .def(
257 py::init(
258 &SmartPointer<Domain<T, D>>::template New<viennahrle::CoordType>),
259 py::arg("gridDelta") = 1.0)
260 // .def(py::init(
261 // &SmartPointer<Domain<T, D>>::New<viennahrle::CoordType *,
262 // BoundaryConditionEnum *>))
263 .def(py::init([](std::array<viennahrle::CoordType, 2 * D> bounds,
264 std::array<BoundaryConditionEnum, D> bcs,
265 viennahrle::CoordType gridDelta) {
266 return SmartPointer<Domain<T, D>>::New(bounds.data(), bcs.data(),
267 gridDelta);
268 }),
269 py::arg("bounds"), py::arg("boundaryConditions"),
270 py::arg("gridDelta") = 1.0)
271 .def(py::init(&SmartPointer<Domain<T, D>>::template New<
272 std::vector<viennahrle::CoordType>, std::vector<unsigned>,
273 viennahrle::CoordType>),
274 py::arg("bounds"), py::arg("boundaryConditions"),
275 py::arg("gridDelta") = 1.0)
276 // .def(py::init(
277 // &SmartPointer<Domain<T, D>>::New<Domain<T,
278 // D>::PointValueVectorType,
279 // viennahrle::CoordType *,
280 // BoundaryConditionEnum *>))
281 // .def(py::init(&SmartPointer<Domain<T, D>>::New<
282 // Domain<T, D>::PointValueVectorType,
283 // viennahrle::CoordType
284 // *, BoundaryConditionEnum *,
285 // viennahrle::CoordType>))
286 .def(py::init(&SmartPointer<Domain<T, D>>::template New<
287 SmartPointer<Domain<T, D>> &>))
288 .def(py::init(
289 &SmartPointer<Domain<T, D>>::template New<viennahrle::Grid<D> &>))
290 // methods
291 .def("deepCopy", &Domain<T, D>::deepCopy,
292 "Copy lsDomain in this lsDomain.")
293 .def("getNumberOfSegments", &Domain<T, D>::getNumberOfSegments,
294 "Get the number of segments, the level set structure is divided "
295 "into.")
296 .def("getNumberOfPoints", &Domain<T, D>::getNumberOfPoints,
297 "Get the number of defined level set values.")
298 .def("getLevelSetWidth", &Domain<T, D>::getLevelSetWidth,
299 "Get the number of layers of level set points around the explicit "
300 "surface.")
301 .def("setLevelSetWidth", &Domain<T, D>::setLevelSetWidth,
302 "Set the number of layers of level set points which should be "
303 "stored around the explicit surface.")
304 .def("clearMetaData", &Domain<T, D>::clearMetaData,
305 "Clear all metadata stored in the level set.")
306 // allow filehandle to be passed and default to python standard output
307 .def(
308 "print",
309 [](Domain<T, D> &d, py::object fileHandle) {
310 if (!(py::hasattr(fileHandle, "write") &&
311 py::hasattr(fileHandle, "flush"))) {
312 throw py::type_error(
313 "MyClass::read_from_file_like_object(file): incompatible "
314 "function argument: `file` must be a file-like object, but "
315 "`" +
316 (std::string)(py::repr(fileHandle)) + "` provided");
317 }
318 py::detail::pythonbuf buf(fileHandle);
319 std::ostream stream(&buf);
320 d.print(stream);
321 },
322 py::arg("stream") = py::module::import("sys").attr("stdout"));
323
324 // Advect
325 py::class_<Advect<T, D>, SmartPointer<Advect<T, D>>>(module, "Advect")
326 // constructors
327 .def(py::init(&SmartPointer<Advect<T, D>>::template New<>))
328 .def(py::init(&SmartPointer<Advect<T, D>>::template New<
329 SmartPointer<Domain<T, D>> &>))
330 .def(py::init(
331 &SmartPointer<Advect<T, D>>::template New<
332 SmartPointer<Domain<T, D>> &, SmartPointer<VelocityField<T>> &>))
333 // getters and setters
334 .def("insertNextLevelSet", &Advect<T, D>::insertNextLevelSet,
335 "Insert next level set to use for advection.")
336 .def("clearLevelSets", &Advect<T, D>::clearLevelSets,
337 "Clear all level sets used for advection.")
338 .def("setVelocityField", &Advect<T, D>::setVelocityField,
339 "Set the velocity to use for advection.")
340 .def("setAdvectionTime", &Advect<T, D>::setAdvectionTime,
341 "Set the time until when the level set should be advected.")
342 .def("setSingleStep", &Advect<T, D>::setSingleStep, py::arg("singleStep"),
343 "Set whether only a single advection step should be performed.")
344 .def("setTimeStepRatio", &Advect<T, D>::setTimeStepRatio,
345 "Set the maximum time step size relative to grid size. Advection is "
346 "only stable for <0.5.")
347 .def("setCalculateNormalVectors",
349 "Set whether normal vectors are needed for the supplied velocity "
350 "field.")
351 .def("setIgnoreVoids", &Advect<T, D>::setIgnoreVoids,
352 "Set whether voids in the geometry should be ignored during "
353 "advection or not.")
354 .def("setAdaptiveTimeStepping", &Advect<T, D>::setAdaptiveTimeStepping,
355 py::arg("enabled") = true, py::arg("subdivisions") = 20,
356 "Enable/disable adaptive time stepping and set the number of "
357 "subdivisions.")
358 .def(
359 "setSaveAdvectionVelocities",
361 "Set whether the velocities applied to each point should be saved in "
362 "the level set for debug purposes.")
363 .def("setCheckDissipation", &Advect<T, D>::setCheckDissipation,
364 py::arg("check"), "Enable/disable dissipation checking.")
365 .def("setUpdatePointData", &Advect<T, D>::setUpdatePointData,
366 py::arg("update"),
367 "Enable/disable updating point data after advection.")
368 .def("getAdvectedTime", &Advect<T, D>::getAdvectedTime,
369 "Get the time passed during advection.")
370 .def("getNumberOfTimeSteps", &Advect<T, D>::getNumberOfTimeSteps,
371 "Get how many advection steps were performed after the last apply() "
372 "call.")
373 .def("getTimeStepRatio", &Advect<T, D>::getTimeStepRatio,
374 "Get the time step ratio used for advection.")
375 .def("getCurrentTimeStep", &Advect<T, D>::getCurrentTimeStep,
376 "Get the current time step.")
377 .def("getCalculateNormalVectors",
379 "Get whether normal vectors are computed during advection.")
380 .def("setSpatialScheme", &Advect<T, D>::setSpatialScheme,
381 "Set the spatial discretization scheme to use during advection.")
382 .def("setTemporalScheme", &Advect<T, D>::setTemporalScheme,
383 "Set the time integration scheme to use during advection.")
384 .def("setIntegrationScheme", &Advect<T, D>::setIntegrationScheme,
385 "(DEPRECATED, use setSpatialScheme instead) Set the spatial "
386 "discretization scheme to use during advection.")
387 .def("setDissipationAlpha", &Advect<T, D>::setDissipationAlpha,
388 "Set the dissipation value to use for Lax Friedrichs spatial "
389 "discretization.")
390 .def("setUpdatePointData", &Advect<T, D>::setUpdatePointData,
391 "Set whether the point data in the old LS should be translated to "
392 "the advected LS. Defaults to true.")
393 .def(
394 "setVelocityUpdateCallback", &Advect<T, D>::setVelocityUpdateCallback,
395 "Set a callback function that is called after the level set has been "
396 "updated during intermediate time integration steps (e.g. RK2, RK3).")
397 .def("prepareLS", &Advect<T, D>::prepareLS, "Prepare the level-set.")
398 // need scoped release since we are calling a python method from
399 // parallelised C++ code here
400 .def("apply", &Advect<T, D>::apply,
401 py::call_guard<py::gil_scoped_release>(), "Perform advection.");
402
403 py::class_<lsInternal::StencilLocalLaxFriedrichsScalar<T, D, 1>>(
404 module, "StencilLocalLaxFriedrichsScalar")
405 .def_static(
406 "setMaxDissipation",
408 1>::setMaxDissipation,
409 py::arg("maxDissipation"));
410
411 module.def("PrepareStencilLocalLaxFriedrichs",
412 &PrepareStencilLocalLaxFriedrichs<T, D>, py::arg("levelSets"),
413 py::arg("isDepo"));
414
415 module.def("FinalizeStencilLocalLaxFriedrichs",
416 &FinalizeStencilLocalLaxFriedrichs<T, D>, py::arg("levelSets"));
417
418 // ReactionBoundarySample — sub-grid crossing info returned by
419 // OxidationDiffusion::getReactionBoundarySample
420 {
422 py::class_<RBS>(module, "ReactionBoundarySample")
423 .def(py::init<>())
424 .def_readwrite("found", &RBS::found)
425 .def_readwrite("distance", &RBS::distance)
426 .def_readwrite("concentration", &RBS::concentration)
427 .def_readwrite("crossingAxis", &RBS::crossingAxis)
428 .def_readwrite("crossingOffset", &RBS::crossingOffset)
429 .def_property(
430 "nodeIndex",
431 [](const RBS &s) {
432 std::array<viennahrle::IndexType, D> arr{};
433 for (unsigned i = 0; i < D; ++i)
434 arr[i] = s.nodeIndex[i];
435 return arr;
436 },
437 [](RBS &s, const std::array<viennahrle::IndexType, D> &arr) {
438 for (unsigned i = 0; i < D; ++i)
439 s.nodeIndex[i] = arr[i];
440 });
441 }
442
443 py::class_<OxidationDiffusion<T, D>, VelocityField<T>,
444 SmartPointer<OxidationDiffusion<T, D>>>(module,
445 "OxidationDiffusion")
446 .def(py::init([](SmartPointer<Domain<T, D>> &reactionInterface,
447 SmartPointer<Domain<T, D>> &ambientInterface,
448 OxidationParameters parameters) {
449 return OxidationDiffusion<T, D>::New(reactionInterface,
450 ambientInterface, parameters);
451 }),
452 py::arg("reactionInterface"), py::arg("ambientInterface"),
453 py::arg("parameters") = OxidationParameters())
454 .def("setReactionInterface",
456 .def("setAmbientInterface",
458 .def("setMaskInterface", &OxidationDiffusion<T, D>::setMaskInterface,
459 py::arg("maskInterface"), py::arg("maskSign") = 1)
460 .def("clearMaskInterface", &OxidationDiffusion<T, D>::clearMaskInterface)
461 .def("setParameters", &OxidationDiffusion<T, D>::setParameters)
462 .def("getParameters", &OxidationDiffusion<T, D>::getParameters)
463 .def("setOxideSigns", &OxidationDiffusion<T, D>::setOxideSigns)
464 .def(
465 "setSolveBounds",
466 [](OxidationDiffusion<T, D> &model,
467 std::array<viennahrle::IndexType, D> passedMinIndex,
468 std::array<viennahrle::IndexType, D> passedMaxIndex) {
469 viennahrle::Index<D> minIndex{};
470 viennahrle::Index<D> maxIndex{};
471 for (unsigned i = 0; i < D; ++i) {
472 minIndex[i] = passedMinIndex[i];
473 maxIndex[i] = passedMaxIndex[i];
474 }
475 model.setSolveBounds(minIndex, maxIndex);
476 },
477 py::arg("minIndex"), py::arg("maxIndex"))
478 .def("clearSolveBounds", &OxidationDiffusion<T, D>::clearSolveBounds)
479 .def("apply", &OxidationDiffusion<T, D>::apply)
480 .def("getConcentration",
481 (T(OxidationDiffusion<T, D>::*)(const Vec3D<T> &) const) &
483 .def("getEffectiveReactionRate",
484 (T(OxidationDiffusion<T, D>::*)(const Vec3D<T> &) const) &
486 .def("clearPressureField", &OxidationDiffusion<T, D>::clearPressureField)
487 .def("setPressure",
488 (void(OxidationDiffusion<T, D>::*)(const Vec3D<T> &, T)) &
490 .def("getIterations", &OxidationDiffusion<T, D>::getIterations)
491 .def("getResidual", &OxidationDiffusion<T, D>::getResidual)
492 .def("getNumberOfSolutionNodes",
494 .def("getReactionBoundarySample",
496 .def("getScalarVelocityFromSample",
498 .def("markSolved", &OxidationDiffusion<T, D>::markSolved)
499 .def("markGeometryChanged",
501 .def("writePersistentFields",
503 .def("getConcentrationCache",
505 py::return_value_policy::copy)
506 .def("setConcentrationCache",
508
509 py::class_<OxidationDeformation<T, D>, VelocityField<T>,
510 SmartPointer<OxidationDeformation<T, D>>>(module,
511 "OxidationDeformation")
512 .def(py::init([](SmartPointer<Domain<T, D>> &reactionInterface,
513 SmartPointer<Domain<T, D>> &ambientInterface,
514 SmartPointer<OxidationDiffusion<T, D>> &diffusionField,
515 OxidationParameters oxidationParameters,
516 OxidationDeformationParameters deformationParameters) {
518 reactionInterface, ambientInterface, diffusionField,
519 oxidationParameters, deformationParameters);
520 }),
521 py::arg("reactionInterface"), py::arg("ambientInterface"),
522 py::arg("diffusionField"), py::arg("oxidationParameters"),
523 py::arg("deformationParameters") = OxidationDeformationParameters())
524 .def("setMaskInterface", &OxidationDeformation<T, D>::setMaskInterface,
525 py::arg("maskInterface"), py::arg("maskSign") = 1)
526 .def("clearMaskInterface",
528 .def(
529 "setSolveBounds",
531 std::array<viennahrle::IndexType, D> passedMinIndex,
532 std::array<viennahrle::IndexType, D> passedMaxIndex) {
533 viennahrle::Index<D> minIndex{};
534 viennahrle::Index<D> maxIndex{};
535 for (unsigned i = 0; i < D; ++i) {
536 minIndex[i] = passedMinIndex[i];
537 maxIndex[i] = passedMaxIndex[i];
538 }
539 model.setSolveBounds(minIndex, maxIndex);
540 },
541 py::arg("minIndex"), py::arg("maxIndex"))
542 .def("clearSolveBounds", &OxidationDeformation<T, D>::clearSolveBounds)
544 .def("getVelocity",
545 (Vec3D<T>(OxidationDeformation<T, D>::*)(const Vec3D<T> &) const) &
547 .def("getPressure",
548 (T(OxidationDeformation<T, D>::*)(const Vec3D<T> &) const) &
550 .def("getStrainTrace",
551 (T(OxidationDeformation<T, D>::*)(const Vec3D<T> &) const) &
553 .def("getStrainRateTensor",
554 (std::array<T, 9>(OxidationDeformation<T, D>::*)(const Vec3D<T> &)
555 const) &
557 .def("getStressTensor", (std::array<T, 9>(OxidationDeformation<T, D>::*)(
558 const Vec3D<T> &) const) &
560 .def("getVonMisesStress",
561 (T(OxidationDeformation<T, D>::*)(const Vec3D<T> &) const) &
563 .def("getIterations", &OxidationDeformation<T, D>::getIterations)
564 .def("getResidual", &OxidationDeformation<T, D>::getResidual)
565 .def("getNumberOfSolutionNodes",
567 .def("avgExpansionSpeed", &OxidationDeformation<T, D>::avgExpansionSpeed)
568 .def("setAmbientInterface",
570 .def("setOxidationParameters",
572 .def("setDeformationParameters",
574 .def("setOxideSigns", &OxidationDeformation<T, D>::setOxideSigns)
575 .def("setReactionInterface",
577 .def("setDiffusionField", &OxidationDeformation<T, D>::setDiffusionField)
578 .def("setMaskVelocityField",
580 .def("clearMaskVelocityField",
582 .def("markGeometryChanged",
584 .def("writeFieldsToLevelSet",
586
587 py::class_<OxidationMaskBending<T, D>, VelocityField<T>,
588 SmartPointer<OxidationMaskBending<T, D>>>(module,
589 "OxidationMaskBending")
590 .def(py::init(
591 [](SmartPointer<OxidationDeformation<T, D>> &deformationField,
592 OxidationMaskParameters maskParameters) {
593 return OxidationMaskBending<T, D>::New(deformationField,
594 maskParameters);
595 }),
596 py::arg("deformationField"),
597 py::arg("maskParameters") = OxidationMaskParameters())
598 .def(py::init(
599 [](SmartPointer<OxidationDeformation<T, D>> &deformationField,
600 SmartPointer<Domain<T, D>> &maskInterface,
601 OxidationMaskParameters maskParameters, int maskSign) {
603 deformationField, maskInterface, maskParameters, maskSign);
604 }),
605 py::arg("deformationField"), py::arg("maskInterface"),
606 py::arg("maskParameters") = OxidationMaskParameters(),
607 py::arg("maskSign") = 1)
608 .def("setMaskInterface", &OxidationMaskBending<T, D>::setMaskInterface,
609 py::arg("maskInterface"), py::arg("maskSign") = 1)
610 .def("setAmbientInterface",
612 py::arg("ambientInterface"), py::arg("ambientSign") = -1)
613 .def(
614 "setSolveBounds",
616 std::array<viennahrle::IndexType, D> passedMinIndex,
617 std::array<viennahrle::IndexType, D> passedMaxIndex) {
618 viennahrle::Index<D> minIndex{};
619 viennahrle::Index<D> maxIndex{};
620 for (unsigned i = 0; i < D; ++i) {
621 minIndex[i] = passedMinIndex[i];
622 maxIndex[i] = passedMaxIndex[i];
623 }
624 model.setSolveBounds(minIndex, maxIndex);
625 },
626 py::arg("minIndex"), py::arg("maxIndex"))
627 .def("clearSolveBounds", &OxidationMaskBending<T, D>::clearSolveBounds)
629 .def("setParameters", &OxidationMaskBending<T, D>::setParameters)
630 .def("getParameters", &OxidationMaskBending<T, D>::getParameters)
631 .def("getIterations", &OxidationMaskBending<T, D>::getIterations)
632 .def("getResidual", &OxidationMaskBending<T, D>::getResidual)
633 .def("getLastApplyVelocityChange",
635 .def("getNumberOfSolutionNodes",
637 .def("getNumberOfContactNodes",
639 .def("getNumberOfFixedNodes",
641 .def("writeFieldsToLevelSet",
643
644 py::class_<OxidationConstrainedAmbient<T, D>, VelocityField<T>,
645 SmartPointer<OxidationConstrainedAmbient<T, D>>>(
646 module, "OxidationConstrainedAmbient")
647 .def(py::init(
648 [](SmartPointer<OxidationDeformation<T, D>> &deformationField,
649 SmartPointer<OxidationMaskBending<T, D>> &maskVelocityField,
650 SmartPointer<Domain<T, D>> &maskInterface, int maskSign) {
652 deformationField, maskVelocityField, maskInterface,
653 maskSign);
654 }),
655 py::arg("deformationField"), py::arg("maskVelocityField"),
656 py::arg("maskInterface"), py::arg("maskSign") = 1);
657
658 py::class_<OxidationModel<T, D>, SmartPointer<OxidationModel<T, D>>>(
659 module, "OxidationModel")
660 .def(py::init(
661 [](SmartPointer<OxidationDiffusion<T, D>> &diffusionField,
662 SmartPointer<OxidationDeformation<T, D>> &deformationField,
663 OxidationCouplingParameters couplingParameters) {
665 diffusionField, deformationField, couplingParameters);
666 }),
667 py::arg("diffusionField"), py::arg("deformationField"),
668 py::arg("couplingParameters") = OxidationCouplingParameters())
669 .def("setDiffusionField", &OxidationModel<T, D>::setDiffusionField)
670 .def("setDeformationField", &OxidationModel<T, D>::setDeformationField)
671 .def("setParameters", &OxidationModel<T, D>::setParameters)
672 .def(
673 "setSolveBounds",
674 [](OxidationModel<T, D> &model,
675 std::array<viennahrle::IndexType, D> passedMinIndex,
676 std::array<viennahrle::IndexType, D> passedMaxIndex) {
677 viennahrle::Index<D> minIndex{};
678 viennahrle::Index<D> maxIndex{};
679 for (unsigned i = 0; i < D; ++i) {
680 minIndex[i] = passedMinIndex[i];
681 maxIndex[i] = passedMaxIndex[i];
682 }
683 model.setSolveBounds(minIndex, maxIndex);
684 },
685 py::arg("minIndex"), py::arg("maxIndex"))
686 .def("clearSolveBounds", &OxidationModel<T, D>::clearSolveBounds)
687 .def("apply", &OxidationModel<T, D>::apply)
688 .def("getIterations", &OxidationModel<T, D>::getIterations)
689 .def("getResidual", &OxidationModel<T, D>::getResidual);
690
691 py::class_<Oxidation<T, D>, SmartPointer<Oxidation<T, D>>>(module,
692 "Oxidation")
693 .def(py::init([](SmartPointer<Domain<T, D>> &siInterface,
694 SmartPointer<Domain<T, D>> &ambientInterface,
695 SmartPointer<Domain<T, D>> &maskInterface) {
696 return Oxidation<T, D>::New(siInterface, ambientInterface,
697 maskInterface);
698 }),
699 py::arg("siInterface"), py::arg("ambientInterface"),
700 py::arg("maskInterface"))
701 .def("setSiInterface", &Oxidation<T, D>::setSiInterface)
702 .def("setAmbientInterface", &Oxidation<T, D>::setAmbientInterface)
703 .def("setMaskInterface", &Oxidation<T, D>::setMaskInterface)
704 .def("setOxidationParameters", &Oxidation<T, D>::setOxidationParameters)
705 .def("setDeformationParameters",
707 .def("setCouplingParameters", &Oxidation<T, D>::setCouplingParameters)
708 .def("setMaskParameters", &Oxidation<T, D>::setMaskParameters)
709 .def("setSpatialScheme", &Oxidation<T, D>::setSpatialScheme)
710 .def("setTemporalScheme", &Oxidation<T, D>::setTemporalScheme)
711 .def("setGpuMode", &Oxidation<T, D>::setGpuMode, py::arg("mode"))
712 .def("setGpuPreconditioner", &Oxidation<T, D>::setGpuPreconditioner,
713 py::arg("preconditioner"))
714 .def("setMaskCouplingIterations",
716 .def("setMaskCouplingTolerance",
718 .def(
719 "setSolveBounds",
720 [](Oxidation<T, D> &model,
721 std::array<viennahrle::IndexType, D> passedMinIndex,
722 std::array<viennahrle::IndexType, D> passedMaxIndex) {
723 viennahrle::Index<D> minIndex{};
724 viennahrle::Index<D> maxIndex{};
725 for (unsigned i = 0; i < D; ++i) {
726 minIndex[i] = passedMinIndex[i];
727 maxIndex[i] = passedMaxIndex[i];
728 }
729 model.setSolveBounds(minIndex, maxIndex);
730 },
731 py::arg("minIndex"), py::arg("maxIndex"))
732 .def(
733 "setMaskBendingBounds",
734 [](Oxidation<T, D> &model,
735 std::array<viennahrle::IndexType, D> passedMinIndex,
736 std::array<viennahrle::IndexType, D> passedMaxIndex) {
737 viennahrle::Index<D> minIndex{};
738 viennahrle::Index<D> maxIndex{};
739 for (unsigned i = 0; i < D; ++i) {
740 minIndex[i] = passedMinIndex[i];
741 maxIndex[i] = passedMaxIndex[i];
742 }
743 model.setMaskBendingBounds(minIndex, maxIndex);
744 },
745 py::arg("minIndex"), py::arg("maxIndex"))
746 .def("apply", &Oxidation<T, D>::apply, py::arg("advectionTime"))
747 .def("applyCFLLimited", &Oxidation<T, D>::applyCFLLimited,
748 py::arg("requestedTime"), py::arg("cflFactor"),
749 "Execute one CFL-limited LOCOS step; returns the actual time "
750 "advanced.")
751 .def("getLastMaxVelocity", &Oxidation<T, D>::getLastMaxVelocity,
752 "Maximum interface velocity (µm/hr) from the most recent CFL step.")
753 .def("getDiffusionField", &Oxidation<T, D>::getDiffusionField)
754 .def("getDeformationField", &Oxidation<T, D>::getDeformationField)
755 .def("getMaskBendingField", &Oxidation<T, D>::getMaskBendingField)
756 .def("getMaskCouplingIterations",
758 .def("getMaskCouplingResidual",
760
761 if constexpr (D == 2) {
762 module.def(
763 "computeLOCOSOpenWindowConservation",
764 [](SmartPointer<Domain<T, D>> siInitial,
765 SmartPointer<Domain<T, D>> siAfter,
766 SmartPointer<Domain<T, D>> ambientInitial,
767 SmartPointer<Domain<T, D>> ambientAfter, T xMin, T xMax,
768 viennahrle::IndexType jMin, viennahrle::IndexType jMax,
769 T expansionCoefficient) {
770 return computeLOCOSOpenWindowConservation<T>(
771 siInitial, siAfter, ambientInitial, ambientAfter, xMin, xMax,
772 jMin, jMax, expansionCoefficient);
773 },
774 py::arg("siInitial"), py::arg("siAfter"), py::arg("ambientInitial"),
775 py::arg("ambientAfter"), py::arg("xMin"), py::arg("xMax"),
776 py::arg("jMin"), py::arg("jMax"), py::arg("expansionCoefficient"));
777 }
778
779 // BooleanOperation
780 py::class_<BooleanOperation<T, D>, SmartPointer<BooleanOperation<T, D>>>(
781 module, "BooleanOperation")
782 // constructors
783 .def(py::init(&SmartPointer<BooleanOperation<T, D>>::template New<>))
784 .def(py::init(&SmartPointer<BooleanOperation<T, D>>::template New<
785 SmartPointer<Domain<T, D>> &>))
786 .def(
787 py::init(&SmartPointer<BooleanOperation<T, D>>::template New<
788 SmartPointer<Domain<T, D>> &, SmartPointer<Domain<T, D>> &>))
789 // some constructors need lambda to work: seems to be an issue with
790 // implicit move constructor
791 .def(py::init(
792 [](SmartPointer<Domain<T, D>> &domain, BooleanOperationEnum op) {
793 return SmartPointer<BooleanOperation<T, D>>::New(domain, op);
794 }))
795 .def(py::init([](SmartPointer<Domain<T, D>> &domainA,
796 SmartPointer<Domain<T, D>> &domainB,
798 return SmartPointer<BooleanOperation<T, D>>::New(domainA, domainB, op);
799 }))
800 // methods
801 .def("setLevelset", &BooleanOperation<T, D>::setLevelSet,
802 "Set levelset on which the boolean operation should be performed.")
803 .def("setSecondLevelSet", &BooleanOperation<T, D>::setSecondLevelSet,
804 "Set second levelset for boolean operation.")
805 .def("setBooleanOperation", &BooleanOperation<T, D>::setBooleanOperation,
806 "Set which type of boolean operation should be performed.")
807 .def("apply", &BooleanOperation<T, D>::apply,
808 "Perform the boolean operation.");
809
810 py::class_<CalculateCurvatures<T, D>,
811 SmartPointer<CalculateCurvatures<T, D>>>(module,
812 "CalculateCurvatures")
813 // constructors
814 .def(py::init(&SmartPointer<CalculateCurvatures<T, D>>::template New<>))
815 .def(py::init(&SmartPointer<CalculateCurvatures<T, D>>::template New<
816 SmartPointer<Domain<T, D>> &>))
817 // some constructors need lambda to work: seems to be an issue with
818 // implicit move constructor
819 .def(py::init([](SmartPointer<Domain<T, D>> &domain, CurvatureEnum type) {
820 return SmartPointer<CalculateCurvatures<T, D>>::New(domain, type);
821 }))
822 // methods
823 .def("setLevelSet", &CalculateCurvatures<T, D>::setLevelSet,
824 "Set levelset for which to calculate the curvatures.")
825 .def("setCurvatureType", &CalculateCurvatures<T, D>::setCurvatureType,
826 "Set which method to use for calculation: Defaults to mean "
827 "curvature.")
828 .def("setMaxValue", &CalculateCurvatures<T, D>::setMaxValue,
829 "Curvatures will be calculated for all LS values < maxValue.")
831 "Perform normal vector calculation.");
832
833 // CalculateNormalVectors
834 py::class_<CalculateNormalVectors<T, D>,
835 SmartPointer<CalculateNormalVectors<T, D>>>(
836 module, "CalculateNormalVectors")
837 // constructors
838 .def(
839 py::init(&SmartPointer<CalculateNormalVectors<T, D>>::template New<>))
840 .def(py::init(&SmartPointer<CalculateNormalVectors<T, D>>::template New<
841 SmartPointer<Domain<T, D>> &>))
842 // methods
844 "Set levelset for which to calculate normal vectors.")
846 "Set the maximum value for which normals should be calculated.")
848 "Set the method to use for normal calculation.")
850 "Perform normal vector calculation.");
851
852 // CalculateVisibilities
853 py::class_<CalculateVisibilities<T, D>,
854 SmartPointer<CalculateVisibilities<T, D>>>(module,
855 "CalculateVisibilities")
856 .def(py::init(
857 &SmartPointer<CalculateVisibilities<T, D>>::template New<
858 SmartPointer<Domain<T, D>> &, const Vec3D<T> &, std::string>))
860
861 // Check
862 py::class_<Check<T, D>, SmartPointer<Check<T, D>>>(module, "Check")
863 // constructors
864 .def(py::init(&SmartPointer<Check<T, D>>::template New<>))
865 .def(py::init(&SmartPointer<Check<T, D>>::template New<
866 SmartPointer<Domain<T, D>> &>))
867 // methods
868 .def("setLevelSet", &Check<T, D>::setLevelSet,
869 "Set levelset for which to calculate normal vectors.")
870 .def("apply", &Check<T, D>::apply, "Perform check.");
871
872 // PointCloud
873 py::class_<PointCloud<T, D>, SmartPointer<PointCloud<T, D>>>(module,
874 "PointCloud")
875 // constructors
876 .def(py::init(&SmartPointer<PointCloud<T, D>>::template New<
877 const std::vector<VectorType<T, D>> &>))
878 // methods
879 .def("insertNextPoint",
880 (void(PointCloud<T, D>::*)(const VectorType<T, D> &)) &
882
883 // ConvexHull
884 py::class_<ConvexHull<T, D>, SmartPointer<ConvexHull<T, D>>>(module,
885 "ConvexHull")
886 // constructors
887 .def(py::init(&SmartPointer<ConvexHull<T, D>>::template New<>))
888 .def(py::init(&SmartPointer<ConvexHull<T, D>>::template New<
889 SmartPointer<Mesh<T>> &, SmartPointer<PointCloud<T, D>> &>))
890 // methods
891 .def("setMesh", &ConvexHull<T, D>::setMesh,
892 "Set mesh object where the generated mesh should be stored.")
893 .def("setPointCloud", &ConvexHull<T, D>::setPointCloud,
894 "Set point cloud used to generate mesh.")
895 .def("apply", &ConvexHull<T, D>::apply, "Generate Hull.");
896
897 // DetectFeatures
898 py::class_<DetectFeatures<T, D>, SmartPointer<DetectFeatures<T, D>>>(
899 module, "DetectFeatures")
900 // constructors
901 .def(py::init(&SmartPointer<DetectFeatures<T, D>>::template New<>))
902 .def(py::init(&SmartPointer<DetectFeatures<T, D>>::template New<
903 SmartPointer<Domain<T, D>> &>))
904 .def(py::init(&SmartPointer<DetectFeatures<T, D>>::template New<
905 SmartPointer<Domain<T, D>> &, T>))
906 // some constructors need lambda to work: seems to be an issue with
907 // implicit move constructor
908 .def(py::init([](SmartPointer<Domain<T, D>> &domain, T maxValue,
910 return SmartPointer<DetectFeatures<T, D>>::New(domain, maxValue, type);
911 }))
912 .def("setDetectionThreshold",
914 "Set the curvature value above which a point is considered a "
915 "feature.")
916 .def("setDetectionMethod", &DetectFeatures<T, D>::setDetectionMethod,
917 "Set which method to use to detect features. Defaults to Curvature.")
918 .def("apply", &DetectFeatures<T, D>::apply, "Detect features.");
919
920 // GeometricAdvect
921 py::class_<GeometricAdvect<T, D>, SmartPointer<GeometricAdvect<T, D>>>(
922 module, "GeometricAdvect")
923 // constructors
924 .def(py::init(&SmartPointer<GeometricAdvect<T, D>>::template New<>))
925 .def(py::init(
926 &SmartPointer<GeometricAdvect<T, D>>::template New<
927 SmartPointer<Domain<T, D>> &,
928 SmartPointer<
930 // methods
931 .def("setLevelSet", &GeometricAdvect<T, D>::setLevelSet,
932 "Set levelset to advect.")
933 .def(
934 "setAdvectionDistribution",
936 "Set advection distribution to use as kernel for the fast advection.")
937 .def("apply", &GeometricAdvect<T, D>::apply,
938 py::call_guard<py::gil_scoped_release>(), "Perform advection.");
939
940 // GeometricAdvectDistributions
941 py::class_<GeometricAdvectDistribution<T, D>,
942 SmartPointer<GeometricAdvectDistribution<T, D>>,
944 "GeometricAdvectDistribution")
945 // constructors
946 .def(py::init<>())
947 // methods
949 "Check whether passed point is inside the distribution.")
950 .def("getSignedDistance",
952 "Get the signed distance of the passed point to the surface of the "
953 "distribution.")
955 "Get the cartesian bounds of the distribution.")
957 "Prepare the distribution for use with the passed level set.")
959 "Finalize the distribution after use with the level set.");
960
961 py::class_<SphereDistribution<T, D>, SmartPointer<SphereDistribution<T, D>>,
962 GeometricAdvectDistribution<T, D>>(module, "SphereDistribution")
963 // constructors
964 .def(py::init(&SmartPointer<SphereDistribution<T, D>>::template New<T>))
965 // methods
966 .def("isInside", &SphereDistribution<T, D>::isInside,
967 "Check whether passed point is inside the distribution.")
968 .def("getSignedDistance", &SphereDistribution<T, D>::getSignedDistance,
969 "Get the signed distance of the passed point to the surface of the "
970 "distribution.")
971 .def("getBounds", &SphereDistribution<T, D>::getBounds,
972 "Get the cartesian bounds of the distribution.");
973
974 py::class_<BoxDistribution<T, D>, SmartPointer<BoxDistribution<T, D>>,
975 GeometricAdvectDistribution<T, D>>(module, "BoxDistribution")
976 // constructors
977 .def(py::init(&SmartPointer<BoxDistribution<T, D>>::template New<
978 const std::array<T, 3>>))
979 // methods
980 .def("isInside", &BoxDistribution<T, D>::isInside,
981 "Check whether passed point is inside the distribution.")
982 .def("getSignedDistance", &BoxDistribution<T, D>::getSignedDistance,
983 "Get the signed distance of the passed point to the surface of the "
984 "distribution.")
985 .def("getBounds", &BoxDistribution<T, D>::getBounds,
986 "Get the cartesian bounds of the distribution.");
987
988 py::class_<CustomSphereDistribution<T, D>,
989 SmartPointer<CustomSphereDistribution<T, D>>,
991 "CustomSphereDistribution")
992 // constructors
993 .def(py::init(&SmartPointer<CustomSphereDistribution<T, D>>::template New<
994 const std::vector<T> &>))
995 // methods
997 "Check whether passed point is inside the distribution.")
998 .def("getSignedDistance",
1000 "Get the signed distance of the passed point to the surface of the "
1001 "distribution.")
1003 "Get the cartesian bounds of the distribution.");
1004
1005 // Expand
1006 py::class_<Expand<T, D>, SmartPointer<Expand<T, D>>>(module, "Expand")
1007 // constructors
1008 .def(py::init(&SmartPointer<Expand<T, D>>::template New<>))
1009 .def(py::init(&SmartPointer<Expand<T, D>>::template New<
1010 SmartPointer<Domain<T, D>> &>))
1011 .def(py::init(&SmartPointer<Expand<T, D>>::template New<
1012 SmartPointer<Domain<T, D>> &, int>))
1013 // methods
1014 .def("setLevelSet", &Expand<T, D>::setLevelSet, "Set levelset to expand.")
1015 .def("setWidth", &Expand<T, D>::setWidth, "Set the width to expand to.")
1016 .def("apply", &Expand<T, D>::apply, "Perform expansion.");
1017
1018 // FromSurfaceMesh
1019 py::class_<FromSurfaceMesh<T, D>, SmartPointer<FromSurfaceMesh<T, D>>>(
1020 module, "FromSurfaceMesh")
1021 // constructors
1022 .def(py::init(&SmartPointer<FromSurfaceMesh<T, D>>::template New<>))
1023 .def(py::init(&SmartPointer<FromSurfaceMesh<T, D>>::template New<
1024 SmartPointer<Domain<T, D>> &, SmartPointer<Mesh<T>> &>))
1025 .def(py::init(
1026 &SmartPointer<FromSurfaceMesh<T, D>>::template New<
1027 SmartPointer<Domain<T, D>> &, SmartPointer<Mesh<T>> &, bool>))
1028 // methods
1029 .def("setLevelSet", &FromSurfaceMesh<T, D>::setLevelSet,
1030 "Set levelset to read into.")
1031 .def("setMesh", &FromSurfaceMesh<T, D>::setMesh,
1032 "Set the mesh to read from.")
1033 .def("setRemoveBoundaryTriangles",
1034 static_cast<void (FromSurfaceMesh<T, D>::*)(bool)>(
1036 "Set whether to include mesh elements outside of the simulation "
1037 "domain.")
1038 .def("setRemoveBoundaryTriangles",
1039 static_cast<void (FromSurfaceMesh<T, D>::*)(std::array<bool, 3>)>(
1041 "Set whether to include mesh elements outside of the simulation "
1042 "domain.")
1043 .def("apply", &FromSurfaceMesh<T, D>::apply,
1044 "Construct a levelset from a surface mesh.");
1045
1046 // FromVolumeMesh
1047 py::class_<FromVolumeMesh<T, D>, SmartPointer<FromVolumeMesh<T, D>>>(
1048 module, "FromVolumeMesh")
1049 // constructors
1050 .def(py::init(&SmartPointer<FromVolumeMesh<T, D>>::template New<>))
1051 .def(py::init(&SmartPointer<FromVolumeMesh<T, D>>::template New<
1053 SmartPointer<Mesh<T>> &>))
1054 .def(py::init(&SmartPointer<FromVolumeMesh<T, D>>::template New<
1056 SmartPointer<Mesh<T>> &, bool>))
1057 // methods
1058 .def("setGrid", &FromVolumeMesh<T, D>::setGrid,
1059 "Set the grid used to read in the level sets.")
1060 .def("setMesh", &FromVolumeMesh<T, D>::setMesh,
1061 "Set the mesh to read from.")
1062 .def("setRemoveBoundaryTriangles",
1064 "Set whether to include mesh elements outside of the simulation "
1065 "domain.")
1066 .def("apply", &FromVolumeMesh<T, D>::apply,
1067 "Construct a levelset from a volume mesh.");
1068
1069 // FromMesh
1070 py::class_<FromMesh<T, D>, SmartPointer<FromMesh<T, D>>>(module, "FromMesh")
1071 .def(py::init(&SmartPointer<FromMesh<T, D>>::template New<>))
1072 .def(py::init(&SmartPointer<FromMesh<T, D>>::template New<
1073 SmartPointer<Domain<T, D>> &, SmartPointer<Mesh<T>> &>))
1074 .def("setMesh", &FromMesh<T, D>::setMesh, "Set the mesh to read from.")
1075 .def("setSortPointList", &FromMesh<T, D>::setSortPointList)
1076 .def("apply", &FromMesh<T, D>::apply);
1077
1078 // lsGeometries
1079 // Sphere
1080 py::class_<Sphere<T, D>, SmartPointer<Sphere<T, D>>>(module, "Sphere")
1081 // constructors
1082 .def(py::init(&SmartPointer<Sphere<T, D>>::template New<
1083 const std::vector<T> & /*origin*/, T /*radius*/>),
1084 py::arg("origin"), py::arg("radius"));
1085 // Plane
1086 py::class_<Plane<T, D>, SmartPointer<Plane<T, D>>>(module, "Plane")
1087 // constructors
1088 .def(py::init(&SmartPointer<Plane<T, D>>::template New<
1089 const std::vector<T> & /*origin*/,
1090 const std::vector<T> & /*normal*/>),
1091 py::arg("origin"), py::arg("normal"));
1092 // Box
1093 py::class_<Box<T, D>, SmartPointer<Box<T, D>>>(module, "Box")
1094 // constructors
1095 .def(py::init(&SmartPointer<Box<T, D>>::template New<
1096 const std::vector<T> & /*minPoint*/,
1097 const std::vector<T> & /*maxPoint*/>),
1098 py::arg("minPoint"), py::arg("maxPoint"));
1099 // Cylinder
1100 py::class_<Cylinder<T, D>, SmartPointer<Cylinder<T, D>>>(module, "Cylinder")
1101 // constructors
1102 .def(
1103 py::init(&SmartPointer<Cylinder<T, D>>::template New<
1104 const std::vector<T> & /*origin*/,
1105 const std::vector<T> & /*axisDirection*/, const T /*height*/,
1106 const T /*radius*/, const T /*topRadius*/>),
1107 py::arg("origin"), py::arg("axisDirection"), py::arg("height"),
1108 py::arg("radius"), py::arg("topRadius") = 0.);
1109
1110 // MakeGeometry
1111 py::class_<MakeGeometry<T, D>, SmartPointer<MakeGeometry<T, D>>>(
1112 module, "MakeGeometry")
1113 // constructors
1114 .def(py::init(&SmartPointer<MakeGeometry<T, D>>::template New<>))
1115 .def(py::init(&SmartPointer<MakeGeometry<T, D>>::template New<
1116 SmartPointer<Domain<T, D>> &>))
1117 .def(
1118 py::init(&SmartPointer<MakeGeometry<T, D>>::template New<
1119 SmartPointer<Domain<T, D>> &, SmartPointer<Sphere<T, D>> &>))
1120 .def(py::init(&SmartPointer<MakeGeometry<T, D>>::template New<
1121 SmartPointer<Domain<T, D>> &, SmartPointer<Plane<T, D>> &>))
1122 .def(py::init(&SmartPointer<MakeGeometry<T, D>>::template New<
1123 SmartPointer<Domain<T, D>> &, SmartPointer<Box<T, D>> &>))
1124 .def(py::init(
1125 &SmartPointer<MakeGeometry<T, D>>::template New<
1126 SmartPointer<Domain<T, D>> &, SmartPointer<Cylinder<T, D>> &>))
1127 .def(py::init(
1128 &SmartPointer<MakeGeometry<T, D>>::template New<
1129 SmartPointer<Domain<T, D>> &, SmartPointer<PointCloud<T, D>> &>))
1130 // methods
1131 .def("setLevelSet", &MakeGeometry<T, D>::setLevelSet,
1132 "Set the levelset in which to create the geometry.")
1133 .def("setGeometry",
1134 (void(MakeGeometry<T, D>::*)(SmartPointer<Sphere<T, D>>)) &
1136 .def("setGeometry",
1137 (void(MakeGeometry<T, D>::*)(SmartPointer<Plane<T, D>>)) &
1139 .def("setGeometry",
1140 (void(MakeGeometry<T, D>::*)(SmartPointer<Box<T, D>>)) &
1142 .def("setGeometry",
1143 (void(MakeGeometry<T, D>::*)(SmartPointer<Cylinder<T, D>>)) &
1145 .def("setGeometry",
1146 (void(MakeGeometry<T, D>::*)(SmartPointer<PointCloud<T, D>>)) &
1148 .def("setIgnoreBoundaryConditions",
1149 (void(MakeGeometry<T, D>::*)(bool)) &
1151 .def("setIgnoreBoundaryConditions",
1152 (void(MakeGeometry<T, D>::*)(std::array<bool, 3>)) &
1154 .def("apply", &MakeGeometry<T, D>::apply, "Generate the geometry.");
1155
1156 // MarkVoidPoints
1157 py::class_<MarkVoidPoints<T, D>, SmartPointer<MarkVoidPoints<T, D>>>(
1158 module, "MarkVoidPoints")
1159 // constructors
1160 .def(py::init(&SmartPointer<MarkVoidPoints<T, D>>::template New<>))
1161 .def(py::init(&SmartPointer<MarkVoidPoints<T, D>>::template New<
1162 SmartPointer<Domain<T, D>> &>))
1163 .def(py::init(&SmartPointer<MarkVoidPoints<T, D>>::template New<
1164 SmartPointer<Domain<T, D>> &, bool &>))
1165 // methods
1166 .def("setLevelSet", &MarkVoidPoints<T, D>::setLevelSet,
1167 "Set the levelset to mark void points in.")
1168 .def("setReverseVoidDetection",
1170 "Reverse the logic of detecting the top surface.")
1171 .def("setDetectLargestSurface",
1173 "Set that the top surface should be the one with the most connected "
1174 "LS points.")
1175 .def("setVoidTopSurface", &MarkVoidPoints<T, D>::setVoidTopSurface,
1176 "Set the logic by which to choose the surface which is non-void. "
1177 "All other connected surfaces will then be marked as void points.")
1178 .def("setSaveComponentIds", &MarkVoidPoints<T, D>::setSaveComponentIds,
1179 "Save the connectivity information of all LS points in the "
1180 "pointData of the level set.")
1181 .def("getNumberOfComponents",
1183 "Get the number of connected components found in the level set.")
1184 .def("apply", &MarkVoidPoints<T, D>::apply, "Mark void points.");
1185
1186 // Prune
1187 py::class_<Prune<T, D>, SmartPointer<Prune<T, D>>>(module, "Prune")
1188 // constructors
1189 .def(py::init(&SmartPointer<Prune<T, D>>::template New<>))
1190 .def(py::init(&SmartPointer<Prune<T, D>>::template New<
1191 SmartPointer<Domain<T, D>> &>))
1192 // methods
1193 .def("setLevelSet", &Prune<T, D>::setLevelSet, "Set levelset to prune.")
1194 .def("apply", &Prune<T, D>::apply, "Perform pruning operation.");
1195
1196 // Reader
1197 py::class_<Reader<T, D>, SmartPointer<Reader<T, D>>>(module, "Reader")
1198 // constructors
1199 .def(py::init(&SmartPointer<Reader<T, D>>::template New<>))
1200 .def(py::init(&SmartPointer<Reader<T, D>>::template New<
1201 SmartPointer<Domain<T, D>> &>))
1202 .def(py::init(&SmartPointer<Reader<T, D>>::template New<
1203 SmartPointer<Domain<T, D>> &, std::string>))
1204 // methods
1205 .def("setLevelSet", &Reader<T, D>::setLevelSet,
1206 "Set levelset to write to file.")
1207 .def("setFileName", &Reader<T, D>::setFileName,
1208 "Set the filename for the output file.")
1209 .def("apply", &Reader<T, D>::apply, "Write to file.");
1210
1211 // Reduce
1212 py::class_<Reduce<T, D>, SmartPointer<Reduce<T, D>>>(module, "Reduce")
1213 // constructors
1214 .def(py::init(&SmartPointer<Reduce<T, D>>::template New<>))
1215 .def(py::init(&SmartPointer<Reduce<T, D>>::template New<
1216 SmartPointer<Domain<T, D>> &>))
1217 .def(py::init(&SmartPointer<Reduce<T, D>>::template New<
1218 SmartPointer<Domain<T, D>> &, int>))
1219 .def(py::init(&SmartPointer<Reduce<T, D>>::template New<
1220 SmartPointer<Domain<T, D>> &, int, bool>))
1221 // methods
1222 .def("setLevelSet", &Reduce<T, D>::setLevelSet, "Set levelset to reduce.")
1223 .def("setWidth", &Reduce<T, D>::setWidth, "Set the width to reduce to.")
1224 .def("setNoNewSegment", &Reduce<T, D>::setNoNewSegment,
1225 "Set whether the levelset should be segmented anew (balanced across "
1226 "cores) after reduction.")
1227 .def("apply", &Reduce<T, D>::apply, "Perform reduction.");
1228
1229 // RemoveStrayPoints
1230 py::class_<RemoveStrayPoints<T, D>, SmartPointer<RemoveStrayPoints<T, D>>>(
1231 module, "RemoveStrayPoints")
1232 // constructors
1233 .def(py::init(&SmartPointer<RemoveStrayPoints<T, D>>::template New<>))
1234 .def(py::init(&SmartPointer<RemoveStrayPoints<T, D>>::template New<
1235 SmartPointer<Domain<T, D>> &>))
1236 // methods
1237 .def("setLevelSet", &RemoveStrayPoints<T, D>::setLevelSet,
1238 "Set levelset for stray point removal.")
1239 .def("setVoidTopSurface", &RemoveStrayPoints<T, D>::setVoidTopSurface,
1240 "Set the logic by which to choose the surface which should be kept. "
1241 "All other LS values will be marked as stray points and removed.")
1242 .def("apply", &RemoveStrayPoints<T, D>::apply, "Remove stray points.");
1243
1244 // ToDiskMesh
1245 py::class_<ToDiskMesh<T, D>, SmartPointer<ToDiskMesh<T, D>>>(module,
1246 "ToDiskMesh")
1247 // constructors
1248 .def(py::init(&SmartPointer<ToDiskMesh<T, D>>::template New<>))
1249 .def(py::init(&SmartPointer<ToDiskMesh<T, D>>::template New<
1250 SmartPointer<Domain<T, D>> &, SmartPointer<Mesh<T>> &>))
1251 // methods
1252 .def("setLevelSet", &ToDiskMesh<T, D>::setLevelSet,
1253 "Set levelset to mesh.")
1254 .def("clearLevelSets", &ToDiskMesh<T, D>::clearLevelSets,
1255 "Clear all inserted level sets.")
1256 .def("insertNextLevelSet", &ToDiskMesh<T, D>::insertNextLevelSet,
1257 "Insert next level set to output in the disk mesh.")
1258 .def("setMesh", &ToDiskMesh<T, D>::setMesh, "Set the mesh to generate.")
1259 .def("setMaterialMap", &ToDiskMesh<T, D>::setMaterialMap,
1260 "Set the material map to use for the disk mesh.")
1261 .def("setMaxValue", &ToDiskMesh<T, D>::setMaxValue,
1262 "Set the maximum level set value to include in the disk mesh.")
1263 .def("apply", &ToDiskMesh<T, D>::apply,
1264 "Convert the levelset to a surface mesh.");
1265
1266 // ToMesh
1267 py::class_<ToMesh<T, D>, SmartPointer<ToMesh<T, D>>>(module, "ToMesh")
1268 // constructors
1269 .def(py::init(&SmartPointer<ToMesh<T, D>>::template New<>))
1270 .def(py::init(&SmartPointer<ToMesh<T, D>>::template New<
1271 SmartPointer<Domain<T, D>> &, SmartPointer<Mesh<T>> &>))
1272 .def(py::init(
1273 &SmartPointer<ToMesh<T, D>>::template New<
1274 SmartPointer<Domain<T, D>> &, SmartPointer<Mesh<T>> &, bool>))
1275 .def(py::init(&SmartPointer<ToMesh<T, D>>::template New<
1276 SmartPointer<Domain<T, D>> &, SmartPointer<Mesh<T>> &, bool,
1277 bool>))
1278 // methods
1279 .def("setLevelSet", &ToMesh<T, D>::setLevelSet, "Set levelset to mesh.")
1280 .def("setMesh", &ToMesh<T, D>::setMesh, "Set the mesh to generate.")
1281 .def("setOnlyDefined", &ToMesh<T, D>::setOnlyDefined,
1282 "Set whether only defined points should be output to the mesh.")
1283 .def("setOnlyActive", &ToMesh<T, D>::setOnlyActive,
1284 "Set whether only level set points <0.5 should be output.")
1285 .def("apply", &ToMesh<T, D>::apply,
1286 "Convert the levelset to a surface mesh.");
1287
1288 // ToSurfaceMesh
1289 py::class_<ToSurfaceMesh<T, D>, SmartPointer<ToSurfaceMesh<T, D>>>(
1290 module, "ToSurfaceMesh")
1291 // constructors
1292 .def(
1293 py::init(
1294 &SmartPointer<ToSurfaceMesh<T, D>>::template New<double, double>),
1295 py::arg("minNodeDistFactor") = 0.05, py::arg("eps") = 1e-12)
1296 .def(py::init(&SmartPointer<ToSurfaceMesh<T, D>>::template New<
1297 SmartPointer<Domain<T, D>> &, SmartPointer<Mesh<T>> &,
1298 double, double>),
1299 py::arg("domain"), py::arg("mesh"),
1300 py::arg("minNodeDistFactor") = 0.05, py::arg("eps") = 1e-12)
1301 // methods
1302 .def("setLevelSet", &ToSurfaceMesh<T, D>::setLevelSet,
1303 "Set levelset to mesh.")
1304 .def("setMesh", &ToSurfaceMesh<T, D>::setMesh,
1305 "Set the mesh to generate.")
1306 .def("setUpdatePointData", &ToSurfaceMesh<T, D>::setUpdatePointData,
1307 "Set whether to update point data. Defaults to true.")
1308 .def("setSharpCorners", &ToSurfaceMesh<T, D>::setSharpCorners,
1309 "Set whether to preserve sharp corners. Defaults to false.")
1310 .def("apply", &ToSurfaceMesh<T, D>::apply,
1311 "Convert the levelset to a surface mesh.");
1312
1313 // ToMultiSurfaceMesh
1314 py::class_<ToMultiSurfaceMesh<T, D>, SmartPointer<ToMultiSurfaceMesh<T, D>>>(
1315 module, "ToMultiSurfaceMesh")
1316 // constructors
1317 .def(py::init(
1318 &SmartPointer<ToMultiSurfaceMesh<T, D>>::template New<double,
1319 double>),
1320 py::arg("minNodeDistFactor") = 0.05, py::arg("eps") = 1e-12)
1321 .def(py::init(&SmartPointer<ToMultiSurfaceMesh<T, D>>::template New<
1322 SmartPointer<Domain<T, D>> &, SmartPointer<Mesh<T>> &,
1323 double, double>),
1324 py::arg("domain"), py::arg("mesh"),
1325 py::arg("minNodeDistFactor") = 0.05, py::arg("eps") = 1e-12)
1326 .def(py::init(&SmartPointer<ToMultiSurfaceMesh<T, D>>::template New<
1327 std::vector<SmartPointer<Domain<T, D>>> &,
1328 SmartPointer<Mesh<T>> &, double, double>),
1329 py::arg("domains"), py::arg("mesh"),
1330 py::arg("minNodeDistFactor") = 0.05, py::arg("eps") = 1e-12)
1331 .def(py::init(&SmartPointer<ToMultiSurfaceMesh<T, D>>::template New<
1332 SmartPointer<Mesh<T>> &, double, double>),
1333 py::arg("mesh"), py::arg("minNodeDistFactor") = 0.05,
1334 py::arg("eps") = 1e-12)
1335 // methods
1336 .def("insertNextLevelSet", &ToMultiSurfaceMesh<T, D>::insertNextLevelSet,
1337 "Insert next level set to output in the mesh.")
1338 .def("clearLevelSets", &ToMultiSurfaceMesh<T, D>::clearLevelSets,
1339 "Clear all inserted level sets.")
1340 .def("setMesh", &ToMultiSurfaceMesh<T, D>::setMesh,
1341 "Set the mesh to generate.")
1342 .def("setMaterialMap", &ToMultiSurfaceMesh<T, D>::setMaterialMap,
1343 "Set the material map to use for the multi surface mesh.")
1344 .def("setSharpCorners", &ToMultiSurfaceMesh<T, D>::setSharpCorners,
1345 "Set whether to preserve sharp corners. Defaults to false.")
1346 .def("apply", &ToMultiSurfaceMesh<T, D>::apply,
1347 "Convert the levelset to a surface mesh.");
1348
1349 // ToVoxelMesh
1350 py::class_<ToVoxelMesh<T, D>, SmartPointer<ToVoxelMesh<T, D>>>(module,
1351 "ToVoxelMesh")
1352 // constructors
1353 .def(py::init(&SmartPointer<ToVoxelMesh<T, D>>::template New<>))
1354 .def(py::init(&SmartPointer<ToVoxelMesh<T, D>>::template New<
1355 SmartPointer<Mesh<T>> &>))
1356 .def(py::init(&SmartPointer<ToVoxelMesh<T, D>>::template New<
1357 SmartPointer<Domain<T, D>> &, SmartPointer<Mesh<T>> &>))
1358 .def(py::init(&SmartPointer<ToVoxelMesh<T, D>>::template New<
1359 std::vector<SmartPointer<Domain<T, D>>> &,
1360 SmartPointer<Mesh<T>> &>))
1361 // methods
1362 .def("insertNextLevelSet", &ToVoxelMesh<T, D>::insertNextLevelSet,
1363 "Insert next level set to output in the mesh.")
1364 .def("clearLevelSets", &ToVoxelMesh<T, D>::clearLevelSets,
1365 "Clear all inserted level sets.")
1366 .def("setMesh", &ToVoxelMesh<T, D>::setMesh, "Set the mesh to generate.")
1367 .def("apply", &ToVoxelMesh<T, D>::apply,
1368 "Convert the levelset to a surface mesh.");
1369
1370 // Writer
1371 py::class_<Writer<T, D>, SmartPointer<Writer<T, D>>>(module, "Writer")
1372 // constructors
1373 .def(py::init(&SmartPointer<Writer<T, D>>::template New<>))
1374 .def(py::init(&SmartPointer<Writer<T, D>>::template New<
1375 SmartPointer<Domain<T, D>> &>))
1376 .def(py::init(&SmartPointer<Writer<T, D>>::template New<
1377 SmartPointer<Domain<T, D>> &, std::string>))
1378 // methods
1379 .def("setLevelSet", &Writer<T, D>::setLevelSet,
1380 "Set levelset to write to file.")
1381 .def("setFileName", &Writer<T, D>::setFileName,
1382 "Set the filename for the output file.")
1383 .def("apply", &Writer<T, D>::apply, "Write to file.");
1384
1385 // CompareSparseField
1386 py::class_<CompareSparseField<T, D>, SmartPointer<CompareSparseField<T, D>>>(
1387 module, "CompareSparseField")
1388 // constructors
1389 .def(py::init(&SmartPointer<CompareSparseField<T, D>>::template New<>))
1390 .def(
1391 py::init(&SmartPointer<CompareSparseField<T, D>>::template New<
1392 SmartPointer<Domain<T, D>> &, SmartPointer<Domain<T, D>> &>))
1393 // methods
1394 .def("setLevelSetExpanded",
1396 "Sets the expanded level set for comparison.")
1397 .def("setLevelSetIterated",
1399 "Sets the iterated level set to compare against the expanded one.")
1400 .def("setXRange", &CompareSparseField<T, D>::setXRange,
1401 "Set the x-coordinate range to restrict the comparison area")
1402 .def("setYRange", &CompareSparseField<T, D>::setYRange,
1403 "Set the y-coordinate range to restrict the comparison area")
1404 .def("clearXRange", &CompareSparseField<T, D>::clearXRange,
1405 "Clear the x-range restriction")
1406 .def("clearYRange", &CompareSparseField<T, D>::clearYRange,
1407 "Clear the y-range restriction")
1408 .def("setZRange", &CompareSparseField<T, D>::setZRange,
1409 "Set the z-coordinate range to restrict the comparison area")
1410 .def("clearZRange", &CompareSparseField<T, D>::clearZRange,
1411 "Clear the z-range restriction")
1412 .def("setOutputMesh", &CompareSparseField<T, D>::setOutputMesh,
1413 "Set the output mesh where difference values will be stored")
1414 .def("setFillIteratedWithDistances",
1416 "Set whether to fill the iterated level set with distance values")
1417 .def("setExpandedLevelSetWidth",
1419 "Set the expansion width for the expanded level set")
1420 .def("apply", &CompareSparseField<T, D>::apply,
1421 "Apply the comparison and calculate the sum of squared "
1422 "differences.")
1423 .def("getSumSquaredDifferences",
1425 "Return the sum of squared differences calculated by apply().")
1426 .def("getSumDifferences", &CompareSparseField<T, D>::getSumDifferences,
1427 "Return the sum of absolute differences calculated by apply().")
1428 .def("getNumPoints", &CompareSparseField<T, D>::getNumPoints,
1429 "Return the number of points used in the comparison.")
1430 .def("getNumSkippedPoints",
1432 "Return the number of points skipped during comparison.")
1433 .def("getRMSE", &CompareSparseField<T, D>::getRMSE,
1434 "Calculate the root mean square error from previously computed "
1435 "values.");
1436
1437// WriteVisualizationMesh
1438#ifdef VIENNALS_USE_VTK
1439 py::class_<WriteVisualizationMesh<T, D>,
1440 SmartPointer<WriteVisualizationMesh<T, D>>>(
1441 module, "WriteVisualizationMesh")
1442 // constructors
1443 .def(
1444 py::init(&SmartPointer<WriteVisualizationMesh<T, D>>::template New<>))
1445 .def(py::init(&SmartPointer<WriteVisualizationMesh<T, D>>::template New<
1446 SmartPointer<Domain<T, D>> &>))
1447 // methods
1448 .def("insertNextLevelSet",
1449 &WriteVisualizationMesh<T, D>::insertNextLevelSet,
1450 "Insert next level set to convert. Bigger level sets wrapping "
1451 "smaller ones, should be inserted last.")
1452 .def("setFileName", &WriteVisualizationMesh<T, D>::setFileName,
1453 "Set Name of File to write.")
1454 .def("setExtractHullMesh",
1455 &WriteVisualizationMesh<T, D>::setExtractHullMesh,
1456 "Whether to extract a hull mesh. Defaults to false.")
1457 .def("setExtractVolumeMesh",
1458 &WriteVisualizationMesh<T, D>::setExtractVolumeMesh,
1459 " Whether to extract a tetra volume mesh. Defaults to true.")
1460 .def("setMetaData", &WriteVisualizationMesh<T, D>::setMetaData,
1461 "Set the metadata to be written to the file.")
1462 .def("addMetaData",
1463 py::overload_cast<const std::string &, T>(
1464 &WriteVisualizationMesh<T, D>::addMetaData),
1465 "Add a single metadata entry to the file.")
1466 .def("addMetaData",
1467 py::overload_cast<const std::string &, const std::vector<T> &>(
1468 &WriteVisualizationMesh<T, D>::addMetaData),
1469 "Add a single metadata entry to the file.")
1470 .def("addMetaData",
1471 py::overload_cast<
1472 const std::unordered_map<std::string, std::vector<T>> &>(
1473 &WriteVisualizationMesh<T, D>::addMetaData),
1474 "Add metadata to the file.")
1475 .def("apply", &WriteVisualizationMesh<T, D>::apply,
1476 "Make and write mesh.");
1477#endif
1478
1479 // ToHullMesh
1480 py::class_<ToHullMesh<T, D>, SmartPointer<ToHullMesh<T, D>>>(module,
1481 "ToHullMesh")
1482 // constructors
1483 .def(py::init(&SmartPointer<ToHullMesh<T, D>>::template New<>))
1484 .def(py::init(&SmartPointer<ToHullMesh<T, D>>::template New<
1485 SmartPointer<Mesh<T>> &>))
1486 .def(py::init(&SmartPointer<ToHullMesh<T, D>>::template New<
1487 SmartPointer<Mesh<T>> &,
1488 std::vector<SmartPointer<Domain<T, D>>> &>))
1489 .def(py::init(&SmartPointer<ToHullMesh<T, D>>::template New<
1490 SmartPointer<Mesh<T>> &, SmartPointer<Domain<T, D>> &>))
1491 // methods
1492 .def("setMesh", &ToHullMesh<T, D>::setMesh, "Set the mesh to generate.")
1493 .def("insertNextLevelSet", &ToHullMesh<T, D>::insertNextLevelSet,
1494 "Insert next level set to convert. Bigger level sets wrapping "
1495 "smaller ones, should be inserted last.")
1496 .def("clearLevelSets", &ToHullMesh<T, D>::clearLevelSets,
1497 "Clear all inserted level sets.")
1498 .def("setSharpCorners", &ToHullMesh<T, D>::setSharpCorners,
1499 "Set whether to generate sharp corners. Defaults to false.")
1500 .def("setMaterialMap", &ToHullMesh<T, D>::setMaterialMap,
1501 "Set the material map to use for the hull mesh.")
1502 .def("setBottomExtension", &ToHullMesh<T, D>::setBottomExtension,
1503 "Set the bottom extension value for 2D hull meshes.")
1504 .def("apply", &ToHullMesh<T, D>::apply, "Generate hull mesh.");
1505
1506 // CompareVolume
1507 py::class_<CompareVolume<T, D>, SmartPointer<CompareVolume<T, D>>>(
1508 module, "CompareVolume")
1509 // constructors
1510 .def(py::init(&SmartPointer<CompareVolume<T, D>>::template New<>))
1511 .def(
1512 py::init(&SmartPointer<CompareVolume<T, D>>::template New<
1513 SmartPointer<Domain<T, D>> &, SmartPointer<Domain<T, D>> &>))
1514 // methods
1515 .def("setLevelSetTarget", &CompareVolume<T, D>::setLevelSetTarget,
1516 "Sets the target level set.")
1517 .def("setLevelSetSample", &CompareVolume<T, D>::setLevelSetSample,
1518 "Sets the sample level set.")
1519 .def("setDefaultIncrement", &CompareVolume<T, D>::setDefaultIncrement,
1520 "Set default increment value")
1521 .def("setXRangeAndIncrement", &CompareVolume<T, D>::setXRangeAndIncrement,
1522 "Sets the x-range and custom increment value")
1523 .def("setYRangeAndIncrement", &CompareVolume<T, D>::setYRangeAndIncrement,
1524 "Sets the y-range and custom increment value")
1525 .def("setZRangeAndIncrement", &CompareVolume<T, D>::setZRangeAndIncrement,
1526 "Sets the z-range and custom increment value")
1527 .def("setOutputMesh", &CompareVolume<T, D>::setOutputMesh,
1528 "Set the output mesh where difference areas will be stored")
1529 .def("getVolumeMismatch", &CompareVolume<T, D>::getVolumeMismatch,
1530 "Returns the computed volume mismatch.")
1531 .def("getAreaMismatch", &CompareVolume<T, D>::getAreaMismatch,
1532 "Returns the computed area mismatch.")
1533 .def("getCustomVolumeMismatch",
1535 "Returns the computed volume mismatch, with custom increments "
1536 "applied.")
1537 .def("getCustomAreaMismatch", &CompareVolume<T, D>::getCustomAreaMismatch,
1538 "Returns the computed area mismatch, with custom increments "
1539 "applied.")
1540 .def("getCellCount", &CompareVolume<T, D>::getCellCount,
1541 "Returns the number of cells where the level sets differ.")
1542 .def("getCustomCellCount", &CompareVolume<T, D>::getCustomCellCount,
1543 "Returns the number of cells where the level sets differ, with "
1544 "custom increments applied.")
1545 .def("apply", &CompareVolume<T, D>::apply,
1546 "Computes the volume difference between the two level sets.");
1547
1548 if constexpr (D == 2) {
1549 module.attr("CompareArea") = module.attr("CompareVolume");
1550 }
1551
1552 // CompareChamfer
1553 py::class_<CompareChamfer<T, D>, SmartPointer<CompareChamfer<T, D>>>(
1554 module, "CompareChamfer")
1555 // constructors
1556 .def(py::init(&SmartPointer<CompareChamfer<T, D>>::template New<>))
1557 .def(
1558 py::init(&SmartPointer<CompareChamfer<T, D>>::template New<
1559 SmartPointer<Domain<T, D>> &, SmartPointer<Domain<T, D>> &>))
1560 // methods
1561 .def("setLevelSetTarget", &CompareChamfer<T, D>::setLevelSetTarget,
1562 "Set the target level set.")
1563 .def("setLevelSetSample", &CompareChamfer<T, D>::setLevelSetSample,
1564 "Set the sample level set.")
1565 .def("setOutputMeshTarget", &CompareChamfer<T, D>::setOutputMeshTarget,
1566 "Set output mesh for target surface points with distance data.")
1567 .def("setOutputMeshSample", &CompareChamfer<T, D>::setOutputMeshSample,
1568 "Set output mesh for sample surface points with distance data.")
1569 .def("apply", &CompareChamfer<T, D>::apply,
1570 "Apply the Chamfer distance calculation.")
1571 .def("getForwardDistance", &CompareChamfer<T, D>::getForwardDistance,
1572 "Get the forward distance (average distance from target to "
1573 "sample).")
1574 .def("getBackwardDistance", &CompareChamfer<T, D>::getBackwardDistance,
1575 "Get the backward distance (average distance from sample to "
1576 "target).")
1577 .def("getChamferDistance", &CompareChamfer<T, D>::getChamferDistance,
1578 "Get the Chamfer distance (average of forward and backward).")
1579 .def("getRMSChamferDistance",
1581 "Get the RMS Chamfer distance.")
1582 .def("getMaxDistance", &CompareChamfer<T, D>::getMaxDistance,
1583 "Get the maximum nearest-neighbor distance.")
1584 .def("getNumTargetPoints", &CompareChamfer<T, D>::getNumTargetPoints,
1585 "Get the number of target surface points.")
1586 .def("getNumSamplePoints", &CompareChamfer<T, D>::getNumSamplePoints,
1587 "Get the number of sample surface points.");
1588
1589 // CompareCriticalDimensions
1590 py::class_<CompareCriticalDimensions<T, D>,
1591 SmartPointer<CompareCriticalDimensions<T, D>>>(
1592 module, "CompareCriticalDimensions")
1593 // constructors
1594 .def(py::init(
1595 &SmartPointer<CompareCriticalDimensions<T, D>>::template New<>))
1596 .def(
1597 py::init(&SmartPointer<CompareCriticalDimensions<T, D>>::template New<
1598 SmartPointer<Domain<T, D>> &, SmartPointer<Domain<T, D>> &>))
1599 // methods
1600 .def("setLevelSetTarget",
1602 "Sets the target level set.")
1603 .def("setLevelSetSample",
1605 "Sets the sample level set.")
1607 py::arg("measureDimension"), py::arg("minBounds"),
1608 py::arg("maxBounds"), py::arg("findMaximum") = true,
1609 "Add a generic range specification.")
1611 py::arg("minX"), py::arg("maxX"), py::arg("findMaximum") = true,
1612 "Add an X range to find maximum or minimum Y position.")
1614 py::arg("minY"), py::arg("maxY"), py::arg("findMaximum") = true,
1615 "Add a Y range to find maximum or minimum X position.")
1617 "Clear all range specifications.")
1619 "Set the output mesh where critical dimension locations will be "
1620 "stored.")
1622 "Apply the comparison.")
1623 .def("getNumCriticalDimensions",
1625 "Get the number of critical dimensions compared.")
1626 .def(
1627 "getCriticalDimensionResult",
1628 [](CompareCriticalDimensions<T, D> &self, size_t index) -> py::tuple {
1629 T posRef{}, posCmp{}, diff{};
1630 bool valid =
1631 self.getCriticalDimensionResult(index, posRef, posCmp, diff);
1632 if (valid)
1633 return py::make_tuple(true, posRef, posCmp, diff);
1634 return py::make_tuple(false, T(0), T(0), T(0));
1635 },
1636 py::arg("index"),
1637 "Get a specific critical dimension result. Returns (valid, "
1638 "positionTarget, positionSample, difference).")
1639 .def("getMeanDifference",
1641 "Get mean absolute difference across all valid critical "
1642 "dimensions.")
1643 .def("getMaxDifference",
1645 "Get maximum difference across all valid critical dimensions.")
1647 "Get RMSE across all valid critical dimensions.")
1648 .def("getAllDifferences",
1650 "Get all valid differences as a list.");
1651
1652 // CompareNarrowBand
1653 py::class_<CompareNarrowBand<T, D>, SmartPointer<CompareNarrowBand<T, D>>>(
1654 module, "CompareNarrowBand")
1655 // constructors
1656 .def(py::init(&SmartPointer<CompareNarrowBand<T, D>>::template New<>))
1657 .def(
1658 py::init(&SmartPointer<CompareNarrowBand<T, D>>::template New<
1659 SmartPointer<Domain<T, D>> &, SmartPointer<Domain<T, D>> &>))
1660 // methods
1661 .def("setLevelSetTarget", &CompareNarrowBand<T, D>::setLevelSetTarget,
1662 "Sets the target level set.")
1663 .def("setLevelSetSample", &CompareNarrowBand<T, D>::setLevelSetSample,
1664 "Sets the sample level set.")
1665 .def("setXRange", &CompareNarrowBand<T, D>::setXRange,
1666 "Set the x-coordinate range to restrict the comparison area")
1667 .def("setYRange", &CompareNarrowBand<T, D>::setYRange,
1668 "Set the y-coordinate range to restrict the comparison area")
1669 .def("clearXRange", &CompareNarrowBand<T, D>::clearXRange,
1670 "Clear the x-range restriction")
1671 .def("clearYRange", &CompareNarrowBand<T, D>::clearYRange,
1672 "Clear the y-range restriction")
1673 .def("setZRange", &CompareNarrowBand<T, D>::setZRange,
1674 "Set the z-coordinate range to restrict the comparison area")
1675 .def("clearZRange", &CompareNarrowBand<T, D>::clearZRange,
1676 "Clear the z-range restriction")
1677 .def("setOutputMesh", &CompareNarrowBand<T, D>::setOutputMesh,
1678 "Set the output mesh where difference values will be stored")
1679 .def("setOutputMeshSquaredDifferences",
1681 "Set whether to output squared differences (true) or absolute "
1682 "differences (false)")
1683 .def("apply", &CompareNarrowBand<T, D>::apply,
1684 "Apply the comparison and calculate the sum of squared "
1685 "differences.")
1686 .def("getSumSquaredDifferences",
1688 "Return the sum of squared differences calculated by apply().")
1689 .def("getSumDifferences", &CompareNarrowBand<T, D>::getSumDifferences,
1690 "Return the sum of absolute differences calculated by apply().")
1691 .def("getNumPoints", &CompareNarrowBand<T, D>::getNumPoints,
1692 "Return the number of points used in the comparison.")
1693 .def("getRMSE", &CompareNarrowBand<T, D>::getRMSE,
1694 "Calculate the root mean square error from previously computed "
1695 "values.");
1696}
constexpr int D
Definition Epitaxy.cpp:12
double T
Definition Epitaxy.cpp:13
Definition pyWrap.hpp:71
T getSignedDistance(const vectorType &initial, const vectorType &candidate, unsigned long initialPointId) const override
Definition pyWrap.hpp:83
bool isInside(const vectorType &initial, const vectorType &candidate, double eps=0.) const override
Definition pyWrap.hpp:78
boundsType getBounds() const override
Sets bounds to the bounding box of the distribution.
Definition pyWrap.hpp:89
Stencil Local Lax Friedrichs Discretization Scheme. It uses a stencil of order around active points,...
Definition lsStencilLocalLaxFriedrichsScalar.hpp:33
This class is used to advance level sets over time. Level sets are passed to the constructor in a std...
Definition lsAdvect.hpp:54
void setVelocityField(SmartPointer< VelocityField< T > > passedVelocities)
Set the velocity field used for advection. This should be a concrete implementation of lsVelocityFiel...
Definition lsAdvect.hpp:864
void insertNextLevelSet(SmartPointer< Domain< T, D > > passedlsDomain)
Pushes the passed level set to the back of the list of level sets used for advection.
Definition lsAdvect.hpp:856
void setVelocityUpdateCallback(std::function< bool(SmartPointer< Domain< T, D > >)> callback)
Set a callback function that is called after the level set has been updated during intermediate time ...
Definition lsAdvect.hpp:966
void setUpdatePointData(bool update)
Set whether the point data in the old LS should be translated to the advected LS. Defaults to true.
Definition lsAdvect.hpp:962
void setSpatialScheme(SpatialSchemeEnum scheme)
Set which spatial discretization scheme should be used out of the ones specified in SpatialSchemeEnum...
Definition lsAdvect.hpp:936
bool getCalculateNormalVectors() const
Get whether normal vectors were calculated.
Definition lsAdvect.hpp:932
void setIgnoreVoids(bool iV)
Set whether level set values, which are not part of the "top" geometrically connected part of values,...
Definition lsAdvect.hpp:899
void clearLevelSets()
Definition lsAdvect.hpp:860
void setCalculateNormalVectors(bool cnv)
Set whether normal vectors should be calculated at each level set point. Defaults to true....
Definition lsAdvect.hpp:891
void apply()
Definition lsAdvect.hpp:1017
void setSingleStep(bool singleStep)
If set to true, only a single advection step will be performed, even if the advection time set with s...
Definition lsAdvect.hpp:879
void prepareLS()
Definition lsAdvect.hpp:973
double getAdvectedTime() const
Get by how much the physical time was advanced during the last apply() call.
Definition lsAdvect.hpp:920
void setTemporalScheme(TemporalSchemeEnum scheme)
Set which time integration scheme should be used.
Definition lsAdvect.hpp:949
void setDissipationAlpha(const double &a)
Set the alpha dissipation coefficient. For lsLaxFriedrichs, this is used as the alpha value....
Definition lsAdvect.hpp:955
void setCheckDissipation(bool check)
Definition lsAdvect.hpp:958
void setIntegrationScheme(IntegrationSchemeEnum scheme)
Definition lsAdvect.hpp:941
double getCurrentTimeStep() const
Return the last applied time step.
Definition lsAdvect.hpp:923
void setAdvectionTime(double time)
Set the time until when the level set should be advected. If this takes more than one advection step,...
Definition lsAdvect.hpp:873
unsigned getNumberOfTimeSteps() const
Get how many advection steps were performed during the last apply() call.
Definition lsAdvect.hpp:926
void setAdaptiveTimeStepping(bool aTS=true, unsigned subdivisions=20)
Set whether adaptive time stepping should be used when approaching material boundaries during etching...
Definition lsAdvect.hpp:904
void setTimeStepRatio(const double &cfl)
Set the CFL condition to use during advection. The CFL condition sets the maximum distance a surface ...
Definition lsAdvect.hpp:885
double getTimeStepRatio() const
Get the value of the CFL number.
Definition lsAdvect.hpp:929
void setSaveAdvectionVelocities(bool sAV)
Set whether the velocities applied to each point should be saved in the level set for debug purposes.
Definition lsAdvect.hpp:916
This class is used to perform boolean operations on two level sets and write the resulting level set ...
Definition lsBooleanOperation.hpp:45
void setLevelSet(SmartPointer< Domain< T, D > > passedlsDomain)
Set which level set to perform the boolean operation on.
Definition lsBooleanOperation.hpp:298
void setSecondLevelSet(SmartPointer< Domain< T, D > > passedlsDomain)
Set the level set which will be used to modify the first level set.
Definition lsBooleanOperation.hpp:304
void setBooleanOperation(BooleanOperationEnum passedOperation)
Set which of the operations of BooleanOperationEnum to perform.
Definition lsBooleanOperation.hpp:309
void apply()
Perform operation.
Definition lsBooleanOperation.hpp:327
Concrete implementation of GeometricAdvectDistribution for a rectangular box distribution.
Definition lsGeometricAdvectDistributions.hpp:129
bool isInside(const Vec3D< viennahrle::CoordType > &initial, const Vec3D< viennahrle::CoordType > &candidate, double eps) const override
Quick check whether a point relative to the distributions center is inside the distribution....
Definition lsGeometricAdvectDistributions.hpp:136
std::array< viennahrle::CoordType, 6 > getBounds() const override
Sets bounds to the bounding box of the distribution.
Definition lsGeometricAdvectDistributions.hpp:159
T getSignedDistance(const Vec3D< viennahrle::CoordType > &initial, const Vec3D< viennahrle::CoordType > &candidate, unsigned long) const override
Returns the signed distance of a point relative to the distributions center. This is the signed manha...
Definition lsGeometricAdvectDistributions.hpp:148
Class describing a square box from one coordinate to another.
Definition lsGeometries.hpp:71
Definition lsCalculateCurvatures.hpp:24
void setCurvatureType(CurvatureEnum passedType)
Definition lsCalculateCurvatures.hpp:46
void setMaxValue(const T passedMaxValue)
Definition lsCalculateCurvatures.hpp:59
void apply()
Definition lsCalculateCurvatures.hpp:61
void setLevelSet(SmartPointer< Domain< T, D > > passedLevelSet)
Definition lsCalculateCurvatures.hpp:42
This algorithm is used to compute the normal vectors for all points with level set values <= maxValue...
Definition lsCalculateNormalVectors.hpp:40
void setLevelSet(SmartPointer< Domain< T, D > > passedLevelSet)
Definition lsCalculateNormalVectors.hpp:63
void apply()
Definition lsCalculateNormalVectors.hpp:95
void setMethod(NormalCalculationMethodEnum passedMethod)
Definition lsCalculateNormalVectors.hpp:79
void setMaxValue(const T passedMaxValue)
Definition lsCalculateNormalVectors.hpp:67
Definition lsCalculateVisibilities.hpp:10
void apply()
Definition lsCalculateVisibilities.hpp:25
This class is used to find errors in the underlying level set structure, like invalid neighbours of d...
Definition lsCheck.hpp:22
void apply()
Definition lsCheck.hpp:78
void setLevelSet(SmartPointer< Domain< T, D > > passedLevelSet)
Definition lsCheck.hpp:66
Calculate Chamfer distance between two level sets by comparing their zero-level-set surfaces....
Definition lsCompareChamfer.hpp:39
unsigned getNumSamplePoints() const
Get the number of sample surface points.
Definition lsCompareChamfer.hpp:329
void apply()
Apply the Chamfer distance calculation.
Definition lsCompareChamfer.hpp:104
T getMaxDistance() const
Get the maximum nearest-neighbor distance.
Definition lsCompareChamfer.hpp:323
T getBackwardDistance() const
Get the backward distance (average distance from sample to target).
Definition lsCompareChamfer.hpp:314
void setOutputMeshSample(SmartPointer< Mesh< T > > passedMesh)
Set output mesh for sample surface points with distance data.
Definition lsCompareChamfer.hpp:99
T getRMSChamferDistance() const
Get the RMS Chamfer distance.
Definition lsCompareChamfer.hpp:320
T getChamferDistance() const
Get the Chamfer distance (average of forward and backward).
Definition lsCompareChamfer.hpp:317
T getForwardDistance() const
Get the forward distance (average distance from target to sample).
Definition lsCompareChamfer.hpp:311
void setOutputMeshTarget(SmartPointer< Mesh< T > > passedMesh)
Set output mesh for target surface points with distance data.
Definition lsCompareChamfer.hpp:94
void setLevelSetTarget(SmartPointer< Domain< T, D > > passedLevelSet)
Set the target level set.
Definition lsCompareChamfer.hpp:84
unsigned getNumTargetPoints() const
Get the number of target surface points.
Definition lsCompareChamfer.hpp:326
void setLevelSetSample(SmartPointer< Domain< T, D > > passedLevelSet)
Set the sample level set.
Definition lsCompareChamfer.hpp:89
Compares critical dimensions (surface positions) between two level sets. Critical dimensions are defi...
Definition lsCompareCriticalDimensions.hpp:33
void apply()
Apply the comparison.
Definition lsCompareCriticalDimensions.hpp:197
std::vector< T > getAllDifferences() const
Get all valid results.
Definition lsCompareCriticalDimensions.hpp:309
void setOutputMesh(SmartPointer< Mesh< T > > passedMesh)
Set the output mesh where critical dimension locations will be stored.
Definition lsCompareCriticalDimensions.hpp:192
bool getCriticalDimensionResult(size_t index, T &positionTarget, T &positionSample, T &difference) const
Get a specific critical dimension result.
Definition lsCompareCriticalDimensions.hpp:259
size_t getNumCriticalDimensions() const
Get the number of critical dimensions compared.
Definition lsCompareCriticalDimensions.hpp:256
void addRange(int measureDimension, const std::array< T, D > &minBounds, const std::array< T, D > &maxBounds, bool findMaximum=true)
Add a generic range specification.
Definition lsCompareCriticalDimensions.hpp:154
void addYRange(T minY, T maxY, bool findMaximum=true)
Add a Y range to find maximum or minimum X position.
Definition lsCompareCriticalDimensions.hpp:177
void clearRanges()
Clear all range specifications.
Definition lsCompareCriticalDimensions.hpp:189
void setLevelSetTarget(SmartPointer< Domain< T, D > > passedLevelSet)
Definition lsCompareCriticalDimensions.hpp:145
T getMeanDifference() const
Get mean absolute difference across all valid critical dimensions.
Definition lsCompareCriticalDimensions.hpp:271
T getMaxDifference() const
Get maximum difference across all valid critical dimensions.
Definition lsCompareCriticalDimensions.hpp:284
void addXRange(T minX, T maxX, bool findMaximum=true)
Add an X range to find maximum or minimum Y position.
Definition lsCompareCriticalDimensions.hpp:165
T getRMSE() const
Get RMSE across all valid critical dimensions.
Definition lsCompareCriticalDimensions.hpp:295
void setLevelSetSample(SmartPointer< Domain< T, D > > passedLevelSet)
Definition lsCompareCriticalDimensions.hpp:149
Calculate distance measure between two level sets by comparing their SDF values on a narrow band....
Definition lsCompareNarrowBand.hpp:19
void setYRange(T minYRange, T maxYRange)
Set the y-coordinate range to restrict the comparison area.
Definition lsCompareNarrowBand.hpp:164
void setOutputMeshSquaredDifferences(bool value)
Set whether to output squared differences (true) or absolute differences (false).
Definition lsCompareNarrowBand.hpp:207
void setXRange(T minXRange, T maxXRange)
Set the x-coordinate range to restrict the comparison area.
Definition lsCompareNarrowBand.hpp:157
void setOutputMesh(SmartPointer< Mesh< T > > passedMesh, bool outputMeshSquaredDiffs=true)
Set the output mesh where difference values will be stored.
Definition lsCompareNarrowBand.hpp:199
void clearZRange()
Clear the z-range restriction.
Definition lsCompareNarrowBand.hpp:192
void setLevelSetTarget(SmartPointer< Domain< T, D > > passedLevelSet)
Definition lsCompareNarrowBand.hpp:148
T getRMSE() const
Calculate the root mean square error from previously computed values.
Definition lsCompareNarrowBand.hpp:387
void setLevelSetSample(SmartPointer< Domain< T, D > > passedLevelSet)
Definition lsCompareNarrowBand.hpp:152
unsigned getNumPoints() const
Return the number of points used in the comparison.
Definition lsCompareNarrowBand.hpp:384
void clearYRange()
Clear the y-range restriction.
Definition lsCompareNarrowBand.hpp:178
T getSumSquaredDifferences() const
Return the sum of squared differences calculated by apply().
Definition lsCompareNarrowBand.hpp:378
void apply()
Apply the comparison and calculate the sum of squared differences.
Definition lsCompareNarrowBand.hpp:212
void clearXRange()
Clear the x-range restriction.
Definition lsCompareNarrowBand.hpp:171
T getSumDifferences() const
Definition lsCompareNarrowBand.hpp:381
void setZRange(T minZRange, T maxZRange)
Set the z-coordinate range to restrict the comparison area.
Definition lsCompareNarrowBand.hpp:185
Calculate distance measure between two level sets by comparing their SDF values on a sparse field....
Definition lsCompareSparseField.hpp:34
unsigned getNumPoints() const
Return the number of points used in the comparison.
Definition lsCompareSparseField.hpp:398
T getRMSE() const
Calculate the root mean square error from previously computed values.
Definition lsCompareSparseField.hpp:404
void setXRange(T minXRange, T maxXRange)
Set the x-coordinate range to restrict the comparison area.
Definition lsCompareSparseField.hpp:155
void setExpandedLevelSetWidth(int width)
Set the expansion width for the expanded level set This value will be used if the expanded level set ...
Definition lsCompareSparseField.hpp:209
void setOutputMesh(SmartPointer< Mesh< T > > passedMesh)
Set the output mesh where difference values will be stored.
Definition lsCompareSparseField.hpp:197
void setLevelSetIterated(SmartPointer< Domain< T, D > > passedLevelSet)
Definition lsCompareSparseField.hpp:150
unsigned getNumSkippedPoints() const
Return the number of skipped points during the comparison.
Definition lsCompareSparseField.hpp:401
void setYRange(T minYRange, T maxYRange)
Set the y-coordinate range to restrict the comparison area.
Definition lsCompareSparseField.hpp:162
void setLevelSetExpanded(SmartPointer< Domain< T, D > > passedLevelSet)
Definition lsCompareSparseField.hpp:146
void setFillIteratedWithDistances(bool fill)
Set whether to fill the iterated level set with distances.
Definition lsCompareSparseField.hpp:202
T getSumSquaredDifferences() const
Return the sum of squared differences calculated by apply().
Definition lsCompareSparseField.hpp:392
T getSumDifferences() const
Return the sum of differences calculated by apply().
Definition lsCompareSparseField.hpp:395
void clearZRange()
Clear the z-range restriction.
Definition lsCompareSparseField.hpp:190
void clearYRange()
Clear the y-range restriction.
Definition lsCompareSparseField.hpp:176
void apply()
Apply the comparison and calculate the sum of squared differences.
Definition lsCompareSparseField.hpp:220
void clearXRange()
Clear the x-range restriction.
Definition lsCompareSparseField.hpp:169
void setZRange(T minZRange, T maxZRange)
Set the z-coordinate range to restrict the comparison area.
Definition lsCompareSparseField.hpp:183
Computes an estimate of the volume/area where two level sets differ. The volume is calculated by iter...
Definition lsCompareVolume.hpp:25
void setOutputMesh(SmartPointer< Mesh< T > > passedMesh)
Set the output mesh where difference areas will be stored for visualization. Each cell in the mesh wi...
Definition lsCompareVolume.hpp:171
unsigned long int getCellCount() const
Returns the number of cells where the level sets differ.
Definition lsCompareVolume.hpp:193
void setXRangeAndIncrement(hrleIndexType minXRange, hrleIndexType maxXRange, unsigned short int Xincrement)
Sets the x-range and custom increment value.
Definition lsCompareVolume.hpp:141
void setLevelSetTarget(SmartPointer< Domain< T, D > > passedLevelSet)
Sets the target level set.
Definition lsCompareVolume.hpp:126
void apply()
Computes the volume/area difference between the two level sets.
Definition lsCompareVolume.hpp:202
double getAreaMismatch() const
Alias for getVolumeMismatch for 2D compatibility.
Definition lsCompareVolume.hpp:181
void setYRangeAndIncrement(hrleIndexType minYRange, hrleIndexType maxYRange, unsigned short int Yincrement)
Sets the y-range and custom increment value.
Definition lsCompareVolume.hpp:150
void setZRangeAndIncrement(hrleIndexType minZRange, hrleIndexType maxZRange, unsigned short int Zincrement)
Sets the z-range and custom increment value.
Definition lsCompareVolume.hpp:159
void setDefaultIncrement(unsigned short int increment)
Set default increment value.
Definition lsCompareVolume.hpp:136
double getCustomVolumeMismatch() const
Returns the computed volume/area mismatch, with custom increments applied.
Definition lsCompareVolume.hpp:184
unsigned long int getCustomCellCount() const
Returns the number of cells where the level sets differ, with custom increments applied.
Definition lsCompareVolume.hpp:197
double getVolumeMismatch() const
Returns the computed volume/area mismatch.
Definition lsCompareVolume.hpp:176
void setLevelSetSample(SmartPointer< Domain< T, D > > passedLevelSet)
Sets the sample level set.
Definition lsCompareVolume.hpp:131
double getCustomAreaMismatch() const
Alias for getCustomVolumeMismatch for 2D compatibility.
Definition lsCompareVolume.hpp:190
This algorithm creates a convex hull mesh from a point cloud. This is done using the gift wrapping ap...
Definition lsConvexHull.hpp:23
void apply()
Definition lsConvexHull.hpp:332
void setMesh(SmartPointer< Mesh< T > > passedMesh)
Definition lsConvexHull.hpp:326
void setPointCloud(SmartPointer< PointCloud< T, D > > passedPointCloud)
Definition lsConvexHull.hpp:328
Definition lsGeometricAdvectDistributions.hpp:185
T getSignedDistance(const Vec3D< viennahrle::CoordType > &initial, const Vec3D< viennahrle::CoordType > &candidate, unsigned long pointId) const override
Returns the signed distance of a point relative to the distributions center. This is the signed manha...
Definition lsGeometricAdvectDistributions.hpp:198
std::array< viennahrle::CoordType, 6 > getBounds() const override
Sets bounds to the bounding box of the distribution.
Definition lsGeometricAdvectDistributions.hpp:242
Class describing a square box from one coordinate to another.
Definition lsGeometries.hpp:100
This class detects features of the level set function. This class offers two methods to determine fea...
Definition lsDetectFeatures.hpp:26
void apply()
Execute the algorithm.
Definition lsDetectFeatures.hpp:64
void setDetectionThreshold(T threshold)
Definition lsDetectFeatures.hpp:51
void setDetectionMethod(FeatureDetectionEnum passedMethod)
Set which algorithm to use to detect features. The curvature-based algorithm should always be preferr...
Definition lsDetectFeatures.hpp:59
Class containing all information about the level set, including the dimensions of the domain,...
Definition lsDomain.hpp:27
void clearMetaData()
Definition lsDomain.hpp:163
void deepCopy(const SmartPointer< Domain< T, D > > passedDomain)
copy all values of "passedDomain" to this Domain
Definition lsDomain.hpp:124
unsigned getNumberOfSegments() const
returns the number of segments, the levelset is split into. This is useful for algorithm parallelisat...
Definition lsDomain.hpp:153
void print(std::ostream &out=std::cout)
prints basic information and all memebers of the levelset structure
Definition lsDomain.hpp:178
int getLevelSetWidth() const
Definition lsDomain.hpp:158
unsigned getNumberOfPoints() const
returns the number of defined points
Definition lsDomain.hpp:156
void setLevelSetWidth(int width)
Definition lsDomain.hpp:160
Expands the levelSet to the specified number of layers. The largest value in the levelset is thus wid...
Definition lsExpand.hpp:17
void apply()
Apply the expansion to the specified width.
Definition lsExpand.hpp:44
void setWidth(int passedWidth)
Set how far the level set should be extended. Points with value width*0.5 will be added by this algor...
Definition lsExpand.hpp:37
void setLevelSet(SmartPointer< Domain< T, D > > passedlsDomain)
Definition lsExpand.hpp:31
Import the regular grid, on which the level set values are defined, from an explicit Mesh<>....
Definition lsFromMesh.hpp:16
void setMesh(const SmartPointer< Mesh< T > > passedMesh)
Definition lsFromMesh.hpp:34
void setSortPointList(bool passedSortPointList)
Definition lsFromMesh.hpp:36
void apply()
Definition lsFromMesh.hpp:40
Construct a level set from an explicit mesh.
Definition lsFromSurfaceMesh.hpp:15
void setRemoveBoundaryTriangles(bool passedRemoveBoundaryTriangles)
Set whether all triangles outside the domain should be ignored (=true) or whether boundary conditions...
Definition lsFromSurfaceMesh.hpp:227
void setLevelSet(SmartPointer< Domain< T, D > > passedLevelSet)
Definition lsFromSurfaceMesh.hpp:218
void apply()
Definition lsFromSurfaceMesh.hpp:243
void setMesh(SmartPointer< Mesh< T > > passedMesh)
Definition lsFromSurfaceMesh.hpp:222
This class creates a level set from a tetrahedral mesh. If the mesh contains a scalar data array call...
Definition lsFromVolumeMesh.hpp:22
typename Domain< T, D >::GridType GridType
Definition lsFromVolumeMesh.hpp:26
void apply()
Definition lsFromVolumeMesh.hpp:56
void setMesh(SmartPointer< Mesh< T > > passedMesh)
Definition lsFromVolumeMesh.hpp:48
void setGrid(const GridType &passedGrid)
Definition lsFromVolumeMesh.hpp:43
void setRemoveBoundaryTriangles(bool passedRemoveBoundaryTriangles)
Definition lsFromVolumeMesh.hpp:50
Base class for distributions used by lsGeometricAdvect. All functions are pure virtual and must be im...
Definition lsGeometricAdvectDistributions.hpp:15
virtual void prepare(SmartPointer< Domain< T, D > > domain)
Definition lsGeometricAdvectDistributions.hpp:43
virtual bool isInside(const Vec3D< viennahrle::CoordType > &initial, const Vec3D< viennahrle::CoordType > &candidate, double eps) const
Quick check whether a point relative to the distributions center is inside the distribution....
Definition lsGeometricAdvectDistributions.hpp:23
virtual T getSignedDistance(const Vec3D< viennahrle::CoordType > &initial, const Vec3D< viennahrle::CoordType > &candidate, unsigned long pointId) const =0
Returns the signed distance of a point relative to the distributions center. This is the signed manha...
virtual void finalize()
Definition lsGeometricAdvectDistributions.hpp:44
virtual std::array< viennahrle::CoordType, 6 > getBounds() const =0
Sets bounds to the bounding box of the distribution.
This class advects the level set according to a given distribution. This distribution is overlayed at...
Definition lsGeometricAdvect.hpp:35
void setLevelSet(SmartPointer< Domain< T, D > > passedLevelSet)
Set the levelset which should be advected.
Definition lsGeometricAdvect.hpp:76
void apply()
Perform geometrical advection.
Definition lsGeometricAdvect.hpp:95
void setAdvectionDistribution(SmartPointer< GeometricAdvectDistribution< T, D > > passedDist)
Set which advection distribution to use. Must be derived from GeometricAdvectDistribution.
Definition lsGeometricAdvect.hpp:82
Create level sets describing basic geometric forms.
Definition lsMakeGeometry.hpp:27
void setIgnoreBoundaryConditions(bool passedIgnoreBoundaryConditions)
Ignore boundary conditions, meaning the parts of the generated geometry which are outside of the doma...
Definition lsMakeGeometry.hpp:127
void apply()
Definition lsMakeGeometry.hpp:144
void setLevelSet(SmartPointer< Domain< T, D > > passedlsDomain)
Definition lsMakeGeometry.hpp:87
void setGeometry(SmartPointer< Sphere< T, D > > passedSphere)
Set sphere as geometry to be created in the level set.
Definition lsMakeGeometry.hpp:92
This class is used to mark points of the level set which are enclosed in a void.
Definition lsMarkVoidPoints.hpp:28
void setLevelSet(SmartPointer< Domain< T, D > > passedlsDomain)
Definition lsMarkVoidPoints.hpp:95
void setReverseVoidDetection(bool passedReverseVoidDetection)
Set whether the "top" level set should be the most positive(default) connected chain of level set val...
Definition lsMarkVoidPoints.hpp:103
void apply()
Definition lsMarkVoidPoints.hpp:154
void setSaveComponentIds(bool scid)
Set whether the connected component IDs used to generate the void points should be saved....
Definition lsMarkVoidPoints.hpp:150
void setDetectLargestSurface(bool passedDetect)
Set whether the number of points of one connected surface should be used to detect void points....
Definition lsMarkVoidPoints.hpp:113
void setVoidTopSurface(VoidTopSurfaceEnum topSurface)
Set which connected component to use as the top surface and mark all other components as void points.
Definition lsMarkVoidPoints.hpp:119
std::size_t getNumberOfComponents() const
Definition lsMarkVoidPoints.hpp:152
This class holds an explicit mesh, which is always given in 3 dimensions. If it describes a 2D mesh,...
Definition lsMesh.hpp:21
static auto New(Args &&...args)
Definition lsOxidationMask.hpp:2266
Propagates the volume expansion generated at the Si/SiO2 interface through the oxide as a Cartesian-g...
Definition lsOxidationDeformation.hpp:60
std::array< T, 9 > getStressTensor(const Vec3D< T > &coordinate) const
Definition lsOxidationDeformation.hpp:529
std::size_t getNumberOfSolutionNodes() const
Definition lsOxidationDeformation.hpp:573
void setMaskInterface(SmartPointer< Domain< T, D > > passedInterface, int passedMaskSign=1)
Definition lsOxidationDeformation.hpp:240
T getResidual() const
Definition lsOxidationDeformation.hpp:550
void setReactionInterface(SmartPointer< Domain< T, D > > passedInterface)
Definition lsOxidationDeformation.hpp:228
unsigned getIterations() const
Definition lsOxidationDeformation.hpp:549
void markGeometryChanged()
Definition lsOxidationDeformation.hpp:303
void setDeformationParameters(OxidationDeformationParameters passedParameters)
Definition lsOxidationDeformation.hpp:277
static auto New(Args &&...args)
Definition lsOxidationDeformation.hpp:211
T getVonMisesStress(const Vec3D< T > &coordinate) const
Definition lsOxidationDeformation.hpp:539
void apply()
Definition lsOxidationDeformation.hpp:308
void clearSolveBounds()
Definition lsOxidationDeformation.hpp:297
void setOxidationParameters(OxidationParameters passedParameters)
Definition lsOxidationDeformation.hpp:271
void writeFieldsToLevelSet()
Write velocity (Vec3D) and viscoelastic stress history (3 tensor-row vectors) into ambientInterface->...
Definition lsOxidationDeformation.hpp:590
void setMaskVelocityField(SmartPointer< VelocityField< T > > passedVelocityField)
Definition lsOxidationDeformation.hpp:255
void clearMaskVelocityField()
Definition lsOxidationDeformation.hpp:260
std::array< T, 9 > getStrainRateTensor(const Vec3D< T > &coordinate) const
Definition lsOxidationDeformation.hpp:519
void setOxideSigns(int passedReactionSign, int passedAmbientSign)
Definition lsOxidationDeformation.hpp:282
void setDiffusionField(SmartPointer< OxidationDiffusion< T, D > > passedDiffusionField)
Definition lsOxidationDeformation.hpp:265
T getPressure(const Vec3D< T > &coordinate) const
Definition lsOxidationDeformation.hpp:502
void setAmbientInterface(SmartPointer< Domain< T, D > > passedInterface)
Definition lsOxidationDeformation.hpp:234
void clearMaskInterface()
Definition lsOxidationDeformation.hpp:248
T avgExpansionSpeed()
Definition lsOxidationDeformation.hpp:574
T getStrainTrace(const Vec3D< T > &coordinate) const
Definition lsOxidationDeformation.hpp:510
Vec3D< T > getVelocity(const Vec3D< T > &coordinate) const
Definition lsOxidationDeformation.hpp:492
Solves the oxidant diffusion step of the Suvorov et al. (10.1007/s10825-006-0003-z) oxidation model o...
Definition lsOxidationDiffusion.hpp:92
void markGeometryChanged()
Call after any in-place modification of the level sets (e.g. after ls::Advect) so that the next apply...
Definition lsOxidationDiffusion.hpp:214
void setConcentrationCache(std::unordered_map< std::size_t, T > cache)
Definition lsOxidationDiffusion.hpp:433
void setMaskInterface(SmartPointer< Domain< T, D > > passedInterface, int passedMaskSign=1)
Definition lsOxidationDiffusion.hpp:231
T getEffectiveReactionRate(const Vec3D< T > &coordinate) const
Definition lsOxidationDiffusion.hpp:252
void markSolved()
Mark the current solution as valid without re-solving. Call this before any parallel advection (lsAdv...
Definition lsOxidationDiffusion.hpp:448
const std::unordered_map< std::size_t, T > & getConcentrationCache() const
Definition lsOxidationDiffusion.hpp:429
T getResidual() const
Definition lsOxidationDiffusion.hpp:418
void apply()
Definition lsOxidationDiffusion.hpp:305
std::size_t getNumberOfSolutionNodes() const
Definition lsOxidationDiffusion.hpp:421
void setParameters(OxidationParameters passedParameters)
Definition lsOxidationDiffusion.hpp:245
void clearSolveBounds()
Definition lsOxidationDiffusion.hpp:299
void clearPressureField()
Definition lsOxidationDiffusion.hpp:259
static auto New(Args &&...args)
Definition lsOxidationDiffusion.hpp:208
void setSolveBounds(const IndexType &passedMinIndex, const IndexType &passedMaxIndex)
Restrict the dense Cartesian diffusion solve to a finite index box. This is useful for level sets wit...
Definition lsOxidationDiffusion.hpp:290
T getScalarVelocityFromSample(const ReactionBoundarySample &sample) const
Absolute scalar velocity derived from an already-computed boundary sample, avoiding a second call to ...
Definition lsOxidationDiffusion.hpp:517
void setPressure(const IndexType &index, T pressure)
Definition lsOxidationDiffusion.hpp:264
unsigned getIterations() const
Definition lsOxidationDiffusion.hpp:417
void setAmbientInterface(SmartPointer< Domain< T, D > > passedInterface)
Definition lsOxidationDiffusion.hpp:225
OxidationParameters getParameters() const
Definition lsOxidationDiffusion.hpp:250
void setReactionInterface(SmartPointer< Domain< T, D > > passedInterface)
Definition lsOxidationDiffusion.hpp:219
void setOxideSigns(int passedReactionSign, int passedAmbientSign)
Set signs defining the oxide band. A node is inside oxide if reactionSign * reactionPhi >= 0 and ambi...
Definition lsOxidationDiffusion.hpp:282
ReactionBoundarySample getReactionBoundarySample(const Vec3D< T > &coordinate) const
Return the reaction boundary sample for the grid node nearest to coordinate. Used by the deformation ...
Definition lsOxidationDiffusion.hpp:508
void clearMaskInterface()
Definition lsOxidationDiffusion.hpp:239
T getConcentration(const Vec3D< T > &coordinate) const
Definition lsOxidationDiffusion.hpp:387
void writePersistentFields()
Convenience wrapper: persist both concentration and pressure in one call.
Definition lsOxidationDiffusion.hpp:499
Vector velocity field for a compliant oxidation mask driven by solved oxide traction....
Definition lsOxidationMask.hpp:91
void apply()
Definition lsOxidationMask.hpp:268
void setMaskInterface(SmartPointer< Domain< T, D > > passedMaskInterface, int passedMaskSign=1)
Definition lsOxidationMask.hpp:221
std::size_t getNumberOfSolutionNodes() const
Definition lsOxidationMask.hpp:260
void setAmbientInterface(SmartPointer< Domain< T, D > > passedAmbientInterface, int passedAmbientSign=-1)
Provide the SiO₂/ambient interface so that contact faces can be detected on any mask face that border...
Definition lsOxidationMask.hpp:232
std::size_t getNumberOfFixedNodes() const
Definition lsOxidationMask.hpp:262
static SmartPointer< OxidationMaskBending > New(SmartPointer< OxidationDeformation< T, D > > passedDeformation, OxidationMaskParameters passedParameters={})
Definition lsOxidationMask.hpp:206
T getLastApplyVelocityChange() const
Definition lsOxidationMask.hpp:263
unsigned getIterations() const
Definition lsOxidationMask.hpp:258
std::size_t getNumberOfContactNodes() const
Definition lsOxidationMask.hpp:261
void writeFieldsToLevelSet()
Write mask bending velocity into maskInterface->getPointData() so that lsInterior + lsAdvect carry it...
Definition lsOxidationMask.hpp:424
OxidationMaskParameters getParameters() const
Definition lsOxidationMask.hpp:257
void clearSolveBounds()
Definition lsOxidationMask.hpp:252
void setParameters(OxidationMaskParameters passedParameters)
Definition lsOxidationMask.hpp:239
T getResidual() const
Definition lsOxidationMask.hpp:259
Iterates diffusion, oxide deformation, and pressure-dependent reaction-rate feedback on the shared Ca...
Definition lsOxidationModel.hpp:21
void setDeformationField(SmartPointer< OxidationDeformation< T, D > > passedDeformationField)
Definition lsOxidationModel.hpp:55
static auto New(Args &&...args)
Definition lsOxidationModel.hpp:46
T getResidual() const
Definition lsOxidationModel.hpp:245
void setDiffusionField(SmartPointer< OxidationDiffusion< T, D > > passedDiffusionField)
Definition lsOxidationModel.hpp:50
unsigned getIterations() const
Definition lsOxidationModel.hpp:244
void clearSolveBounds()
Definition lsOxidationModel.hpp:71
void apply()
Definition lsOxidationModel.hpp:73
void setParameters(OxidationCouplingParameters passedParameters)
Definition lsOxidationModel.hpp:60
Unified oxidation time-step orchestrator.
Definition lsOxidation.hpp:151
T getMaskCouplingResidual() const
Definition lsOxidation.hpp:295
void setMaskCouplingTolerance(T tolerance)
Definition lsOxidation.hpp:255
void setCouplingParameters(OxidationCouplingParameters params)
Definition lsOxidation.hpp:238
void setGpuPreconditioner(GpuPreconditioner preconditioner)
Definition lsOxidation.hpp:220
static auto New(Args &&...args)
Definition lsOxidation.hpp:215
SmartPointer< OxidationDeformation< T, D > > getDeformationField() const
Return the deformation field populated by the most recent apply() call.
Definition lsOxidation.hpp:282
void setDeformationParameters(OxidationDeformationParameters params)
Definition lsOxidation.hpp:235
T applyCFLLimited(T requestedTime, T cflFactor)
Execute one CFL-limited oxidation step; returns the actual time advanced.
Definition lsOxidation.hpp:304
void setSpatialScheme(SpatialSchemeEnum scheme)
Set the spatial integration scheme for all advections.
Definition lsOxidation.hpp:246
void setMaskInterface(SmartPointer< Domain< T, D > > mask)
Definition lsOxidation.hpp:228
void setMaskParameters(OxidationMaskParameters params)
Definition lsOxidation.hpp:241
unsigned getMaskCouplingIterations() const
Definition lsOxidation.hpp:291
void setGpuMode(GpuMode mode)
Definition lsOxidation.hpp:219
void setSiInterface(SmartPointer< Domain< T, D > > si)
Definition lsOxidation.hpp:224
void setMaskCouplingIterations(unsigned iterations)
Definition lsOxidation.hpp:251
SmartPointer< OxidationDiffusion< T, D > > getDiffusionField() const
Return the diffusion field populated by the most recent apply() call.
Definition lsOxidation.hpp:277
SmartPointer< OxidationMaskBending< T, D > > getMaskBendingField() const
Return the mask bending field (null when no mask is set).
Definition lsOxidation.hpp:287
void setAmbientInterface(SmartPointer< Domain< T, D > > ambient)
Definition lsOxidation.hpp:225
void setTemporalScheme(TemporalSchemeEnum scheme)
Set the temporal integration scheme for all advections.
Definition lsOxidation.hpp:249
void setOxidationParameters(OxidationParameters params)
Definition lsOxidation.hpp:232
void apply(T advectionTime)
Execute one oxidation time step of duration advectionTime.
Definition lsOxidation.hpp:301
T getLastMaxVelocity() const
Maximum interface velocity (µm/hr) from the most recent CFL-limited step.
Definition lsOxidation.hpp:298
Class describing a plane via a point in it and the plane normal.
Definition lsGeometries.hpp:42
Class describing a point cloud, which can be used to create geometries from its convex hull mesh.
Definition lsGeometries.hpp:145
void insertNextPoint(T *newPoint)
Definition lsGeometries.hpp:154
Removes all level set points, which do not have at least one oppositely signed neighbour (Meaning the...
Definition lsPrune.hpp:17
void apply()
removes all grid points, which do not have at least one opposite signed neighbour returns the number ...
Definition lsPrune.hpp:74
void setLevelSet(SmartPointer< Domain< T, D > > passedlsDomain)
Definition lsPrune.hpp:59
Definition lsReader.hpp:13
void setLevelSet(SmartPointer< Domain< T, D > > passedLevelSet)
Definition lsReader.hpp:26
void apply()
Definition lsReader.hpp:35
void setFileName(std::string passedFileName)
set file name for file to write
Definition lsReader.hpp:31
Reduce the level set size to the specified width. This means all level set points with value <= 0....
Definition lsReduce.hpp:14
void apply()
Reduces the leveleSet to the specified number of layers. The largest value in the levelset is thus wi...
Definition lsReduce.hpp:55
void setLevelSet(SmartPointer< Domain< T, D > > passedlsDomain)
Definition lsReduce.hpp:32
void setWidth(int passedWidth)
Set which level set points should be kept. All points with a level set value >0.5*width will be remov...
Definition lsReduce.hpp:39
void setNoNewSegment(bool passedNoNewSegment)
Set whether to segment the level set after algorithm is finished. This means points will be evenly di...
Definition lsReduce.hpp:44
This algorithm can be used to remove all LS values which are not part of a so-called top surface....
Definition lsRemoveStrayPoints.hpp:17
void setVoidTopSurface(VoidTopSurfaceEnum topSurface)
Set how the algorithm should pick the surface which will not be removed. Defaults to the surface with...
Definition lsRemoveStrayPoints.hpp:33
void apply()
Definition lsRemoveStrayPoints.hpp:37
void setLevelSet(SmartPointer< Domain< T, D > > passedLevelSet)
Definition lsRemoveStrayPoints.hpp:27
Concrete implementation of GeometricAdvectDistribution for a spherical advection distribution.
Definition lsGeometricAdvectDistributions.hpp:50
bool isInside(const Vec3D< viennahrle::CoordType > &initial, const Vec3D< viennahrle::CoordType > &candidate, double eps) const override
Quick check whether a point relative to the distributions center is inside the distribution....
Definition lsGeometricAdvectDistributions.hpp:60
std::array< viennahrle::CoordType, 6 > getBounds() const override
Sets bounds to the bounding box of the distribution.
Definition lsGeometricAdvectDistributions.hpp:110
T getSignedDistance(const Vec3D< viennahrle::CoordType > &initial, const Vec3D< viennahrle::CoordType > &candidate, unsigned long) const override
Returns the signed distance of a point relative to the distributions center. This is the signed manha...
Definition lsGeometricAdvectDistributions.hpp:75
Class describing a sphere via origin and radius.
Definition lsGeometries.hpp:15
This class creates a mesh from the level set with all grid points with a level set value <= 0....
Definition lsToDiskMesh.hpp:24
void clearLevelSets()
Definition lsToDiskMesh.hpp:83
void setMesh(SmartPointer< Mesh< N > > passedMesh)
Definition lsToDiskMesh.hpp:70
void setMaterialMap(SmartPointer< MaterialMap > passedMaterialMap)
Definition lsToDiskMesh.hpp:77
void apply()
Definition lsToDiskMesh.hpp:85
void insertNextLevelSet(SmartPointer< Domain< T, D > > passedLevelSet)
Pushes the passed level set to the back of the list of level sets.
Definition lsToDiskMesh.hpp:66
void setMaxValue(const T passedMaxValue)
Definition lsToDiskMesh.hpp:81
void setLevelSet(SmartPointer< Domain< T, D > > passedLevelSet)
Definition lsToDiskMesh.hpp:61
Extracts a hull (surface outline) mesh from a stack of level sets using ToMultiSurfaceMesh with close...
Definition lsToHullMesh.hpp:22
void setMaterialMap(SmartPointer< MaterialMap > passedMaterialMap)
Definition lsToHullMesh.hpp:431
void setMesh(SmartPointer< Mesh< T > > passedMesh)
Definition lsToHullMesh.hpp:418
void clearLevelSets()
Definition lsToHullMesh.hpp:425
void insertNextLevelSet(SmartPointer< Domain< T, D > > levelSet)
Level sets wrapping other level sets have to be inserted last.
Definition lsToHullMesh.hpp:421
void apply()
Definition lsToHullMesh.hpp:460
void setSharpCorners(bool passedSharpCorners)
Definition lsToHullMesh.hpp:427
void setBottomExtension(T extension)
Definition lsToHullMesh.hpp:435
Extract the regular grid, on which the level set values are defined, to an explicit Mesh<>....
Definition lsToMesh.hpp:19
void setOnlyDefined(bool passedOnlyDefined)
Definition lsToMesh.hpp:43
void setLevelSet(SmartPointer< Domain< T, D > > passedlsDomain)
Definition lsToMesh.hpp:37
void apply()
Definition lsToMesh.hpp:49
void setOnlyActive(bool passedOnlyActive)
Definition lsToMesh.hpp:47
void setMesh(SmartPointer< Mesh< T > > passedMesh)
Definition lsToMesh.hpp:41
Definition lsToMultiSurfaceMesh.hpp:11
void apply() override
Definition lsToMultiSurfaceMesh.hpp:622
void setMaterialMap(SmartPointer< MaterialMap > passedMaterialMap)
Definition lsToMultiSurfaceMesh.hpp:618
void clearLevelSets()
Definition lsToMultiSurfaceMesh.hpp:616
void insertNextLevelSet(SmartPointer< lsDomainType > passedLevelSet)
Definition lsToMultiSurfaceMesh.hpp:612
Extract an explicit Mesh<> instance from an lsDomain. The interface is then described by explicit sur...
Definition lsToSurfaceMesh.hpp:25
void setMesh(SmartPointer< Mesh< T > > passedMesh)
Definition lsToSurfaceMesh.hpp:96
void setUpdatePointData(bool update)
Definition lsToSurfaceMesh.hpp:98
void setSharpCorners(bool check)
Definition lsToSurfaceMesh.hpp:100
virtual void apply()
Definition lsToSurfaceMesh.hpp:102
void setLevelSet(SmartPointer< lsDomainType > passedlsDomain)
Definition lsToSurfaceMesh.hpp:91
Creates a mesh, which consists only of quads/hexas for completely filled grid cells in the level set....
Definition lsToVoxelMesh.hpp:20
void setMesh(SmartPointer< Mesh< T > > passedMesh)
Definition lsToVoxelMesh.hpp:76
void clearLevelSets()
Definition lsToVoxelMesh.hpp:74
void insertNextLevelSet(SmartPointer< Domain< T, D > > passedLevelSet)
Push level set to the list of level sets used for output. If more than one are specified,...
Definition lsToVoxelMesh.hpp:70
void apply()
Definition lsToVoxelMesh.hpp:82
Abstract class defining the interface for the velocity field used during advection using lsAdvect.
Definition lsVelocityField.hpp:11
Definition lsWriter.hpp:13
void setFileName(std::string passedFileName)
set file name for file to write
Definition lsWriter.hpp:31
void setLevelSet(SmartPointer< Domain< T, D > > passedLevelSet)
Definition lsWriter.hpp:26
void apply()
Definition lsWriter.hpp:35
Definition lsAdvect.hpp:41
@ Gpu
Always use GPU; fail if unavailable or unsuccessful.
Definition lsOxidationDiffusion.hpp:28
@ Cpu
Always use CPU (default).
Definition lsOxidationDiffusion.hpp:27
FeatureDetectionEnum
Definition lsDetectFeatures.hpp:16
BooleanOperationEnum
Enumeration for the different types of boolean operations which are supported. When INVERT,...
Definition lsBooleanOperation.hpp:27
@ ILU0
Definition lsOxidationDiffusion.hpp:35
@ Jacobi
Definition lsOxidationDiffusion.hpp:35
CurvatureEnum
Definition lsCalculateCurvatures.hpp:15
void bindApi(py::module &module)
Definition pyWrap.hpp:248
PYBIND11_DECLARE_HOLDER_TYPE(TemplateType, SmartPointer< TemplateType >)
void bindOxidationSharedTypes(py::module &module)
Definition pyWrap.hpp:94
T ambientLiftRatio
Definition lsOxidation.hpp:29
T siliconRecession
Definition lsOxidation.hpp:26
T relativeError
Definition lsOxidation.hpp:30
unsigned samples
Definition lsOxidation.hpp:31
T ambientLift
Definition lsOxidation.hpp:27
T expectedAmbientLift
Definition lsOxidation.hpp:28
Definition lsOxidationModel.hpp:13
double tolerance
Definition lsOxidationModel.hpp:15
double relaxation
Definition lsOxidationModel.hpp:16
unsigned maxIterations
Definition lsOxidationModel.hpp:14
Parameters for the Cartesian-grid oxide deformation model.
Definition lsOxidationDeformation.hpp:18
double viscosity
Definition lsOxidationDeformation.hpp:19
unsigned stokesIterations
Definition lsOxidationDeformation.hpp:30
double tolerance
Definition lsOxidationDeformation.hpp:33
unsigned harmonicIterations
Definition lsOxidationDeformation.hpp:27
double shearModulus
Definition lsOxidationDeformation.hpp:24
double stressRelaxationTime
Definition lsOxidationDeformation.hpp:25
double relaxation
Definition lsOxidationDeformation.hpp:34
double minMechanicsBoundaryDistance
Definition lsOxidationDeformation.hpp:23
double bulkModulus
Definition lsOxidationDeformation.hpp:20
unsigned mechanicsIterations
Definition lsOxidationDeformation.hpp:28
unsigned pressureIterations
Definition lsOxidationDeformation.hpp:29
double pressureTolerance
Definition lsOxidationDeformation.hpp:22
double mechanicsTolerance
Definition lsOxidationDeformation.hpp:31
double stressTimeStep
Definition lsOxidationDeformation.hpp:26
double stokesTolerance
Definition lsOxidationDeformation.hpp:32
double pressureRelaxation
Definition lsOxidationDeformation.hpp:35
int material
Definition lsOxidationDeformation.hpp:38
double ambientPressure
Definition lsOxidationDeformation.hpp:21
std::size_t maxGridPoints
Definition lsOxidationDeformation.hpp:37
Sub-grid accurate sample of the reaction boundary crossing closest to a given grid node....
Definition lsOxidationDiffusion.hpp:183
Definition lsOxidationMask.hpp:17
double creepActivationEnergy
Definition lsOxidationMask.hpp:37
int anchorBoundarySide
Definition lsOxidationMask.hpp:80
int contactMode
Definition lsOxidationMask.hpp:30
std::size_t maxGridPoints
Definition lsOxidationMask.hpp:73
unsigned anchorBoundaryLayers
Definition lsOxidationMask.hpp:81
double minBoundaryDistance
Definition lsOxidationMask.hpp:71
double referenceViscosity
Definition lsOxidationMask.hpp:36
double contactReleaseFraction
Definition lsOxidationMask.hpp:61
double multigridSmootherOmega
Definition lsOxidationMask.hpp:65
int material
Definition lsOxidationMask.hpp:74
double poissonRatio
Definition lsOxidationMask.hpp:45
double referenceTemperature
Definition lsOxidationMask.hpp:35
int anchorBoundaryDirection
Definition lsOxidationMask.hpp:79
double tolerance
Definition lsOxidationMask.hpp:66
unsigned maxIterations
Definition lsOxidationMask.hpp:72
double youngModulus
Definition lsOxidationMask.hpp:40
bool unilateralContact
Definition lsOxidationMask.hpp:48
double relaxation
Definition lsOxidationMask.hpp:51
double temperature
Definition lsOxidationMask.hpp:34
double contactLoadRelaxation
Definition lsOxidationMask.hpp:56
Parameters for the steady oxidant diffusion model used by OxidationDiffusion.
Definition lsOxidationDiffusion.hpp:39
double maskConcentration
Definition lsOxidationDiffusion.hpp:66
double maskTransferCoefficient
Definition lsOxidationDiffusion.hpp:65
double transferCoefficient
Definition lsOxidationDiffusion.hpp:42
double temperature
Definition lsOxidationDiffusion.hpp:51
double minBoundaryDistance
Definition lsOxidationDiffusion.hpp:67
double relaxation
Definition lsOxidationDiffusion.hpp:70
Vec3D< double > crystalAxis
Definition lsOxidationDiffusion.hpp:63
double reactionActivationVolume
Definition lsOxidationDiffusion.hpp:52
double diffusionActivationVolume
Definition lsOxidationDiffusion.hpp:57
double reactionRateRatio111
Definition lsOxidationDiffusion.hpp:62
double diffusionCoefficient
Definition lsOxidationDiffusion.hpp:40
int material
Definition lsOxidationDiffusion.hpp:72
double velocitySign
Definition lsOxidationDiffusion.hpp:46
double reactionRate
Definition lsOxidationDiffusion.hpp:41
double oxidantMoleculeDensity
Definition lsOxidationDiffusion.hpp:44
double equilibriumConcentration
Definition lsOxidationDiffusion.hpp:43
double referencePressure
Definition lsOxidationDiffusion.hpp:53
double tolerance
Definition lsOxidationDiffusion.hpp:69
std::size_t maxGridPoints
Definition lsOxidationDiffusion.hpp:71
double expansionCoefficient
Definition lsOxidationDiffusion.hpp:45
unsigned maxIterations
Definition lsOxidationDiffusion.hpp:68
static OxidationMaskParameters siliconNitrideMask1000C()
LPCVD Si3N4 mask creep at 1000 °C (Hu 1991; Senez et al. 1994). referenceViscosity = 5×10¹¹ Pa·hr at ...
Definition lsOxidationPresets.hpp:63
static OxidationDeformationParameters oxideMechanics1000C(double timeStep)
Thermal SiO2 viscoelastic mechanics at 1000 °C. Viscosity ~1×10¹⁰ Pa·hr (Irene 1978),...
Definition lsOxidationPresets.hpp:42
static OxidationParameters wet1000CDealGrove100()
Wet oxidation at 1000 °C (Deal-Grove linear-parabolic coefficients). B/2 = D_eff = 0....
Definition lsOxidationPresets.hpp:25