OpenPisco.Structured.StructuredLevelsetBase module#

OpenPisco.Structured.StructuredLevelsetBase.CheckIntegrity(GUI=False)[source]#
class OpenPisco.Structured.StructuredLevelsetBase.StructuredLevelsetBase(other=None, support=None)[source]#

Bases: LevelSetBase

ApplyTransportStep(velocity, dt)[source]#
ComputeInterfaceProjection(data, phi=None)[source]#
GetDxMin()[source]#
GetElementsVolumicFractions(phi=None)[source]#

Get the element-wise volumic fractions located inside the domain implicitly defined by a levelset function.

By convention, the inside corresponds to the nonpositive values of the levelset function.

Parameters

levelset (np.ndarray) – A node-based levelset function interpreted as the signed distance close to the interface.

Returns

Element-based field.

Return type

np.ndarray

GetMonoIndexView(field)[source]#
GetMultiIndexView(field)[source]#
GetVolumeOfNegativePartbyElement(phi=None)[source]#

Get the element-wise volumic located inside the domain implicitly defined by a levelset function.

By convention, the inside corresponds to the nonpositive values of the levelset function.

Parameters

levelset (np.ndarray) – A node-based levelset function interpreted as the signed distance close to the interface.

GradientNormVelocity(phi, support)[source]#
InterfaceIntegral(field)[source]#

The value of the surface integral applied to the trace of a scalar-valued field defined on the whole design domain.

InterfaceRestriction(field, phi=None)[source]#
Regularize(field, lengthscaleParameter, extra=None)[source]#
Reinitialize(length=None)[source]#

Reinitialize the levelset function as a signed distance.

The levelset function guaranteed to be a signed distance function at least at a distance of length from the interface.

Parameters

length (real, optional) – Sufficient length of redistanciation, expressed as an absolute distance from the interface (the default is 4 * self.GetDxMin())

Notes

Solve the evolution equation: d(phi)/dt + sign(phi0)(|grad(phi)|-1) = 0 on a pseudo-time interval corresponding to the specified length, using the property that the velocity is uniformly equal to one.

SurfaceDiracFunction(phi=None)[source]#
TransportAndReinitialize(velocity, velocity_normalization=1.0)[source]#
TransportOnce(velocity, cfl=0.5)[source]#

Apply a single transport time-step to the level set function.

Solve the advection equation:

d(phi)/dt + V |grad(phi)| = 0 with d(phi)/dn = 0 on the boundary

where V is the normal velocity (scalar field).