Skip to content

Update generated code for DPF 261_multiply_fc on main #2509

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
470 changes: 170 additions & 300 deletions doc/source/_static/dpf_operators.html

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions src/ansys/dpf/core/operators/math/compute_residual_and_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ class compute_residual_and_error(Operator):
normalization_type: int, optional
type of normalization applied to the residuals and norm calculation (optional, defaut: absolute):
0 for absolute,
1 for relative to the first entry at a given time step,
2 for normalized by the max at a given time step of the first entry or residuals depending on the reference field option,
3 for normalized by the max over all time steps of the first entry or residuals depending on the reference field option
1 for relative to the first entry,
2 for normalized by the max of each field of the first entry or residuals depending on the reference field option,
3 for normalized by the max over all fields of the first entry or residuals depending on the reference field option
norm_calculation_type: int, optional
type for norm calculation (optional, default: L2) - It is normalized depending on Pin2 selection
1 for L1, ie sum(abs(xi)),
Expand Down Expand Up @@ -140,9 +140,9 @@ def _spec() -> Specification:
optional=True,
document=r"""type of normalization applied to the residuals and norm calculation (optional, defaut: absolute):
0 for absolute,
1 for relative to the first entry at a given time step,
2 for normalized by the max at a given time step of the first entry or residuals depending on the reference field option,
3 for normalized by the max over all time steps of the first entry or residuals depending on the reference field option""",
1 for relative to the first entry,
2 for normalized by the max of each field of the first entry or residuals depending on the reference field option,
3 for normalized by the max over all fields of the first entry or residuals depending on the reference field option""",
),
2: PinSpecification(
name="norm_calculation_type",
Expand Down Expand Up @@ -308,9 +308,9 @@ def normalization_type(self) -> Input:

type of normalization applied to the residuals and norm calculation (optional, defaut: absolute):
0 for absolute,
1 for relative to the first entry at a given time step,
2 for normalized by the max at a given time step of the first entry or residuals depending on the reference field option,
3 for normalized by the max over all time steps of the first entry or residuals depending on the reference field option
1 for relative to the first entry,
2 for normalized by the max of each field of the first entry or residuals depending on the reference field option,
3 for normalized by the max over all fields of the first entry or residuals depending on the reference field option

Returns
-------
Expand Down
41 changes: 41 additions & 0 deletions src/ansys/dpf/core/operators/math/modal_superposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class modal_superposition(Operator):

Parameters
----------
is_output_custom: bool, optional
If true, output will be a a custom container, otherwise a reconstructed fields_container. Default is false.
modal_basis: FieldsContainer
One field by mode with each field representing a mode shape on nodes or elements.
solution_in_modal_space: FieldsContainer
Expand All @@ -46,6 +48,8 @@ class modal_superposition(Operator):
>>> op = dpf.operators.math.modal_superposition()

>>> # Make input connections
>>> my_is_output_custom = bool()
>>> op.inputs.is_output_custom.connect(my_is_output_custom)
>>> my_modal_basis = dpf.FieldsContainer()
>>> op.inputs.modal_basis.connect(my_modal_basis)
>>> my_solution_in_modal_space = dpf.FieldsContainer()
Expand All @@ -59,6 +63,7 @@ class modal_superposition(Operator):

>>> # Instantiate operator and connect inputs in one line
>>> op = dpf.operators.math.modal_superposition(
... is_output_custom=my_is_output_custom,
... modal_basis=my_modal_basis,
... solution_in_modal_space=my_solution_in_modal_space,
... incremental_fc=my_incremental_fc,
Expand All @@ -72,6 +77,7 @@ class modal_superposition(Operator):

def __init__(
self,
is_output_custom=None,
modal_basis=None,
solution_in_modal_space=None,
incremental_fc=None,
Expand All @@ -85,6 +91,8 @@ def __init__(
)
self._inputs = InputsModalSuperposition(self)
self._outputs = OutputsModalSuperposition(self)
if is_output_custom is not None:
self.inputs.is_output_custom.connect(is_output_custom)
if modal_basis is not None:
self.inputs.modal_basis.connect(modal_basis)
if solution_in_modal_space is not None:
Expand All @@ -105,6 +113,12 @@ def _spec() -> Specification:
spec = Specification(
description=description,
map_input_pin_spec={
-1: PinSpecification(
name="is_output_custom",
type_names=["bool"],
optional=True,
document=r"""If true, output will be a a custom container, otherwise a reconstructed fields_container. Default is false.""",
),
0: PinSpecification(
name="modal_basis",
type_names=["fields_container"],
Expand Down Expand Up @@ -201,6 +215,8 @@ class InputsModalSuperposition(_Inputs):
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.math.modal_superposition()
>>> my_is_output_custom = bool()
>>> op.inputs.is_output_custom.connect(my_is_output_custom)
>>> my_modal_basis = dpf.FieldsContainer()
>>> op.inputs.modal_basis.connect(my_modal_basis)
>>> my_solution_in_modal_space = dpf.FieldsContainer()
Expand All @@ -215,6 +231,10 @@ class InputsModalSuperposition(_Inputs):

def __init__(self, op: Operator):
super().__init__(modal_superposition._spec().inputs, op)
self._is_output_custom = Input(
modal_superposition._spec().input_pin(-1), -1, op, -1
)
self._inputs.append(self._is_output_custom)
self._modal_basis = Input(modal_superposition._spec().input_pin(0), 0, op, -1)
self._inputs.append(self._modal_basis)
self._solution_in_modal_space = Input(
Expand All @@ -230,6 +250,27 @@ def __init__(self, op: Operator):
self._mesh_scoping = Input(modal_superposition._spec().input_pin(4), 4, op, -1)
self._inputs.append(self._mesh_scoping)

@property
def is_output_custom(self) -> Input:
r"""Allows to connect is_output_custom input to the operator.

If true, output will be a a custom container, otherwise a reconstructed fields_container. Default is false.

Returns
-------
input:
An Input instance for this pin.

Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.math.modal_superposition()
>>> op.inputs.is_output_custom.connect(my_is_output_custom)
>>> # or
>>> op.inputs.is_output_custom(my_is_output_custom)
"""
return self._is_output_custom

@property
def modal_basis(self) -> Input:
r"""Allows to connect modal_basis input to the operator.
Expand Down
8 changes: 4 additions & 4 deletions src/ansys/dpf/core/operators/result/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,6 @@
from .euler_load_buckling import euler_load_buckling
from .euler_nodes import euler_nodes
from .fluid_velocity import fluid_velocity
from .gasket_deformation import gasket_deformation
from .gasket_deformation_X import gasket_deformation_X
from .gasket_deformation_XY import gasket_deformation_XY
from .gasket_deformation_XZ import gasket_deformation_XZ
from .gasket_inelastic_closure import gasket_inelastic_closure
from .gasket_inelastic_closure_X import gasket_inelastic_closure_X
from .gasket_inelastic_closure_XY import gasket_inelastic_closure_XY
Expand All @@ -142,6 +138,10 @@
from .gasket_thermal_closure_X import gasket_thermal_closure_X
from .gasket_thermal_closure_XY import gasket_thermal_closure_XY
from .gasket_thermal_closure_XZ import gasket_thermal_closure_XZ
from .gasket_total_closure import gasket_total_closure
from .gasket_total_closure_X import gasket_total_closure_X
from .gasket_total_closure_XY import gasket_total_closure_XY
from .gasket_total_closure_XZ import gasket_total_closure_XZ
from .global_added_mass import global_added_mass
from .global_added_mass_pct import global_added_mass_pct
from .global_center_mass import global_center_mass
Expand Down
Loading
Loading