BoundaryMesher¶
(Source code, png)
- class BoundaryMesher¶
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.experimentalsubmodule.Notes
The boundary extraction is based on the remark that a
face of a
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
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.
Accessor to the object's name.
getName()Accessor to the object's name.
hasName()Test if the object is named.
setName(name)Accessor to the object's name.
- __init__()¶
- build(mesh, offset=0.0)¶
Build the boundary of the given mesh.
- getClassName()¶
Accessor to the object’s name.
- Returns:
- class_namestr
The object class name (object.__class__.__name__).
- getName()¶
Accessor to the object’s name.
- Returns:
- namestr
The name of the object.
- hasName()¶
Test if the object is named.
- Returns:
- hasNamebool
True if the name is not empty.
- setName(name)¶
Accessor to the object’s name.
- Parameters:
- namestr
The name of the object.
OpenTURNS