Skip to content

Commit 7c31136

Browse files
authored
update generated code
1 parent 5c3eb1c commit 7c31136

22 files changed

+1509
-67
lines changed

doc/source/_static/dpf_operators.html

Lines changed: 12 additions & 5 deletions
Large diffs are not rendered by default.

src/ansys/dpf/core/operators/averaging/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from .elemental_to_elemental_nodal import elemental_to_elemental_nodal
1111
from .elemental_to_elemental_nodal_fc import elemental_to_elemental_nodal_fc
1212
from .elemental_to_nodal import elemental_to_nodal
13+
from .elemental_to_nodal_fc import elemental_to_nodal_fc
1314
from .extend_to_mid_nodes import extend_to_mid_nodes
1415
from .extend_to_mid_nodes_fc import extend_to_mid_nodes_fc
1516
from .force_summation import force_summation
@@ -20,5 +21,6 @@
2021
from .nodal_to_elemental import nodal_to_elemental
2122
from .nodal_to_elemental_fc import nodal_to_elemental_fc
2223
from .to_elemental_fc import to_elemental_fc
24+
from .to_elemental_nodal_fc import to_elemental_nodal_fc
2325
from .to_nodal import to_nodal
2426
from .to_nodal_fc import to_nodal_fc
Lines changed: 377 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,377 @@
1+
"""
2+
elemental_to_nodal_fc
3+
=====================
4+
Autogenerated DPF operator classes.
5+
"""
6+
7+
from warnings import warn
8+
from ansys.dpf.core.dpf_operator import Operator
9+
from ansys.dpf.core.inputs import Input, _Inputs
10+
from ansys.dpf.core.outputs import Output, _Outputs
11+
from ansys.dpf.core.operators.specification import PinSpecification, Specification
12+
13+
14+
class elemental_to_nodal_fc(Operator):
15+
"""Transforms Elemental Nodal fields to Nodal fields. The result is
16+
computed on a given node's scoping.1. For a finite element mesh,
17+
the value on a node is the average of the values of the neighbour
18+
elements. 2. For a finite volume mesh, the agorithm is : - For
19+
each node, compute interpolation weights for the cells connected
20+
to it based on the Frink's Laplacian method. - If the
21+
determinant of the I matrix is zero, switch to an inverse distance
22+
weighted average. - If not, compute the Frink weights and
23+
apply the Holmes' weight clip. - If the clipping produces
24+
a large overshoot, inverse volume weighted average is used.. 3.
25+
For a face finite volume mesh inverse distance weighted average is
26+
used.
27+
28+
Parameters
29+
----------
30+
fields_container : FieldsContainer
31+
mesh : MeshedRegion or MeshesContainer, optional
32+
force_averaging : int, optional
33+
Averaging on nodes is used if this pin is set
34+
to 1 (default is 1 for integrated
35+
results and 0 for discrete ones).
36+
mesh_scoping : Scoping or ScopingsContainer, optional
37+
algorithm : int, optional
38+
Forces the usage of algorithm 1, 2 or 3
39+
(default is chosen based on the type
40+
of mesh).
41+
42+
Returns
43+
-------
44+
fields_container : FieldsContainer
45+
46+
Examples
47+
--------
48+
>>> from ansys.dpf import core as dpf
49+
50+
>>> # Instantiate operator
51+
>>> op = dpf.operators.averaging.elemental_to_nodal_fc()
52+
53+
>>> # Make input connections
54+
>>> my_fields_container = dpf.FieldsContainer()
55+
>>> op.inputs.fields_container.connect(my_fields_container)
56+
>>> my_mesh = dpf.MeshedRegion()
57+
>>> op.inputs.mesh.connect(my_mesh)
58+
>>> my_force_averaging = int()
59+
>>> op.inputs.force_averaging.connect(my_force_averaging)
60+
>>> my_mesh_scoping = dpf.Scoping()
61+
>>> op.inputs.mesh_scoping.connect(my_mesh_scoping)
62+
>>> my_algorithm = int()
63+
>>> op.inputs.algorithm.connect(my_algorithm)
64+
65+
>>> # Instantiate operator and connect inputs in one line
66+
>>> op = dpf.operators.averaging.elemental_to_nodal_fc(
67+
... fields_container=my_fields_container,
68+
... mesh=my_mesh,
69+
... force_averaging=my_force_averaging,
70+
... mesh_scoping=my_mesh_scoping,
71+
... algorithm=my_algorithm,
72+
... )
73+
74+
>>> # Get output data
75+
>>> result_fields_container = op.outputs.fields_container()
76+
"""
77+
78+
def __init__(
79+
self,
80+
fields_container=None,
81+
mesh=None,
82+
force_averaging=None,
83+
mesh_scoping=None,
84+
algorithm=None,
85+
config=None,
86+
server=None,
87+
):
88+
super().__init__(name="elemental_to_nodal_fc", config=config, server=server)
89+
self._inputs = InputsElementalToNodalFc(self)
90+
self._outputs = OutputsElementalToNodalFc(self)
91+
if fields_container is not None:
92+
self.inputs.fields_container.connect(fields_container)
93+
if mesh is not None:
94+
self.inputs.mesh.connect(mesh)
95+
if force_averaging is not None:
96+
self.inputs.force_averaging.connect(force_averaging)
97+
if mesh_scoping is not None:
98+
self.inputs.mesh_scoping.connect(mesh_scoping)
99+
if algorithm is not None:
100+
self.inputs.algorithm.connect(algorithm)
101+
102+
@staticmethod
103+
def _spec():
104+
description = """Transforms Elemental Nodal fields to Nodal fields. The result is
105+
computed on a given node's scoping.1. For a finite element
106+
mesh, the value on a node is the average of the values of
107+
the neighbour elements. 2. For a finite volume mesh, the
108+
agorithm is : - For each node, compute interpolation
109+
weights for the cells connected to it based on the
110+
Frink's Laplacian method. - If the determinant of
111+
the I matrix is zero, switch to an inverse distance
112+
weighted average. - If not, compute the Frink
113+
weights and apply the Holmes' weight clip. - If
114+
the clipping produces a large overshoot, inverse volume
115+
weighted average is used.. 3. For a face finite volume
116+
mesh inverse distance weighted average is used."""
117+
spec = Specification(
118+
description=description,
119+
map_input_pin_spec={
120+
0: PinSpecification(
121+
name="fields_container",
122+
type_names=["fields_container"],
123+
optional=False,
124+
document="""""",
125+
),
126+
1: PinSpecification(
127+
name="mesh",
128+
type_names=["abstract_meshed_region", "meshes_container"],
129+
optional=True,
130+
document="""""",
131+
),
132+
2: PinSpecification(
133+
name="force_averaging",
134+
type_names=["int32"],
135+
optional=True,
136+
document="""Averaging on nodes is used if this pin is set
137+
to 1 (default is 1 for integrated
138+
results and 0 for discrete ones).""",
139+
),
140+
3: PinSpecification(
141+
name="mesh_scoping",
142+
type_names=["scoping", "scopings_container"],
143+
optional=True,
144+
document="""""",
145+
),
146+
200: PinSpecification(
147+
name="algorithm",
148+
type_names=["int32"],
149+
optional=True,
150+
document="""Forces the usage of algorithm 1, 2 or 3
151+
(default is chosen based on the type
152+
of mesh).""",
153+
),
154+
},
155+
map_output_pin_spec={
156+
0: PinSpecification(
157+
name="fields_container",
158+
type_names=["fields_container"],
159+
optional=False,
160+
document="""""",
161+
),
162+
},
163+
)
164+
return spec
165+
166+
@staticmethod
167+
def default_config(server=None):
168+
"""Returns the default config of the operator.
169+
170+
This config can then be changed to the user needs and be used to
171+
instantiate the operator. The Configuration allows to customize
172+
how the operation will be processed by the operator.
173+
174+
Parameters
175+
----------
176+
server : server.DPFServer, optional
177+
Server with channel connected to the remote or local instance. When
178+
``None``, attempts to use the global server.
179+
"""
180+
return Operator.default_config(name="elemental_to_nodal_fc", server=server)
181+
182+
@property
183+
def inputs(self):
184+
"""Enables to connect inputs to the operator
185+
186+
Returns
187+
--------
188+
inputs : InputsElementalToNodalFc
189+
"""
190+
return super().inputs
191+
192+
@property
193+
def outputs(self):
194+
"""Enables to get outputs of the operator by evaluating it
195+
196+
Returns
197+
--------
198+
outputs : OutputsElementalToNodalFc
199+
"""
200+
return super().outputs
201+
202+
203+
class InputsElementalToNodalFc(_Inputs):
204+
"""Intermediate class used to connect user inputs to
205+
elemental_to_nodal_fc operator.
206+
207+
Examples
208+
--------
209+
>>> from ansys.dpf import core as dpf
210+
>>> op = dpf.operators.averaging.elemental_to_nodal_fc()
211+
>>> my_fields_container = dpf.FieldsContainer()
212+
>>> op.inputs.fields_container.connect(my_fields_container)
213+
>>> my_mesh = dpf.MeshedRegion()
214+
>>> op.inputs.mesh.connect(my_mesh)
215+
>>> my_force_averaging = int()
216+
>>> op.inputs.force_averaging.connect(my_force_averaging)
217+
>>> my_mesh_scoping = dpf.Scoping()
218+
>>> op.inputs.mesh_scoping.connect(my_mesh_scoping)
219+
>>> my_algorithm = int()
220+
>>> op.inputs.algorithm.connect(my_algorithm)
221+
"""
222+
223+
def __init__(self, op: Operator):
224+
super().__init__(elemental_to_nodal_fc._spec().inputs, op)
225+
self._fields_container = Input(
226+
elemental_to_nodal_fc._spec().input_pin(0), 0, op, -1
227+
)
228+
self._inputs.append(self._fields_container)
229+
self._mesh = Input(elemental_to_nodal_fc._spec().input_pin(1), 1, op, -1)
230+
self._inputs.append(self._mesh)
231+
self._force_averaging = Input(
232+
elemental_to_nodal_fc._spec().input_pin(2), 2, op, -1
233+
)
234+
self._inputs.append(self._force_averaging)
235+
self._mesh_scoping = Input(
236+
elemental_to_nodal_fc._spec().input_pin(3), 3, op, -1
237+
)
238+
self._inputs.append(self._mesh_scoping)
239+
self._algorithm = Input(
240+
elemental_to_nodal_fc._spec().input_pin(200), 200, op, -1
241+
)
242+
self._inputs.append(self._algorithm)
243+
244+
@property
245+
def fields_container(self):
246+
"""Allows to connect fields_container input to the operator.
247+
248+
Parameters
249+
----------
250+
my_fields_container : FieldsContainer
251+
252+
Examples
253+
--------
254+
>>> from ansys.dpf import core as dpf
255+
>>> op = dpf.operators.averaging.elemental_to_nodal_fc()
256+
>>> op.inputs.fields_container.connect(my_fields_container)
257+
>>> # or
258+
>>> op.inputs.fields_container(my_fields_container)
259+
"""
260+
return self._fields_container
261+
262+
@property
263+
def mesh(self):
264+
"""Allows to connect mesh input to the operator.
265+
266+
Parameters
267+
----------
268+
my_mesh : MeshedRegion or MeshesContainer
269+
270+
Examples
271+
--------
272+
>>> from ansys.dpf import core as dpf
273+
>>> op = dpf.operators.averaging.elemental_to_nodal_fc()
274+
>>> op.inputs.mesh.connect(my_mesh)
275+
>>> # or
276+
>>> op.inputs.mesh(my_mesh)
277+
"""
278+
return self._mesh
279+
280+
@property
281+
def force_averaging(self):
282+
"""Allows to connect force_averaging input to the operator.
283+
284+
Averaging on nodes is used if this pin is set
285+
to 1 (default is 1 for integrated
286+
results and 0 for discrete ones).
287+
288+
Parameters
289+
----------
290+
my_force_averaging : int
291+
292+
Examples
293+
--------
294+
>>> from ansys.dpf import core as dpf
295+
>>> op = dpf.operators.averaging.elemental_to_nodal_fc()
296+
>>> op.inputs.force_averaging.connect(my_force_averaging)
297+
>>> # or
298+
>>> op.inputs.force_averaging(my_force_averaging)
299+
"""
300+
return self._force_averaging
301+
302+
@property
303+
def mesh_scoping(self):
304+
"""Allows to connect mesh_scoping input to the operator.
305+
306+
Parameters
307+
----------
308+
my_mesh_scoping : Scoping or ScopingsContainer
309+
310+
Examples
311+
--------
312+
>>> from ansys.dpf import core as dpf
313+
>>> op = dpf.operators.averaging.elemental_to_nodal_fc()
314+
>>> op.inputs.mesh_scoping.connect(my_mesh_scoping)
315+
>>> # or
316+
>>> op.inputs.mesh_scoping(my_mesh_scoping)
317+
"""
318+
return self._mesh_scoping
319+
320+
@property
321+
def algorithm(self):
322+
"""Allows to connect algorithm input to the operator.
323+
324+
Forces the usage of algorithm 1, 2 or 3
325+
(default is chosen based on the type
326+
of mesh).
327+
328+
Parameters
329+
----------
330+
my_algorithm : int
331+
332+
Examples
333+
--------
334+
>>> from ansys.dpf import core as dpf
335+
>>> op = dpf.operators.averaging.elemental_to_nodal_fc()
336+
>>> op.inputs.algorithm.connect(my_algorithm)
337+
>>> # or
338+
>>> op.inputs.algorithm(my_algorithm)
339+
"""
340+
return self._algorithm
341+
342+
343+
class OutputsElementalToNodalFc(_Outputs):
344+
"""Intermediate class used to get outputs from
345+
elemental_to_nodal_fc operator.
346+
347+
Examples
348+
--------
349+
>>> from ansys.dpf import core as dpf
350+
>>> op = dpf.operators.averaging.elemental_to_nodal_fc()
351+
>>> # Connect inputs : op.inputs. ...
352+
>>> result_fields_container = op.outputs.fields_container()
353+
"""
354+
355+
def __init__(self, op: Operator):
356+
super().__init__(elemental_to_nodal_fc._spec().outputs, op)
357+
self._fields_container = Output(
358+
elemental_to_nodal_fc._spec().output_pin(0), 0, op
359+
)
360+
self._outputs.append(self._fields_container)
361+
362+
@property
363+
def fields_container(self):
364+
"""Allows to get fields_container output of the operator
365+
366+
Returns
367+
----------
368+
my_fields_container : FieldsContainer
369+
370+
Examples
371+
--------
372+
>>> from ansys.dpf import core as dpf
373+
>>> op = dpf.operators.averaging.elemental_to_nodal_fc()
374+
>>> # Connect inputs : op.inputs. ...
375+
>>> result_fields_container = op.outputs.fields_container()
376+
""" # noqa: E501
377+
return self._fields_container

0 commit comments

Comments
 (0)