Skip to content

Inconsistency between MAPDL and DPF step/substep/cumulative #544

Open
@germa89

Description

@germa89

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

It seems that the scoping operator does not return the correct cumulative index in some cases.

Steps To Reproduce

Use the attached RST file.

file.zip

Open it, and run:

from ansys.dpf import core as dpf

rst_file = r"C:\Users\gayuso\AppData\Local\Temp\pytest-of-gayuso\pytest-1344\ansys0\file.rst"
model = dpf.Model(rst_file)

set_ = (1, 10)
cum_set = model.metadata.time_freq_support.get_cumulative_index(set_[0], set_[1])

scop = dpf.Scoping()
scop.location = "time_freq_steps"
scop.ids = [cum_set]

op = model.results.displacement()
op.inputs.time_scoping.connect(scop)

output = op.outputs.fields_container()[0].data

where output is:

DPFArray([[ 0.        , -0.02314378,  0.        ],
          [ 0.        ,  0.        ,  0.        ],
          [ 0.        ,  0.        ,  0.        ]])

However, using MAPDL, and running:

post1
set,1,10
prnsol,u

I get:

PRINT U    NODAL SOLUTION PER NODE
   *****MAPDL VERIFICATION RUN ONLY*****
     DO NOT USE RESULTS FOR PRODUCTION
 
  ***** POST1 NODAL DEGREE OF FREEDOM LISTING *****                            
 
  LOAD STEP=     1  SUBSTEP=    10                                             
   TIME=   0.10000E-02  LOAD CASE=   0                                         
 
  THE FOLLOWING DEGREE OF FREEDOM RESULTS ARE IN THE GLOBAL COORDINATE SYSTEM  
 
    NODE       UX           UY           UZ           USUM  
       1   0.0000     -0.17485E-003  0.0000      0.17485E-003
       2   0.0000       0.0000       0.0000       0.0000     
       3   0.0000       0.0000       0.0000       0.0000     
       
 MAXIMUM ABSOLUTE VALUES
 NODE          0            0            0            0
 VALUE    0.0000     -0.17485E-003  0.0000      0.17485E-003

I believe the issue is related to get_cumulative_index, because it retuns cum_set= 11, whereas MAPDL when issued set,list returns 10.

