Skip to content

Commit 2b51a62

Browse files
committed
feat: updated script and operators
1 parent 3e45b9f commit 2b51a62

File tree

781 files changed

+20176
-10084
lines changed

Some content is hidden

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

781 files changed

+20176
-10084
lines changed

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

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
from ansys.dpf.core.config import Config
1515
from ansys.dpf.core.server_types import AnyServerType
1616

17+
# For type checking
18+
from ansys.dpf.core.fields_container import FieldsContainer
19+
from ansys.dpf.core.scoping import Scoping
20+
from ansys.dpf.core.field import Field
21+
from ansys.dpf.core.meshed_region import MeshedRegion
22+
1723

1824
class elemental_difference(Operator):
1925
r"""Transforms an Elemental Nodal or Nodal field into an Elemental field.
@@ -199,19 +205,25 @@ class InputsElementalDifference(_Inputs):
199205

200206
def __init__(self, op: Operator):
201207
super().__init__(elemental_difference._spec().inputs, op)
202-
self._field = Input(elemental_difference._spec().input_pin(0), 0, op, -1)
208+
self._field: Input[Field | FieldsContainer] = Input(
209+
elemental_difference._spec().input_pin(0), 0, op, -1
210+
)
203211
self._inputs.append(self._field)
204-
self._mesh_scoping = Input(elemental_difference._spec().input_pin(1), 1, op, -1)
212+
self._mesh_scoping: Input[Scoping] = Input(
213+
elemental_difference._spec().input_pin(1), 1, op, -1
214+
)
205215
self._inputs.append(self._mesh_scoping)
206-
self._mesh = Input(elemental_difference._spec().input_pin(7), 7, op, -1)
216+
self._mesh: Input[MeshedRegion] = Input(
217+
elemental_difference._spec().input_pin(7), 7, op, -1
218+
)
207219
self._inputs.append(self._mesh)
208-
self._through_layers = Input(
220+
self._through_layers: Input[bool] = Input(
209221
elemental_difference._spec().input_pin(10), 10, op, -1
210222
)
211223
self._inputs.append(self._through_layers)
212224

213225
@property
214-
def field(self) -> Input:
226+
def field(self) -> Input[Field | FieldsContainer]:
215227
r"""Allows to connect field input to the operator.
216228
217229
field or fields container with only one field is expected
@@ -232,7 +244,7 @@ def field(self) -> Input:
232244
return self._field
233245

234246
@property
235-
def mesh_scoping(self) -> Input:
247+
def mesh_scoping(self) -> Input[Scoping]:
236248
r"""Allows to connect mesh_scoping input to the operator.
237249
238250
average only on these entities
@@ -253,7 +265,7 @@ def mesh_scoping(self) -> Input:
253265
return self._mesh_scoping
254266

255267
@property
256-
def mesh(self) -> Input:
268+
def mesh(self) -> Input[MeshedRegion]:
257269
r"""Allows to connect mesh input to the operator.
258270
259271
Returns
@@ -272,7 +284,7 @@ def mesh(self) -> Input:
272284
return self._mesh
273285

274286
@property
275-
def through_layers(self) -> Input:
287+
def through_layers(self) -> Input[bool]:
276288
r"""Allows to connect through_layers input to the operator.
277289
278290
The maximum elemental difference is taken through the different shell layers if true (default is false).
@@ -307,11 +319,13 @@ class OutputsElementalDifference(_Outputs):
307319

308320
def __init__(self, op: Operator):
309321
super().__init__(elemental_difference._spec().outputs, op)
310-
self._field = Output(elemental_difference._spec().output_pin(0), 0, op)
322+
self._field: Output[Field] = Output(
323+
elemental_difference._spec().output_pin(0), 0, op
324+
)
311325
self._outputs.append(self._field)
312326

313327
@property
314-
def field(self) -> Output:
328+
def field(self) -> Output[Field]:
315329
r"""Allows to get field output of the operator
316330
317331
Returns

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

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
from ansys.dpf.core.config import Config
1515
from ansys.dpf.core.server_types import AnyServerType
1616

