|
8 | 8 | from ansys.dpf.core.dpf_operator import Operator |
9 | 9 | from ansys.dpf.core.inputs import Input, _Inputs |
10 | 10 | from ansys.dpf.core.outputs import Output, _Outputs |
| 11 | +from ansys.dpf.core.outputs import _modify_output_spec_with_one_type |
11 | 12 | from ansys.dpf.core.operators.specification import PinSpecification, Specification |
12 | 13 |
|
13 | 14 |
|
@@ -143,9 +144,12 @@ def _spec(): |
143 | 144 | ), |
144 | 145 | 2: PinSpecification( |
145 | 146 | name="sigma", |
146 | | - type_names=["field"], |
| 147 | + type_names=["field", "fields_container"], |
147 | 148 | optional=False, |
148 | | - document="""The output entity is a field, containing |
| 149 | + document="""The output entity is a field (or a field |
| 150 | + container if input fc contains |
| 151 | + several labels, where field contains |
| 152 | + results per label), containing |
149 | 153 | singular (s) values of the input |
150 | 154 | data, where a=u.s.vt""", |
151 | 155 | ), |
@@ -328,8 +332,20 @@ def __init__(self, op: Operator): |
328 | 332 | self._outputs.append(self._us_svd) |
329 | 333 | self._vt_svd = Output(apply_svd._spec().output_pin(1), 1, op) |
330 | 334 | self._outputs.append(self._vt_svd) |
331 | | - self._sigma = Output(apply_svd._spec().output_pin(2), 2, op) |
332 | | - self._outputs.append(self._sigma) |
| 335 | + self.sigma_as_field = Output( |
| 336 | + _modify_output_spec_with_one_type(apply_svd._spec().output_pin(2), "field"), |
| 337 | + 2, |
| 338 | + op, |
| 339 | + ) |
| 340 | + self._outputs.append(self.sigma_as_field) |
| 341 | + self.sigma_as_fields_container = Output( |
| 342 | + _modify_output_spec_with_one_type( |
| 343 | + apply_svd._spec().output_pin(2), "fields_container" |
| 344 | + ), |
| 345 | + 2, |
| 346 | + op, |
| 347 | + ) |
| 348 | + self._outputs.append(self.sigma_as_fields_container) |
333 | 349 |
|
334 | 350 | @property |
335 | 351 | def us_svd(self): |
@@ -364,20 +380,3 @@ def vt_svd(self): |
364 | 380 | >>> result_vt_svd = op.outputs.vt_svd() |
365 | 381 | """ # noqa: E501 |
366 | 382 | return self._vt_svd |
367 | | - |
368 | | - @property |
369 | | - def sigma(self): |
370 | | - """Allows to get sigma output of the operator |
371 | | -
|
372 | | - Returns |
373 | | - ---------- |
374 | | - my_sigma : Field |
375 | | -
|
376 | | - Examples |
377 | | - -------- |
378 | | - >>> from ansys.dpf import core as dpf |
379 | | - >>> op = dpf.operators.compression.apply_svd() |
380 | | - >>> # Connect inputs : op.inputs. ... |
381 | | - >>> result_sigma = op.outputs.sigma() |
382 | | - """ # noqa: E501 |
383 | | - return self._sigma |
0 commit comments