ansys / pymapdl

Pythonic interface to MAPDL
https://mapdl.docs.pyansys.com
MIT License
423 stars 120 forks source link

Bug located in Mapdl.input() while executing "solve" #1424

Closed emhen closed 2 years ago

emhen commented 2 years ago

Before submitting the issue

Description of the bug

Pymapdl cannot complete ansys.input('analysis','inp') due to the SOLVE command being issued as an APDL command and not a pymapdl command. The analysis.inp file issues material properties, boundary conditions, and executes back-to-back analyses, but hangs up when the solve command is embedded. If I use convert_script so that the solve is completed by ansys.solve(), the analysis can be completed. With the attached input file, it's resulting in additional issues for the modal analysis solve (Cannot complete MODOPT or SOLVE)

Truncated error when solve is in the analysis.inp file

AAS_CORBA.MAPDL.Exceptions.EAnsysUnknown: AAS_CORBA.MAPDL.Exceptions.EAnsysUnknown(code=1, 
description='RunCommandStr is not allowed during distributed solve.', scope='MAPDL', interfaceName='ICoMapdlUnit', 
operation='executeCommand', moreInfo='/GO')

Truncated error after issueing convert script, then running solve through the end of the inp file in pymapdl

AAS_CORBA.MAPDL.Exceptions.EAnsysUnknown: AAS_CORBA.MAPDL.Exceptions.EAnsysUnknown(code=-15, 
description='Low-level communication error -15: Connection was closed', scope='MAPDL', interfaceName='ICoMapdlUnit', 
operation='executeCommand', moreInfo='SOLVE,')

Currently using ANSYS 2020 R1 on Windows

Steps To Reproduce

path = './Test/VMsubtest' ansys = launch_mapdl(run_location=path,override=True,allow_ignore=True,log_apdl=path+'/pymapdl_htc_log.txt')
with ansys.non_interactive: ansys.input('analysis','inp') ansys.finish() ansys.exit()

