ansys.dyna.core.lib.parameters.ParameterSet#

class ansys.dyna.core.lib.parameters.ParameterSet(parent: ParameterSet | None = None)#

Deck parameters with scope support.

Supports hierarchical parameter scopes where child scopes can see parent parameters but local parameters in child scopes don’t leak to parents or siblings.

get(param: str) Any#

Get a parameter by name, checking local then parent scopes.

Parameters:
paramstr

Parameter name to lookup.

Returns:
Any

Parameter value.

Raises:
KeyError

If parameter is not found in this scope or any parent scope.

add(param: str, value: Any) None#

Add a parameter to the local scope.

This method is for global parameters (PARAMETER keyword). They are added to the local scope but will be visible to child scopes.

Parameters:
paramstr

Parameter name.

valueAny

Parameter value.

add_local(param: str, value: Any) None#

Add a parameter to local scope only (PARAMETER_LOCAL).

Local parameters are only visible within the current scope and child scopes created from it, but won’t leak to parent or sibling scopes.

Parameters:
paramstr

Parameter name.

valueAny

Parameter value.

copy_with_child_scope() ParameterSet#

Create a new ParameterSet with this as the parent scope.

The child scope will be able to see parameters from this scope, but parameters added to the child won’t leak back to this scope.

Returns:
ParameterSet

New ParameterSet with this as parent.