Plotting nodal displacement results in one node being selected after the plot, but only when using CINT for crack calculation.
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
The number of nodes selected after a plot_nodal_displacement("Y) is 1 if a crack is being used for crack calculation.
π΅οΈ Steps To Reproduce
from ansys.mapdl.core import launch_mapdl
mapdl = launch_mapdl(loglevel="WARNING", print_com=True)
mapdl.units('mpa')
# parameters
# loading
P_1 = 10 # N
# geometric
L_1 = 100 # mm
a_1 = 60
h_1 = 5
b_1 = 1
# materail
EX_1 = 210_000 # MPa
PR_1 = 0.3
mapdl.prep7()
# 2D 4 NODE STRUCTURAL SOLID ELEMENT with plane strain formulation
mapdl.et(1, "PLANE182")
mapdl.keyopt(1, 3, 2)
# MATERIAL PROPERTIES
mapdl.mp("EX", 1, EX_1)
mapdl.mp("PRXY", 1, PR_1)
# create solid model, DEFINE AREAS
mapdl.rectng(0, 2*L_1, h_1)
mapdl.rectng(0, 2*L_1, 0, -h_1)
# DEFINE LINE DIVISION
mapdl.lsel("S", "LINE", "", 2, 8, 2)
mapdl.lesize("ALL", h_1/2)
mapdl.lsel("INVE")
mapdl.lesize("ALL", "", "", 2*L_1)
mapdl.allsel("ALL")
# MESH AREAS
mapdl.type(1)
mapdl.amesh(1, 2)
mapdl.nsel("S", "LOC", "X", a_1, 2*L_1)
mapdl.nummrg("NODES")
mapdl.allsel()
# APPLY CONSTRAINTS
mapdl.nsel("S", "LOC", "X", 2*L_1)
mapdl.d("ALL", "ALL")
mapdl.nsel("ALL")
# create component of crack front nodes
mapdl.nsel("S", "LOC", "X", a_1)
mapdl.nsel("R", "LOC", "Y", 0)
mapdl.cm("CRACK1", "NODE")
mapdl.allsel()
mapdl.finish()
mapdl.slashsolu()
mapdl.antype('static')
mapdl.time(1)
# APPLY LOADING
mapdl.nsel("S", "LOC", "X")
mapdl.nsel("R", "LOC", "Y", h_1)
mapdl.f("ALL", "FY", P_1)
mapdl.nsel("S", "LOC", "X")
mapdl.nsel("R", "LOC", "Y", -h_1)
mapdl.f("ALL", "FY", -P_1)
mapdl.nsel("ALL")
# DEFINE CRACK ID
mapdl.cint("NEW", 1)
mapdl.cint("TYPE", "VCCT")
# CRACK TIP NODE COMPONENT
mapdl.cint("CTNC", "CRACK1")
# SYMMETRY OFF
mapdl.cint("SYMM", "OFF")
# DEFINE CRACK PLANE NORMAL
mapdl.cint("NORMAL")
# print(mapdl.cint("LIST"))
mapdl.allsel("ALL")
mapdl.solve()
mapdl.finish()
mapdl.post1()
mapdl.set(1)
before = mapdl.mesh.n_node
mapdl.post_processing.plot_nodal_displacement("Y", cpos='xy', cmap='jet')
after = mapdl.mesh.n_node
mapdl.allsel()
after_2 = mapdl.mesh.n_node
print("number nodes prior plotting {}".format(before))
print("number nodes after plotting {}".format(after))
print("number nodes after plotting and allsel {}".format(after_2))
mapdl.exit()
π» Which Operating System are you using?
Windows
π Which Python version are you using?
3.10
π PyMAPDL Report
Show the Report!
PyMAPDL Software and Environment Report
Packages Requirements
*********************
Core packages
-------------
ansys.mapdl.core : 0.68.0
numpy : 1.26.4
platformdirs : 4.2.0
scipy : 1.12.0
grpc : Package not found
ansys.api.mapdl.v0 : Package not found
ansys.mapdl.reader : 0.53.0
google.protobuf : Package not found
Optional packages
-----------------
matplotlib : 3.8.3
pyvista : 0.43.3
pyiges : 0.3.1
tqdm : 4.66.2
Ansys Installation
******************
Version Location
------------------
201 C:\Program Files\ANSYS Inc\v201
202 C:\Program Files\ANSYS Inc\v202
211 C:\Program Files\ANSYS Inc\v211
212 C:\Program Files\ANSYS Inc\v212
221 C:\Program Files\ANSYS Inc\v221
222 C:\Program Files\ANSYS Inc\v222
231 C:\Program Files\ANSYS Inc\v231
232 C:\Program Files\ANSYS Inc\v232
Ansys Environment Variables
***************************
ANSYS201_DIR C:\Program Files\ANSYS Inc\v201\ANSYS
ANSYS202_DIR C:\Program Files\ANSYS Inc\v202\ANSYS
ANSYS211_DIR C:\Program Files\ANSYS Inc\v211\ANSYS
ANSYS212_DIR C:\Program Files\ANSYS Inc\v212\ANSYS
ANSYS221_DIR C:\Program Files\ANSYS Inc\v221\ANSYS
ANSYS222_DIR C:\Program Files\ANSYS Inc\v222\ANSYS
ANSYS231_DIR C:\Program Files\ANSYS Inc\v231\ANSYS
ANSYS232_DIR C:\Program Files\ANSYS Inc\v232\ANSYS
ANSYSCLOUDCLI_ROOT C:\Program Files\ANSYS Inc\ANSYS Cloud\ANSYS Cloud CLI\
ANSYSELECTRON_ROOT C:\Program Files\ANSYS Inc\ANSYS Cloud\ANSYS Electron\
ANSYSEM_ROOT231 C:\Program Files\AnsysEM\v231\Win64
ANSYSLIC_DIR C:\Program Files\ANSYS Inc\Shared Files\Licensing
ANSYSNCODE221_DIR C:\Program Files\nCode\ANSYS 2022 R1 nCode DesignLife 64-bit
ANSYS_SYSDIR winx64
ANSYS_SYSDIR32 win32
AWP_LOCALE201 en-us
AWP_LOCALE202 en-us
AWP_LOCALE211 en-us
AWP_LOCALE212 en-us
AWP_LOCALE221 en-us
AWP_LOCALE222 en-us
AWP_LOCALE231 en-us
AWP_LOCALE232 en-us
AWP_ROOT201 C:\Program Files\ANSYS Inc\v201
AWP_ROOT202 C:\Program Files\ANSYS Inc\v202
AWP_ROOT211 C:\Program Files\ANSYS Inc\v211
AWP_ROOT212 C:\Program Files\ANSYS Inc\v212
AWP_ROOT221 C:\Program Files\ANSYS Inc\v221
AWP_ROOT222 C:\Program Files\ANSYS Inc\v222
AWP_ROOT231 C:\Program Files\ANSYS Inc\v231
AWP_ROOT232 C:\Program Files\ANSYS Inc\v232
CADOE_LIBDIR201 C:\Program Files\ANSYS Inc\v201\CommonFiles\Language\en-us
CADOE_LIBDIR211 C:\Program Files\ANSYS Inc\v211\CommonFiles\Language\en-us
CADOE_LIBDIR212 C:\Program Files\ANSYS Inc\v212\CommonFiles\Language\en-us
CADOE_LIBDIR221 C:\Program Files\ANSYS Inc\v221\CommonFiles\Language\en-us
CADOE_LIBDIR222 C:\Program Files\ANSYS Inc\v222\CommonFiles\Language\en-us
CADOE_LIBDIR231 C:\Program Files\ANSYS Inc\v231\CommonFiles\Language\en-us
CADOE_LIBDIR232 C:\Program Files\ANSYS Inc\v232\CommonFiles\Language\en-us
ICEFLOW_ANSYS_PORT 9600
π Installed packages
Show the installed packages!
ansys-api-mapdl==0.5.1
ansys-api-platform-instancemanagement==1.0.0
ansys-dpf-core==0.11.0
ansys-mapdl-core==0.68.0
ansys-mapdl-reader==0.53.0
ansys-math-core==0.1.3
ansys-platform-instancemanagement==1.1.2
ansys-tools-path==0.4.1
anyio==4.3.0
appdirs==1.4.4
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
arrow==1.3.0
asttokens==2.4.1
async-lru==2.0.4
attrs==23.2.0
Babel==2.14.0
beautifulsoup4==4.12.3
bleach==6.1.0
cachetools==5.3.3
certifi==2024.2.2
cffi==1.16.0
charset-normalizer==3.3.2
click==8.1.7
colorama==0.4.6
comm==0.2.1
contourpy==1.2.0
cycler==0.12.1
debugpy==1.8.1
decorator==5.1.1
defusedxml==0.7.1
exceptiongroup==1.2.0
executing==2.0.1
fastjsonschema==2.19.1
fonttools==4.49.0
fqdn==1.5.1
geomdl==5.3.1
google-api-core==2.17.1
google-api-python-client==2.120.0
google-auth==2.28.1
google-auth-httplib2==0.2.0
googleapis-common-protos==1.62.0
grpcio==1.62.0
h11==0.14.0
httpcore==1.0.4
httplib2==0.22.0
httpx==0.27.0
idna==3.6
imageio==2.28.0
imageio-ffmpeg==0.4.9
importlib-metadata==7.0.1
ipykernel==6.29.3
ipython==8.22.2
isoduration==20.11.0
jedi==0.19.1
Jinja2==3.1.3
json5==0.9.20
jsonpointer==2.4
jsonschema==4.21.1
jsonschema-specifications==2023.12.1
jupyter-events==0.9.0
jupyter-lsp==2.2.3
jupyter_client==8.6.0
jupyter_core==5.7.1
jupyter_server==2.13.0
jupyter_server_terminals==0.5.2
jupyterlab==4.1.2
jupyterlab_pygments==0.3.0
jupyterlab_server==2.25.3
kiwisolver==1.4.5
MarkupSafe==2.1.5
matplotlib==3.8.3
matplotlib-inline==0.1.6
mistune==3.0.2
nbclient==0.9.0
nbconvert==7.16.2
nbformat==5.9.2
nest-asyncio==1.6.0
notebook_shim==0.2.4
numpy==1.26.4
overrides==7.7.0
packaging==23.2
pandocfilters==1.5.1
parso==0.8.3
pillow==10.2.0
platformdirs==4.2.0
pooch==1.8.1
prometheus_client==0.20.0
prompt-toolkit==3.0.43
protobuf==3.20.3
psutil==5.9.8
pure-eval==0.2.2
pyansys-tools-versioning==0.5.0
pyasn1==0.5.1
pyasn1-modules==0.3.0
pycparser==2.21
Pygments==2.17.2
pyiges==0.3.1
pyparsing==3.1.1
python-dateutil==2.9.0.post0
python-json-logger==2.0.7
pyvista==0.43.3
pywin32==306
pywinpty==2.0.13
PyYAML==6.0.1
pyzmq==25.1.2
referencing==0.33.0
requests==2.31.0
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rpds-py==0.18.0
rsa==4.9
scipy==1.12.0
scooby==0.9.2
Send2Trash==1.8.2
six==1.16.0
sniffio==1.3.1
soupsieve==2.5
stack-data==0.6.3
tabulate==0.9.0
terminado==0.18.0
tinycss2==1.2.1
tomli==2.0.1
tornado==6.4
tqdm==4.66.2
traitlets==5.14.1
types-python-dateutil==2.8.19.20240106
typing_extensions==4.10.0
uri-template==1.3.0
uritemplate==4.1.1
urllib3==2.2.1
vtk==9.3.0
wcwidth==0.2.13
webcolors==1.13
webencodings==0.5.1
websocket-client==1.7.0
zipp==3.17.0
π Logger output file
Show the logger output file.
# PASTE HERE THE CONTENT OF THE LOGGER OUTPUT FILE.