Skip to content

Commit 5c6c721

Browse files
committed
Expose SLLF setMaxDissipation function in Python bindings
1 parent 832fe68 commit 5c6c721

File tree

4 files changed

+37
-19
lines changed

4 files changed

+37
-19
lines changed

include/viennals/lsStencilLocalLaxFriedrichsScalar.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ class StencilLocalLaxFriedrichsScalar {
276276
alpha[k] = std::fabs(monti + toifl + osher);
277277

278278
if (alpha[k] > maxDissipation) {
279-
alpha[k] = 0.;
279+
alpha[k] = maxDissipation;
280280
}
281281
}
282282

python/pyWrap.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,14 @@ PYBIND11_MODULE(VIENNALS_MODULE_NAME, module) {
239239
"Apply the integration scheme and calculate rates and maximum time "
240240
"step, but it do **not** move the surface.");
241241

242+
pybind11::class_<lsInternal::StencilLocalLaxFriedrichsScalar<T, D, 1>>(
243+
module, "StencilLocalLaxFriedrichsScalar")
244+
.def_static(
245+
"setMaxDissipation",
246+
&lsInternal::StencilLocalLaxFriedrichsScalar<T, D,
247+
1>::setMaxDissipation,
248+
pybind11::arg("maxDissipation"));
249+
242250
// enums
243251
pybind11::enum_<IntegrationSchemeEnum>(module, "IntegrationSchemeEnum")
244252
.value("ENGQUIST_OSHER_1ST_ORDER",

python/viennals2d/viennals2d.pyi

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class BooleanOperationEnum:
4545
def __int__(self) -> int: ...
4646
def __ne__(self, other: object) -> bool: ...
4747
@property
48-
def name(self): ...
48+
def name(self) -> str: ...
4949
@property
5050
def value(self) -> int: ...
5151

@@ -64,7 +64,7 @@ class BoundaryConditionEnum:
6464
def __int__(self) -> int: ...
6565
def __ne__(self, other: object) -> bool: ...
6666
@property
67-
def name(self): ...
67+
def name(self) -> str: ...
6868
@property
6969
def value(self) -> int: ...
7070

@@ -186,7 +186,7 @@ class CurvatureEnum:
186186
def __int__(self) -> int: ...
187187
def __ne__(self, other: object) -> bool: ...
188188
@property
189-
def name(self): ...
189+
def name(self) -> str: ...
190190
@property
191191
def value(self) -> int: ...
192192

@@ -257,7 +257,7 @@ class FeatureDetectionEnum:
257257
def __int__(self) -> int: ...
258258
def __ne__(self, other: object) -> bool: ...
259259
@property
260-
def name(self): ...
260+
def name(self) -> str: ...
261261
@property
262262
def value(self) -> int: ...
263263

@@ -274,7 +274,7 @@ class FileFormatEnum:
274274
def __int__(self) -> int: ...
275275
def __ne__(self, other: object) -> bool: ...
276276
@property
277-
def name(self): ...
277+
def name(self) -> str: ...
278278
@property
279279
def value(self) -> int: ...
280280

@@ -348,7 +348,7 @@ class IntegrationSchemeEnum:
348348
def __int__(self) -> int: ...
349349
def __ne__(self, other: object) -> bool: ...
350350
@property
351-
def name(self): ...
351+
def name(self) -> str: ...
352352
@property
353353
def value(self) -> int: ...
354354

@@ -368,7 +368,7 @@ class LogLevel:
368368
def __int__(self) -> int: ...
369369
def __ne__(self, other: object) -> bool: ...
370370
@property
371-
def name(self): ...
371+
def name(self) -> str: ...
372372
@property
373373
def value(self) -> int: ...
374374

@@ -570,6 +570,11 @@ class SphereDistribution(GeometricAdvectDistribution):
570570
def getSignedDistance(self, arg0, arg1, arg2: typing.SupportsInt) -> float: ...
571571
def isInside(self, arg0, arg1, arg2: typing.SupportsFloat) -> bool: ...
572572

573+
class StencilLocalLaxFriedrichsScalar:
574+
def __init__(self, *args, **kwargs) -> None: ...
575+
@staticmethod
576+
def setMaxDissipation(maxDissipation: typing.SupportsFloat) -> None: ...
577+
573578
class ToDiskMesh:
574579
@overload
575580
def __init__(self) -> None: ...
@@ -629,7 +634,7 @@ class TransformEnum:
629634
def __int__(self) -> int: ...
630635
def __ne__(self, other: object) -> bool: ...
631636
@property
632-
def name(self): ...
637+
def name(self) -> str: ...
633638
@property
634639
def value(self) -> int: ...
635640

@@ -715,7 +720,7 @@ class VoidTopSurfaceEnum:
715720
def __int__(self) -> int: ...
716721
def __ne__(self, other: object) -> bool: ...
717722
@property
718-
def name(self): ...
723+
def name(self) -> str: ...
719724
@property
720725
def value(self) -> int: ...
721726

python/viennals3d/viennals3d.pyi

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class BooleanOperationEnum:
4545
def __int__(self) -> int: ...
4646
def __ne__(self, other: object) -> bool: ...
4747
@property
48-
def name(self): ...
48+
def name(self) -> str: ...
4949
@property
5050
def value(self) -> int: ...
5151

@@ -64,7 +64,7 @@ class BoundaryConditionEnum:
6464
def __int__(self) -> int: ...
6565
def __ne__(self, other: object) -> bool: ...
6666
@property
67-
def name(self): ...
67+
def name(self) -> str: ...
6868
@property
6969
def value(self) -> int: ...
7070

@@ -121,7 +121,7 @@ class CurvatureEnum:
121121
def __int__(self) -> int: ...
122122
def __ne__(self, other: object) -> bool: ...
123123
@property
124-
def name(self): ...
124+
def name(self) -> str: ...
125125
@property
126126
def value(self) -> int: ...
127127

@@ -192,7 +192,7 @@ class FeatureDetectionEnum:
192192
def __int__(self) -> int: ...
193193
def __ne__(self, other: object) -> bool: ...
194194
@property
195-
def name(self): ...
195+
def name(self) -> str: ...
196196
@property
197197
def value(self) -> int: ...
198198

@@ -209,7 +209,7 @@ class FileFormatEnum:
209209
def __int__(self) -> int: ...
210210
def __ne__(self, other: object) -> bool: ...
211211
@property
212-
def name(self): ...
212+
def name(self) -> str: ...
213213
@property
214214
def value(self) -> int: ...
215215

@@ -283,7 +283,7 @@ class IntegrationSchemeEnum:
283283
def __int__(self) -> int: ...
284284
def __ne__(self, other: object) -> bool: ...
285285
@property
286-
def name(self): ...
286+
def name(self) -> str: ...
287287
@property
288288
def value(self) -> int: ...
289289

@@ -303,7 +303,7 @@ class LogLevel:
303303
def __int__(self) -> int: ...
304304
def __ne__(self, other: object) -> bool: ...
305305
@property
306-
def name(self): ...
306+
def name(self) -> str: ...
307307
@property
308308
def value(self) -> int: ...
309309

@@ -510,6 +510,11 @@ class SphereDistribution(GeometricAdvectDistribution):
510510
def getSignedDistance(self, arg0, arg1, arg2: typing.SupportsInt) -> float: ...
511511
def isInside(self, arg0, arg1, arg2: typing.SupportsFloat) -> bool: ...
512512

513+
class StencilLocalLaxFriedrichsScalar:
514+
def __init__(self, *args, **kwargs) -> None: ...
515+
@staticmethod
516+
def setMaxDissipation(maxDissipation: typing.SupportsFloat) -> None: ...
517+
513518
class ToDiskMesh:
514519
@overload
515520
def __init__(self) -> None: ...
@@ -569,7 +574,7 @@ class TransformEnum:
569574
def __int__(self) -> int: ...
570575
def __ne__(self, other: object) -> bool: ...
571576
@property
572-
def name(self): ...
577+
def name(self) -> str: ...
573578
@property
574579
def value(self) -> int: ...
575580

@@ -655,7 +660,7 @@ class VoidTopSurfaceEnum:
655660
def __int__(self) -> int: ...
656661
def __ne__(self, other: object) -> bool: ...
657662
@property
658-
def name(self): ...
663+
def name(self) -> str: ...
659664
@property
660665
def value(self) -> int: ...
661666

0 commit comments

Comments
 (0)