ansys / pydpf-post

Data Processing Framework - Post Processing Module
https://post.docs.pyansys.com
MIT License
45 stars 9 forks source link

Random results/crashes when getting skin results #653

Open janvonrickenbach opened 5 months ago

janvonrickenbach commented 5 months ago

Before submitting the issue

Description of the bug

The following snipped reads strains from a distributed rst file. The resulting array (res.array) has a random size every time the script is run (usually 220 or 216). Sometimes the script also crashes.

To reproduce:

Notes:

import os
from ansys.dpf.core import DataSources
from ansys.dpf.post import StaticMechanicalSimulation
from ansys.dpf.post.simulation import ResultCategory

data_directory = 
distributed_files = [
    os.path.join(data_directory, f"file{i}.rst") for i in range(4)
]

ds = DataSources()
for domain_id, file_path in enumerate(distributed_files):
    ds.set_domain_result_file_path(file_path, domain_id)

model = StaticMechanicalSimulation(result_file=ds)

selection = model._build_selection(
    base_name="EPEL",
    category=ResultCategory.matrix,
    location="Elemental",
    skin=True,
    set_ids=[5],
    times=None,
    selection=None,
)

res = model._get_result(
    base_name="EPEL",
    location="Elemental",
    category=ResultCategory.matrix,
    selection=selection,
)
assert res.array.shape[0] == 224, res.array.shape[0]

distributed.zip

Steps To Reproduce

See above

Which Operating System are you using?

Windows

Which DPF/Ansys version are you using?

DPF Server 2025.1.pre0

Which Python version are you using?

3.10

Installed packages

annotated-types==0.7.0 ansys-dpf-core @ git+https://git@github.com/ansys/pydpf-core.git@24523e39859964b54cc8de1b07c9096f4ec804ad ansys-dpf-post @ git+https://github.com/ansys/pydpf-post.git@e47a80a336093b7e06fc07d27045b1d1a4b41627 ansys-hps-client @ git+https://github.com/ansys/pyhps.git@4512655320766fa5575491ade15dc720875b2809 anyio==4.4.0 backoff==2.2.1 backports.tarfile==1.2.0 build==1.2.1 cachetools==5.3.3 certifi==2024.2.2 cfgv==3.4.0 charset-normalizer==3.3.2 click==8.1.7 colorama==0.4.6 contourpy==1.2.1 coverage==7.5.3 cx_Freeze==6.15.16 cx_Logging==3.2.0 cycler==0.12.1 distlib==0.3.8 dnspython==2.6.1 docutils==0.21.2 email_validator==2.1.1 exceptiongroup==1.2.1 fast_simplification==0.1.7 fastapi==0.111.0 fastapi-cli==0.0.4 filelock==3.14.0 fonttools==4.52.4 google-api-core==2.19.0 google-api-python-client==2.131.0 google-auth==2.29.0 google-auth-httplib2==0.2.0 googleapis-common-protos==1.63.0 grpcio==1.64.0 h11==0.14.0 httpcore==1.0.5 httplib2==0.22.0 httptools==0.6.1 httpx==0.27.0 humanize==4.9.0 identify==2.5.36 idna==3.7 importlib_metadata==7.1.0 iniconfig==2.0.0 jaraco.classes==3.4.0 jaraco.context==5.3.0 jaraco.functools==4.0.1 Jinja2==3.1.4 keyring==25.2.1 kiwisolver==1.4.5 lief==0.14.1 markdown-it-py==3.0.0 MarkupSafe==2.1.5 marshmallow==3.21.2 marshmallow-oneofschema==3.1.1 matplotlib==3.9.0 mdurl==0.1.2 more-itertools==10.2.0 nh3==0.2.17 nodeenv==1.9.0 numpy==1.26.4 orjson==3.10.3 packaging==24.0 pandas==2.2.2 pillow==10.3.0 pkginfo==1.10.0 platformdirs==4.2.2 plotly==5.22.0 pluggy==1.5.0 pooch==1.8.1 portend==3.2.0 pre-commit==3.7.1 proto-plus==1.23.0 protobuf==4.25.3 psutil==5.9.8 pyasn1==0.6.0 pyasn1_modules==0.4.0 pydantic==2.7.0 pydantic-settings==2.2.1 pydantic_core==2.18.1 Pygments==2.18.0 PyJWT==2.8.0 pyparsing==3.1.2 pyproject_hooks==1.1.0 pytest==8.2.1 pytest-cov==5.0.0 pytest-rerunfailures==14.0 pytest-timeout==2.3.1 python-dateutil==2.9.0.post0 python-dotenv==1.0.1 python-multipart==0.0.9 pytz==2024.1 pyvista==0.43.8 pywin32-ctypes==0.2.2 PyYAML==6.0.1 readme_renderer==43.0 requests==2.32.2 requests-toolbelt==1.0.0 rfc3986==2.0.0 rich==13.7.1 rsa==4.9 scooby==0.10.0 shellingham==1.5.4 six==1.16.0 sniffio==1.3.1 starlette==0.37.2 tempora==5.5.1 tenacity==8.3.0 tomli==2.0.1 tqdm==4.66.4 twine==5.1.0 typer==0.12.3 typing_extensions==4.12.0 tzdata==2024.1 ujson==5.10.0 uritemplate==4.1.1 urllib3==2.2.1 uvicorn==0.29.0 virtualenv==20.26.2 vtk==9.3.0 watchfiles==0.22.0 websockets==12.0 zipp==3.19.0

MichaelNale commented 5 months ago

@janvonrickenbach I think that the link to download your rst is broken or I need access.

janvonrickenbach commented 5 months ago

@MichaelNale Sorry for that. I replaced the link.