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: 3 additions & 1 deletion docs/source/_static/dpf_entry.html

Large diffs are not rendered by default.

56 changes: 29 additions & 27 deletions docs/source/_static/dpf_premium.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/ansys/dpf/core/operators/averaging/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from .nodal_to_elemental_fc import nodal_to_elemental_fc
from .to_elemental_nodal_fc import to_elemental_nodal_fc
from .elemental_fraction_fc import elemental_fraction_fc
from .elemental_difference import elemental_difference
from .elemental_difference_fc import elemental_difference_fc
from .elemental_difference import elemental_difference
from .extend_to_mid_nodes_fc import extend_to_mid_nodes_fc
from .extend_to_mid_nodes import extend_to_mid_nodes
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class elemental_nodal_to_nodal(Operator):
Compute mid nodes (when available) by
averaging neighbour primary nodes
extend_weights_to_mid_nodes : bool, optional
Assigns weights = 2 to mid nodes (when
Extends weights to mid nodes (when
available). default is false
mesh : MeshedRegion, optional

Expand Down Expand Up @@ -136,7 +136,7 @@ def _spec():
name="extend_weights_to_mid_nodes",
type_names=["bool"],
optional=True,
document="""Assigns weights = 2 to mid nodes (when
document="""Extends weights to mid nodes (when
available). default is false""",
),
7: PinSpecification(
Expand Down Expand Up @@ -335,7 +335,7 @@ def extend_to_mid_nodes(self):
def extend_weights_to_mid_nodes(self):
"""Allows to connect extend_weights_to_mid_nodes input to the operator.

Assigns weights = 2 to mid nodes (when
Extends weights to mid nodes (when
available). default is false

Parameters
Expand Down Expand Up @@ -423,4 +423,4 @@ def weight(self):
>>> # Connect inputs : op.inputs. ...
>>> result_weight = op.outputs.weight()
""" # noqa: E501
return self._weight
return self._weight
Original file line number Diff line number Diff line change
Expand Up @@ -448,4 +448,4 @@ def weights(self):
>>> # Connect inputs : op.inputs. ...
>>> result_weights = op.outputs.weights()
""" # noqa: E501
return self._weights
return self._weights
4 changes: 2 additions & 2 deletions src/ansys/dpf/core/operators/geo/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from .rotate_in_cylindrical_cs_fc import rotate_in_cylindrical_cs_fc
from .elements_volumes_over_time import elements_volumes_over_time
from .normals_provider_nl import normals_provider_nl
from .rotate_in_cylindrical_cs import rotate_in_cylindrical_cs
from .rotate import rotate
from .rotate_fc import rotate_fc
from .to_polar_coordinates import to_polar_coordinates
from .normals_provider_nl import normals_provider_nl
from .elements_volumes_over_time import elements_volumes_over_time
from .elements_facets_surfaces_over_time import elements_facets_surfaces_over_time
from .gauss_to_node import gauss_to_node
from .elements_volume import elements_volume
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/dpf/core/operators/mapping/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .solid_to_skin import solid_to_skin
from .scoping_on_coordinates import scoping_on_coordinates
from .find_reduced_coordinates import find_reduced_coordinates
from .on_reduced_coordinates import on_reduced_coordinates
from .on_coordinates import on_coordinates
from .solid_to_skin import solid_to_skin
from .prepare_mapping_workflow import prepare_mapping_workflow
61 changes: 61 additions & 0 deletions src/ansys/dpf/core/operators/math/time_freq_interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ class time_freq_interpolation(Operator):
should be its scoping.
interpolation_type : int, optional
1 is ramped, 2 is stepped, default is 0.
force_new_time_freq_support : bool, optional
If set to true, the output fields container
will always have a new time freq
support rescoped to the output
time_freq_values (default is false).
if set to false, the time freq
support is only recreated when time
or frequency values are between
existing ones.
time_freq_support : TimeFreqSupport, optional


Expand All @@ -50,6 +59,8 @@ class time_freq_interpolation(Operator):
>>> op.inputs.step.connect(my_step)
>>> my_interpolation_type = int()
>>> op.inputs.interpolation_type.connect(my_interpolation_type)
>>> my_force_new_time_freq_support = bool()
>>> op.inputs.force_new_time_freq_support.connect(my_force_new_time_freq_support)
>>> my_time_freq_support = dpf.TimeFreqSupport()
>>> op.inputs.time_freq_support.connect(my_time_freq_support)

Expand All @@ -59,6 +70,7 @@ class time_freq_interpolation(Operator):
... time_freq_values=my_time_freq_values,
... step=my_step,
... interpolation_type=my_interpolation_type,
... force_new_time_freq_support=my_force_new_time_freq_support,
... time_freq_support=my_time_freq_support,
... )

Expand All @@ -72,6 +84,7 @@ def __init__(
time_freq_values=None,
step=None,
interpolation_type=None,
force_new_time_freq_support=None,
time_freq_support=None,
config=None,
server=None,
Expand All @@ -87,6 +100,8 @@ def __init__(
self.inputs.step.connect(step)
if interpolation_type is not None:
self.inputs.interpolation_type.connect(interpolation_type)
if force_new_time_freq_support is not None:
self.inputs.force_new_time_freq_support.connect(force_new_time_freq_support)
if time_freq_support is not None:
self.inputs.time_freq_support.connect(time_freq_support)

Expand Down Expand Up @@ -130,6 +145,19 @@ def _spec():
optional=True,
document="""1 is ramped, 2 is stepped, default is 0.""",
),
4: PinSpecification(
name="force_new_time_freq_support",
type_names=["bool"],
optional=True,
document="""If set to true, the output fields container
will always have a new time freq
support rescoped to the output
time_freq_values (default is false).
if set to false, the time freq
support is only recreated when time
or frequency values are between
existing ones.""",
),
8: PinSpecification(
name="time_freq_support",
type_names=["time_freq_support"],
Expand Down Expand Up @@ -201,6 +229,8 @@ class InputsTimeFreqInterpolation(_Inputs):
>>> op.inputs.step.connect(my_step)
>>> my_interpolation_type = int()
>>> op.inputs.interpolation_type.connect(my_interpolation_type)
>>> my_force_new_time_freq_support = bool()
>>> op.inputs.force_new_time_freq_support.connect(my_force_new_time_freq_support)
>>> my_time_freq_support = dpf.TimeFreqSupport()
>>> op.inputs.time_freq_support.connect(my_time_freq_support)
"""
Expand All @@ -221,6 +251,10 @@ def __init__(self, op: Operator):
time_freq_interpolation._spec().input_pin(3), 3, op, -1
)
self._inputs.append(self._interpolation_type)
self._force_new_time_freq_support = Input(
time_freq_interpolation._spec().input_pin(4), 4, op, -1
)
self._inputs.append(self._force_new_time_freq_support)
self._time_freq_support = Input(
time_freq_interpolation._spec().input_pin(8), 8, op, -1
)
Expand Down Expand Up @@ -308,6 +342,33 @@ def interpolation_type(self):
"""
return self._interpolation_type

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

If set to true, the output fields container
will always have a new time freq
support rescoped to the output
time_freq_values (default is false).
if set to false, the time freq
support is only recreated when time
or frequency values are between
existing ones.

Parameters
----------
my_force_new_time_freq_support : bool

Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.math.time_freq_interpolation()
>>> op.inputs.force_new_time_freq_support.connect(my_force_new_time_freq_support)
>>> # or
>>> op.inputs.force_new_time_freq_support(my_force_new_time_freq_support)
"""
return self._force_new_time_freq_support

@property
def time_freq_support(self):
"""Allows to connect time_freq_support input to the operator.
Expand Down
4 changes: 2 additions & 2 deletions src/ansys/dpf/core/operators/mesh/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
from .mesh_provider import mesh_provider
from .meshes_provider import meshes_provider
from .beam_properties import beam_properties
from .merge_meshes import merge_meshes
from .get_attribute import get_attribute
from .points_from_coordinates import points_from_coordinates
from .change_cs import change_cs
from .from_scoping import from_scoping
from .split_fields import split_fields
from .split_mesh import split_mesh
from .points_from_coordinates import points_from_coordinates
from .mesh_clip import mesh_clip
from .make_sphere_levelset import make_sphere_levelset
from .tri_mesh_skin import tri_mesh_skin
Expand Down
36 changes: 35 additions & 1 deletion src/ansys/dpf/core/operators/mesh/acmo_mesh_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class acmo_mesh_provider(Operator):
Parameters
----------
assembly_mesh : AnsDispatchHolder or Struct Iansdispatch
unit : str, optional


Examples
Expand All @@ -28,22 +29,27 @@ class acmo_mesh_provider(Operator):
>>> # Make input connections
>>> my_assembly_mesh = dpf.AnsDispatchHolder()
>>> op.inputs.assembly_mesh.connect(my_assembly_mesh)
>>> my_unit = str()
>>> op.inputs.unit.connect(my_unit)

>>> # Instantiate operator and connect inputs in one line
>>> op = dpf.operators.mesh.acmo_mesh_provider(
... assembly_mesh=my_assembly_mesh,
... unit=my_unit,
... )

>>> # Get output data
>>> result_meshes_container = op.outputs.meshes_container()
"""

def __init__(self, assembly_mesh=None, config=None, server=None):
def __init__(self, assembly_mesh=None, unit=None, config=None, server=None):
super().__init__(name="acmo_mesh_provider", config=config, server=server)
self._inputs = InputsAcmoMeshProvider(self)
self._outputs = OutputsAcmoMeshProvider(self)
if assembly_mesh is not None:
self.inputs.assembly_mesh.connect(assembly_mesh)
if unit is not None:
self.inputs.unit.connect(unit)

@staticmethod
def _spec():
Expand All @@ -57,6 +63,12 @@ def _spec():
optional=False,
document="""""",
),
1: PinSpecification(
name="unit",
type_names=["string"],
optional=True,
document="""""",
),
},
map_output_pin_spec={
0: PinSpecification(
Expand Down Expand Up @@ -116,12 +128,16 @@ class InputsAcmoMeshProvider(_Inputs):
>>> op = dpf.operators.mesh.acmo_mesh_provider()
>>> my_assembly_mesh = dpf.AnsDispatchHolder()
>>> op.inputs.assembly_mesh.connect(my_assembly_mesh)
>>> my_unit = str()
>>> op.inputs.unit.connect(my_unit)
"""

def __init__(self, op: Operator):
super().__init__(acmo_mesh_provider._spec().inputs, op)
self._assembly_mesh = Input(acmo_mesh_provider._spec().input_pin(0), 0, op, -1)
self._inputs.append(self._assembly_mesh)
self._unit = Input(acmo_mesh_provider._spec().input_pin(1), 1, op, -1)
self._inputs.append(self._unit)

@property
def assembly_mesh(self):
Expand All @@ -141,6 +157,24 @@ def assembly_mesh(self):
"""
return self._assembly_mesh

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

Parameters
----------
my_unit : str

Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.mesh.acmo_mesh_provider()
>>> op.inputs.unit.connect(my_unit)
>>> # or
>>> op.inputs.unit(my_unit)
"""
return self._unit


class OutputsAcmoMeshProvider(_Outputs):
"""Intermediate class used to get outputs from
Expand Down
27 changes: 15 additions & 12 deletions src/ansys/dpf/core/operators/mesh/decimate_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,23 @@


class decimate_mesh(Operator):
"""Decimate a surface meshed region with triangle elements
"""Decimate a meshed region

Parameters
----------
mesh : MeshedRegion
Mesh to decimate
preservation_ratio : float, optional
Ratio of triangles to preserve. default value
is 0.5.
Target ratio of elements to preserve, the
actual number of elements preserved
might differ. default value is 0.5.
aggressiveness : int, optional
Quality measure for the resulting decimated
mesh. lower aggresiveness will
provide a higher quality mesh with
the tradeoff of higher execution
time. value range is 0 to 150,
default is 1.
default is 0.


Examples
Expand Down Expand Up @@ -75,7 +76,7 @@ def __init__(

@staticmethod
def _spec():
description = """Decimate a surface meshed region with triangle elements"""
description = """Decimate a meshed region"""
spec = Specification(
description=description,
map_input_pin_spec={
Expand All @@ -89,8 +90,9 @@ def _spec():
name="preservation_ratio",
type_names=["double"],
optional=True,
document="""Ratio of triangles to preserve. default value
is 0.5.""",
document="""Target ratio of elements to preserve, the
actual number of elements preserved
might differ. default value is 0.5.""",
),
2: PinSpecification(
name="aggressiveness",
Expand All @@ -101,15 +103,15 @@ def _spec():
provide a higher quality mesh with
the tradeoff of higher execution
time. value range is 0 to 150,
default is 1.""",
default is 0.""",
),
},
map_output_pin_spec={
0: PinSpecification(
name="mesh",
type_names=["abstract_meshed_region"],
optional=False,
document="""Decimated mesh""",
document="""Decimated mesh with triangle elements""",
),
},
)
Expand Down Expand Up @@ -201,8 +203,9 @@ def mesh(self):
def preservation_ratio(self):
"""Allows to connect preservation_ratio input to the operator.

Ratio of triangles to preserve. default value
is 0.5.
Target ratio of elements to preserve, the
actual number of elements preserved
might differ. default value is 0.5.

Parameters
----------
Expand All @@ -227,7 +230,7 @@ def aggressiveness(self):
provide a higher quality mesh with
the tradeoff of higher execution
time. value range is 0 to 150,
default is 1.
default is 0.

Parameters
----------
Expand Down
Loading