17+
# For type checking
18+
from ansys.dpf.core.fields_container import FieldsContainer
19+
from ansys.dpf.core.scoping import Scoping
20+
from ansys.dpf.core.scopings_container import ScopingsContainer
21+
from ansys.dpf.core.meshes_container import MeshesContainer
22+
from ansys.dpf.core.meshed_region import MeshedRegion
23+
1724

1825
class elemental_difference_fc(Operator):
1926
r"""Transforms an Elemental Nodal or Nodal field into an Elemental field.
@@ -205,21 +212,25 @@ class InputsElementalDifferenceFc(_Inputs):
205212

206213
def __init__(self, op: Operator):
207214
super().__init__(elemental_difference_fc._spec().inputs, op)
208-
self._fields_container = Input(
215+
self._fields_container: Input[FieldsContainer] = Input(
209216
elemental_difference_fc._spec().input_pin(0), 0, op, -1
210217
)
211218
self._inputs.append(self._fields_container)
212-
self._mesh = Input(elemental_difference_fc._spec().input_pin(1), 1, op, -1)
219+
self._mesh: Input[MeshedRegion | MeshesContainer] = Input(
220+
elemental_difference_fc._spec().input_pin(1), 1, op, -1
221+
)
213222
self._inputs.append(self._mesh)
214-
self._scoping = Input(elemental_difference_fc._spec().input_pin(3), 3, op, -1)
223+
self._scoping: Input[Scoping | ScopingsContainer] = Input(
224+
elemental_difference_fc._spec().input_pin(3), 3, op, -1
225+
)
215226
self._inputs.append(self._scoping)
216-
self._collapse_shell_layers = Input(
227+
self._collapse_shell_layers: Input[bool] = Input(
217228
elemental_difference_fc._spec().input_pin(10), 10, op, -1
218229
)
219230
self._inputs.append(self._collapse_shell_layers)
220231

221232
@property
222-
def fields_container(self) -> Input:
233+
def fields_container(self) -> Input[FieldsContainer]:
223234
r"""Allows to connect fields_container input to the operator.
224235
225236
Returns
@@ -238,7 +249,7 @@ def fields_container(self) -> Input:
238249
return self._fields_container
239250

240251
@property
241-
def mesh(self) -> Input:
252+
def mesh(self) -> Input[MeshedRegion | MeshesContainer]:
242253
r"""Allows to connect mesh input to the operator.
243254
244255
The mesh region in this pin is used to perform the averaging, used if there is no fields support.
@@ -259,7 +270,7 @@ def mesh(self) -> Input:
259270
return self._mesh
260271

261272
@property
262-
def scoping(self) -> Input:
273+
def scoping(self) -> Input[Scoping | ScopingsContainer]:
263274
r"""Allows to connect scoping input to the operator.
264275
265276
Average only on these elements. If it is scoping container, the label must correspond to the one of the fields container.
@@ -280,7 +291,7 @@ def scoping(self) -> Input:
280291
return self._scoping
281292

282293
@property
283-
def collapse_shell_layers(self) -> Input:
294+
def collapse_shell_layers(self) -> Input[bool]:
284295
r"""Allows to connect collapse_shell_layers input to the operator.
285296
286297
If true, the data across different shell layers is averaged as well (default is false).
@@ -315,13 +326,13 @@ class OutputsElementalDifferenceFc(_Outputs):
315326

316327
def __init__(self, op: Operator):
317328
super().__init__(elemental_difference_fc._spec().outputs, op)
318-
self._fields_container = Output(
329+
self._fields_container: Output[FieldsContainer] = Output(
319330
elemental_difference_fc._spec().output_pin(0), 0, op
320331
)
321332
self._outputs.append(self._fields_container)
322333

323334
@property
324-
def fields_container(self) -> Output:
335+
def fields_container(self) -> Output[FieldsContainer]:
325336
r"""Allows to get fields_container output of the operator
326337
327338
Returns

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

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
from ansys.dpf.core.config import Config
1515
from ansys.dpf.core.server_types import AnyServerType
1616

