OpenPisco.Unstructured.Levelset module#
- 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
- 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
- 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
- InterfaceIntegral(field)[source]#
The value of the surface integral applied to the trace of a scalar-valued field defined on the whole design domain.
- 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