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

computeMesh()

Build the mesh.

getBase()

Base accessor.

getBoundingBox()

Bounding box accessor.

getClassName()

Accessor to the object's name.

getDimension()

Dimension accessor.

getDiscretization()

Discretization accessor.

getExtension()

Extension accessor.

getInjection()

Injection accessor.

getName()

Accessor to the object's name.

getVertices()

Vertices accessor.

getVolume()

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:
meshopenturns.Mesh

Mesh of the cylinder

getBase()

Base accessor.

Returns:
baseopenturns.Mesh

Cylinder base

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__).

getDimension()

Dimension accessor.

Returns:
dimensionint

Dimension

getDiscretization()

Discretization accessor.

Returns:
discretizationint

Discretization number along dimensions of the extension

getExtension()

Extension accessor.

Returns:
extensionopenturns.Interval

Extension range

getInjection()

Injection accessor.

Returns:
injectionopenturns.Indices

Dimension indices of the extension

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.

isConvex()

Convex property accessor.

Returns:
isConvexbool

Convex property.

setName(name)

Accessor to the object’s name.

Parameters:
namestr

The name of the object.

Examples using the class

Cylinder meshing

Cylinder meshing

Application example

Application example