@@ -22,16 +22,18 @@ class vtu_export(Operator):
2222 Vtu base file name, (default is file)
2323 mesh : MeshedRegion
2424 Mesh
25- fields1 : Field or FieldsContainer
26- Nodal, face, or elemental fields (over time)
27- to export. when there is no support
28- available in the exported mesh, that
29- data is ignored.
30- fields2 : Field or FieldsContainer
31- Nodal, face, or elemental fields (over time)
32- to export. when there is no support
33- available in the exported mesh, that
34- data is ignored.
25+ fields1 : Field or FieldsContainer or PropertyField
26+ Nodal, face, or elemental field, fields
27+ container (over time), or property
28+ field to export. when there is no
29+ support available in the exported
30+ mesh, that data is ignored.
31+ fields2 : Field or FieldsContainer or PropertyField
32+ Nodal, face, or elemental field, fields
33+ container (over time), or property
34+ field to export. when there is no
35+ support available in the exported
36+ mesh, that data is ignored.
3537 write_mode : str, optional
3638 Available are rawbinarycompressed, rawbinary,
3739 base64appended, base64inline, ascii,
@@ -43,6 +45,8 @@ class vtu_export(Operator):
4345 Whether to also export faces as shell
4446 elements when the mesh contains
4547 cells. default is false.
48+ mesh_properties : StringField, optional
49+ List of names of mesh properties to export.
4650
4751
4852 Examples
@@ -69,6 +73,8 @@ class vtu_export(Operator):
6973 >>> op.inputs.as_point_cloud.connect(my_as_point_cloud)
7074 >>> my_export_faces = bool()
7175 >>> op.inputs.export_faces.connect(my_export_faces)
76+ >>> my_mesh_properties = dpf.StringField()
77+ >>> op.inputs.mesh_properties.connect(my_mesh_properties)
7278
7379 >>> # Instantiate operator and connect inputs in one line
7480 >>> op = dpf.operators.serialization.vtu_export(
@@ -80,6 +86,7 @@ class vtu_export(Operator):
8086 ... write_mode=my_write_mode,
8187 ... as_point_cloud=my_as_point_cloud,
8288 ... export_faces=my_export_faces,
89+ ... mesh_properties=my_mesh_properties,
8390 ... )
8491
8592 >>> # Get output data
@@ -96,6 +103,7 @@ def __init__(
96103 write_mode = None ,
97104 as_point_cloud = None ,
98105 export_faces = None ,
106+ mesh_properties = None ,
99107 config = None ,
100108 server = None ,
101109 ):
@@ -118,6 +126,8 @@ def __init__(
118126 self .inputs .as_point_cloud .connect (as_point_cloud )
119127 if export_faces is not None :
120128 self .inputs .export_faces .connect (export_faces )
129+ if mesh_properties is not None :
130+ self .inputs .mesh_properties .connect (mesh_properties )
121131
122132 @staticmethod
123133 def _spec ():
@@ -145,21 +155,23 @@ def _spec():
145155 ),
146156 3 : PinSpecification (
147157 name = "fields" ,
148- type_names = ["field" , "fields_container" ],
158+ type_names = ["field" , "fields_container" , "property_field" ],
149159 optional = False ,
150- document = """Nodal, face, or elemental fields (over time)
151- to export. when there is no support
152- available in the exported mesh, that
153- data is ignored.""" ,
160+ document = """Nodal, face, or elemental field, fields
161+ container (over time), or property
162+ field to export. when there is no
163+ support available in the exported
164+ mesh, that data is ignored.""" ,
154165 ),
155166 4 : PinSpecification (
156167 name = "fields" ,
157- type_names = ["field" , "fields_container" ],
168+ type_names = ["field" , "fields_container" , "property_field" ],
158169 optional = False ,
159- document = """Nodal, face, or elemental fields (over time)
160- to export. when there is no support
161- available in the exported mesh, that
162- data is ignored.""" ,
170+ document = """Nodal, face, or elemental field, fields
171+ container (over time), or property
172+ field to export. when there is no
173+ support available in the exported
174+ mesh, that data is ignored.""" ,
163175 ),
164176 100 : PinSpecification (
165177 name = "write_mode" ,
@@ -184,6 +196,12 @@ def _spec():
184196 elements when the mesh contains
185197 cells. default is false.""" ,
186198 ),
199+ 103 : PinSpecification (
200+ name = "mesh_properties" ,
201+ type_names = ["vector<string>" , "string_field" ],
202+ optional = True ,
203+ document = """List of names of mesh properties to export.""" ,
204+ ),
187205 },
188206 map_output_pin_spec = {
189207 0 : PinSpecification (
@@ -257,6 +275,8 @@ class InputsVtuExport(_Inputs):
257275 >>> op.inputs.as_point_cloud.connect(my_as_point_cloud)
258276 >>> my_export_faces = bool()
259277 >>> op.inputs.export_faces.connect(my_export_faces)
278+ >>> my_mesh_properties = dpf.StringField()
279+ >>> op.inputs.mesh_properties.connect(my_mesh_properties)
260280 """
261281
262282 def __init__ (self , op : Operator ):
@@ -277,6 +297,8 @@ def __init__(self, op: Operator):
277297 self ._inputs .append (self ._as_point_cloud )
278298 self ._export_faces = Input (vtu_export ._spec ().input_pin (102 ), 102 , op , - 1 )
279299 self ._inputs .append (self ._export_faces )
300+ self ._mesh_properties = Input (vtu_export ._spec ().input_pin (103 ), 103 , op , - 1 )
301+ self ._inputs .append (self ._mesh_properties )
280302
281303 @property
282304 def directory (self ):
@@ -342,14 +364,15 @@ def mesh(self):
342364 def fields1 (self ):
343365 """Allows to connect fields1 input to the operator.
344366
345- Nodal, face, or elemental fields (over time)
346- to export. when there is no support
347- available in the exported mesh, that
348- data is ignored.
367+ Nodal, face, or elemental field, fields
368+ container (over time), or property
369+ field to export. when there is no
370+ support available in the exported
371+ mesh, that data is ignored.
349372
350373 Parameters
351374 ----------
352- my_fields1 : Field or FieldsContainer
375+ my_fields1 : Field or FieldsContainer or PropertyField
353376
354377 Examples
355378 --------
@@ -365,14 +388,15 @@ def fields1(self):
365388 def fields2 (self ):
366389 """Allows to connect fields2 input to the operator.
367390
368- Nodal, face, or elemental fields (over time)
369- to export. when there is no support
370- available in the exported mesh, that
371- data is ignored.
391+ Nodal, face, or elemental field, fields
392+ container (over time), or property
393+ field to export. when there is no
394+ support available in the exported
395+ mesh, that data is ignored.
372396
373397 Parameters
374398 ----------
375- my_fields2 : Field or FieldsContainer
399+ my_fields2 : Field or FieldsContainer or PropertyField
376400
377401 Examples
378402 --------
@@ -449,6 +473,26 @@ def export_faces(self):
449473 """
450474 return self ._export_faces
451475
476+ @property
477+ def mesh_properties (self ):
478+ """Allows to connect mesh_properties input to the operator.
479+
480+ List of names of mesh properties to export.
481+
482+ Parameters
483+ ----------
484+ my_mesh_properties : StringField
485+
486+ Examples
487+ --------
488+ >>> from ansys.dpf import core as dpf
489+ >>> op = dpf.operators.serialization.vtu_export()
490+ >>> op.inputs.mesh_properties.connect(my_mesh_properties)
491+ >>> # or
492+ >>> op.inputs.mesh_properties(my_mesh_properties)
493+ """
494+ return self ._mesh_properties
495+
452496
453497class OutputsVtuExport (_Outputs ):
454498 """Intermediate class used to get outputs from
0 commit comments