OpenPisco.Unstructured.Levelset module#

OpenPisco.Unstructured.Levelset.AddRidgesToMesh(UM)[source]#
OpenPisco.Unstructured.Levelset.CheckIntegrity(GUI=False)[source]#
OpenPisco.Unstructured.Levelset.CheckIntegrityCleanSmallIslandsInImplicitDomain(GUI)[source]#
OpenPisco.Unstructured.Levelset.CheckIntegrityConform(GUI)[source]#
OpenPisco.Unstructured.Levelset.CheckIntegrityConformMuscatGrad(GUI)[source]#
OpenPisco.Unstructured.Levelset.CheckIntegrityInterfaceIntegral(GUI)[source]#
OpenPisco.Unstructured.Levelset.CheckIntegrityNonConform(GUI)[source]#
OpenPisco.Unstructured.Levelset.CheckIntegrityNonConformExtension(GUI)[source]#
OpenPisco.Unstructured.Levelset.CreateLevelSet(ops)[source]#

Unstructured Levelset support : Grid (mesh) conform : for conform mesh to the iso 0 (remeshing) (False) useVtk : use vtk to compute the Gradient of phi (True) also a MeshInfo child element in the form of :

<MesherInfo iso=”0.0” hmin=”0.05” hmax=”0.5” hausd=”0.1” nr=”True” hgrad=”1.1” <LocalParams eTag=”tagName” hmin=”0.05” hmax=”0.5” hausd=”0.1” dim=”3” /> <LocalParams eTag=”2dtagName” hmin=”2.” hmax=”1.” hausd=”2.” dim=”2” /> MesherInfo />

with the properties for the remesher algorithm

iso : iso surface to mesh (0.0) hmin : Minimal edge size hmax : Maximal edge size hsiz : Constant edge size rmc : Remove connected components smaller than a given threshold ar : Value for angle detection hausd: Maximal Hausdorff distance for the boundaries approximation nr : No angle detection met : use isotropic metric field ‘met’ to drive the remeshing

computeDistanceWith (meshdist/vtk) : update signed distance function using meshdist/vtk keepGeneratedFiles : keep files generated during remeshing

class OpenPisco.Unstructured.Levelset.LevelSet(other=None, support=None)[source]#

Bases: LevelSetBase

AcceptChanges(newphi=None)[source]#
ApplyVelocityRestriction(raw_v, moldingDirection)[source]#
Parameters

raw_v (np.ndarray) – The (scalar) advection field

Returns

The (vector) advection field restricted according to the molding condition

Return type

np.ndarray

Notes

The molding constraint is enforced as in the paper A level set based method for the optimization of cast parts

CleanCacheMesh() None[source]#

Clean internal cache for mesh dependent functions

CleanCachePhi() None[source]#

Clean internal cache for phi dependent functions

CleanSmallIslandsInImplicitDomain()[source]#
ComputeInterfaceProjection(data)[source]#
DiscardState() None[source]#
GetElementsVolumicFractions(phi=None)[source]#

get the negative fraction of the volume (only for tets)

Parameters

phi (ndarray, optional) – a phi field, if None self.phi is used, by default None

Returns

a ndarray with the volume fraction for the tetras

Return type

ndarray

GetInterfaceLumpedMassMatrix()[source]#
GetInterfaceMassMatrix()[source]#
GetMassMatrix()[source]#
GetVolumeOfNegativePartbyElement(phi=None)[source]#
Initialize(Function)[source]#
InitializePointByPoint(Function)[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)[source]#
Regularize(field_, lengthscaleParameter=1.0)[source]#
RegularizePhi()[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

SetSupport(support)[source]#
TakePhiAndMesh(phi, mesh)[source]#
Transport(velocity, velocity_normalization=1.0)[source]#
TransportAndReinitialize(velocity, velocity_normalization=1.0)[source]#
OpenPisco.Unstructured.Levelset.ReadMeshInfo(child)[source]#
OpenPisco.Unstructured.Levelset.bar_2d_lenght(coords)[source]#
OpenPisco.Unstructured.Levelset.bar_2d_lumped_mass_matrix(nodal_coords, elem_conn)[source]#
OpenPisco.Unstructured.Levelset.dimensionality_lumped_mass_matrix(dimensionality)[source]#
OpenPisco.Unstructured.Levelset.interface_lumped_mass_matrix(support)[source]#
OpenPisco.Unstructured.Levelset.triangle_3d_areas(coords)[source]#
OpenPisco.Unstructured.Levelset.triangle_3d_lumped_mass_matrix(nodal_coords, elem_conn)[source]#