Skip to content

Commit c1f205d

Browse files
update generated code (#1175)
Co-authored-by: rlagha <[email protected]>
1 parent 2548df5 commit c1f205d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1151
-313
lines changed

docs/source/_static/dpf_operators.html

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

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
from .identical_fields import identical_fields
1414
from .identical_meshes import identical_meshes
1515
from .identical_property_fields import identical_property_fields
16+
from .identical_string_fields import identical_string_fields
1617
from .included_fields import included_fields
1718
from .solid_shell_fields import solid_shell_fields
Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
"""
2+
identical_string_fields
3+
=======================
4+
Autogenerated DPF operator classes.
5+
"""
6+
from warnings import warn
7+
from ansys.dpf.core.dpf_operator import Operator
8+
from ansys.dpf.core.inputs import Input, _Inputs
9+
from ansys.dpf.core.outputs import Output, _Outputs
10+
from ansys.dpf.core.operators.specification import PinSpecification, Specification
11+
12+
13+
class identical_string_fields(Operator):
14+
"""Takes two string fields and compares them.
15+
16+
Parameters
17+
----------
18+
string_fieldA : StringField
19+
string_fieldB : StringField
20+
21+
22+
Examples
23+
--------
24+
>>> from ansys.dpf import core as dpf
25+
26+
>>> # Instantiate operator
27+
>>> op = dpf.operators.logic.identical_string_fields()
28+
29+
>>> # Make input connections
30+
>>> my_string_fieldA = dpf.StringField()
31+
>>> op.inputs.string_fieldA.connect(my_string_fieldA)
32+
>>> my_string_fieldB = dpf.StringField()
33+
>>> op.inputs.string_fieldB.connect(my_string_fieldB)
34+
35+
>>> # Instantiate operator and connect inputs in one line
36+
>>> op = dpf.operators.logic.identical_string_fields(
37+
... string_fieldA=my_string_fieldA,
38+
... string_fieldB=my_string_fieldB,
39+
... )
40+
41+
>>> # Get output data
42+
>>> result_are_identical = op.outputs.are_identical()
43+
>>> result_information = op.outputs.information()
44+
"""
45+
46+
def __init__(
47+
self, string_fieldA=None, string_fieldB=None, config=None, server=None
48+
):
49+
super().__init__(name="compare::string_field", config=config, server=server)
50+
self._inputs = InputsIdenticalStringFields(self)
51+
self._outputs = OutputsIdenticalStringFields(self)
52+
if string_fieldA is not None:
53+
self.inputs.string_fieldA.connect(string_fieldA)
54+
if string_fieldB is not None:
55+
self.inputs.string_fieldB.connect(string_fieldB)
56+
57+
@staticmethod
58+
def _spec():
59+
description = """Takes two string fields and compares them."""
60+
spec = Specification(
61+
description=description,
62+
map_input_pin_spec={
63+
0: PinSpecification(
64+
name="string_fieldA",
65+
type_names=["string_field"],
66+
optional=False,
67+
document="""""",
68+
),
69+
1: PinSpecification(
70+
name="string_fieldB",
71+
type_names=["string_field"],
72+
optional=False,
73+
document="""""",
74+
),
75+
},
76+
map_output_pin_spec={
77+
0: PinSpecification(
78+
name="are_identical",
79+
type_names=["bool"],
80+
optional=False,
81+
document="""""",
82+
),
83+
1: PinSpecification(
84+
name="information",
85+
type_names=["string"],
86+
optional=False,
87+
document="""""",
88+
),
89+
},
90+
)
91+
return spec
92+
93+
@staticmethod
94+
def default_config(server=None):
95+
"""Returns the default config of the operator.
96+
97+
This config can then be changed to the user needs and be used to
98+
instantiate the operator. The Configuration allows to customize
99+
how the operation will be processed by the operator.
100+
101+
Parameters
102+
----------
103+
server : server.DPFServer, optional
104+
Server with channel connected to the remote or local instance. When
105+
``None``, attempts to use the global server.
106+
"""
107+
return Operator.default_config(name="compare::string_field", server=server)
108+
109+
@property
110+
def inputs(self):
111+
"""Enables to connect inputs to the operator
112+
113+
Returns
114+
--------
115+
inputs : InputsIdenticalStringFields
116+
"""
117+
return super().inputs
118+
119+
@property
120+
def outputs(self):
121+
"""Enables to get outputs of the operator by evaluating it
122+
123+
Returns
124+
--------
125+
outputs : OutputsIdenticalStringFields
126+
"""
127+
return super().outputs
128+
129+
130+
class InputsIdenticalStringFields(_Inputs):
131+
"""Intermediate class used to connect user inputs to
132+
identical_string_fields operator.
133+
134+
Examples
135+
--------
136+
>>> from ansys.dpf import core as dpf
137+
>>> op = dpf.operators.logic.identical_string_fields()
138+
>>> my_string_fieldA = dpf.StringField()
139+
>>> op.inputs.string_fieldA.connect(my_string_fieldA)
140+
>>> my_string_fieldB = dpf.StringField()
141+
>>> op.inputs.string_fieldB.connect(my_string_fieldB)
142+
"""
143+
144+
def __init__(self, op: Operator):
145+
super().__init__(identical_string_fields._spec().inputs, op)
146+
self._string_fieldA = Input(
147+
identical_string_fields._spec().input_pin(0), 0, op, -1
148+
)
149+
self._inputs.append(self._string_fieldA)
150+
self._string_fieldB = Input(
151+
identical_string_fields._spec().input_pin(1), 1, op, -1
152+
)
153+
self._inputs.append(self._string_fieldB)
154+
155+
@property
156+
def string_fieldA(self):
157+
"""Allows to connect string_fieldA input to the operator.
158+
159+
Parameters
160+
----------
161+
my_string_fieldA : StringField
162+
163+
Examples
164+
--------
165+
>>> from ansys.dpf import core as dpf
166+
>>> op = dpf.operators.logic.identical_string_fields()
167+
>>> op.inputs.string_fieldA.connect(my_string_fieldA)
168+
>>> # or
169+
>>> op.inputs.string_fieldA(my_string_fieldA)
170+
"""
171+
return self._string_fieldA
172+
173+
@property
174+
def string_fieldB(self):
175+
"""Allows to connect string_fieldB input to the operator.
176+
177+
Parameters
178+
----------
179+
my_string_fieldB : StringField
180+
181+
Examples
182+
--------
183+
>>> from ansys.dpf import core as dpf
184+
>>> op = dpf.operators.logic.identical_string_fields()
185+
>>> op.inputs.string_fieldB.connect(my_string_fieldB)
186+
>>> # or
187+
>>> op.inputs.string_fieldB(my_string_fieldB)
188+
"""
189+
return self._string_fieldB
190+
191+
192+
class OutputsIdenticalStringFields(_Outputs):
193+
"""Intermediate class used to get outputs from
194+
identical_string_fields operator.
195+
196+
Examples
197+
--------
198+
>>> from ansys.dpf import core as dpf
199+
>>> op = dpf.operators.logic.identical_string_fields()
200+
>>> # Connect inputs : op.inputs. ...
201+
>>> result_are_identical = op.outputs.are_identical()
202+
>>> result_information = op.outputs.information()
203+
"""
204+
205+
def __init__(self, op: Operator):
206+
super().__init__(identical_string_fields._spec().outputs, op)
207+
self._are_identical = Output(
208+
identical_string_fields._spec().output_pin(0), 0, op
209+
)
210+
self._outputs.append(self._are_identical)
211+
self._information = Output(identical_string_fields._spec().output_pin(1), 1, op)
212+
self._outputs.append(self._information)
213+
214+
@property
215+
def are_identical(self):
216+
"""Allows to get are_identical output of the operator
217+
218+
Returns
219+
----------
220+
my_are_identical : bool
221+
222+
Examples
223+
--------
224+
>>> from ansys.dpf import core as dpf
225+
>>> op = dpf.operators.logic.identical_string_fields()
226+
>>> # Connect inputs : op.inputs. ...
227+
>>> result_are_identical = op.outputs.are_identical()
228+
""" # noqa: E501
229+
return self._are_identical
230+
231+
@property
232+
def information(self):
233+
"""Allows to get information output of the operator
234+
235+
Returns
236+
----------
237+
my_information : str
238+
239+
Examples
240+
--------
241+
>>> from ansys.dpf import core as dpf
242+
>>> op = dpf.operators.logic.identical_string_fields()
243+
>>> # Connect inputs : op.inputs. ...
244+
>>> result_information = op.outputs.information()
245+
""" # noqa: E501
246+
return self._information

src/ansys/dpf/core/operators/mapping/find_reduced_coordinates.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ class find_reduced_coordinates(Operator):
2525
is set, it should be on the same
2626
label spaces as the coordinates
2727
fields container.
28-
use_quadratic_elements : bool
28+
use_quadratic_elements : bool, optional
2929
If this pin is set to true, reduced
3030
coordinates are computed on the
3131
quadratic element if the element is
32-
quadratic (default is false).
32+
quadratic (more precise but less
33+
performant). default is false.
3334
3435
3536
Examples
@@ -110,11 +111,12 @@ def _spec():
110111
200: PinSpecification(
111112
name="use_quadratic_elements",
112113
type_names=["bool"],
113-
optional=False,
114+
optional=True,
114115
document="""If this pin is set to true, reduced
115116
coordinates are computed on the
116117
quadratic element if the element is
117-
quadratic (default is false).""",
118+
quadratic (more precise but less
119+
performant). default is false.""",
118120
),
119121
},
120122
map_output_pin_spec={
@@ -252,7 +254,8 @@ def use_quadratic_elements(self):
252254
If this pin is set to true, reduced
253255
coordinates are computed on the
254256
quadratic element if the element is
255-
quadratic (default is false).
257+
quadratic (more precise but less
258+
performant). default is false.
256259
257260
Parameters
258261
----------

0 commit comments

Comments
 (0)