17+
# For type checking
18+
from ansys.dpf.core.fields_container import FieldsContainer
19+
from ansys.dpf.core.scoping import Scoping
20+
from ansys.dpf.core.meshed_region import MeshedRegion
21+
1722

1823
class elemental_fraction_fc(Operator):
1924
r"""Transforms Elemental Nodal fields into Elemental fields. Each elemental
@@ -213,23 +218,29 @@ class InputsElementalFractionFc(_Inputs):
213218

214219
def __init__(self, op: Operator):
215220
super().__init__(elemental_fraction_fc._spec().inputs, op)
216-
self._fields_container = Input(
221+
self._fields_container: Input[FieldsContainer] = Input(
217222
elemental_fraction_fc._spec().input_pin(0), 0, op, -1
218223
)
219224
self._inputs.append(self._fields_container)
220-
self._mesh = Input(elemental_fraction_fc._spec().input_pin(1), 1, op, -1)
225+
self._mesh: Input[MeshedRegion] = Input(
226+
elemental_fraction_fc._spec().input_pin(1), 1, op, -1
227+
)
221228
self._inputs.append(self._mesh)
222-
self._scoping = Input(elemental_fraction_fc._spec().input_pin(3), 3, op, -1)
229+
self._scoping: Input[Scoping] = Input(
230+
elemental_fraction_fc._spec().input_pin(3), 3, op, -1
231+
)
223232
self._inputs.append(self._scoping)
224-
self._denominator = Input(elemental_fraction_fc._spec().input_pin(6), 6, op, -1)
233+
self._denominator: Input[FieldsContainer] = Input(
234+
elemental_fraction_fc._spec().input_pin(6), 6, op, -1
235+
)
225236
self._inputs.append(self._denominator)
226-
self._collapse_shell_layers = Input(
237+
self._collapse_shell_layers: Input[bool] = Input(
227238
elemental_fraction_fc._spec().input_pin(10), 10, op, -1
228239
)
229240
self._inputs.append(self._collapse_shell_layers)
230241

231242
@property
232-
def fields_container(self) -> Input:
243+
def fields_container(self) -> Input[FieldsContainer]:
233244
r"""Allows to connect fields_container input to the operator.
234245
235246
Returns
@@ -248,7 +259,7 @@ def fields_container(self) -> Input:
248259
return self._fields_container
249260

250261
@property
251-
def mesh(self) -> Input:
262+
def mesh(self) -> Input[MeshedRegion]:
252263
r"""Allows to connect mesh input to the operator.
253264
254265
The mesh region in this pin is used to perform the averaging. It is used if there is no fields support.
@@ -269,7 +280,7 @@ def mesh(self) -> Input:
269280
return self._mesh
270281

271282
@property
272-
def scoping(self) -> Input:
283+
def scoping(self) -> Input[Scoping]:
273284
r"""Allows to connect scoping input to the operator.
274285
275286
Average only on these elements. If it is a scoping container, the label must correspond to the one of the fields containers.
@@ -290,7 +301,7 @@ def scoping(self) -> Input:
290301
return self._scoping
291302

292303
@property
293-
def denominator(self) -> Input:
304+
def denominator(self) -> Input[FieldsContainer]:
294305
r"""Allows to connect denominator input to the operator.
295306
296307
If a fields container is set in this pin, it is used as the denominator of the fraction instead of entity_average_fc.
@@ -311,7 +322,7 @@ def denominator(self) -> Input:
311322
return self._denominator
312323

313324
@property
314-
def collapse_shell_layers(self) -> Input:
325+
def collapse_shell_layers(self) -> Input[bool]:
315326
r"""Allows to connect collapse_shell_layers input to the operator.
316327
317328
If true, the data across different shell layers is averaged as well (default is false).
@@ -346,13 +357,13 @@ class OutputsElementalFractionFc(_Outputs):
346357

