ogstools.ogs6py.parameters module#

class ogstools.ogs6py.parameters.Parameters[source]#

Bases: BuildTree

Class for managing the parameters section of the project file.

__init__(tree)[source]#
__getitem__(key)[source]#
Return type:

Element

add_parameter(**kwargs)[source]#

Adds a parameter.

Return type:

None

Parameters#

namestr

Name of the parameter.

typestr

Type of the parameter, one of Constant, CurveScaled, Function, Group, MeshElement, MeshNode, RandomFieldMeshElement, Raster, or TimeDependentHeterogeneousParameter.

valuefloat or str

Value for a constant parameter.

valuesfloat or str

Values for a constant parameter.

expressionstr or list[str]

Expression describing a function (valid for function parameter).

curvestr

Name of the curve (used in CurveScaled parameter).

parameterstr

Used in CurveScaled parameter; name of the parameter scaled by the curve.

meshstr

Used in MeshElement or MeshNode parameter; specification of the mesh the parameter is defined on.

field_namestr

Used in MeshElement or MeshNode parameter; reference to the PropertyVector / DataArray given in the mesh.

timelist[float]

Used in TimeDependentHeterogeneousParameter.

parameter_namelist[str]

Used in CurveScaled to specify the parameter that shall be scaled.

use_local_coordinate_systembool or str

can be added to any parameter type

Raises#

KeyError

If ‘name’ or ‘type’ is not provided.

KeyError

If the parameter type is not supported.

use_local_coordinate_system(parameter)[source]#

Add the local coordinate system element.

Return type:

None

set_constant_parameter(name, **kwargs)[source]#

Set a constant parameter.

Parameters:

name (str) – parameter name

Return type:

Element

Keyword Arguments:
  • value: str

  • values: list[str]

set_mesh_parameter(name, type, field_name, mesh=None)[source]#

Set a mesh-based parameter (MeshElement or MeshNode).

Parameters:
  • name (str) – parameter name

  • type (Literal['MeshNode', 'MeshElement']) – parameter type

  • field_name (str) – fieldata name to read from the mesh

  • mesh (str | None) – mesh name

Return type:

Element

set_function_parameter(name, expression, mesh=None)[source]#

Set a function parameter.

Parameters:
  • name (str) – parameter name

  • expression (str | Sequence[str]) – function expression of the parameter

  • mesh (str | None) – mesh name

Return type:

Element

set_curve_scaled_parameter(name, curve, parameter)[source]#

Set a curve-scaled parameter.

Parameters:
  • name (str) – parameter name

  • curve (str) – name of the curve which scales this parameter

  • parameter (str) – name of the parameter which is scaled

Return type:

Element

set_time_dependent_heterogeneous_parameter(name, time, parameter_name)[source]#

Set a time-dependent heterogeneous parameter.

Parameters:
  • name (str) – parameter name

  • time (list[Any]) – list of timevalues

  • parameter_name (list[str]) – list of parameter names

Return type:

Element

set_group_parameter(name, group_id_property='MaterialIDs', index_values=None)[source]#

Set a group type parameter.

Parameters:
  • name (str) – parameter name

  • group_id_property (str) – name of index field (default: ‘MaterialIDs’)

  • index_values (dict[int, Any] | None) – pairs of indices and corresponding values.

Return type:

Element

add_index_values_to_group(name, index_values)[source]#
Return type:

None