Cylinder

(Source code, svg)

../../_images/Cylinder.svg
class otmeshing.Cylinder(*args)

Generalized cylinder.

Parameters:
baseopenturns.Mesh

Cylinder base

extensionopenturns.Interval

Extension range

injectionsequence of int

Dimension indices of the extension

discretizationint

Discretization number along dimensions of the extension

Methods

getBoundingBox()

Bounding box accessor.

getClassName()

Accessor to the object's name.

getName()

Accessor to the object's name.

getVertices()

Vertices accessor.

getVolume()

Volume accessor.

hasName()

Test if the object is named.

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)
getBoundingBox()

Bounding box accessor.

Returns:
bboxopenturns.Interval

Cylinder bounding box.

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.

getVertices()

Vertices accessor.

Returns:
verticesopenturns.Sample

Cylinder vertices.

getVolume()

Volume accessor.

Returns:
volumefloat

Cylinder volume.

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.

Examples using the class

Cylinder meshing

Cylinder meshing