GridMeshModel

class persalys.GridMeshModel(*args)

Create a model to build regular meshes.

Available constructors:

GridMeshModel(parameters, bounds, nbNodes)

Parameters
parameterssequence of persalys.Variable

Sequence of index parameters (optional). By default the index parameter is named t

boundsopenturns.Interval

Mesh bounds along each direction

nbNodessequence of int

Number of nodes along each direction

Notes

The sequences must have a dimension equal to the number of index parameters.

Examples

>>> import openturns as ot
>>> import persalys

Create the mesh model:

>>> meshModel = persalys.GridMeshModel([persalys.Variable('x', 'aDescription')], ot.Interval(0., 12.), [10])

Create the model:

>>> z0 = persalys.Input('z0', 100)
>>> v0 = persalys.Input('v0', 55)
>>> m = persalys.Input('m', 80)
>>> c = persalys.Input('c', 15)
>>> z = persalys.Output('z')
>>> formula = ['max(0, z0 + (m * 9.81 / c) * x + (m / c) * (v0 - (m * 9.81 / c)) * (1 - exp(-x * c / m)))']
>>> model = persalys.SymbolicFieldModel('model', meshModel, [z0, v0, m, c], [z], formula)
>>> y = model.getPointToFieldFunction()([100, 55, 80, 15])

Methods

getBounds(self)

Get bounds of the mesh nodes accessor.

getClassName(self)

Accessor to the object’s name.

getId(self)

Accessor to the object’s id.

getIndexParameters(self)

Index parameters accessor.

getMesh(self)

Mesh accessor.

getName(self)

Accessor to the object’s name.

getNumberOfNodes(self)

Number of nodes accessor.

getPythonScript(self)

Python script accessor.

getShadowedId(self)

Accessor to the object’s shadowed id.

getVisibility(self)

Accessor to the object’s visibility state.

hasName(self)

Test if the object is named.

hasVisibleName(self)

Test if the object has a distinguishable name.

setIndexParameters(self, parameters)

Index parameters accessor.

setName(self, name)

Accessor to the object’s name.

setParameters(self, bounds, nbNodes)

Parameters accessor.

setShadowedId(self, id)

Accessor to the object’s shadowed id.

setVisibility(self, visible)

Accessor to the object’s visibility state.

__init__(self, *args)

Initialize self. See help(type(self)) for accurate signature.

getBounds(self)

Get bounds of the mesh nodes accessor.

Returns
boundsopenturns.Interval

Bounds of the mesh nodes along each direction

getClassName(self)

Accessor to the object’s name.

Returns
class_namestr

The object class name (object.__class__.__name__).

getId(self)

Accessor to the object’s id.

Returns
idint

Internal unique identifier.

getIndexParameters(self)

Index parameters accessor.

Returns
parameterssequence of persalys.Variable

Index parameters

getMesh(self)

Mesh accessor.

Returns
meshopenturns.Mesh

Mesh

getName(self)

Accessor to the object’s name.

Returns
namestr

The name of the object.

getNumberOfNodes(self)

Number of nodes accessor.

Returns
numberopenturns.Indices

Number of nodes along each direction

getPythonScript(self)

Python script accessor.

Returns
scriptstr

Python script to replay the analysis

getShadowedId(self)

Accessor to the object’s shadowed id.

Returns
idint

Internal unique identifier.

getVisibility(self)

Accessor to the object’s visibility state.

Returns
visiblebool

Visibility flag.

hasName(self)

Test if the object is named.

Returns
hasNamebool

True if the name is not empty.

hasVisibleName(self)

Test if the object has a distinguishable name.

Returns
hasVisibleNamebool

True if the name is not empty and not the default one.

setIndexParameters(self, parameters)

Index parameters accessor.

Parameters
parameterssequence of persalys.Variable

Index parameters

setName(self, name)

Accessor to the object’s name.

Parameters
namestr

The name of the object.

setParameters(self, bounds, nbNodes)

Parameters accessor.

Parameters
boundsopenturns.Interval

Mesh bounds along each direction

nbNodessequence of int

Number of nodes along each direction

setShadowedId(self, id)

Accessor to the object’s shadowed id.

Parameters
idint

Internal unique identifier.

setVisibility(self, visible)

Accessor to the object’s visibility state.

Parameters
visiblebool

Visibility flag.