Description
Before submitting the issue
- I have checked for Compatibility issues
- I have searched among the existing issues
- I am using a Python virtual environment
Description of the bug
General Issue Description
We observed missing contact status in case of 2D static analysis result file (with surface contact elements) attached as data_sources. However, contact status can be retrieved from 3D static analysis doing it in the same way. For the first glance, it seems to be a bug or missing support for the 2D models.
Could confirm, if contact status can be retrieved from 2D models as well?
More Details
Above is present in my two environments:
- ANSYS 2021R2 + 1st python venv compatible with grpc 2.0
- ANSYS 2022R2 + 2nd python venv compatible with grpc 4.0
What is more, contact pressure can be retrieved from 2D model, only using grpc 2.0. In newer version, it's returning 0 entities in Fields Container.
Chance for Quick Advice
- Is someone able to check it and confirm?
- Is there any simple and stable workaround to retrieve contact data from 2D result file using dpf technology?
- If bug will be confirmed, what is the lead time to fix such thing and release updated version?
Steps To Reproduce
Steps
- Install Ansys in appropriate version 2021R2 or 2022R2
- Create python 3.8 virtual environment with below
pip freeze
requirements respectively to Ansys version - Change
path_to_rst_2d
andpath_to_rst_3d
to your own rst files (which contain surface contact elements) and run below code - Validate output against mine output pasted below
Code to run
from ansys.dpf import core as dpf
from ansys.dpf import post
import os
### Approach with dpf core ###
path_to_rst_2d = r"files/ansys_rst/file_2d.rst"
path_to_rst_3d = r"files/ansys_rst/file_3d.rst"
serv = dpf.server.start_local_server()
print(serv)
test = "status"
# test = "pressure"
if test == "status":
op = dpf.operators.result.contact_status()
elif test == "pressure":
op = dpf.operators.result.contact_pressure()
else:
print("Wrong test selection")
my_data_sources = dpf.DataSources()
my_data_sources.set_result_file_path(os.path.realpath(path_to_rst_2d))
op.inputs.data_sources.connect(my_data_sources)
result_fields_container = op.outputs.fields_container()
print("path_to_rst_2d <------")
print(my_data_sources.result_files)
print(result_fields_container)
print(result_fields_container[0].data)
print('-- ' * 30)
if test == "status":
op = dpf.operators.result.contact_status()
elif test == "pressure":
op = dpf.operators.result.contact_pressure()
my_data_sources = dpf.DataSources()
my_data_sources.set_result_file_path(os.path.realpath(path_to_rst_3d))
op.inputs.data_sources.connect(my_data_sources)
result_fields_container = op.outputs.fields_container()
print("path_to_rst_3d <------")
print(my_data_sources.result_files)
print(result_fields_container)
print(result_fields_container[0].data)
print('-- ' * 30)
Output | grpc 4.0 or grpc 2.0 | status
path_to_rst_2d <------
['C:\***\files\ansys_rst\file_2d.rst']
DPF contact_status(s)Fields Container
with 1 field(s)
defined on labels: time
with:
- field 0 {time: 1} with ElementalNodal location, 1 components and 0 entities.
[]
path_to_rst_3d <------
['C:\***\files\ansys_rst\file_3d.rst']
DPF contact_status(s)Fields Container
with 1 field(s)
defined on labels: time
with:
- field 0 {time: 4} with ElementalNodal location, 1 components and 100 entities.
[3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3.
6. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3.
3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3.
3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3.
3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3.
3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3.
3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3.
3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3.
3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3.
3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3.
3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3.
3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3.
3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3.
3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3.
3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3.
3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3.
3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3.]
Output | grpc 4.0 | pressure
path_to_rst_2d <------
['C:\***\files\ansys_rst\file_2d.rst']
DPF contact_pressure(s)Fields Container
with 1 field(s)
defined on labels: time
with:
- field 0 {time: 1} with ElementalNodal location, 1 components and 0 entities.
[]
path_to_rst_3d <------
['C:\***\files\ansys_rst\file_3d.rst']
DPF contact_pressure(s)Fields Container
with 1 field(s)
defined on labels: time
with:
- field 0 {time: 4} with ElementalNodal location, 1 components and 100 entities.
[0.09375736 0.09284583 0.09283905 0.09375086 0.093789 0.09287871
...
0.03372499 0.03059068 0.03073025 0.03383414]
Output | grpc 2.0 | pressure
path_to_rst_2d <------
['C:\***\files\ansys_rst\file_2d.rst']
DPF contact_pressure(s)Fields Container
with 1 field(s)
defined on labels: time
with:
- field 0 {time: 1} with ElementalNodal location, 1 components and 13 entities.
[ 7030.18701172 5833.45996094 7948.21826172 7007.97021484
9332.68164062 7024.25341797 17229. 9398.88769531
2212.85571289 3798.87084961 1349.48132324 1818.00073242
292.41766357 936.50317383 0. 0.
0. 0. 0. 0.
0. 0. 0. 0.
0. 0. ]
path_to_rst_3d <------
['C:\***\files\ansys_rst\file_3d.rst']
DPF contact_pressure(s)Fields Container
with 1 field(s)
defined on labels: time
with:
- field 0 {time: 4} with ElementalNodal location, 1 components and 100 entities.
[0.09375736 0.09284583 0.09283905 0.09375086 0.093789 0.09287871
...
0.03372499 0.03059068 0.03073025 0.03383414]
Which Operating System are you using?
Windows
Which Python version are you using?
3.8
Installed packages
#Environment for grpc 4.0
aiohttp==3.8.1
aiosignal==1.2.0
ansys-dpf-core==0.5.2
ansys-dpf-gate==0.2.1
ansys-dpf-gatebin==0.2.1
ansys-dpf-post==0.2.4
ansys-grpc-dpf==0.5.1
appdirs==1.4.4
asttokens==2.0.8
async-timeout==4.0.2
attrs==22.1.0
autobahn==22.7.1
Automat==20.2.0
backcall==0.2.0
cachetools==5.2.0
certifi==2022.6.15.1
cffi==1.15.1
charset-normalizer==2.1.1
colorama==0.4.5
constantly==15.1.0
cryptography==38.0.1
cycler==0.11.0
debugpy==1.6.3
decorator==5.1.1
entrypoints==0.4
executing==1.0.0
fonttools==4.37.1
frozenlist==1.3.1
google-api-core==2.10.0
google-api-python-client==2.60.0
google-auth==2.11.0
google-auth-httplib2==0.1.0
googleapis-common-protos==1.56.4
grpcio==1.48.1
httplib2==0.20.4
hyperlink==21.0.0
idna==3.3
imageio==2.21.3
incremental==21.3.0
ipykernel==6.15.2
ipython==8.5.0
jedi==0.18.1
jupyter-core==4.11.1
jupyter_client==7.3.5
kiwisolver==1.4.4
matplotlib==3.5.3
matplotlib-inline==0.1.6
multidict==6.0.2
nest-asyncio==1.5.5
numpy==1.23.3
packaging==21.3
parso==0.8.3
pickleshare==0.7.5
Pillow==9.2.0
prompt-toolkit==3.0.31
protobuf==3.20.1
psutil==5.9.2
pure-eval==0.2.2
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycparser==2.21
Pygments==2.13.0
pyparsing==3.0.9
python-dateutil==2.8.2
pyvista==0.36.1
pywin32==304
pyzmq==23.2.1
requests==2.28.1
rsa==4.9
scooby==0.6.0
six==1.16.0
stack-data==0.5.0
tornado==6.2
tqdm==4.64.1
traitlets==5.4.0
Twisted==22.8.0
twisted-iocpsupport==1.0.2
txaio==22.2.1
typing_extensions==4.3.0
uritemplate==4.1.1
urllib3==1.26.12
vtk==9.1.0
wcwidth==0.2.5
wslink==1.8.2
yarl==1.8.1
zope.interface==5.4.0
#Environment for grpc 2.0
aiohttp==3.8.1
aiosignal==1.2.0
ansys-dpf-core==0.3.5
ansys-dpf-post==0.1.0
ansys-grpc-dpf==0.3.0
appdirs==1.4.4
asttokens==2.0.8
async-timeout==4.0.2
attrs==22.1.0
backcall==0.2.0
cachetools==5.2.0
certifi==2022.6.15
charset-normalizer==2.1.1
colorama==0.4.5
cycler==0.11.0
debugpy==1.6.3
decorator==5.1.1
entrypoints==0.4
executing==1.0.0
fonttools==4.37.1
frozenlist==1.3.1
google-api-core==2.8.2
google-api-python-client==2.60.0
google-auth==2.11.0
google-auth-httplib2==0.1.0
googleapis-common-protos==1.56.4
grpcio==1.48.1
httplib2==0.20.4
idna==3.3
imageio==2.21.2
ipykernel==6.15.2
ipython==8.5.0
jedi==0.18.1
jupyter-core==4.11.1
jupyter_client==7.3.5
kiwisolver==1.4.4
matplotlib==3.5.3
matplotlib-inline==0.1.6
multidict==6.0.2
nest-asyncio==1.5.5
numpy==1.23.2
packaging==21.3
parso==0.8.3
pickleshare==0.7.5
Pillow==9.2.0
progressbar2==4.0.0
prompt-toolkit==3.0.31
protobuf==3.20.0
psutil==5.9.2
pure-eval==0.2.2
pyasn1==0.4.8
pyasn1-modules==0.2.8
Pygments==2.13.0
pyparsing==3.0.9
python-dateutil==2.8.2
python-utils==3.3.3
pyvista==0.36.1
pywin32==304
pyzmq==23.2.1
requests==2.28.1
rsa==4.9
scooby==0.6.0
six==1.16.0
stack-data==0.5.0
tornado==6.2
traitlets==5.3.0
uritemplate==4.1.1
urllib3==1.26.12
vtk==9.1.0
wcwidth==0.2.5
wslink==1.8.2
yarl==1.8.1