Skip to content
Merged
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
4 changes: 2 additions & 2 deletions doc/source/_static/dpf_operators.html

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions src/ansys/dpf/core/operators/result/cyclic_equivalent_mass.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@


class cyclic_equivalent_mass(Operator):
"""Read equivalent mass from an rst file and expand it with cyclic
symmetry.
"""This operator is deprecated: use the operator equivalent_mass with the
read_cyclic pin instead. Read equivalent mass from an rst file and
expand it with cyclic symmetry.

Parameters
----------
Expand Down Expand Up @@ -172,8 +173,9 @@ def __init__(

@staticmethod
def _spec():
description = """Read equivalent mass from an rst file and expand it with cyclic
symmetry."""
description = """This operator is deprecated: use the operator equivalent_mass with the
read_cyclic pin instead. Read equivalent mass from an rst
file and expand it with cyclic symmetry."""
spec = Specification(
description=description,
map_input_pin_spec={
Expand Down
195 changes: 189 additions & 6 deletions src/ansys/dpf/core/operators/result/equivalent_mass.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,25 @@ class equivalent_mass(Operator):
all_dofs : bool, optional
Default is false.
mesh : MeshedRegion or MeshesContainer, optional
Prevents from reading the mesh in the result
files
Mesh. if cylic expansion is to be done, mesh
of the base sector
read_cyclic : int, optional
If 0 cyclic symmetry is ignored, if 1 cyclic
sector is read, if 2 cyclic expansion
is done, if 3 cyclic expansion is
done and stages are merged (default
is 1)
expanded_meshed_region : MeshedRegion or MeshesContainer, optional
Mesh expanded, use if cyclic expansion is to
be done.
sectors_to_expand : Scoping or ScopingsContainer, optional
Sectors to expand (start at 0), for
multistage: use scopings container
with 'stage' label, use if cyclic
expansion is to be done.
phi : float, optional
Angle phi in degrees (default value 0.0), use
if cyclic expansion is to be done.

Returns
-------
Expand Down Expand Up @@ -86,6 +103,14 @@ class equivalent_mass(Operator):
>>> op.inputs.all_dofs.connect(my_all_dofs)
>>> my_mesh = dpf.MeshedRegion()
>>> op.inputs.mesh.connect(my_mesh)
>>> my_read_cyclic = int()
>>> op.inputs.read_cyclic.connect(my_read_cyclic)
>>> my_expanded_meshed_region = dpf.MeshedRegion()
>>> op.inputs.expanded_meshed_region.connect(my_expanded_meshed_region)
>>> my_sectors_to_expand = dpf.Scoping()
>>> op.inputs.sectors_to_expand.connect(my_sectors_to_expand)
>>> my_phi = float()
>>> op.inputs.phi.connect(my_phi)

>>> # Instantiate operator and connect inputs in one line
>>> op = dpf.operators.result.equivalent_mass(
Expand All @@ -96,6 +121,10 @@ class equivalent_mass(Operator):
... data_sources=my_data_sources,
... all_dofs=my_all_dofs,
... mesh=my_mesh,
... read_cyclic=my_read_cyclic,
... expanded_meshed_region=my_expanded_meshed_region,
... sectors_to_expand=my_sectors_to_expand,
... phi=my_phi,
... )

>>> # Get output data
Expand All @@ -111,6 +140,10 @@ def __init__(
data_sources=None,
all_dofs=None,
mesh=None,
read_cyclic=None,
expanded_meshed_region=None,
sectors_to_expand=None,
phi=None,
config=None,
server=None,
):
Expand All @@ -131,6 +164,14 @@ def __init__(
self.inputs.all_dofs.connect(all_dofs)
if mesh is not None:
self.inputs.mesh.connect(mesh)
if read_cyclic is not None:
self.inputs.read_cyclic.connect(read_cyclic)
if expanded_meshed_region is not None:
self.inputs.expanded_meshed_region.connect(expanded_meshed_region)
if sectors_to_expand is not None:
self.inputs.sectors_to_expand.connect(sectors_to_expand)
if phi is not None:
self.inputs.phi.connect(phi)

@staticmethod
def _spec():
Expand Down Expand Up @@ -213,8 +254,41 @@ def _spec():
name="mesh",
type_names=["abstract_meshed_region", "meshes_container"],
optional=True,
document="""Prevents from reading the mesh in the result
files""",
document="""Mesh. if cylic expansion is to be done, mesh
of the base sector""",
),
14: PinSpecification(
name="read_cyclic",
type_names=["enum dataProcessing::ECyclicReading", "int32"],
optional=True,
document="""If 0 cyclic symmetry is ignored, if 1 cyclic
sector is read, if 2 cyclic expansion
is done, if 3 cyclic expansion is
done and stages are merged (default
is 1)""",
),
15: PinSpecification(
name="expanded_meshed_region",
type_names=["abstract_meshed_region", "meshes_container"],
optional=True,
document="""Mesh expanded, use if cyclic expansion is to
be done.""",
),
18: PinSpecification(
name="sectors_to_expand",
type_names=["vector<int32>", "scoping", "scopings_container"],
optional=True,
document="""Sectors to expand (start at 0), for
multistage: use scopings container
with 'stage' label, use if cyclic
expansion is to be done.""",
),
19: PinSpecification(
name="phi",
type_names=["double"],
optional=True,
document="""Angle phi in degrees (default value 0.0), use
if cyclic expansion is to be done.""",
),
},
map_output_pin_spec={
Expand Down Expand Up @@ -287,6 +361,14 @@ class InputsEquivalentMass(_Inputs):
>>> op.inputs.all_dofs.connect(my_all_dofs)
>>> my_mesh = dpf.MeshedRegion()
>>> op.inputs.mesh.connect(my_mesh)
>>> my_read_cyclic = int()
>>> op.inputs.read_cyclic.connect(my_read_cyclic)
>>> my_expanded_meshed_region = dpf.MeshedRegion()
>>> op.inputs.expanded_meshed_region.connect(my_expanded_meshed_region)
>>> my_sectors_to_expand = dpf.Scoping()
>>> op.inputs.sectors_to_expand.connect(my_sectors_to_expand)
>>> my_phi = float()
>>> op.inputs.phi.connect(my_phi)
"""

def __init__(self, op: Operator):
Expand All @@ -305,6 +387,18 @@ def __init__(self, op: Operator):
self._inputs.append(self._all_dofs)
self._mesh = Input(equivalent_mass._spec().input_pin(7), 7, op, -1)
self._inputs.append(self._mesh)
self._read_cyclic = Input(equivalent_mass._spec().input_pin(14), 14, op, -1)
self._inputs.append(self._read_cyclic)
self._expanded_meshed_region = Input(
equivalent_mass._spec().input_pin(15), 15, op, -1
)
self._inputs.append(self._expanded_meshed_region)
self._sectors_to_expand = Input(
equivalent_mass._spec().input_pin(18), 18, op, -1
)
self._inputs.append(self._sectors_to_expand)
self._phi = Input(equivalent_mass._spec().input_pin(19), 19, op, -1)
self._inputs.append(self._phi)

@property
def time_scoping(self):
Expand Down Expand Up @@ -457,8 +551,8 @@ def all_dofs(self):
def mesh(self):
"""Allows to connect mesh input to the operator.

Prevents from reading the mesh in the result
files
Mesh. if cylic expansion is to be done, mesh
of the base sector

Parameters
----------
Expand All @@ -474,6 +568,95 @@ def mesh(self):
"""
return self._mesh

@property
def read_cyclic(self):
"""Allows to connect read_cyclic input to the operator.

If 0 cyclic symmetry is ignored, if 1 cyclic
sector is read, if 2 cyclic expansion
is done, if 3 cyclic expansion is
done and stages are merged (default
is 1)

Parameters
----------
my_read_cyclic : int

Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.result.equivalent_mass()
>>> op.inputs.read_cyclic.connect(my_read_cyclic)
>>> # or
>>> op.inputs.read_cyclic(my_read_cyclic)
"""
return self._read_cyclic

@property
def expanded_meshed_region(self):
"""Allows to connect expanded_meshed_region input to the operator.

Mesh expanded, use if cyclic expansion is to
be done.

Parameters
----------
my_expanded_meshed_region : MeshedRegion or MeshesContainer

Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.result.equivalent_mass()
>>> op.inputs.expanded_meshed_region.connect(my_expanded_meshed_region)
>>> # or
>>> op.inputs.expanded_meshed_region(my_expanded_meshed_region)
"""
return self._expanded_meshed_region

@property
def sectors_to_expand(self):
"""Allows to connect sectors_to_expand input to the operator.

Sectors to expand (start at 0), for
multistage: use scopings container
with 'stage' label, use if cyclic
expansion is to be done.

Parameters
----------
my_sectors_to_expand : Scoping or ScopingsContainer

Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.result.equivalent_mass()
>>> op.inputs.sectors_to_expand.connect(my_sectors_to_expand)
>>> # or
>>> op.inputs.sectors_to_expand(my_sectors_to_expand)
"""
return self._sectors_to_expand

@property
def phi(self):
"""Allows to connect phi input to the operator.

Angle phi in degrees (default value 0.0), use
if cyclic expansion is to be done.

Parameters
----------
my_phi : float

Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.result.equivalent_mass()
>>> op.inputs.phi.connect(my_phi)
>>> # or
>>> op.inputs.phi(my_phi)
"""
return self._phi


class OutputsEquivalentMass(_Outputs):
"""Intermediate class used to get outputs from
Expand Down
Loading
Loading