*****  INDEX OF DATA SETS ON RESULTS FILE  *****

   SET   TIME/FREQ    LOAD STEP   SUBSTEP  CUMULATIVE
     1 0.10000E-02         1        10        10                  
     2 0.20000E-02         2         1        11                  
     3 0.30000E-02         2         2        12                  
     4 0.40000E-02         2         3        13                  
     5 0.50000E-02         2         4        14                  
     6 0.60000E-02         2         5        15                  
     7 0.70000E-02         2         6        16                  
     8 0.80000E-02         2         7        17                  
     9 0.90000E-02         2         8        18                  
    10 0.10000E-01         2         9        19                  
    11 0.11000E-01         2        10        20                  
    12 0.12000E-01         2        11        21                  
    13 0.13000E-01         2        12        22                  
    14 0.14000E-01         2        13        23                  
    15 0.15000E-01         2        14        24                  
    16 0.16000E-01         2        15        25                  
    17 0.17000E-01         2        16        26                  
    18 0.18000E-01         2        17        27                  
    19 0.19000E-01         2        18        28                  
    20 0.20000E-01         2        19        29                  
    21 0.21000E-01         2        20        30                  
    22 0.22000E-01         2        21        31                  
    23 0.23000E-01         2        22        32                  
    24 0.24000E-01         2        23        33                  
    25 0.25000E-01         2        24        34                  
    26 0.26000E-01         2        25        35                  
    27 0.27000E-01         2        26        36                  
    28 0.28000E-01         2        27        37                  
    29 0.29000E-01         2        28        38                  
    30 0.30000E-01         2        29        39                  
    31 0.31000E-01         2        30        40                  
    32 0.32000E-01         2        31        41                  
    33 0.33000E-01         2        32        42                  
    34 0.34000E-01         2        33        43                  
    35 0.35000E-01         2        34        44                  
    36 0.36000E-01         2        35        45                  
    37 0.37000E-01         2        36        46                  
    38 0.38000E-01         2        37        47                  
    39 0.39000E-01         2        38        48                  
    40 0.40000E-01         2        39        49                  
    41 0.41000E-01         2        40        50                  
    42 0.42000E-01         2        41        51                  
    43 0.43000E-01         2        42        52                  
    44 0.44000E-01         2        43        53                  
    45 0.45000E-01         2        44        54                  
    46 0.46000E-01         2        45        55                  
    47 0.47000E-01         2        46        56                  
    48 0.48000E-01         2        47        57                  
    49 0.49000E-01         2        48        58                  
    50 0.50000E-01         2        49        59                  
    51 0.51000E-01         2        50        60                  
    52 0.52000E-01         2        51        61                  
    53 0.53000E-01         2        52        62                  
    54 0.54000E-01         2        53        63                  
    55 0.55000E-01         2        54        64                  
    56 0.56000E-01         2        55        65                  
    57 0.57000E-01         2        56        66                  
    58 0.58000E-01         2        57        67                  
    59 0.59000E-01         2        58        68                  
    60 0.60000E-01         2        59        69                  
    61 0.61000E-01         2        60        70                  
    62 0.62000E-01         2        61        71                  
    63 0.63000E-01         2        62        72                  
    64 0.64000E-01         2        63        73                  
    65 0.65000E-01         2        64        74                  
    66 0.66000E-01         2        65        75                  
    67 0.67000E-01         2        66        76                  
    68 0.68000E-01         2        67        77                  
    69 0.69000E-01         2        68        78                  
    70 0.70000E-01         2        69        79                  
    71 0.71000E-01         2        70        80                  
    72 0.72000E-01         2        71        81                  
    73 0.73000E-01         2        72        83                  
    74 0.74000E-01         2        73        84                  
    75 0.75000E-01         2        74        85                  
    76 0.76000E-01         2        75        86                  
    77 0.77000E-01         2        76        87                  
    78 0.78000E-01         2        77        88                  
    79 0.79000E-01         2        78        89                  
    80 0.80000E-01         2        79        90                  
    81 0.81000E-01         2        80        91                  
    82 0.82000E-01         2        81        92                  
    83 0.83000E-01         2        82        93                  
    84 0.84000E-01         2        83        94                  
    85 0.85000E-01         2        84        95                  
    86 0.86000E-01         2        85        96                  
    87 0.87000E-01         2        86        97                  
    88 0.88000E-01         2        87        98                  
    89 0.89000E-01         2        88        99                  
    90 0.90000E-01         2        89       100                  
    91 0.91000E-01         2        90       101                  
    92 0.92000E-01         2        91       102                  
    93 0.93000E-01         2        92       103                  
    94 0.94000E-01         2        93       104                  
    95 0.95000E-01         2        94       105                  
    96 0.96000E-01         2        95       106                  
    97 0.97000E-01         2        96       107                  
    98 0.98000E-01         2        97       108                  
    99 0.99000E-01         2        98       109                  
   100 0.10000             2        99       110                  
   101 0.10100             2       100       111                  
   102 0.10200             2       101       112                  
   103 0.10300             2       102       113                  
   104 0.10400             2       103       114                  
   105 0.10500             2       104       115                  
   106 0.10600             2       105       116                  
   107 0.10700             2       106       117                  
   108 0.10800             2       107       118                  
   109 0.10900             2       108       119                  
   110 0.11000             2       109       120

If I run with cum_set equals 1, I do get the expected result:

DPFArray([[ 0.        , -0.00017485,  0.        ],
          [ 0.        ,  0.        ,  0.        ],
          [ 0.        ,  0.        ,  0.        ]])

Which Operating System are you using?

Windows

Which Python version are you using?

3.9

Installed packages

