Cylinder¶
(Source code, svg)
- class otmeshing.Cylinder(*args)¶
Generalized cylinder.
- Parameters:
- base
openturns.Mesh Cylinder base
- extension
openturns.Interval Extension range
- injectionsequence of int
Dimension indices of the extension
- discretizationint
Discretization number along dimensions of the extension
- base
Methods
Build the mesh.
getBase()Base accessor.
Bounding box accessor.
Accessor to the object's name.
Dimension accessor.
Discretization accessor.
Extension accessor.
Injection accessor.
getName()Accessor to the object's name.
Vertices accessor.
Volume accessor.
hasName()Test if the object is named.
isConvex()Convex property accessor.
setName(name)Accessor to the object's name.
Examples
Create a cylinder with an octogonal base, extended in the z-axis over [0, 5]:
>>> import otmeshing >>> import openturns as ot >>> import math >>> polyline = [] >>> n = 8 >>> for i in range(n): ... theta = i * 2.0 * math.pi / n ... polyline.append([math.cos(theta), math.sin(theta)]) >>> base = otmeshing.PolygonMesher().build(polyline) >>> extension = ot.Interval([0.0], [5.0]) # z-range >>> injection = [2] # extension in the z-axis >>> M = 4 # number of cells in the z-axis >>> cylinder = otmeshing.Cylinder(base, extension, injection, M)
- __init__(*args)¶
- computeMesh()¶
Build the mesh.
- Returns:
- mesh
openturns.Mesh Mesh of the cylinder
- mesh
- getBase()¶
Base accessor.
- Returns:
- base
openturns.Mesh Cylinder base
- base
- getBoundingBox()¶
Bounding box accessor.
- Returns:
- bbox
openturns.Interval Cylinder bounding box.
- bbox
- getClassName()¶
Accessor to the object’s name.
- Returns:
- class_namestr
The object class name (object.__class__.__name__).
- getDimension()¶
Dimension accessor.
- Returns:
- dimensionint
Dimension
- getDiscretization()¶
Discretization accessor.
- Returns:
- discretizationint
Discretization number along dimensions of the extension
- getExtension()¶
Extension accessor.
- Returns:
- extension
openturns.Interval Extension range
- extension
- getInjection()¶
Injection accessor.
- Returns:
- injection
openturns.Indices Dimension indices of the extension
- injection
- getName()¶
Accessor to the object’s name.
- Returns:
- namestr
The name of the object.
- getVertices()¶
Vertices accessor.
- Returns:
- vertices
openturns.Sample Cylinder vertices.
- vertices
- getVolume()¶
Volume accessor.
- Returns:
- volumefloat
Cylinder volume.
- hasName()¶
Test if the object is named.
- Returns:
- hasNamebool
True if the name is not empty.
- isConvex()¶
Convex property accessor.
- Returns:
- isConvexbool
Convex property.
- setName(name)¶
Accessor to the object’s name.
- Parameters:
- namestr
The name of the object.
otmeshing