FunctionGraphMesher

(Source code, svg)

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

Function meshing algorithm.

Methods

build(function, outputIndex, minOutput, ...)

Generate a mesh from function discretization.

getClassName()

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.

Examples

>>> import openturns as ot
>>> import otmeshing
>>> bbox = ot.Interval([-8] * 2, [8] * 2)
>>> inputDiscretization = [10] * 2
>>> mesher = otmeshing.FunctionGraphMesher(bbox, inputDiscretization)
>>> f = ot.SymbolicFunction(['x', 'y'], ['cos(x) * sin(y)'])
>>> zIndex = 2  # z axis index
>>> zMin, zMax = 0.01, 0.3  # clip f in [0.01, 0.3]
>>> mesh = mesher.build(f, zIndex, zMin, zMax)
__init__(*args)
build(function, outputIndex, minOutput, maxOutput, outputDiscretization=1, subGraph=True)

Generate a mesh from function discretization.

Parameters:
functionopenturns.Function

Surface function, of output dimension 1

outputIndexint

Index of the output variable

minOutputfloat

Minimum output value

maxOutputfloat

Maximum output value

outputDiscretizationint, optional

Number of discretizations along the output axis (default=1)

subGraphbool, optional

Whether to mesh below or above the surface (default=True: below)

Returns:
meshopenturns.Mesh

The mesh generated.

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.

Examples using the class

Application example

Application example

Function graph meshing

Function graph meshing