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

PyMAPDL closes gRPC connection when an error occurs in SOLVE command #3447

Open
4 tasks done
andreiflancanova opened this issue Oct 1, 2024 · 0 comments
Open
4 tasks done
Labels
bug Issue, problem or error in PyMAPDL

Comments

@andreiflancanova
Copy link

🤓 Before submitting the issue

🔍 Description of the bug

I am running some nonlinear buckling analysis, and I am facing an issue when an error occurs on Mechanical APDL side: It returns an exception to python and it closes the gRPC connection:

MAPDL server connection terminated unexpectedly while running:
SOLVE,
called by:
_send_command
with the following error
<_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "IOCP/Socket: Connection reset (Unable to retrieve error string -- 10054)"
debug_error_string = "UNKNOWN:Error received from peer {grpc_message:"IOCP/Socket: Connection reset (Unable to retrieve error string -- 10054)", grpc_status:14, created_time:"2024-10-01T13:52:44.5005483+00:00"}"

The error in Mechanical APDL side is this:

*** ERROR *** CP = 94.391 TIME= 10:57:03
Element 1509 has excessive thickness change.

*** ERROR *** CP = 94.484 TIME= 10:57:18
Element 166 has excessive thickness change.

*** WARNING *** CP = 94.484 TIME= 10:57:18
The unconverged solution (identified as time 6390 substep 999999) is
output for analysis debug purposes. Results should not be used for
any other purpose.

In Mechanical APDL GUI I am able to extract results and plot them even after the analysis returns an error. Is there a way to do the same in PyMAPDL?

🕵️ Steps To Reproduce

