Skip to content
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

Displacement operator throws an error when EP-data is present (24R2 and up) #1990

Open
3 tasks done
mhoeijm opened this issue Jan 6, 2025 · 0 comments
Open
3 tasks done
Labels
bug Something isn't working

Comments

@mhoeijm
Copy link

mhoeijm commented Jan 6, 2025

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

Extracting displacements from d3plots that contain EP (electrophysiology) data fails for DPF servers 24R2 (and above). 24R1 is working (and also allows user to read EP results, although somewhat less conveniently through variable ids).

So far I haven't had issues when extracting displacements from d3plots that do not contain EP, so I suspect the issue is related to EP data being present.

@ayush-kumar-423, @PProfizi, @wenfengye, @KarimElHouari

Steps To Reproduce

The d3plot below contains EP results and should return 0 displacement for all time-steps (no mechanics involved).

data to reproduce: d3plot.zip

import ansys.dpf.core as dpf
path = "d3plot"
# start 2024.2 server
server = dpf.server.available_servers()["2024.2"]()
ds = dpf.DataSources()
ds.set_result_file_path(path, "d3plot")
model = dpf.Model(ds)
print(model)
model.results.displacement.on_all_time_freqs().eval()

Gives me the following traceback:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "d:\development\conda-envs\debug-dpf\lib\site-packages\ansys\dpf\core\dpf_operator.py", line 736, in eval
    return self.outputs._outputs[0]()
  File "d:\development\conda-envs\debug-dpf\lib\site-packages\ansys\dpf\core\outputs.py", line 75, in __call__
    return self.get_data()
  File "d:\development\conda-envs\debug-dpf\lib\site-packages\ansys\dpf\core\outputs.py", line 72, in get_data
    return self._operator.get_output(self._pin, type_output)
  File "d:\development\conda-envs\debug-dpf\lib\site-packages\ansys\dpf\core\dpf_operator.py", line 543, in get_output
    internal_obj = type_tuple[1](self, pin)
  File "d:\development\conda-envs\debug-dpf\lib\site-packages\ansys\dpf\gate\generated\operator_capi.py", line 422, in operator_getoutput_fields_container
    raise errors.DPFServerException(sError.value)
ansys.dpf.gate.errors.DPFServerException: U:29<-lsdyna::d3plot::U:38<-error code 4:DPF error - runtime error: dpf core function call; the entry obj is not of type scoping

The above will work when you substitute "2024.1" for "2024.2" (should ofcourse be instlaled):

import ansys.dpf.core as dpf
path = "d3plot"
# start 2024.1 server
server = dpf.server.available_servers()["2024.1"]()
ds = dpf.DataSources()
ds.set_result_file_path(path, "d3plot")
model = dpf.Model(ds)
print(model)
model.results.displacement.on_all_time_freqs().eval()

Moreover with 24R2 we can access EP data in an attribute-like way, however some results also contain invalid characters. For instance the attached d3plot has data fields where the name contains +, since this does not give a valid Python attribute name we won't be able to access this data in an attribute-like fashion:

print(model)

gives:

Available results:
...
     -  displacement: Nodal Displacement
     -  electrical_conductivity: Elemental Electrical Conductivity
     -  ep_transmembrane_pot: Nodal Ep Transmembrane Pot
     -  ep_extra_cell_pot: Nodal Ep Extra Cell Pot
     -  ep_intra_cell_pot: Nodal Ep Intra Cell Pot
     -  ep_ca2+_concentration: Nodal Ep Ca2+ Concentration      
     -  ep_intra_cell_pot: Nodal Ep Intra Cell Pot
     -  ep_ca2+_concentration: Nodal Ep Ca2+ Concentration

The following would be invalid:

model.results.ep_ca2+_concentration

I have seen the same when history variable results are present - the attribute names contain [ and ] - in the d3plots (data not attached):

Available results:
...
     -  history_variablesihv__[1__27]: Elemental History Variables(ihv: [1, 27])
     -  displacement: Nodal Displacement
...
     -  ep_transmembrane_pot: Nodal Ep Transmembrane Pot
     -  ep_extra_cell_pot: Nodal Ep Extra Cell Pot
     -  ep_intra_cell_pot: Nodal Ep Intra Cell Pot
     -  ep_activ__time: Nodal Ep Activ. Time
     -  ep_ca2+_concentration: Nodal Ep Ca2+ Concentration
     -  : Nodal

Which Operating System causes the issue?

Windows

Which DPF/Ansys version are you using?

Ansys 2024 R2

Which Python version causes the issue?

3.10

Installed packages

Package                  Version
------------------------ ----------
ansys-dpf-core           0.13.0
cachetools               5.5.0
certifi                  2024.12.14
charset-normalizer       3.4.1
colorama                 0.4.6
google-api-core          2.24.0
google-api-python-client 2.157.0
google-auth              2.37.0
google-auth-httplib2     0.2.0
googleapis-common-protos 1.66.0
grpcio                   1.69.0
httplib2                 0.22.0
idna                     3.10
importlib_metadata       8.5.0
numpy                    1.26.4
packaging                24.2
pip                      24.3.1
proto-plus               1.25.0
protobuf                 5.29.2
psutil                   6.1.1
pyasn1                   0.6.1
pyasn1_modules           0.4.1
pyparsing                3.2.1
requests                 2.32.3
rsa                      4.9
setuptools               75.6.0
tqdm                     4.67.1
uritemplate              4.1.1
urllib3                  2.3.0
wheel                    0.45.1
zipp                     3.21.0
@mhoeijm mhoeijm added the bug Something isn't working label Jan 6, 2025
@mhoeijm mhoeijm changed the title Displacement operator throws an error for d3plot results with 24R2 (and up) when EP-data is present Displacement operator throws an error when EP-data is present (24R2 and up) Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant