ImportedMeshModel

class persalys.ImportedMeshModel(*args)

Create a model with imported meshes

Parameters:
fileNamestr

Name of a data file to load

parameterssequence of persalys.Variable, optional

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

columnssequence of int, optional

Indices of columns in files to consider. The sequence dimension must have a dimension equal to the number of index parameters

orderint, optional

Data order in the file. Possible values are: - persalys.Tools.Unknown (default) : the file contains 1D data and order will be inferred automatically - persalys.tools.Columns : each time step is stored in a different columns - persalys.tools.Rows : each time step is stored in a different row

Methods

getBounds()

Get bounds of the mesh nodes accessor.

getClassName()

Accessor to the object's name.

getImportedDataset()

Get the imported dataset.

getIndexParameters()

Index parameters accessor.

getMesh()

Mesh accessor.

getName()

Accessor to the object's name.

getNumberOfNodes()

Number of nodes accessor.

getPythonScript()

Python script accessor.

hasName()

Test if the object is named.

setIndexParameters(parameters)

Index parameters accessor.

setMeshFilename(filename)

Mesh file name accessor.

setName(name)

Accessor to the object's name.

setParameterColumns(inputColumns)

Columns of the index parameters accessor.

Examples

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

Create the mesh model:

>>> mesh = ot.IntervalMesher(ot.Indices(1, 20)).build(ot.Interval(0., 12.))
>>> mesh.getVertices().exportToCSVFile('mesh.csv')
>>> meshModel = persalys.ImportedMeshModel('mesh.csv', [persalys.Variable('x', 'aDescription')], [0])

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])
__init__(*args)
getBounds()

Get bounds of the mesh nodes accessor.

Returns:
boundsopenturns.Interval

Bounds of the mesh nodes along each direction

getClassName()

Accessor to the object’s name.

Returns:
class_namestr

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

getImportedDataset()

Get the imported dataset.

Returns:
persalys.ImportedDataset

The imported dataset

getIndexParameters()

Index parameters accessor.

Returns:
parameterssequence of persalys.Variable

Index parameters

getMesh()

Mesh accessor.

Returns:
meshopenturns.Mesh

Mesh

getName()

Accessor to the object’s name.

Returns:
namestr

The name of the object.

getNumberOfNodes()

Number of nodes accessor.

Returns:
numberopenturns.Indices

Number of nodes along each direction

getPythonScript()

Python script accessor.

Returns:
scriptstr

Python script to replay the analysis

hasName()

Test if the object is named.

Returns:
hasNamebool

True if the name is not empty.

setIndexParameters(parameters)

Index parameters accessor.

Parameters:
parameterssequence of persalys.Variable

Index parameters

setMeshFilename(filename)

Mesh file name accessor.

Parameters:
fileNamestr

Name of the file containing the mesh data

setName(name)

Accessor to the object’s name.

Parameters:
namestr

The name of the object.

setParameterColumns(inputColumns)

Columns of the index parameters accessor.

Parameters:
columnssequence of int

Indices of columns in file of the index parameters