mapdl.run("/TITLE,phi_0.10_L_2_T_2_k_5.00_SP_192")
mapdl.run("SAVE,,,,ALL")
mapdl.run("/PREP7,")
mapdl.run("KEYW,PR_SET,1")
mapdl.run("KEYW,PR_STRUC,1")
mapdl.run("KEYW,PR_THERM,0")
mapdl.run("KEYW,PR_FLUID,0")
mapdl.run("KEYW,PR_ELMAG,0")
mapdl.run("KEYW,MAGNOD,0")
mapdl.run("KEYW,MAGEDG,0")
mapdl.run("KEYW,MAGHFE,0")
mapdl.run("KEYW,MAGELC,0")
mapdl.run("KEYW,PR_MULTI,0")
mapdl.run("/GO")
mapdl.run("ET,1,SHELL281,,,,,,,")
mapdl.run("MPTEMP,,,,,,,")
mapdl.run("MPTEMP,1,0,,,,,")
mapdl.run("MPDATA,EX,1,,210000.00,,,,,")
mapdl.run("MPDATA,PRXY,1,,0.300,,,,,")
mapdl.run("sect,1,shell")
mapdl.run("SECDATA,18.00,1,0,5,,,,,,,,")
mapdl.run("SECOFFSET,TOP,,,,,,")
mapdl.run("SECCONTROL,,,,,,,,,,,,,")
mapdl.run("sect,2,shell")
mapdl.run("SECDATA,12.00,1,0,5,,,,,,,,")
mapdl.run("SECOFFSET,MID,,,,,,")
mapdl.run("SECCONTROL,0,0,0,0,1,1,1,,,,,,")
mapdl.run("K,1,667.0,0,0")
mapdl.run("K,2,667.0,1000.00,0")
mapdl.run("K,3,667.0,1000.00,58.00")
mapdl.run("K,4,667.0,0,58.00")
mapdl.run("K,5,0,333.0,0")
mapdl.run("K,6,2000.00,333.0,0")
mapdl.run("K,7,2000.00,333.0,58.00")
mapdl.run("K,8,0,333.0,58.00")
mapdl.run("FLST,2,4,3,,")
mapdl.run("FITEM,2,1,,")
mapdl.run("FITEM,2,2,,")
mapdl.run("FITEM,2,3,,")
mapdl.run("FITEM,2,4,,")
mapdl.run("A,P51X,,,,,,,,,,,,,,,,,")
mapdl.run("ASEL,S,LOC,X,660.33,673.67,,")
mapdl.run("tmpvar = wrinqr(1)")
mapdl.run("*GET,_floatparameter_,AREA,,COUNT,,,,,,,")
mapdl.run("CM,enrijecedor_transversal, AREA")
mapdl.run("AGEN,2,enrijecedor_transversal,,,667.0,,,,,")
mapdl.run("ASEL,ALL,,,,,,")
mapdl.run("_tmpvar_ = wrinqr(1)")
mapdl.run("*GET,_floatparameter_,AREA,,COUNT,,,,,,,")
mapdl.run("CM,transversais_pre_aptn, AREA")
mapdl.run("FLST,2,4,3,,")
mapdl.run("FITEM,2,5,,")
mapdl.run("FITEM,2,6,,")
mapdl.run("FITEM,2,7,,")
mapdl.run("FITEM,2,8,,")
mapdl.run("A,P51X,,,,,,,,,,,,,,,,,")
mapdl.run("ASEL,ALL,,,,,,")
mapdl.run("_tmpvar_ = wrinqr(1)")
mapdl.run("*GET,_floatparameter_,AREA,,COUNT,,,,,,,")
mapdl.run("ASEL,S,LOC,Y,329.67,336.33,,")
mapdl.run("_tmpvar_ = wrinqr(1)")
mapdl.run("*GET,_floatparameter_,AREA,,COUNT,,,,,,,")
mapdl.run("CM,enrijecedor_longitudinal, AREA")
mapdl.run("AGEN,2,enrijecedor_longitudinal,,,,333.0,,,,")
mapdl.run("CMSEL,S,transversais_pre_aptn,")
mapdl.run("ASEL,INVE,AREA,,,,,")
mapdl.run("_tmpvar_ = wrinqr(1)")
mapdl.run("*GET,_floatparameter_,AREA,,COUNT,,,,,,,")
mapdl.run("CM,longitudinais_pre_aptn, AREA")
mapdl.run("RECTNG,0,2000.00,0,1000.00")
mapdl.run("CMSEL,S,transversais_pre_aptn,")
mapdl.run("CMSEL,A,longitudinais_pre_aptn,")
mapdl.run("ASEL,INVE,AREA,,,,,")
mapdl.run("_tmpvar_ = wrinqr(1)")
mapdl.run("*GET,_floatparameter_,AREA,,COUNT,,,,,,,")
mapdl.run("ALLSEL,ALL")
mapdl.run("APTN,ALL,,,,,,,,")
mapdl.run("ASEL,ALL,,,,,,")
mapdl.run("ASEL,S,LOC,X,266.8,400.2,,")
mapdl.run("ASEL,A,LOC,X,933.8,1067.2,,")
mapdl.run("ASEL,A,LOC,X,1600.8,1734.2,,")
mapdl.run("ASEL,R,LOC,Z,-9.0,9.0,,")
mapdl.run("CM,placa_pos_aptn, AREA")
mapdl.run("ASEL,ALL,,,,,,")
mapdl.run("ASEL,S,LOC,X,266.8,400.2,,")
mapdl.run("ASEL,A,LOC,X,933.8,1067.2,,")
mapdl.run("ASEL,A,LOC,X,1600.8,1734.2,,")
mapdl.run("ASEL,R,LOC,Z,23.2,34.8,,")
mapdl.run("CM,longitudinais_pos_aptn, AREA")
mapdl.run("ASEL,ALL,,,,,,")
mapdl.run("ASEL,S,LOC,Y,133.20,199.8,,")
mapdl.run("ASEL,A,LOC,Y,466.2,506.16,,")
mapdl.run("ASEL,A,LOC,Y,799.2,839.16,,")
mapdl.run("ASEL,R,LOC,Z,23.2,34.8,,")
mapdl.run("CM,transversais_pos_aptn, AREA")
mapdl.run("ALLSEL,ALL,")
mapdl.run("NUMMRG,ALL,,,,LOW")
mapdl.run("CMSEL,ALL,,")
mapdl.run("MSHAPE,0,2D")
mapdl.run("MSHKEY,0")
mapdl.run("TYPE,1")
mapdl.run("MAT,1")
mapdl.run("REAL")
mapdl.run("ESYS,0")
mapdl.run("SECNUM,1")
mapdl.run("AESIZE,placa_pos_aptn,25.0")
mapdl.run("AMESH,placa_pos_aptn,,")
mapdl.run("TYPE,1")
mapdl.run("MAT,1")
mapdl.run("REAL")
mapdl.run("ESYS,0")
mapdl.run("SECNUM,2")
mapdl.run("AESIZE,transversais_pos_aptn,25.0")
mapdl.run("AMESH,transversais_pos_aptn,,")
mapdl.run("TYPE,1")
mapdl.run("MAT,1")
mapdl.run("REAL")
mapdl.run("ESYS,0")
mapdl.run("SECNUM,2")
mapdl.run("AESIZE,longitudinais_pos_aptn,25.0")
mapdl.run("AMESH,longitudinais_pos_aptn,,")
mapdl.run("FINISH,")
mapdl.run("/SOLU,")
mapdl.run("ANTYPE,0")
mapdl.run("PSTRES,0")
mapdl.run("CMSEL,ALL,,")
mapdl.run("CMSEL,S,placa_pos_aptn,")
mapdl.run("LSLA,S")
mapdl.run("KSLL,S")
mapdl.run("KSEL,S,LOC,X,0,,,")
mapdl.run("KSEL,R,LOC,Y,0,,,")
mapdl.run("CM,kp_inferior_esquerdo, KP")
mapdl.run("DK,kp_inferior_esquerdo,UX,UY,0,0,,,,,")
mapdl.run("CMSEL,ALL,,")
mapdl.run("CMSEL,S,placa_pos_aptn,")
mapdl.run("LSLA,S")
mapdl.run("KSLL,S")
mapdl.run("KSEL,S,LOC,X,0,,,")
mapdl.run("KSEL,R,LOC,Y,1000.00,,,")
mapdl.run("CM,kp_superior_esquerdo, KP")
mapdl.run("DK,kp_superior_esquerdo,UX,0,,,,,,,")
mapdl.run("CMSEL,ALL,,")
mapdl.run("CMSEL,S,placa_pos_aptn,")
mapdl.run("LSLA,S")
mapdl.run("KSLL,S")
mapdl.run("KSEL,S,LOC,X,2000.00,,,")
mapdl.run("KSEL,R,LOC,Y,0,,,")
mapdl.run("CM,kp_inferior_direito, KP")
mapdl.run("DK,kp_inferior_direito,UY,0,,,,,,,")
mapdl.run("")
mapdl.run("")
mapdl.run("CMSEL,ALL,,")
mapdl.run("CMSEL,S,placa_pos_aptn,")
mapdl.run("LSLA,S")
mapdl.run("LSEL,S,LOC,X,0,,,")
mapdl.run("LSEL,A,LOC,X,2000.00,,,")
mapdl.run("LSEL,A,LOC,Y,0,,,")
mapdl.run("LSEL,A,LOC,Y,1000.00,,,")
mapdl.run("LSEL,R,LOC,Z,0,18.00,,")
mapdl.run("CM,lines_contorno_placa, LINE")
mapdl.run("CMSEL,ALL,,")
mapdl.run("CMSEL,S,lines_contorno_placa,")
mapdl.run("LSEL,R,LOC,X,0,,,")
mapdl.run("CM,lines_contorno_placa_esquerda, LINE")
mapdl.run("CMSEL,ALL,,")
mapdl.run("CMSEL,S,lines_contorno_placa,")
mapdl.run("LSEL,R,LOC,X,2000.00,,,")
mapdl.run("CM,lines_contorno_placa_direita, LINE")
mapdl.run("CMGRP,lines_contorno_placa_ts,lines_contorno_placa_esquerda,lines_contorno_placa_direita,,,,,,")
mapdl.run("CMSEL,ALL,,")
mapdl.run("CMSEL,S,lines_contorno_placa,")
mapdl.run("LSEL,R,LOC,Y,0,,,")
mapdl.run("CM,lines_contorno_placa_inferior, LINE")
mapdl.run("CMSEL,ALL,,")
mapdl.run("CMSEL,S,lines_contorno_placa,")
mapdl.run("LSEL,R,LOC,Y,1000.00,,,")
mapdl.run("CM,lines_contorno_placa_superior, LINE")
mapdl.run("CMGRP,lines_contorno_placa_ls,lines_contorno_placa_inferior,lines_contorno_placa_superior,,,,,,")
mapdl.run("CMSEL,ALL,,")
mapdl.run("DL,lines_contorno_placa,,UZ,0,")
mapdl.run("allsel,all,all")
mapdl.run("CMSEL,S,transversais_pos_aptn,")
mapdl.run("LSLA,S")
mapdl.run("LSEL,R,LOC,Y,0,,,")
mapdl.run("CM,lines_borda_ts_inferior, LINE")
mapdl.run("CMSEL,ALL,,")
mapdl.run("CMSEL,S,transversais_pos_aptn,")
mapdl.run("LSLA,S")
mapdl.run("LSEL,R,LOC,Y,1000.00,,,")
mapdl.run("CM,lines_borda_ts_superior, LINE")
mapdl.run("CMGRP,lines_borda_ts,lines_borda_ts_inferior,lines_borda_ts_superior,,,,,,")
mapdl.run("allsel,all,all")
mapdl.run("CMSEL,S,longitudinais_pos_aptn,")
mapdl.run("LSLA,S")
mapdl.run("LSEL,R,LOC,X,0,,,")
mapdl.run("CM,lines_borda_ls_esquerda, LINE")
mapdl.run("allsel,all,all")
mapdl.run("CMSEL,S,longitudinais_pos_aptn,")
mapdl.run("LSLA,S")
mapdl.run("LSEL,R,LOC,X,2000.00,,,")
mapdl.run("CM,lines_borda_ls_direita, LINE")
mapdl.run("CMGRP,lines_borda_ls,lines_borda_ls_esquerda,lines_borda_ls_direita,,,,,,")
mapdl.run("CMGRP,lines_borda_enrijecedores,lines_borda_ts,lines_borda_ls,,,,,,")
mapdl.run("allsel,all,all")
mapdl.run("DL,lines_borda_enrijecedores,,UZ,0,")
mapdl.run("allsel,all,all")
mapdl.run("FINISH,")
mapdl.run("SAVE,,,,ALL")
mapdl.run("/SOLU,")
mapdl.run("ASEL,ALL,,,,,,")
mapdl.run("SFL,lines_contorno_placa_ts,PRESS,1.000,,,")
mapdl.run("SFL,lines_contorno_placa_ls,PRESS,1.000000,,,")
mapdl.run("SFL,lines_borda_ls,PRESS,1.000,,,")
mapdl.run("SFL,lines_borda_ts,PRESS,1.000000,,,")
mapdl.run("allsel,all,all")
mapdl.run("SOLVE,")
mapdl.run("FINISH,")
mapdl.run("/SOLU")
mapdl.run("ANTYPE,1")
mapdl.run("BUCOPT,LANB,1,0,0,CENTER")
mapdl.run("MXPAND,1,0,0,0,0.001,,")
mapdl.run("SOLVE,")
mapdl.run("FINISH,")
mapdl.run("SAVE,,,,")
mapdl.run("")
mapdl.run("")
mapdl.run("/POST1")
mapdl.run("SAVE,,,,")
mapdl.run("NSEL,S,NODE,,NODE(1000.0,500.0,0)")
mapdl.run("FINISH,")
mapdl.run("SAVE,,,,")
mapdl.run("/SOLU,")
mapdl.run("allsel,all,all")
mapdl.run("/PREP7,")
mapdl.run("UPGEOM,0.5,LAST,LAST,'file','rst',' '   ")
mapdl.run("TB,BISO,1,1,2,,,")
mapdl.run("TBTEMP,0,")
mapdl.run("TBDATA,,355.00,0.00,,,,")
mapdl.run("/SOL")
mapdl.run("ANTYPE,0")
mapdl.run("NLGEOM,ON")
mapdl.run("PSTRES,1")
mapdl.run("pred,off")
mapdl.run("AUTOTS,ON")
mapdl.run("LNSRCH,on")
mapdl.run("NSUBST,200,400,100,")
mapdl.run("OUTRES,ERASE")
mapdl.run("OUTRES,ALL,ALL")
mapdl.run("TIME,6390")
mapdl.run("NEQIT,100")
mapdl.run("SFL,lines_contorno_placa_ts,PRESS,1980.9,,,")
mapdl.run("SFL,lines_contorno_placa_ls,PRESS,1980.9,,,")
mapdl.run("SFL,lines_borda_ls,PRESS,1980.9,,,")
mapdl.run("SFL,lines_borda_ts,PRESS,1980.9,,,")
mapdl.run("STABILIZE,CONSTANT,energy,0.0001")
mapdl.run("SOLVE,")

