1818
1919if TYPE_CHECKING :
2020 from ansys .dpf .core .data_sources import DataSources
21+ from ansys .dpf .core .scoping import Scoping
2122 from ansys .dpf .core .streams_container import StreamsContainer
2223
2324
@@ -28,13 +29,33 @@ class boundary_condition_provider(Operator):
2829
2930 Inputs
3031 ------
32+ time_scoping: Scoping, optional
33+ Time/freq set ids (use ints or scoping) or time/freq step ids (use scoping with TimeFreq_steps location) required in output.
3134 streams_container: StreamsContainer, optional
35+ Result file container allowed to be kept open to cache data.
3236 data_sources: DataSources
37+ Result file path container, used if no streams are set.
38+ property: int
39+ Type of boundary condition to get.
40+
41+ Available boundary conditions are :
42+ - Applied Force : 1
43+ - Fixed Displacement : 2
44+ - Applied Pressure : 3
45+ - Fixed Temperature : 4
46+ - Applied Heat Flux : 5
47+ - Fluid Temperature : 6
48+ - Film Coefficient Convection : 7
49+ - Ambient Temperature : 8
50+ - Spatial Integrand : 9
51+ - Fixed Rotation : 10
52+ - Fixed Acceleration : 11
53+ - Fixed Velocity : 12
3354
3455 Outputs
3556 -------
36- results_info : Field or FieldsContainer
37- results info
57+ field_or_fields_container : Field or FieldsContainer
58+ Value of the boundary condition at each node (0 if there is not). It is a field if there is only one time step, and a fields container otherwise.
3859
3960 Examples
4061 --------
@@ -44,23 +65,35 @@ class boundary_condition_provider(Operator):
4465 >>> op = dpf.operators.metadata.boundary_condition_provider()
4566
4667 >>> # Make input connections
68+ >>> my_time_scoping = dpf.Scoping()
69+ >>> op.inputs.time_scoping.connect(my_time_scoping)
4770 >>> my_streams_container = dpf.StreamsContainer()
4871 >>> op.inputs.streams_container.connect(my_streams_container)
4972 >>> my_data_sources = dpf.DataSources()
5073 >>> op.inputs.data_sources.connect(my_data_sources)
74+ >>> my_property = int()
75+ >>> op.inputs.property.connect(my_property)
5176
5277 >>> # Instantiate operator and connect inputs in one line
5378 >>> op = dpf.operators.metadata.boundary_condition_provider(
79+ ... time_scoping=my_time_scoping,
5480 ... streams_container=my_streams_container,
5581 ... data_sources=my_data_sources,
82+ ... property=my_property,
5683 ... )
5784
5885 >>> # Get output data
59- >>> result_results_info = op.outputs.results_info ()
86+ >>> result_field_or_fields_container = op.outputs.field_or_fields_container ()
6087 """
6188
6289 def __init__ (
63- self , streams_container = None , data_sources = None , config = None , server = None
90+ self ,
91+ time_scoping = None ,
92+ streams_container = None ,
93+ data_sources = None ,
94+ property = None ,
95+ config = None ,
96+ server = None ,
6497 ):
6598 super ().__init__ (
6699 name = "boundary_conditions" ,
@@ -69,10 +102,14 @@ def __init__(
69102 inputs_type = InputsBoundaryConditionProvider ,
70103 outputs_type = OutputsBoundaryConditionProvider ,
71104 )
105+ if time_scoping is not None :
106+ self .inputs .time_scoping .connect (time_scoping )
72107 if streams_container is not None :
73108 self .inputs .streams_container .connect (streams_container )
74109 if data_sources is not None :
75110 self .inputs .data_sources .connect (data_sources )
111+ if property is not None :
112+ self .inputs .property .connect (property )
76113
77114 @staticmethod
78115 def _spec () -> Specification :
@@ -82,25 +119,52 @@ def _spec() -> Specification:
82119 spec = Specification (
83120 description = description ,
84121 map_input_pin_spec = {
122+ 0 : PinSpecification (
123+ name = "time_scoping" ,
124+ type_names = ["scoping" , "vector<int32>" ],
125+ optional = True ,
126+ document = r"""Time/freq set ids (use ints or scoping) or time/freq step ids (use scoping with TimeFreq_steps location) required in output.""" ,
127+ ),
85128 3 : PinSpecification (
86129 name = "streams_container" ,
87130 type_names = ["streams_container" ],
88131 optional = True ,
89- document = r"""""" ,
132+ document = r"""Result file container allowed to be kept open to cache data. """ ,
90133 ),
91134 4 : PinSpecification (
92135 name = "data_sources" ,
93136 type_names = ["data_sources" ],
94137 optional = False ,
95- document = r"""""" ,
138+ document = r"""Result file path container, used if no streams are set.""" ,
139+ ),
140+ 13 : PinSpecification (
141+ name = "property" ,
142+ type_names = ["int32" ],
143+ optional = False ,
144+ document = r"""Type of boundary condition to get.
145+
146+ Available boundary conditions are :
147+ - Applied Force : 1
148+ - Fixed Displacement : 2
149+ - Applied Pressure : 3
150+ - Fixed Temperature : 4
151+ - Applied Heat Flux : 5
152+ - Fluid Temperature : 6
153+ - Film Coefficient Convection : 7
154+ - Ambient Temperature : 8
155+ - Spatial Integrand : 9
156+ - Fixed Rotation : 10
157+ - Fixed Acceleration : 11
158+ - Fixed Velocity : 12""" ,
96159 ),
97160 },
98161 map_output_pin_spec = {
99162 0 : PinSpecification (
100- name = "results_info " ,
163+ name = "field_or_fields_container " ,
101164 type_names = ["field" , "fields_container" ],
102165 optional = False ,
103- document = r"""results info""" ,
166+ document = r"""Value of the boundary condition at each node (0 if there is not). It is a field if there is only one time step, and a fields container otherwise.""" ,
167+ aliases = ["result_info" ],
104168 ),
105169 },
106170 )
@@ -158,14 +222,22 @@ class InputsBoundaryConditionProvider(_Inputs):
158222 --------
159223 >>> from ansys.dpf import core as dpf
160224 >>> op = dpf.operators.metadata.boundary_condition_provider()
225+ >>> my_time_scoping = dpf.Scoping()
226+ >>> op.inputs.time_scoping.connect(my_time_scoping)
161227 >>> my_streams_container = dpf.StreamsContainer()
162228 >>> op.inputs.streams_container.connect(my_streams_container)
163229 >>> my_data_sources = dpf.DataSources()
164230 >>> op.inputs.data_sources.connect(my_data_sources)
231+ >>> my_property = int()
232+ >>> op.inputs.property.connect(my_property)
165233 """
166234
167235 def __init__ (self , op : Operator ):
168236 super ().__init__ (boundary_condition_provider ._spec ().inputs , op )
237+ self ._time_scoping : Input [Scoping ] = Input (
238+ boundary_condition_provider ._spec ().input_pin (0 ), 0 , op , - 1
239+ )
240+ self ._inputs .append (self ._time_scoping )
169241 self ._streams_container : Input [StreamsContainer ] = Input (
170242 boundary_condition_provider ._spec ().input_pin (3 ), 3 , op , - 1
171243 )
@@ -174,11 +246,38 @@ def __init__(self, op: Operator):
174246 boundary_condition_provider ._spec ().input_pin (4 ), 4 , op , - 1
175247 )
176248 self ._inputs .append (self ._data_sources )
249+ self ._property : Input [int ] = Input (
250+ boundary_condition_provider ._spec ().input_pin (13 ), 13 , op , - 1
251+ )
252+ self ._inputs .append (self ._property )
253+
254+ @property
255+ def time_scoping (self ) -> Input [Scoping ]:
256+ r"""Allows to connect time_scoping input to the operator.
257+
258+ Time/freq set ids (use ints or scoping) or time/freq step ids (use scoping with TimeFreq_steps location) required in output.
259+
260+ Returns
261+ -------
262+ input:
263+ An Input instance for this pin.
264+
265+ Examples
266+ --------
267+ >>> from ansys.dpf import core as dpf
268+ >>> op = dpf.operators.metadata.boundary_condition_provider()
269+ >>> op.inputs.time_scoping.connect(my_time_scoping)
270+ >>> # or
271+ >>> op.inputs.time_scoping(my_time_scoping)
272+ """
273+ return self ._time_scoping
177274
178275 @property
179276 def streams_container (self ) -> Input [StreamsContainer ]:
180277 r"""Allows to connect streams_container input to the operator.
181278
279+ Result file container allowed to be kept open to cache data.
280+
182281 Returns
183282 -------
184283 input:
@@ -198,6 +297,8 @@ def streams_container(self) -> Input[StreamsContainer]:
198297 def data_sources (self ) -> Input [DataSources ]:
199298 r"""Allows to connect data_sources input to the operator.
200299
300+ Result file path container, used if no streams are set.
301+
201302 Returns
202303 -------
203304 input:
@@ -213,6 +314,41 @@ def data_sources(self) -> Input[DataSources]:
213314 """
214315 return self ._data_sources
215316
317+ @property
318+ def property (self ) -> Input [int ]:
319+ r"""Allows to connect property input to the operator.
320+
321+ Type of boundary condition to get.
322+
323+ Available boundary conditions are :
324+ - Applied Force : 1
325+ - Fixed Displacement : 2
326+ - Applied Pressure : 3
327+ - Fixed Temperature : 4
328+ - Applied Heat Flux : 5
329+ - Fluid Temperature : 6
330+ - Film Coefficient Convection : 7
331+ - Ambient Temperature : 8
332+ - Spatial Integrand : 9
333+ - Fixed Rotation : 10
334+ - Fixed Acceleration : 11
335+ - Fixed Velocity : 12
336+
337+ Returns
338+ -------
339+ input:
340+ An Input instance for this pin.
341+
342+ Examples
343+ --------
344+ >>> from ansys.dpf import core as dpf
345+ >>> op = dpf.operators.metadata.boundary_condition_provider()
346+ >>> op.inputs.property.connect(my_property)
347+ >>> # or
348+ >>> op.inputs.property(my_property)
349+ """
350+ return self ._property
351+
216352
217353class OutputsBoundaryConditionProvider (_Outputs ):
218354 """Intermediate class used to get outputs from
@@ -223,24 +359,36 @@ class OutputsBoundaryConditionProvider(_Outputs):
223359 >>> from ansys.dpf import core as dpf
224360 >>> op = dpf.operators.metadata.boundary_condition_provider()
225361 >>> # Connect inputs : op.inputs. ...
226- >>> result_results_info = op.outputs.results_info ()
362+ >>> result_field_or_fields_container = op.outputs.field_or_fields_container ()
227363 """
228364
229365 def __init__ (self , op : Operator ):
230366 super ().__init__ (boundary_condition_provider ._spec ().outputs , op )
231- self .results_info_as_field = Output (
367+ self .field_or_fields_container_as_field = Output (
232368 _modify_output_spec_with_one_type (
233369 boundary_condition_provider ._spec ().output_pin (0 ), "field"
234370 ),
235371 0 ,
236372 op ,
237373 )
238- self ._outputs .append (self .results_info_as_field )
239- self .results_info_as_fields_container = Output (
374+ self ._outputs .append (self .field_or_fields_container_as_field )
375+ self .field_or_fields_container_as_fields_container = Output (
240376 _modify_output_spec_with_one_type (
241377 boundary_condition_provider ._spec ().output_pin (0 ), "fields_container"
242378 ),
243379 0 ,
244380 op ,
245381 )
246- self ._outputs .append (self .results_info_as_fields_container )
382+ self ._outputs .append (self .field_or_fields_container_as_fields_container )
383+
384+ def __getattr__ (self , name ):
385+ if name in ["result_info" ]:
386+ warn (
387+ DeprecationWarning (
388+ f'Operator boundary_condition_provider: Output name "{ name } " is deprecated in favor of "field_or_fields_container".'
389+ )
390+ )
391+ return self .field_or_fields_container
392+ raise AttributeError (
393+ f"'{ self .__class__ .__name__ } ' object has no attribute '{ name } '."
394+ )
0 commit comments