Toggle me! ```text aiohttp==3.8.1 aiosignal==1.2.0 alabaster==0.7.12 ansys-api-mapdl==0.5.1 ansys-api-platform-instancemanagement==1.0.0b3 -e git+https://github.com/pyansys/pydpf-core.git@e03ab10#egg=ansys_dpf_core ansys-dpf-gate==0.2.1 ansys-dpf-gatebin==0.2.1 -e git+https://github.com/pyansys/pydpf-post.git@f9a6412f906a0e70c1a3a7fe19b88248124933d7#egg=ansys_dpf_post ansys-grpc-dpf==0.4.0 -e git+https://github.com/pyansys/pymapdl.git@1274686a65b3815ce02b45c139d321fc8a598cb5#egg=ansys_mapdl_core ansys-mapdl-reader==0.52.0 ansys-platform-instancemanagement==1.0.2 ansys-sphinx-theme==0.5.2 anyio==3.5.0 appdirs==1.4.4 argcomplete==2.0.0 argon2-cffi==21.3.0 argon2-cffi-bindings==21.2.0 asttokens==2.0.5 async-timeout==4.0.2 atomicwrites==1.4.0 attrs==21.4.0 autobahn==22.2.2 Automat==20.2.0 autopep8==1.6.0 Babel==2.9.1 backcall==0.2.0 beautifulsoup4==4.11.1 black==22.1.0 bleach==4.1.0 build==0.8.0 cachetools==5.0.0 certifi==2021.10.8 cffi==1.15.0 cfgv==3.3.1 charset-normalizer==2.0.12 click==8.0.4 colorama==0.4.4 commonmark==0.9.1 constantly==15.1.0 coverage==6.3.2 cryptography==36.0.1 cycler==0.11.0 debugpy==1.5.1 decorator==5.1.1 defusedxml==0.7.1 distlib==0.3.4 dnspython==2.2.0 docopt==0.6.2 docutils==0.17.1 entrypoints==0.3 esbonio==0.11.0 executing==0.8.2 fett==0.3.2 filelock==3.6.0 flake8 @ file:///opt/conda/conda-bld/flake8_1648129545443/work fonttools==4.29.1 frozenlist==1.3.0 geomdl==5.3.1 google==3.0.0 google-api-core==2.5.0 google-api-python-client==2.37.0 google-auth==2.6.0 google-auth-httplib2==0.1.0 googleapis-common-protos==1.54.0 grpcio==1.43.0 httplib2==0.20.4 hyperlink==21.0.0 identify==2.4.11 idna==3.3 imageio==2.21.3 imageio-ffmpeg==0.4.7 imagesize==1.3.0 importlib-metadata @ file:///C:/ci/importlib-metadata_1648562621412/work incremental==21.3.0 iniconfig==1.1.1 ipycanvas==0.12.0 ipydatawidgets==4.2.0 ipyevents==2.0.1 ipykernel==6.9.1 ipython==8.0.1 ipython-genutils==0.2.0 ipyvtklink==0.2.2 ipywidgets==7.6.5 jedi==0.18.1 Jinja2==3.1.2 json5==0.9.6 jsonschema==4.4.0 jupyter==1.0.0 jupyter-client==7.1.1 jupyter-console==6.4.0 jupyter-core==4.9.1 jupyter-server==1.13.5 jupyter-sphinx==0.4.0 jupyterlab==3.3.3 jupyterlab-pygments==0.1.2 jupyterlab-server==2.10.3 jupyterlab-widgets==1.0.2 keyring==23.6.0 kiwisolver==1.3.2 livereload==2.6.3 mapdl @ file:///C:/Program%20Files/ANSYS%20Inc/v212/ANSYS/syslib/ansGRPC/User/mapdl-pyupf.tar.gz MarkupSafe==2.1.1 matplotlib==3.5.3 matplotlib-inline==0.1.3 mccabe @ file:///opt/conda/conda-bld/mccabe_1644221741721/work mistune==0.8.4 mpmath==1.2.1 multidict==6.0.2 mypy-extensions==0.4.3 nbclassic==0.3.5 nbclient==0.5.10 nbconvert==6.5.0 nbformat==5.2.0 nbsphinx==0.8.8 nest-asyncio==1.5.4 networkx==2.6.3 nodeenv==1.6.0 nose==1.3.7 notebook==6.4.7 numpy==1.22.2 numpydoc==1.4.0 packaging==21.3 pandas==1.4.4 pandocfilters==1.5.0 parso==0.8.3 pathspec==0.9.0 pep517==0.12.0 pickleshare==0.7.5 Pillow==9.0.1 pipx==1.0.0 pkginfo==1.8.3 platformdirs==2.5.1 plotly==5.10.0 pluggy==1.0.0 pre-commit==2.17.0 progressbar2==4.0.0 prometheus-client==0.12.0 prompt-toolkit==3.0.28 protobuf==3.19.4 protoc-gen-swagger==0.1.0 psutil==5.9.1 pure-eval==0.2.2 py==1.11.0 pyansys-sphinx-theme==0.2.3 pyansys-tools-report==0.2.2 pyasn1==0.4.8 pyasn1-modules==0.2.8 pycodestyle @ file:///tmp/build/80754af9/pycodestyle_1636635402688/work pycparser==2.21 pydantic==1.8.2 pydata-sphinx-theme==0.9.0 pyflakes @ file:///tmp/build/80754af9/pyflakes_1636644436481/work pygls==0.11.3 Pygments==2.11.2 pyiges==0.2.1 pymongo==3.12.3 pypandoc==1.8.1 pyparsing==3.0.7 pyrsistent==0.18.1 pyspellchecker==0.6.3 pytest==7.0.1 pytest-cov==3.0.0 pytest-sphinx==0.5.0 python-dateutil==2.8.2 python-jsonrpc-server==0.3.4 python-utils==3.3.3 pythreejs==2.4.1 pytz==2021.3 pyvista==0.36.1 pywin32==303 pywin32-ctypes==0.2.0 pywinpty==1.1.6 PyYAML==5.4.1 pyzmq==22.3.0 qtconsole==5.2.2 QtPy==2.0.0 readme-renderer==35.0 requests==2.27.1 requests-toolbelt==0.9.1 rfc3986==2.0.0 rich==12.4.4 rsa==4.8 rstcheck==3.3.1 scipy==1.8.0 scooby==0.5.12 Send2Trash==1.8.0 six==1.16.0 sniffio==1.2.0 snooty-lextudio==1.12.0 snowballstemmer==2.2.0 soupsieve==2.3.2.post1 Sphinx==5.1.1 sphinx-autobuild==2021.3.14 sphinx-autodoc-typehints==1.19.2 sphinx-copybutton==0.5.0 sphinx-gallery==0.11.1 sphinx-notfound-page==0.8.3 sphinxcontrib-applehelp==1.0.2 sphinxcontrib-devhelp==1.0.2 sphinxcontrib-htmlhelp==2.0.0 sphinxcontrib-jsmath==1.0.1 sphinxcontrib-qthelp==1.0.3 sphinxcontrib-serializinghtml==1.1.5 sphinxcontrib-websupport==1.2.4 sphinxemoji==0.2.0 stack-data==0.2.0 sympy==1.9 tenacity==8.0.1 terminado==0.12.1 testpath==0.5.0 tinycss2==1.1.1 toml==0.10.2 tomli==2.0.1 tornado==6.1 tox==3.25.0 tqdm==4.62.3 traitlets==5.1.1 traittypes==0.2.1 twine==4.0.1 Twisted==22.1.0 twisted-iocpsupport==1.0.2 txaio==22.2.1 typeguard==2.13.3 typing_extensions==4.1.1 uritemplate==4.1.1 urllib3==1.26.8 userpath==1.8.0 virtualenv==20.13.2 vtk==9.0.3 watchdog==1.0.2 wcwidth==0.2.5 webencodings==0.5.1 websocket-client==1.3.1 widgetsnbextension==3.5.2 wincertstore==0.2 wslink==1.4.1 xlrd==2.0.1 yarl==1.7.2 zipp @ file:///opt/conda/conda-bld/zipp_1641824620731/work zope.interface==5.4.0 ```

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions