Mesh.grid seems to result in losing the gRPC connection to MAPDL aaS when a non-trivial number of mixed uP elements are present.
mikerife opened this issue Β· comments
π€ Before submitting the issue
- I have visited the Troubleshooting section.
- I have searched among the existing issues.
- I am using a Python virtual environment.
- I am using the latest version of PyMAPDL and its dependencies (fully updated virtual environment). You can update them using
pip install --upgrade --upgrade-strategy eager ansys-mapdl-core
in your activated virtual environment.
π Description of the bug
After a solution with mixed uP elements present and after reading the last set of results mapdl.mesh.grid seems to result in a lost connection to the MAPDL aaS instance.
π΅οΈ Steps To Reproduce
from ansys.mapdl.core import launch_mapdl
import matplotlib.pyplot as plt
import pyvista as pv
import math
mapdl = launch_mapdl(port=50056, additional_switches='-smp')
mapdl.clear()
mapdl.units('mpa')
# material
C1 = 0.293
C2 = 0.177
NU1 = 0.49967
D1 = (1-2*NU1)/(C1+C2)
mapdl.prep7()
# 3D 8NODE STRUCTURAL SOLID mixed uP formulation
mapdl.et(1, "SOLID185")
mapdl.keyopt(1, 6, 1)
# mooney-rivlin material model
mapdl.tb("HYPER", 1, 1, 2, "MOONEY")
mapdl.tbdata(1, C1, C2, D1)
mapdl.block(0, 1, 0, 1, 0, 1)
mapdl.esize("", 10)
mapdl.smrtsize("off")
mapdl.type(1)
mapdl.vmesh("ALL")
mapdl.nsel("S", "LOC", "X", 0)
mapdl.d("ALL", "UX")
mapdl.nsel("S", "LOC", "Z", 0)
mapdl.d('all', 'uz', 0)
mapdl.nsel("S", "LOC", "Y", 0)
mapdl.d('ALL', "UY", 0)
mapdl.nsel("ALL")
mapdl.shpp('off')
mapdl.finish()
mapdl.slashsolu()
mapdl.antype("STATIC")
mapdl.nlgeom("ON")
mapdl.time(1)
mapdl.autots('off')
mapdl.nsubst(10)
# apply displacement
mapdl.nsel('s', 'loc', 'y', 1)
mapdl.d('all', "UY", -.1)
mapdl.allsel()
# write results to result file at every sub step
mapdl.outres("", 1)
mapdl.solve()
mapdl.finish()
mapdl.post1()
mapdl.set('last')
mesh1 = mapdl.mesh.grid
# am gathering undeformed and deformed mesh for PyVista plotting so next commands would be
# mapdl.upcoord(1)
# mesh1 = mapdl.mesh.grid
# mapdl.upcoord(-1)
π» Which Operating System are you using?
Windows
π Which Python version are you using?
3.10
π PyMAPDL Report
Show the Report!
# PASTE HERE THE OUTPUT OF `python -c "from ansys.mapdl import core as pymapdl; print(pymapdl.Report())"` here
π Installed packages
Show the installed packages!
# PASTE HERE THE OUTPUT OF `python -m pip freeze` here
π Logger output file
Show the logger output file.
# PASTE HERE THE CONTENT OF THE LOGGER OUTPUT FILE.
Interestingly, I'm getting segmentation fault:
(.venv_macos) pymapdl git:(main) $ python ./tmp/main.py
[1] 4460 segmentation fault python ./tmp/main.py
All because of the last uncommented line:
mesh1 = mapdl.mesh.grid
I do not understand why having complex material models would make retrieving the meshing to fail... retrieving the meshing only depends on the type of element, solid186
in this case, which is fairly tested.