ansys-fluent-core 0.14.dev0__py3-none-any.whl → 0.14.dev2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ansys-fluent-core might be problematic. Click here for more details.
- ansys/fluent/core/__init__.py +12 -12
- ansys/fluent/core/_version.py +1 -1
- ansys/fluent/core/docs/README.rst +26 -26
- ansys/fluent/core/examples/downloads.py +28 -16
- ansys/fluent/core/filereader/case_file.py +20 -11
- ansys/fluent/core/fluent_connection.py +21 -1
- ansys/fluent/core/launcher/fluent_container.py +1 -1
- ansys/fluent/core/launcher/fluent_launcher_options.json +10 -0
- ansys/fluent/core/launcher/launcher.py +29 -15
- ansys/fluent/core/meshing/tui_231.py +7642 -7642
- ansys/fluent/core/services/datamodel_se.py +142 -110
- ansys/fluent/core/services/field_data.py +278 -29
- ansys/fluent/core/services/meshing_queries.py +1795 -0
- ansys/fluent/core/services/settings.py +1 -1
- ansys/fluent/core/services/svar.py +606 -0
- ansys/fluent/core/session_pure_meshing.py +4 -5
- ansys/fluent/core/solver/flobject.py +59 -2
- ansys/fluent/core/solver/settings_222/change_type.py +1 -1
- ansys/fluent/core/solver/settings_222/clear_generated_data.py +1 -1
- ansys/fluent/core/solver/settings_222/compute_2.py +1 -1
- ansys/fluent/core/solver/settings_222/delete_design_points.py +1 -1
- ansys/fluent/core/solver/settings_222/position_1.py +1 -1
- ansys/fluent/core/solver/settings_222/setup_unsteady_statistics.py +1 -1
- ansys/fluent/core/solver/settings_222/target.py +1 -1
- ansys/fluent/core/solver/settings_222/up_vector.py +1 -1
- ansys/fluent/core/solver/settings_222/update_selected.py +1 -1
- ansys/fluent/core/solver/settings_222/write_1.py +1 -1
- ansys/fluent/core/solver/settings_222/write_views.py +1 -1
- ansys/fluent/core/solver/settings_231/abaqus.py +2 -2
- ansys/fluent/core/solver/settings_231/activate_cell_zone.py +1 -1
- ansys/fluent/core/solver/settings_231/calculate_patch.py +2 -2
- ansys/fluent/core/solver/settings_231/change_type.py +1 -1
- ansys/fluent/core/solver/settings_231/clear_generated_data.py +1 -1
- ansys/fluent/core/solver/settings_231/compute_1.py +1 -1
- ansys/fluent/core/solver/settings_231/convert_skewed_cells_1.py +1 -1
- ansys/fluent/core/solver/settings_231/custom_heat_flux.py +1 -1
- ansys/fluent/core/solver/settings_231/customize_fmg_initialization.py +2 -2
- ansys/fluent/core/solver/settings_231/delete_design_points.py +1 -1
- ansys/fluent/core/solver/settings_231/export_1.py +1 -1
- ansys/fluent/core/solver/settings_231/export_modifications.py +1 -1
- ansys/fluent/core/solver/settings_231/film_heat_transfer.py +1 -1
- ansys/fluent/core/solver/settings_231/film_mass_flow.py +1 -1
- ansys/fluent/core/solver/settings_231/forces.py +4 -4
- ansys/fluent/core/solver/settings_231/heat_transfer_1.py +1 -1
- ansys/fluent/core/solver/settings_231/heat_transfer_sensible.py +1 -1
- ansys/fluent/core/solver/settings_231/mass_flow_1.py +1 -1
- ansys/fluent/core/solver/settings_231/mechanical_apdl.py +1 -1
- ansys/fluent/core/solver/settings_231/mechanical_apdl_input.py +2 -2
- ansys/fluent/core/solver/settings_231/modified_setting.py +1 -1
- ansys/fluent/core/solver/settings_231/moments.py +2 -2
- ansys/fluent/core/solver/settings_231/number_density.py +2 -2
- ansys/fluent/core/solver/settings_231/particle_summary.py +1 -1
- ansys/fluent/core/solver/settings_231/position_1.py +1 -1
- ansys/fluent/core/solver/settings_231/pressure_work_1.py +1 -1
- ansys/fluent/core/solver/settings_231/print_histogram.py +1 -1
- ansys/fluent/core/solver/settings_231/projected_surface_area.py +2 -2
- ansys/fluent/core/solver/settings_231/rad_heat_trans.py +1 -1
- ansys/fluent/core/solver/settings_231/read_journal.py +1 -1
- ansys/fluent/core/solver/settings_231/rotate.py +2 -2
- ansys/fluent/core/solver/settings_231/sample_1.py +4 -4
- ansys/fluent/core/solver/settings_231/set_ambient_color.py +1 -1
- ansys/fluent/core/solver/settings_231/set_light.py +2 -2
- ansys/fluent/core/solver/settings_231/setup_unsteady_statistics.py +1 -1
- ansys/fluent/core/solver/settings_231/surface_integrals.py +1 -1
- ansys/fluent/core/solver/settings_231/taitherm.py +1 -1
- ansys/fluent/core/solver/settings_231/target.py +1 -1
- ansys/fluent/core/solver/settings_231/translate.py +1 -1
- ansys/fluent/core/solver/settings_231/up_vector.py +1 -1
- ansys/fluent/core/solver/settings_231/update_selected.py +1 -1
- ansys/fluent/core/solver/settings_231/viscous_work.py +1 -1
- ansys/fluent/core/solver/settings_231/volume_integrals.py +1 -1
- ansys/fluent/core/solver/settings_231/write_1.py +1 -1
- ansys/fluent/core/solver/settings_231/write_histogram.py +1 -1
- ansys/fluent/core/solver/settings_231/write_views.py +1 -1
- ansys/fluent/core/solver/tui_231.py +36423 -36423
- {ansys_fluent_core-0.14.dev0.dist-info → ansys_fluent_core-0.14.dev2.dist-info}/METADATA +30 -30
- {ansys_fluent_core-0.14.dev0.dist-info → ansys_fluent_core-0.14.dev2.dist-info}/RECORD +80 -78
- {ansys_fluent_core-0.14.dev0.dist-info → ansys_fluent_core-0.14.dev2.dist-info}/LICENSE +0 -0
- {ansys_fluent_core-0.14.dev0.dist-info → ansys_fluent_core-0.14.dev2.dist-info}/WHEEL +0 -0
- {ansys_fluent_core-0.14.dev0.dist-info → ansys_fluent_core-0.14.dev2.dist-info}/top_level.txt +0 -0
|
@@ -664,6 +664,12 @@ class _FieldDataConstants:
|
|
|
664
664
|
FieldDataProtoModule.FieldType.FLOAT_ARRAY: np.float32,
|
|
665
665
|
FieldDataProtoModule.FieldType.DOUBLE_ARRAY: np.float64,
|
|
666
666
|
}
|
|
667
|
+
np_data_type_to_proto_field_type = {
|
|
668
|
+
np.int32: FieldDataProtoModule.FieldType.INT_ARRAY,
|
|
669
|
+
np.int64: FieldDataProtoModule.FieldType.LONG_ARRAY,
|
|
670
|
+
np.float32: FieldDataProtoModule.FieldType.FLOAT_ARRAY,
|
|
671
|
+
np.float64: FieldDataProtoModule.FieldType.DOUBLE_ARRAY,
|
|
672
|
+
}
|
|
667
673
|
chunk_size = 256 * 1024
|
|
668
674
|
bytes_stream = True
|
|
669
675
|
payloadTags = {
|
|
@@ -838,6 +844,155 @@ def extract_fields(chunk_iterator):
|
|
|
838
844
|
return fields_data
|
|
839
845
|
|
|
840
846
|
|
|
847
|
+
class BaseFieldData:
|
|
848
|
+
"""Contains common properties required by all field data types."""
|
|
849
|
+
|
|
850
|
+
def __init__(self, i_d, data):
|
|
851
|
+
self._data = data
|
|
852
|
+
self._id = i_d
|
|
853
|
+
|
|
854
|
+
@property
|
|
855
|
+
def data(self):
|
|
856
|
+
return self._data
|
|
857
|
+
|
|
858
|
+
@property
|
|
859
|
+
def surface_id(self):
|
|
860
|
+
return self._id
|
|
861
|
+
|
|
862
|
+
@property
|
|
863
|
+
def size(self):
|
|
864
|
+
return len(self._data)
|
|
865
|
+
|
|
866
|
+
def __getitem__(self, item):
|
|
867
|
+
return self._data[item]
|
|
868
|
+
|
|
869
|
+
|
|
870
|
+
class ScalarFieldData(BaseFieldData):
|
|
871
|
+
"""Contains scalar field data."""
|
|
872
|
+
|
|
873
|
+
class ScalarData:
|
|
874
|
+
"""Stores and provides the data as a scalar."""
|
|
875
|
+
|
|
876
|
+
def __init__(self, data):
|
|
877
|
+
self.scalar_data = data
|
|
878
|
+
|
|
879
|
+
def __init__(self, i_d, data):
|
|
880
|
+
super().__init__(i_d, [ScalarFieldData.ScalarData(_data) for _data in data])
|
|
881
|
+
|
|
882
|
+
|
|
883
|
+
class Vector:
|
|
884
|
+
"""Stores the data as a vector ``(x, y, z)``."""
|
|
885
|
+
|
|
886
|
+
def __init__(self, x, y, z):
|
|
887
|
+
self._x = x
|
|
888
|
+
self._y = y
|
|
889
|
+
self._z = z
|
|
890
|
+
|
|
891
|
+
@property
|
|
892
|
+
def x(self) -> float:
|
|
893
|
+
return self._x
|
|
894
|
+
|
|
895
|
+
@property
|
|
896
|
+
def y(self) -> float:
|
|
897
|
+
return self._y
|
|
898
|
+
|
|
899
|
+
@property
|
|
900
|
+
def z(self) -> float:
|
|
901
|
+
return self._z
|
|
902
|
+
|
|
903
|
+
|
|
904
|
+
def _resolve_into_array_of_vectors(data):
|
|
905
|
+
if data.size % 3:
|
|
906
|
+
raise ValueError(
|
|
907
|
+
"Dataset must be resolved as a set of vectors."
|
|
908
|
+
"The length of the dataset should always be in multiples of 3."
|
|
909
|
+
)
|
|
910
|
+
data.shape = data.size // 3, 3
|
|
911
|
+
|
|
912
|
+
|
|
913
|
+
class VectorFieldData(BaseFieldData):
|
|
914
|
+
"""Provides a container for vector field data."""
|
|
915
|
+
|
|
916
|
+
class VectorData(Vector):
|
|
917
|
+
"""Stores and provides the data as a vector."""
|
|
918
|
+
|
|
919
|
+
def __init__(self, x, y, z):
|
|
920
|
+
super().__init__(x, y, z)
|
|
921
|
+
|
|
922
|
+
def __init__(self, i_d, data, scale):
|
|
923
|
+
_resolve_into_array_of_vectors(data)
|
|
924
|
+
self._scale = scale
|
|
925
|
+
super().__init__(i_d, [VectorFieldData.VectorData(x, y, z) for x, y, z in data])
|
|
926
|
+
|
|
927
|
+
@property
|
|
928
|
+
def scale(self) -> float:
|
|
929
|
+
return self._scale
|
|
930
|
+
|
|
931
|
+
|
|
932
|
+
class Vertices(BaseFieldData):
|
|
933
|
+
"""Provides a container for the vertex data."""
|
|
934
|
+
|
|
935
|
+
class Vertex(Vector):
|
|
936
|
+
"""Stores and provides the data as a vector of a vertex."""
|
|
937
|
+
|
|
938
|
+
def __init__(self, x, y, z):
|
|
939
|
+
super().__init__(x, y, z)
|
|
940
|
+
|
|
941
|
+
def __init__(self, i_d, data):
|
|
942
|
+
_resolve_into_array_of_vectors(data)
|
|
943
|
+
super().__init__(i_d, [(Vertices.Vertex(x, y, z)) for x, y, z in data])
|
|
944
|
+
|
|
945
|
+
|
|
946
|
+
class FacesCentroid(BaseFieldData):
|
|
947
|
+
"""Provides the container for the face centroid data."""
|
|
948
|
+
|
|
949
|
+
class Centroid(Vector):
|
|
950
|
+
"""Stores and provides the face centroid data as a vector."""
|
|
951
|
+
|
|
952
|
+
def __init__(self, x, y, z):
|
|
953
|
+
super().__init__(x, y, z)
|
|
954
|
+
|
|
955
|
+
def __init__(self, i_d, data):
|
|
956
|
+
_resolve_into_array_of_vectors(data)
|
|
957
|
+
super().__init__(i_d, [(FacesCentroid.Centroid(x, y, z)) for x, y, z in data])
|
|
958
|
+
|
|
959
|
+
|
|
960
|
+
class FacesConnectivity(BaseFieldData):
|
|
961
|
+
"""Provides the container for the face connectivity data."""
|
|
962
|
+
|
|
963
|
+
class Faces:
|
|
964
|
+
"""Stores and provides the face connectivity data as an array."""
|
|
965
|
+
|
|
966
|
+
def __init__(self, node_count, node_indices):
|
|
967
|
+
self.node_count = node_count
|
|
968
|
+
self.node_indices = node_indices
|
|
969
|
+
|
|
970
|
+
def __init__(self, i_d, data):
|
|
971
|
+
faces_data = []
|
|
972
|
+
i = 0
|
|
973
|
+
|
|
974
|
+
while i < len(data):
|
|
975
|
+
end = i + 1 + data[i]
|
|
976
|
+
faces_data.append(FacesConnectivity.Faces(data[i], data[i + 1 : end]))
|
|
977
|
+
i = end
|
|
978
|
+
|
|
979
|
+
super().__init__(i_d, faces_data)
|
|
980
|
+
|
|
981
|
+
|
|
982
|
+
class FacesNormal(BaseFieldData):
|
|
983
|
+
"""Provides the container for the face normal data."""
|
|
984
|
+
|
|
985
|
+
class Normal(Vector):
|
|
986
|
+
"""Stores and provides the face normal data as a vector."""
|
|
987
|
+
|
|
988
|
+
def __init__(self, x, y, z):
|
|
989
|
+
super().__init__(x, y, z)
|
|
990
|
+
|
|
991
|
+
def __init__(self, i_d, data):
|
|
992
|
+
_resolve_into_array_of_vectors(data)
|
|
993
|
+
super().__init__(i_d, [FacesNormal.Normal(x, y, z) for x, y, z in data])
|
|
994
|
+
|
|
995
|
+
|
|
841
996
|
class FieldData:
|
|
842
997
|
"""Provides access to Fluent field data on surfaces."""
|
|
843
998
|
|
|
@@ -922,7 +1077,7 @@ class FieldData:
|
|
|
922
1077
|
surface_name: Optional[str] = None,
|
|
923
1078
|
node_value: Optional[bool] = True,
|
|
924
1079
|
boundary_value: Optional[bool] = False,
|
|
925
|
-
) -> Dict[int,
|
|
1080
|
+
) -> Union[ScalarFieldData, Dict[int, ScalarFieldData]]:
|
|
926
1081
|
"""Get scalar field data on a surface.
|
|
927
1082
|
|
|
928
1083
|
Parameters
|
|
@@ -942,8 +1097,10 @@ class FieldData:
|
|
|
942
1097
|
|
|
943
1098
|
Returns
|
|
944
1099
|
-------
|
|
945
|
-
Dict[int,
|
|
946
|
-
|
|
1100
|
+
Union[ScalarFieldData, Dict[int, ScalarFieldData]]
|
|
1101
|
+
If a surface name is provided as input, scalar field data is returned. If surface
|
|
1102
|
+
IDs are provided as input, a dictionary containing a map of surface IDs to scalar
|
|
1103
|
+
field data.
|
|
947
1104
|
"""
|
|
948
1105
|
surface_ids = _get_surface_ids(
|
|
949
1106
|
field_info=self._field_info,
|
|
@@ -970,10 +1127,18 @@ class FieldData:
|
|
|
970
1127
|
|
|
971
1128
|
fields = extract_fields(self._service.get_fields(fields_request))
|
|
972
1129
|
scalar_field_data = next(iter(fields.values()))
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
1130
|
+
|
|
1131
|
+
if surface_name:
|
|
1132
|
+
return ScalarFieldData(
|
|
1133
|
+
surface_ids[0], scalar_field_data[surface_ids[0]][field_name]
|
|
1134
|
+
)
|
|
1135
|
+
else:
|
|
1136
|
+
return {
|
|
1137
|
+
surface_id: ScalarFieldData(
|
|
1138
|
+
surface_id, scalar_field_data[surface_id][field_name]
|
|
1139
|
+
)
|
|
1140
|
+
for surface_id in surface_ids
|
|
1141
|
+
}
|
|
977
1142
|
|
|
978
1143
|
def get_surface_data(
|
|
979
1144
|
self,
|
|
@@ -981,7 +1146,10 @@ class FieldData:
|
|
|
981
1146
|
surface_ids: Optional[List[int]] = None,
|
|
982
1147
|
surface_name: Optional[str] = None,
|
|
983
1148
|
overset_mesh: Optional[bool] = False,
|
|
984
|
-
) ->
|
|
1149
|
+
) -> Union[
|
|
1150
|
+
Union[Vertices, FacesConnectivity, FacesNormal, FacesCentroid],
|
|
1151
|
+
Dict[int, Union[Vertices, FacesConnectivity, FacesNormal, FacesCentroid]],
|
|
1152
|
+
]:
|
|
985
1153
|
"""Get surface data (vertices, faces connectivity, centroids, and
|
|
986
1154
|
normals).
|
|
987
1155
|
|
|
@@ -998,8 +1166,11 @@ class FieldData:
|
|
|
998
1166
|
|
|
999
1167
|
Returns
|
|
1000
1168
|
-------
|
|
1001
|
-
|
|
1002
|
-
|
|
1169
|
+
Union[Vertices, FacesConnectivity, FacesNormal, FacesCentroid,
|
|
1170
|
+
Dict[int, Union[Vertices, FacesConnectivity, FacesNormal, FacesCentroid]]]
|
|
1171
|
+
If a surface name is provided as input, face vertices, connectivity data, and normal or centroid data are returned.
|
|
1172
|
+
If surface IDs are provided as input, a dictionary containing a map of surface IDs to face
|
|
1173
|
+
vertices, connectivity data, and normal or centroid data is returned.
|
|
1003
1174
|
"""
|
|
1004
1175
|
surface_ids = _get_surface_ids(
|
|
1005
1176
|
field_info=self._field_info,
|
|
@@ -1029,17 +1200,57 @@ class FieldData:
|
|
|
1029
1200
|
}
|
|
1030
1201
|
fields = extract_fields(self._service.get_fields(fields_request))
|
|
1031
1202
|
surface_data = next(iter(fields.values()))
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1203
|
+
|
|
1204
|
+
def _get_surfaces_data(parent_class, surf_id, _data_type):
|
|
1205
|
+
return parent_class(
|
|
1206
|
+
surf_id,
|
|
1207
|
+
surface_data[surf_id][enum_to_field_name[_data_type]],
|
|
1208
|
+
)
|
|
1209
|
+
|
|
1210
|
+
if data_type == SurfaceDataType.Vertices:
|
|
1211
|
+
if surface_name:
|
|
1212
|
+
return _get_surfaces_data(Vertices, surface_ids[0], data_type)
|
|
1213
|
+
else:
|
|
1214
|
+
return {
|
|
1215
|
+
surface_id: _get_surfaces_data(Vertices, surface_id, data_type)
|
|
1216
|
+
for surface_id in surface_ids
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
if data_type == SurfaceDataType.FacesCentroid:
|
|
1220
|
+
if surface_name:
|
|
1221
|
+
return _get_surfaces_data(FacesCentroid, surface_ids[0], data_type)
|
|
1222
|
+
else:
|
|
1223
|
+
return {
|
|
1224
|
+
surface_id: _get_surfaces_data(FacesCentroid, surface_id, data_type)
|
|
1225
|
+
for surface_id in surface_ids
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
if data_type == SurfaceDataType.FacesConnectivity:
|
|
1229
|
+
if surface_name:
|
|
1230
|
+
return _get_surfaces_data(FacesConnectivity, surface_ids[0], data_type)
|
|
1231
|
+
else:
|
|
1232
|
+
return {
|
|
1233
|
+
surface_id: _get_surfaces_data(
|
|
1234
|
+
FacesConnectivity, surface_id, data_type
|
|
1235
|
+
)
|
|
1236
|
+
for surface_id in surface_ids
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
if data_type == SurfaceDataType.FacesNormal:
|
|
1240
|
+
if surface_name:
|
|
1241
|
+
return _get_surfaces_data(FacesNormal, surface_ids[0], data_type)
|
|
1242
|
+
else:
|
|
1243
|
+
return {
|
|
1244
|
+
surface_id: _get_surfaces_data(FacesNormal, surface_id, data_type)
|
|
1245
|
+
for surface_id in surface_ids
|
|
1246
|
+
}
|
|
1036
1247
|
|
|
1037
1248
|
def get_vector_field_data(
|
|
1038
1249
|
self,
|
|
1039
1250
|
field_name: str,
|
|
1040
1251
|
surface_ids: Optional[List[int]] = None,
|
|
1041
1252
|
surface_name: Optional[str] = None,
|
|
1042
|
-
) ->
|
|
1253
|
+
) -> Union[VectorFieldData, Dict[int, VectorFieldData]]:
|
|
1043
1254
|
"""Get vector field data on a surface.
|
|
1044
1255
|
|
|
1045
1256
|
Parameters
|
|
@@ -1053,8 +1264,10 @@ class FieldData:
|
|
|
1053
1264
|
|
|
1054
1265
|
Returns
|
|
1055
1266
|
-------
|
|
1056
|
-
|
|
1057
|
-
|
|
1267
|
+
Union[VectorFieldData, Dict[int, VectorFieldData]]
|
|
1268
|
+
If a surface name is provided as input, vector field data is returned.
|
|
1269
|
+
If surface IDs are provided as input, a dictionary containing a map of
|
|
1270
|
+
surface IDs to vector field data is returned.
|
|
1058
1271
|
"""
|
|
1059
1272
|
surface_ids = _get_surface_ids(
|
|
1060
1273
|
field_info=self._field_info,
|
|
@@ -1076,13 +1289,22 @@ class FieldData:
|
|
|
1076
1289
|
)
|
|
1077
1290
|
fields = extract_fields(self._service.get_fields(fields_request))
|
|
1078
1291
|
vector_field_data = next(iter(fields.values()))
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1292
|
+
|
|
1293
|
+
if surface_name:
|
|
1294
|
+
return VectorFieldData(
|
|
1295
|
+
surface_ids[0],
|
|
1296
|
+
vector_field_data[surface_ids[0]][field_name],
|
|
1297
|
+
vector_field_data[surface_ids[0]]["vector-scale"][0],
|
|
1083
1298
|
)
|
|
1084
|
-
|
|
1085
|
-
|
|
1299
|
+
else:
|
|
1300
|
+
return {
|
|
1301
|
+
surface_id: VectorFieldData(
|
|
1302
|
+
surface_id,
|
|
1303
|
+
vector_field_data[surface_id][field_name],
|
|
1304
|
+
vector_field_data[surface_id]["vector-scale"][0],
|
|
1305
|
+
)
|
|
1306
|
+
for surface_id in surface_ids
|
|
1307
|
+
}
|
|
1086
1308
|
|
|
1087
1309
|
def get_pathlines_field_data(
|
|
1088
1310
|
self,
|
|
@@ -1101,8 +1323,8 @@ class FieldData:
|
|
|
1101
1323
|
coarsen: Optional[int] = 1,
|
|
1102
1324
|
velocity_domain: Optional[str] = "all-phases",
|
|
1103
1325
|
zones: Optional[list] = [],
|
|
1104
|
-
) -> Dict
|
|
1105
|
-
"""Get pathlines field data on a surface.
|
|
1326
|
+
) -> Dict:
|
|
1327
|
+
"""Get the pathlines field data on a surface.
|
|
1106
1328
|
|
|
1107
1329
|
Parameters
|
|
1108
1330
|
----------
|
|
@@ -1138,8 +1360,8 @@ class FieldData:
|
|
|
1138
1360
|
|
|
1139
1361
|
Returns
|
|
1140
1362
|
-------
|
|
1141
|
-
Dict
|
|
1142
|
-
Dictionary containing a map of surface IDs to the pathline data
|
|
1363
|
+
Dict
|
|
1364
|
+
Dictionary containing a map of surface IDs to the pathline data.
|
|
1143
1365
|
For example, pathlines connectivity, vertices, and field.
|
|
1144
1366
|
"""
|
|
1145
1367
|
surface_ids = _get_surface_ids(
|
|
@@ -1173,6 +1395,33 @@ class FieldData:
|
|
|
1173
1395
|
]
|
|
1174
1396
|
)
|
|
1175
1397
|
fields = extract_fields(self._service.get_fields(fields_request))
|
|
1176
|
-
vector_field_data = next(iter(fields.values()))
|
|
1177
1398
|
pathlines_data = next(iter(fields.values()))
|
|
1178
|
-
|
|
1399
|
+
|
|
1400
|
+
def _get_surfaces_data(parent_class, surf_id, _data_type):
|
|
1401
|
+
return parent_class(
|
|
1402
|
+
surf_id,
|
|
1403
|
+
pathlines_data[surf_id][_data_type],
|
|
1404
|
+
)
|
|
1405
|
+
|
|
1406
|
+
if surface_name:
|
|
1407
|
+
vertices_data = _get_surfaces_data(Vertices, surface_ids[0], "vertices")
|
|
1408
|
+
lines_data = _get_surfaces_data(FacesConnectivity, surface_ids[0], "lines")
|
|
1409
|
+
field_data = ScalarFieldData(
|
|
1410
|
+
surface_ids[0], pathlines_data[surface_ids[0]][field_name]
|
|
1411
|
+
)
|
|
1412
|
+
return {
|
|
1413
|
+
"vertices": vertices_data,
|
|
1414
|
+
"lines": lines_data,
|
|
1415
|
+
field_name: field_data,
|
|
1416
|
+
}
|
|
1417
|
+
else:
|
|
1418
|
+
path_lines_dict = {}
|
|
1419
|
+
for surface_id in surface_ids:
|
|
1420
|
+
path_lines_dict[surface_id] = {
|
|
1421
|
+
"vertices": _get_surfaces_data(Vertices, surface_id, "vertices"),
|
|
1422
|
+
"lines": _get_surfaces_data(FacesConnectivity, surface_id, "lines"),
|
|
1423
|
+
field_name: ScalarFieldData(
|
|
1424
|
+
surface_id, pathlines_data[surface_id][field_name]
|
|
1425
|
+
),
|
|
1426
|
+
}
|
|
1427
|
+
return path_lines_dict
|