Skip to content

Bug located in metadata.meshed_region.named_selection() for Surface selections created using "Element Face" #1499

Open
@Louise-Ramos

Description

@Louise-Ramos

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

Hello,

I have a model with a selection created with the "element face" selection on a mechanical solid model. I want to extract the face elements by using selection ids and the model mesh elemnts ID.

I see that the selection definition can be set as:
"Send to solver : Yes"
"Send as : Nodes/Mesh200"

If I choose "Send as : Nodes", the selection location is Nodal and only the face selection nodes are given. If I choose "Send as : Mesh200", the elements IDs are given. So I am using Mesh200 definition to extract the surface elements IDs.

I tried to get the selection elements information by going through metadata.meshed_region.named_selection('MY_SURFACE_SELECTION').ids and searching the element ID on the mesh elements id list ( metadata.meshed_region.elements.element_by_id(selection_id) ), but no element is found.

I seams that the surface elements ID are new and not written in the meshed_region data when Mesh200 is used.
Could you help me with this bug ?

Also, is there another way to access the surface elements and associated nodes from a selection created in mechacical with "element face" ? Or some way to create the face elemets with pyDPF based on the face selection nodes ?

A code to reproduce the error is given bellow.
Ps : - element face selection with Nodes option : 'X1_SURFELEM'
- element face selection with Mesh200 option : 'X1_SURFELEM_MESH200'

Thanks in advance.

Steps To Reproduce

from ansys.dpf.core import Model

rst = Model('file.rst')
metadata = rst.metadata;
ansys_mesh = metadata.meshed_region;

my_surface_selection = 'X1_SURFELEM_MESH200'
Surf_selection_scoping = metadata.named_selection(my_surface_selection)
print(Surf_selection_scoping.size)
for sid in Surf_selection_scoping.ids:
try:
ansys_mesh.elements.element_by_id(sid)
except:
print('Element ID {} not existent in mesh elements!'.format(sid))
continue

Which Operating System causes the issue?

Windows

Which DPF/Ansys version are you using?

Ansys 2022 R2

Which Python version causes the issue?

3.11

Installed packages

Package Version


