BoundaryMesher

(Source code, png)

../../_images/BoundaryMesher.png
class BoundaryMesher(*args)

Creation of the boundary mesh of a given mesh.

Warning

This class is experimental and likely to be modified in future releases. To use it, import the openturns.experimental submodule.

Notes

The boundary extraction is based on the remark that a (d-1) face of a d dimensional simplex of a mesh is a boundary face if and only if this face is not shared by any other simplex of the mesh. By convention, a face is represented as a flat simplex, by repeating the d th vertex so the two last indices of the simplex are equal. A thick version of the boundary can also be built, where each face is replaced by a simplex with a last vertex at distance offset from the face hyperplane. If offset is positive, this new vertex is in the open half-space not containing the simplex associated to the face, otherwise it is in the open half-space containing the simplex.

Examples

Create a mesh:

>>> import openturns as ot
>>> import openturns.experimental as otexp
>>> mesher = ot.LevelSetMesher([5, 10])
>>> level = 1.0
>>> function = ot.SymbolicFunction(['x0', 'x1'], ['x0^2+x1^2'])
>>> levelSet = ot.LevelSet(function, ot.LessOrEqual(), level)
>>> mesh = mesher.build(levelSet, ot.Interval([-2.0]*2, [2.0]*2))
>>> boundaryFactory = otexp.BoundaryMesher()
>>> boundaryMesh = boundaryFactory.build(mesh)
>>> thickBoundaryMeshOutside = boundaryFactory.build(mesh, 1e-5)
>>> thickBoundaryMeshInside = boundaryFactory.build(mesh, -1e-5)

Methods

build(mesh[, offset])

Build the boundary of the given mesh.

getClassName()

Accessor to the object's name.

getId()

Accessor to the object's id.

getName()

Accessor to the object's name.

getShadowedId()

Accessor to the object's shadowed id.

getVisibility()

Accessor to the object's visibility state.

hasName()

Test if the object is named.

hasVisibleName()

Test if the object has a distinguishable name.

setName(name)

Accessor to the object's name.

setShadowedId(id)

Accessor to the object's shadowed id.

setVisibility(visible)

Accessor to the object's visibility state.

__init__(*args)
build(mesh, offset=0.0)

Build the boundary of the given mesh.

Parameters:
meshMesh

The mesh from which the boundary is extracted.

offsetfloat

The thickness of the boundary to be generated, see Notes.

Returns:
meshMesh

The mesh built.

getClassName()

Accessor to the object’s name.

Returns:
class_namestr

The object class name (object.__class__.__name__).

getId()

Accessor to the object’s id.

Returns:
idint

Internal unique identifier.

getName()

Accessor to the object’s name.

Returns:
namestr

The name of the object.

getShadowedId()

Accessor to the object’s shadowed id.

Returns:
idint

Internal unique identifier.

getVisibility()

Accessor to the object’s visibility state.

Returns:
visiblebool

Visibility flag.

hasName()

Test if the object is named.

Returns:
hasNamebool

True if the name is not empty.

hasVisibleName()

Test if the object has a distinguishable name.

Returns:
hasVisibleNamebool

True if the name is not empty and not the default one.

setName(name)

Accessor to the object’s name.

Parameters:
namestr

The name of the object.

setShadowedId(id)

Accessor to the object’s shadowed id.

Parameters:
idint

Internal unique identifier.

setVisibility(visible)

Accessor to the object’s visibility state.

Parameters:
visiblebool

Visibility flag.