Skip to content

Updates to support CFF mesh/result refactoring #1002

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@
connectivity_f_n_shell = dpf.PropertyField()
for face_nodes_index_shell, face_nodes_shell in enumerate(polygon_faces_node_connectivity):
connectivity_f_n_shell.append(face_nodes_shell, face_nodes_index_shell)
connectivity_f_n_shell.scoping = mesh_scoping_factory.face_scoping(list(range(30)))
mesh_shell_only.set_property_field(
property_name="faces_nodes_connectivity", value=connectivity_f_n_shell
)
Expand All @@ -277,6 +278,7 @@
connectivity_f_n_solid = dpf.PropertyField()
for face_nodes_index_solid, face_nodes_solid in enumerate(polyhedron_faces_node_connectivity):
connectivity_f_n_solid.append(face_nodes_solid, face_nodes_index_solid)
connectivity_f_n_solid.scoping = mesh_scoping_factory.face_scoping(list(range(24)))
mesh_solid_only.set_property_field(
property_name="faces_nodes_connectivity", value=connectivity_f_n_solid
)
Expand Down Expand Up @@ -335,7 +337,7 @@
fcs_types_shell = dpf.PropertyField()
for face_index_solid, fctype_shell in enumerate(FT_shell_line):
fcs_types_shell.append(fctype_shell, face_index_solid)
fcs_types_shell.scoping = mesh_scoping_factory.elemental_scoping(list(range(30)))
fcs_types_shell.scoping = mesh_scoping_factory.face_scoping(list(range(30)))
mesh_shell_only.set_property_field(property_name="faces_type", value=fcs_types_shell)

# SolidOnly
Expand All @@ -351,7 +353,7 @@
fcs_types_solid = dpf.PropertyField()
for face_index_shell, fctype_solid in enumerate(FT_tot):
fcs_types_solid.append(fctype_solid, face_index_shell)
fcs_types_solid.scoping = mesh_scoping_factory.elemental_scoping(list(range(24)))
fcs_types_solid.scoping = mesh_scoping_factory.face_scoping(list(range(24)))
mesh_solid_only.set_property_field(property_name="faces_type", value=fcs_types_solid)

###############################################################################
Expand Down
16 changes: 16 additions & 0 deletions src/ansys/dpf/core/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,22 @@ class nodal_properties:
nodal_connectivity = "reverse_connectivity"


class face_properties:
"""Contains strings to define face property fields.

Attributes
----------
element_type = "faces_type"
face type property data is provided

connectivity = "faces_nodes_connectivity"
faces connectivity property data is provided
"""

faces_type = "faces_type"
faces_nodes_connectivity = "faces_nodes_connectivity"


class config_options:
"""Contains strings to define configuration options.

Expand Down
36 changes: 36 additions & 0 deletions src/ansys/dpf/core/examples/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,3 +422,39 @@ def find_distributed_msup_folder(

"""
return find_files(distributed_msup_folder, should_upload, server, return_local_path)


def find_fluent_model(should_upload: bool = True, server=None, return_local_path=False) -> str:
"""Make the result file available server side, if the server is remote the file is uploaded
server side. Returns the path on the file.

Parameters
----------
should_upload : bool, optional (default True)
Whether the file should be uploaded server side when the server is remote.
server : server.DPFServer, optional
Server with channel connected to the remote or local instance. When
``None``, attempts to use the global server.
return_local_path: bool, optional
If ``True``, the local path is returned as is, without uploading, nor searching
for mounted volumes.

Returns
-------
str
Path to the example file.

Examples
--------

>>> from ansys.dpf.core import examples
>>> ds = examples.find_fluent_mesh()
"""
from .downloads import download_fluent_axial_comp
from ansys.dpf.core import data_sources

aux = download_fluent_axial_comp()
ds = data_sources.DataSources()
ds.set_result_file_path(aux["cas"][0], "cas")
ds.add_file_path(aux["dat"][0], "dat")
return ds
Loading