ansys / pydpf-core

Data Processing Framework - Python Core
http://dpf.docs.pyansys.com/
MIT License
68 stars 25 forks source link

Bug in "Average Elemental Stress on a given volume" #560

Open GuillemBarroso opened 2 years ago

GuillemBarroso commented 2 years ago

Before submitting the issue

Description of the bug

In the example Average Elemental Stress on a given volume, the values_to_sum_field are correctly visualized in the first plot.

However, the second and third plots (regarding divide and out variables, respectively) are not correctly displayed.

Note that I tried to isolate the last plot and create a python script that recreates only the third plot. When doing that, I was able to plot the results of the operator volume_stress.

Steps To Reproduce

Follow the example.

Which Operating System are you using?

Windows

Which Python version are you using?

3.10

Installed packages

aiohttp==3.8.3 aiosignal==1.2.0 -e git+https://github.com/pyansys/pydpf-core@3977c3952a6d67ceb67390fe7ea7a862b8389c6c#egg=ansys_dpf_core ansys-dpf-gate==0.2.3 ansys-dpf-gatebin==0.2.3 ansys-grpc-dpf==0.6.1 appdirs==1.4.4 async-timeout==4.0.2 attrs==22.1.0 cachetools==5.2.0 certifi==2022.9.24 charset-normalizer==2.1.1 colorama==0.4.5 contourpy==1.0.5 cycler==0.11.0 fonttools==4.37.4 frozenlist==1.3.1 google-api-core==2.10.2 google-api-python-client==2.64.0 google-auth==2.12.0 google-auth-httplib2==0.1.0 googleapis-common-protos==1.56.4 grpcio==1.49.1 httplib2==0.20.4 idna==3.4 imageio==2.22.1 kiwisolver==1.4.4 matplotlib==3.6.1 multidict==6.0.2 numpy==1.23.4 packaging==21.3 Pillow==9.2.0 protobuf==4.21.7 psutil==5.9.2 pyasn1==0.4.8 pyasn1-modules==0.2.8 pyparsing==3.0.9 python-dateutil==2.8.2 pyvista==0.36.1 requests==2.28.1 rsa==4.9 scooby==0.6.0 six==1.16.0 tqdm==4.64.1 uritemplate==4.1.1 urllib3==1.26.12 vtk==9.2.2 wslink==1.8.4 yarl==1.8.1

GuillemBarroso commented 2 years ago

Hi @PProfizi,

I just realized that now the 2nd and 3rd figures are properly displayed in the example.

However, the first figure has changed now. When I run the example locally, I get:

image

as opposed to what it is displayed in the example

PProfizi commented 2 years ago

Hi @GuillemBarroso, I've released 0.6.2 yesterday, so the documentation has been updated. No idea why that would have changed something here, yet if the third plot is right then that is good news as it is the result of an operator. If the first is wrong, then it might be a problem with the script.

GuillemBarroso commented 2 years ago

Hi @PProfizi, Yes, the third plot looks fine. The operator shouldn't be the problem since when I isolated the last part of the example, I could visualize the results correctly (see issue description). It looks like the release fixed the visualization of the last two plots.

I will keep going through all examples in detail to see if I realize what's the issue with the first plot. Please, let me know if you find something on your side. Thanks!

rajesh1359 commented 3 months ago

@PProfizi Why is there a factor of 10 when 'volume_stress' operator is used?

image

PProfizi commented 3 months ago

Hi @rlagha, I see you are the one who implemented this operator, can you tell us more about its behavior? I can also see it's been switched to private in March 2023 for some reason... if private, then it should not appear in an example. @cbellot000 I see you are the one who added the paragraph concerning the private operator in the example, maybe we should switch it to public?