💻 Which Operating System are you using?

Windows

🐍 Which Python version are you using?

3.12

💾 Which MAPDL version are you using?

2024R2

📝 PyMAPDL Report

Show the Report!

C:\pymapdl-venv\Lib\site-packages\pyvista\utilities\__init__.py:72: PyVistaDeprecationWarning: The `pyvista.utilities` module has been deprecated. `GPUInfo` is now imported as: `from pyvista.report import GPUInfo`.
  warnings.warn(
-------------------------------------------------------------------------------


PyMAPDL Software and Environment Report


Packages Requirements
*********************

Core packages
-------------
ansys.mapdl.core    : 0.68.4
numpy               : 1.26.4
platformdirs        : 4.3.6
scipy               : 1.14.1
grpc                : Package not found
ansys.api.mapdl.v0  : Package not found
ansys.mapdl.reader  : 0.54.1
google.protobuf     : Package not found

Optional packages
-----------------
matplotlib          : 3.9.2
pyvista             : 0.44.1
pyiges              : 0.3.1
tqdm                : 4.66.5


Ansys Installation
******************
Version   Location
------------------
242       C:\Program Files\ANSYS Inc\ANSYS Student\v242


Ansys Environment Variables
***************************
ANSYS242_DIR                   C:\Program Files\ANSYS Inc\ANSYS Student\v242\ANSYS
AWP_ROOT242                    C:\Program Files\ANSYS Inc\ANSYS Student\v242
CADOE_LIBDIR242                C:\Program Files\ANSYS Inc\ANSYS Student\v242\CommonFiles\Language\en-us

📝 Installed packages

Show the installed packages!

ansys-api-mapdl==0.5.2
ansys-api-platform-instancemanagement==1.1.0
ansys-mapdl-core==0.68.4
ansys-mapdl-reader==0.54.1
ansys-math-core==0.1.5
ansys-platform-instancemanagement==1.1.2
ansys-tools-path==0.6.0
appdirs==1.4.4
asgiref==3.8.1
certifi==2024.8.30
charset-normalizer==3.3.2
click==8.1.7
colorama==0.4.6
contourpy==1.3.0
cycler==0.12.1
Django==5.1.1
django-filter==24.3
djangorestframework==3.15.2
fonttools==4.53.1
geomdl==5.3.1
grpcio==1.66.1
idna==3.10
importlib_metadata==8.5.0
kiwisolver==1.4.7
Markdown==3.7
matplotlib==3.9.2
mysqlclient==2.2.4
numpy==1.26.4
packaging==24.1
pillow==10.4.0
platformdirs==4.3.6
pooch==1.8.2
protobuf==4.25.5
psutil==6.0.0
pyansys-tools-versioning==0.6.0
pyiges==0.3.1
pyparsing==3.1.4
python-dateutil==2.9.0.post0
python-dotenv==1.0.1
pyvista==0.44.1
requests==2.32.3
scipy==1.14.1
scooby==0.10.0
six==1.16.0
sqlparse==0.5.1
tabulate==0.9.0
tqdm==4.66.5
typing_extensions==4.12.2
tzdata==2024.1
urllib3==2.2.3
vtk==9.3.1
zipp==3.20.2

📝 Logger output file

Show the logger output file.

# PASTE HERE THE CONTENT OF THE LOGGER OUTPUT FILE.

@andreiflancanova andreiflancanova added the bug Issue, problem or error in PyMAPDL label Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue, problem or error in PyMAPDL
Projects
None yet
Development

No branches or pull requests

1 participant