347358
def __init__(self, op: Operator):
348359
super().__init__(elemental_fraction_fc._spec().outputs, op)
349-
self._fields_container = Output(
360+
self._fields_container: Output[FieldsContainer] = Output(
350361
elemental_fraction_fc._spec().output_pin(0), 0, op
351362
)
352363
self._outputs.append(self._fields_container)
353364

354365
@property
355-
def fields_container(self) -> Output:
366+
def fields_container(self) -> Output[FieldsContainer]:
356367
r"""Allows to get fields_container output of the operator
357368
358369
Returns

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

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
from ansys.dpf.core.config import Config
1515
from ansys.dpf.core.server_types import AnyServerType
1616

17+
# For type checking
18+
from ansys.dpf.core.field import Field
19+
from ansys.dpf.core.scoping import Scoping
20+
1721

1822
class elemental_mean(Operator):
1923
r"""Computes the average of a multi-entity field, (ElementalNodal ->
@@ -195,19 +199,25 @@ class InputsElementalMean(_Inputs):
195199

196200
def __init__(self, op: Operator):
197201
super().__init__(elemental_mean._spec().inputs, op)
198-
self._field = Input(elemental_mean._spec().input_pin(0), 0, op, -1)
202+
self._field: Input[Field] = Input(
203+
elemental_mean._spec().input_pin(0), 0, op, -1
204+
)
199205
self._inputs.append(self._field)
200-
self._collapse_shell_layers = Input(
206+
self._collapse_shell_layers: Input[bool] = Input(
201207
elemental_mean._spec().input_pin(1), 1, op, -1
202208
)
203209
self._inputs.append(self._collapse_shell_layers)
204-
self._force_averaging = Input(elemental_mean._spec().input_pin(2), 2, op, -1)
210+
self._force_averaging: Input[bool] = Input(
211+
elemental_mean._spec().input_pin(2), 2, op, -1
212+
)
205213
self._inputs.append(self._force_averaging)
206-
self._scoping = Input(elemental_mean._spec().input_pin(3), 3, op, -1)
214+
self._scoping: Input[Scoping] = Input(
215+
elemental_mean._spec().input_pin(3), 3, op, -1
216+
)
207217
self._inputs.append(self._scoping)
208218

209219
@property
210-
def field(self) -> Input:
220+
def field(self) -> Input[Field]:
211221
r"""Allows to connect field input to the operator.
212222
213223
Returns
@@ -226,7 +236,7 @@ def field(self) -> Input:
226236
return self._field
227237

228238
@property
229-
def collapse_shell_layers(self) -> Input:
239+
def collapse_shell_layers(self) -> Input[bool]:
230240
r"""Allows to connect collapse_shell_layers input to the operator.
231241
232242
If true, shell layers are averaged as well (default is false).
@@ -247,7 +257,7 @@ def collapse_shell_layers(self) -> Input:
247257
return self._collapse_shell_layers
248258

249259
@property
250-
def force_averaging(self) -> Input:
260+
def force_averaging(self) -> Input[bool]:
251261
r"""Allows to connect force_averaging input to the operator.
252262
253263
If true you average, if false you just sum.
@@ -268,7 +278,7 @@ def force_averaging(self) -> Input:
268278
return self._force_averaging
269279

270280
@property
271-
def scoping(self) -> Input:
281+
def scoping(self) -> Input[Scoping]:
272282
r"""Allows to connect scoping input to the operator.
273283
274284
Average only on these elements. If it is a scoping container, the label must correspond to the one of the fields containers.
@@ -303,11 +313,11 @@ class OutputsElementalMean(_Outputs):
303313

304314
def __init__(self, op: Operator):
305315
super().__init__(elemental_mean._spec().outputs, op)
306-
self._field = Output(elemental_mean._spec().output_pin(0), 0, op)
316+
self._field: Output[Field] = Output(elemental_mean._spec().output_pin(0), 0, op)
307317
self._outputs.append(self._field)
308318

309319
@property
310-
def field(self) -> Output:
320+
def field(self) -> Output[Field]:
311321
r"""Allows to get field output of the operator
312322
313323
Returns

0 commit comments

Comments
 (0)