OR
```py
from ansys.mapdl.core import launch_mapdl

path = './Test/VMsubtest'
ansys = launch_mapdl(run_location=path,override=True,allow_ignore=True,log_apdl=path+'/pymapdl_htc_log.txt')    
ansys.input('analysis','inp')
ansys.finish()
ansys.exit()

Which Operating System are you using?

Windows

Which Python version are you using?

3.8

PyMAPDL Report

Packages Requirements


Core packages

ansys.mapdl.core : 0.63.1 numpy : 1.23.1 appdirs : 1.4.4 scipy : 1.9.0 grpc : Package not found ansys.api.mapdl.v0 : Package not found ansys.mapdl.reader : 0.51.15 google.protobuf : Package not found

Optional packages

matplotlib : 3.5.2 pyvista : 0.34.0 pyiges : 0.2.1 tqdm : 4.64.0 ansys_corba : 0.1.1

Ansys Installation


Version Location

162 C:\Program Files\ANSYS INC\v162 182 C:\Program Files\ANSYS INC\v182 201 C:\Program Files\ANSYS INC\v201 222 C:\Program Files\ANSYS INC\v222

Ansys Environment Variables


ANSYS162_DIR C:\Program Files\ANSYS Inc\v162\ANSYS ANSYS182_DIR C:\Program Files\ANSYS Inc\v182\ANSYS ANSYS201_DIR C:\Program Files\ANSYS Inc\v201\ANSYS ANSYS222_DIR C:\Program Files\ANSYS Inc\v222\ANSYS ANSYSLIC_DIR C:\Program Files\ANSYS Inc\Shared Files\Licensing ANSYS_SYSDIR winx64 ANSYS_SYSDIR32 win32 AWP_LOCALE162 en-us AWP_LOCALE182 en-us AWP_LOCALE201 en-us AWP_LOCALE222 en-us AWP_ROOT162 C:\Program Files\ANSYS Inc\v162 AWP_ROOT182 C:\Program Files\ANSYS Inc\v182 AWP_ROOT201 C:\Program Files\ANSYS Inc\v201 AWP_ROOT222 C:\Program Files\ANSYS Inc\v222 CADOE_LIBDIR162 C:\Program Files\ANSYS Inc\v162\CommonFiles\Language\en-us CADOE_LIBDIR182 C:\Program Files\ANSYS Inc\v182\CommonFiles\Language\en-us CADOE_LIBDIR201 C:\Program Files\ANSYS Inc\v201\CommonFiles\Language\en-us CADOE_LIBDIR222 C:\Program Files\ANSYS Inc\v222\CommonFiles\Language\en-us

Installed packages

aiohttp==3.8.1 aiosignal==1.2.0 ansys-api-mapdl==0.5.1 ansys-api-platform-instancemanagement==1.0.0b3 ansys-corba==0.1.1 ansys-grpc-mapdl==0.2.0 ansys-mapdl-core==0.63.1 ansys-mapdl-reader==0.51.15 ansys-platform-instancemanagement==1.0.2 appdirs==1.4.4 asttokens==2.0.5 async-timeout==4.0.2 attrs==22.1.0 backcall==0.2.0 cachetools==5.0.0 certifi==2021.10.8 charset-normalizer==2.1.0 colorama==0.4.5 cycler==0.11.0 Cython==0.29.32 debugpy==1.6.2 decorator==5.1.1 entrypoints==0.4 executing==0.9.1 femorph==1.2.15 femorph-blender==0.7.2 femorph-cfd==0.2.8 femorph-gui==1.7.1 femorph-remesh==0.2.9 femorph-tetblaster==0.2.5 fonttools==4.34.4 frozenlist==1.3.1 geomdl==5.3.1 google-api-core==2.7.1 google-api-python-client==2.42.0 google-auth==2.6.2 google-auth-httplib2==0.1.0 googleapis-common-protos==1.56.0 grpcio==1.45.0 h5py==3.7.0 httplib2==0.20.4 idna==3.3 imageio==2.21.0 imageio-ffmpeg==0.4.7 importlib-metadata==4.11.3 ipykernel==6.15.1 ipython==8.4.0 ipython-genutils==0.2.0 jedi==0.18.1 joblib==1.1.0 jupyter-client==7.3.4 jupyter-core==4.11.1 kiwisolver==1.4.4 matplotlib==3.5.2 matplotlib-inline==0.1.3 meshio==4.4.6 multidict==6.0.2 nest-asyncio==1.5.5 numpy==1.23.1 packaging==21.3 parso==0.8.3 pickleshare==0.7.5 Pillow==9.2.0 prompt-toolkit==3.0.30 protobuf==3.19.4 protoc-gen-swagger==0.1.0 psutil==5.9.1 ptpython==3.0.20 pure-eval==0.2.2 pyasn1==0.4.8 pyasn1-modules==0.2.8 pygeodesic==0.1.7 Pygments==2.12.0 pyiges==0.2.1 pymeshfix==0.16.1 pyparsing==3.0.9 PyQt5==5.15.7 PyQt5-Qt5==5.15.2 PyQt5-sip==12.11.0 python-dateutil==2.8.2 pyvista==0.36.1 pyvistaqt==0.9.0 pywin32==304 PyYAML==6.0 pyzmq==23.2.0 QDarkStyle==3.0.3 QtAwesome==1.1.1 qtconsole==5.3.1 QtPy==2.1.0 requests==2.27.1 rsa==4.8 scikit-learn==1.0.2 scipy==1.9.0 scooby==0.6.0 six==1.16.0 sklearn==0.0 stack-data==0.3.0 tetgen==0.5.5 threadpoolctl==3.1.0 tornado==6.2 tqdm==4.64.0 traitlets==5.3.0 typing_extensions==4.1.1 uritemplate==4.1.1 urllib3==1.26.9 vtk==9.1.0 wcwidth==0.2.5 wincertstore==0.2 wslink==1.6.6 yarl==1.8.1 zipp==3.7.0

akaszynski commented 2 years ago

It looks like it's still using an older version of MAPDL and the (less that optional) CORBA mode. Can you use v222 and the gRPC mode?

emhen commented 2 years ago
germa89 commented 2 years ago

@emhen the /INPUT and CDREAD commands are not recorded because they are not executed using the traditional mapdl.run, they both use a input gRPC method.

I guess I could add something to get it recorded somehow.