annotated-types 0.6.0
ansys-additive-core 0.17.2
ansys-api-additive 1.4.1
ansys-api-dbu 0.2.5
ansys-api-dyna 0.3.6
ansys-api-edb 1.0.0
ansys-api-fluent 0.3.22
ansys-api-geometry 0.3.8
ansys-api-mapdl 0.5.1
ansys-api-mechanical 0.1.1
ansys-api-meshing-prime 0.1.2
ansys-api-platform-instancemanagement 1.0.0
ansys-api-pyensight 0.3.4
ansys-api-sherlock 0.1.22
ansys-api-systemcoupling 0.1.0
ansys-dpf-composites 0.4.0
ansys-dpf-core 0.10.1
ansys-dpf-gate 0.4.1
ansys-dpf-gatebin 0.4.1
ansys-dpf-post 0.6.0
ansys-dyna-core 0.4.12
ansys-dynamicreporting-core 0.5.1
ansys-edb-core 0.1.3
ansys-fluent-core 0.18.2
ansys-geometry-core 0.4.11
ansys-grantami-bomanalytics 2.0.0
ansys-grantami-bomanalytics-openapi 2.0.0
ansys-grantami-recordlists 1.1.0
ansys-grantami-serverapi-openapi 2.0.0
ansys-grpc-dpf 0.8.1
ansys-hps-client 0.7.1
ansys-mapdl-core 0.67.0
ansys-mapdl-reader 0.52.20
ansys-math-core 0.1.3
ansys-mechanical-core 0.10.7
ansys-mechanical-env 0.1.3
ansys-meshing-prime 0.5.1
ansys-motorcad-core 0.4.2
ansys-openapi-common 1.5.1
ansys-optislang-core 0.6.1
ansys-platform-instancemanagement 1.1.2
ansys-pyensight-core 0.7.5
ansys-pythonnet 3.1.0rc3
ansys-rocky-core 0.1.0
ansys-seascape 0.2.0
ansys-sherlock-core 0.4.0
ansys-simai-core 0.1.4
ansys-systemcoupling-core 0.4.1
ansys-tools-path 0.4.0
ansys-turbogrid-api 0.4.0
ansys-turbogrid-core 0.4.0
appdirs 1.4.4
asgiref 3.7.2
backoff 2.2.1
bcrypt 4.1.2
beartype 0.17.2
bleach 6.1.0
bokeh 3.3.4
build 1.0.3
cachetools 5.3.1
certifi 2023.7.22
cffi 1.16.0
charset-normalizer 3.3.0
click 8.1.7
clr-loader 0.2.6
colorama 0.4.6
contourpy 1.1.1
coverage 7.3.3
cryptography 41.0.4
cycler 0.12.1
decorator 5.1.1
defusedxml 0.7.1
Deprecated 1.2.14
dill 0.3.8
Django 4.2.6
docker 7.0.0
docutils 0.20.1
ecdsa 0.18.0
elementpath 4.3.0
fabric 3.2.2
filelock 3.12.4
fonttools 4.43.1
fpdf2 2.7.8
geomdl 5.3.1
google-api-core 2.12.0
google-api-python-client 2.103.0
google-auth 2.23.3
google-auth-httplib2 0.1.1
googleapis-common-protos 1.60.0
grpcio 1.59.0
grpcio-health-checking 1.48.2
grpcio-status 1.48.2
h5py 3.10.0
httplib2 0.22.0
idna 3.4
imageio 2.28.0
imageio-ffmpeg 0.4.9
importlib-metadata 6.8.0
iniconfig 2.0.0
invoke 2.2.0
jaraco.classes 3.3.0
Jinja2 3.1.3
keyring 24.2.0
kiwisolver 1.4.5
linkify-it-py 2.0.3
lxml 4.9.3
Markdown 3.5.2
markdown-it-py 3.0.0
MarkupSafe 2.1.5
marshmallow 3.21.1
marshmallow-oneofschema 3.1.1
matplotlib 3.8.0
mdit-py-plugins 0.4.0
mdurl 0.1.2
more-itertools 10.1.0
nh3 0.2.14
numpy 1.25.2
packaging 23.2
pandas 2.1.1
panel 1.3.8
param 2.0.2
paramiko 3.4.0
Pillow 10.0.1
Pint 0.23
pip 23.3.1
pkginfo 1.9.6
platformdirs 3.11.0
plotly 5.19.0
pluggy 1.3.0
plumbum 1.8.2
pooch 1.7.0
protobuf 3.20.3
psutil 5.9.5
pyaedt 0.7.10
pyansys 2024.1.6
pyansys-docker 5.0.4
pyansys-tools-versioning 0.5.0
pyasn1 0.5.0
pyasn1-modules 0.3.0
pycparser 2.21
pydantic 2.6.3
pydantic_core 2.16.3
Pygments 2.16.1
pygranta 2024.1.0
pyiges 0.3.1
PyNaCl 1.5.0
pyparsing 3.1.1
pypiwin32 223
pypng 0.20220715.0
pyproject_hooks 1.0.0
Pyro5 5.15
pyspnego 0.10.2
pytest 7.4.3
pytest-cov 4.1.0
python-dateutil 2.8.2
python-jose 3.3.0
python-keycloak 2.0.0
pythonnet 3.0.1
pytwin 0.6.0
pytz 2023.3.post1
pyvista 0.42.3
pyviz_comms 3.0.1
pywin32 306
pywin32-ctypes 0.2.2
PyYAML 6.0.1
readme-renderer 42.0
requests 2.31.0
requests-negotiate-sspi 0.5.2
requests-ntlm 1.2.0
requests-toolbelt 1.0.0
rfc3986 2.0.0
rich 13.6.0
rpyc 5.3.1
rsa 4.9
scipy 1.11.3
scooby 0.7.4
semver 3.0.2
serpent 1.41
setuptools 65.5.1
six 1.16.0
sqlparse 0.4.4
sseclient-py 1.8.0
sspilib 0.1.0
tenacity 8.2.3
tomli 2.0.1
tornado 6.4
tqdm 4.66.1
twine 4.0.2
typing 3.7.4.3
typing_extensions 4.8.0
tzdata 2023.3
uc-micro-py 1.0.3
uritemplate 4.1.1
urllib3 1.26.17
vtk 9.2.6
wakepy 0.7.2
webencodings 0.5.1
websocket-client 1.6.4
wheel 0.38.4
wrapt 1.16.0
xmlschema 2.5.1
xyzservices 2023.10.1
zipp 3.17.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestserverissue on the server side

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions