cosapp.drivers.runsinglecase¶
Classes
|
Set new boundary conditions and equations on the system. |
-
class
cosapp.drivers.runsinglecase.RunSingleCase(name: str, owner: Optional[cosapp.systems.system.System] = None, **kwargs)[source]¶ Bases:
cosapp.drivers.iterativecase.IterativeCaseSet new boundary conditions and equations on the system.
By default, it has a
RunOncedriver as child to run the system.-
case_values¶ List of requested variable assignments to set up the case
- Type
List[AssignString]
-
initial_values¶ List of variables to set with the values to set and associated indices selection
- Type
Dict[str, Tuple[Any, Optional[numpy.ndarray]]]
- Parameters
-
add_equation(equation: Union[str, Iterable[Union[dict, str]]], *args, **kwargs) → cosapp.core.numerics.basics.MathematicalProblem[source]¶ Add local equation(s). Shortcut to self.offdesign.add_equation(equation, *args, **kwargs).
More details in MathematicalProblem.add_equation.
- Parameters
equation (-) – Equation or list of equations to add
*args (-) –
**kwargs (Forwarded to MathematicalProblem.add_equation) –
- Returns
The modified mathematical problem
- Return type
-
add_offdesign_problem(offdesign: cosapp.core.numerics.basics.MathematicalProblem) → cosapp.core.numerics.basics.MathematicalProblem[source]¶ Add outer off-design problem to inner problem.
- MathematicalProblem
The modified mathematical problem
-
add_target(expression: Union[str, Iterable[str]], *args, **kwargs) → cosapp.core.numerics.basics.MathematicalProblem[source]¶ Add deferred equation(s) on current point. Shortcut to self.offdesign.add_target(expression, *args, **kwargs).
More details in MathematicalProblem.add_target.
- Parameters
expression (-) – Targetted expression
*args (-) –
**kwargs (Forwarded to MathematicalProblem.add_target) –
- Returns
The modified mathematical problem
- Return type
-
add_unknown(name: Union[str, Iterable[Union[dict, str]]], *args, **kwargs) → cosapp.core.numerics.basics.MathematicalProblem[source]¶ Add local unknown(s). Shortcut to self.offdesign.add_unknown(name, *args, **kwargs).
More details in MathematicalProblem.add_unknown.
- Parameters
name (-) – Name of the variable or list of variables to add
*args (-) –
**kwargs (Forwarded to MathematicalProblem.add_unknown) –
- Returns
The modified mathematical problem
- Return type
-
add_value(variable: str, value: Any) → None[source]¶ Add a single variable to list of case values.
The variable can be contextual child1.port2.var. The only rule is that it should belong to the owner System of this driver or any of its descendants.
- Parameters
variable (str) – Name of the variable
value (Any) – Value to be used.
Examples
>>> driver.add_value('myvar', 42)
-
add_values(modifications: Dict[str, Any]) → None[source]¶ Add a set of variables to the list of case values, from a dictionary of the kind {‘variable1’: value1, …}
The variable can be contextual child1.port2.var. The only rule is that it should belong to the owner System of this driver or any of its descendants.
- Parameters
modifications (Dict[str, Any]) – Dictionary of (variable name, value)
Examples
>>> driver.add_values({'myvar': 42, 'port.dummy': 'banana'})
-
property
case_values¶
-
property
design¶ Design problem solved for case
- Type
-
extend(problem: cosapp.core.numerics.basics.MathematicalProblem) → cosapp.core.numerics.basics.MathematicalProblem[source]¶ Extend local problem. Shortcut to self.offdesign.extend(problem).
- Parameters
problem (-) –
- Returns
The extended mathematical problem
- Return type
-
get_problem() → cosapp.core.numerics.basics.MathematicalProblem[source]¶ Returns the full mathematical for the case.
- Returns
The full mathematical problem to solve for the case
- Return type
-
merged_problem(copy=True) → cosapp.core.numerics.basics.MathematicalProblem[source]¶
-
property
offdesign¶ Local problem solved for case
- Type
-
problem¶
-
property
processed_problems¶ design/off-design problem handler
- Type
-
set_values(modifications: Dict[str, Any]) → None[source]¶ Enter the set of variables defining the case, from a dictionary of the kind {‘variable1’: value1, …} Note: will erase all previously defined values. Use ‘add_values’ to append new case values.
The variable can be contextual child1.port2.var. The only rule is that it should belong to the owner System of this driver or any of its descendants.
- Parameters
modifications (Dict[str, Any]) – Dictionary of (variable name, value)
Examples
>>> driver.set_values({'myvar': 42, 'port.dummy': 'banana'})
-