ImportedMeshModel¶
-
class
persalys.
ImportedMeshModel
(*args)¶ Create a model with imported meshes
- Available constructors:
ImportedMeshModel(parameters, fileName, columns)
- Parameters
- parameterssequence of
persalys.Variable
Sequence of index parameters (optional). By default the index parameter is named t
- fileNamestr
Name of a data file to load
- columnssequence of int
Indices of columns in files to consider. The sequence dimension must have a dimension equal to the number of index parameters
- parameterssequence of
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([persalys.Variable('x', 'aDescription')], 'mesh.csv', [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])
- Attributes
thisown
The membership flag
Methods
Get bounds of the mesh nodes accessor.
Accessor to the object’s name.
File name accessor.
getId
()Accessor to the object’s id.
Index parameters accessor.
Columns of the input variables accessor.
getMesh
()Mesh accessor.
getName
()Accessor to the object’s name.
Number of nodes accessor.
Columns of the ouput variables accessor.
Python script accessor.
Sample from the file accessor.
Accessor to the object’s shadowed id.
Accessor to the object’s visibility state.
hasName
()Test if the object is named.
Test if the object has a distinguishable name.
setFileName
(fileName)File name accessor.
setIndexParameters
(parameters)Index parameters accessor.
setName
(name)Accessor to the object’s name.
setParameterColumns
(inputColumns)Columns of the index parameters accessor.
setShadowedId
(id)Accessor to the object’s shadowed id.
setVisibility
(visible)Accessor to the object’s visibility state.
-
__init__
(*args)¶ Initialize self. See help(type(self)) for accurate signature.
-
getBounds
()¶ Get bounds of the mesh nodes accessor.
- Returns
- bounds
openturns.Interval
Bounds of the mesh nodes along each direction
- bounds
-
getClassName
()¶ Accessor to the object’s name.
- Returns
- class_namestr
The object class name (object.__class__.__name__).
-
getFileName
()¶ File name accessor.
- Returns
- fileNamestr
Name of the file containing data
-
getId
()¶ Accessor to the object’s id.
- Returns
- idint
Internal unique identifier.
-
getIndexParameters
()¶ Index parameters accessor.
- Returns
- parameterssequence of
persalys.Variable
Index parameters
- parameterssequence of
-
getInputColumns
()¶ Columns of the input variables accessor.
- Returns
- columns
openturns.Indices
Columns of the input variables
- columns
-
getMesh
()¶ Mesh accessor.
- Returns
- mesh
openturns.Mesh
Mesh
- mesh
-
getName
()¶ Accessor to the object’s name.
- Returns
- namestr
The name of the object.
-
getNumberOfNodes
()¶ Number of nodes accessor.
- Returns
- number
openturns.Indices
Number of nodes along each direction
- number
-
getOutputColumns
()¶ Columns of the ouput variables accessor.
- Returns
- columns
openturns.Indices
Columns of the output variables
- columns
-
getPythonScript
()¶ Python script accessor.
- Returns
- scriptstr
Python script to replay the analysis
-
getSampleFromFile
()¶ Sample from the file accessor.
- Returns
- sample
openturns.Sample
Sample from the file
- sample
-
getShadowedId
()¶ Accessor to the object’s shadowed id.
- Returns
- idint
Internal unique identifier.
-
getVisibility
()¶ Accessor to the object’s visibility state.
- Returns
- visiblebool
Visibility flag.
-
hasName
()¶ Test if the object is named.
- Returns
- hasNamebool
True if the name is not empty.
-
hasVisibleName
()¶ Test if the object has a distinguishable name.
- Returns
- hasVisibleNamebool
True if the name is not empty and not the default one.
-
setFileName
(fileName)¶ File name accessor.
- Parameters
- fileNamestr
Name of the file containing data
-
setIndexParameters
(parameters)¶ Index parameters accessor.
- Parameters
- parameterssequence of
persalys.Variable
Index parameters
- parameterssequence of
-
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
-
setShadowedId
(id)¶ Accessor to the object’s shadowed id.
- Parameters
- idint
Internal unique identifier.
-
setVisibility
(visible)¶ Accessor to the object’s visibility state.
- Parameters
- visiblebool
Visibility flag.
-
property
thisown
¶ The membership flag