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

Add Sensor by Solid Model #722

Open
2 of 6 tasks
roosre opened this issue Nov 29, 2024 · 0 comments
Open
2 of 6 tasks

Add Sensor by Solid Model #722

roosre opened this issue Nov 29, 2024 · 0 comments
Labels
feature New feature or request needs-backend-changes Needs changes in the ACP gRPC server backend

Comments

@roosre
Copy link
Contributor

roosre commented Nov 29, 2024

🔍 Before submitting the issue

  • I have searched among the existing issues
  • I am using a Python virtual environment

🐞 Description of the bug

gRPC service of Sensor does not support SensorBySolidModel

Error before updating the _LINKABLE_ENTITY_TYPES of the sensor
TypeError: List items must be of type Fabric, Stackup, SubLaminate, ElementSet, OrientedSelectionSet, ModelingPly, not SolidModel.

grpc server error after updating _LINKABLE_ENTITY_TYPES:
RuntimeError: Internal error: Invalid path type for resource path 'models/0c0e31f4-f6a3-445e-a7d0-265f40f2b453/solid_models/c47555f3-599b-4b19-9a4b-91bc226d01d9'.

Tasks

  • Update linkable entity types of Sensor (pyACP)
  • ensure that grpc layer support SolidModel and ImportedSolidModel as valid entities for SensorBySolidModel (ACP Core)
  • Add unit tests (pyACP)
  • Update 006-sensor.py example (pyACP)

"""
elset_wing_1 = model.element_sets["els_wing_1"]
solid_model = model.create_solid_model(
name="Wing 1",
element_sets=[elset_wing_1]
)
sensor_by_solid_model = model.create_sensor(
name="By Solid Model",
sensor_type=SensorType.SENSOR_BY_SOLID_MODEL,
entities=[solid_model],
)
model.update()

print_measures(sensor_by_solid_model)
plotter = pyvista.Plotter()
plotter.add_mesh(solid_model.solid_mesh.to_pyvista(), show_edges=False, opacity=1, color="turquoise")
plotter.add_mesh(model.mesh.to_pyvista(), show_edges=False, opacity=0.2)
plotter.camera_position = camera
plotter.show()
"""

📝 Steps to reproduce

import pathlib
import tempfile
import numpy as np
import pyvista

import ansys.acp.core
from ansys.acp.core import launch_acp, SensorType, UnitSystemType
from ansys.acp.core.extras import FLAT_PLATE_SOLID_CAMERA, ExampleKeys, get_example_file

tempdir = tempfile.TemporaryDirectory()
WORKING_DIR = pathlib.Path(tempdir.name)
acph5_input_file = get_example_file(ExampleKeys.RACE_CAR_NOSE_ACPH5, WORKING_DIR)

acp = launch_acp()

model = acp.import_model(acph5_input_file)
model.unit_system = UnitSystemType.SI
print(model.unit_system)

model.fabrics["UD"].area_price = 15 # $/m^2
model.fabrics["woven"].area_price = 23 # $/m^2
model.fabrics["core_4mm"].area_price = 7 # $/m^2

elset_wing_1 = model.element_sets["els_wing_1"]
solid_model = model.create_solid_model(
name="Wing 1",
element_sets=[elset_wing_1]
)
sensor_by_solid_model = model.create_sensor(
name="By Solid Model",
sensor_type=SensorType.SENSOR_BY_SOLID_MODEL,
entities=[solid_model],
)
model.update()

print_measures(sensor_by_solid_model)
plotter = pyvista.Plotter()
plotter.add_mesh(solid_model.solid_mesh.to_pyvista(), show_edges=False, opacity=1, color="turquoise")
plotter.add_mesh(model.mesh.to_pyvista(), show_edges=False, opacity=0.2)
plotter.camera_position = camera
plotter.show()

💻 Which operating system are you using?

Windows

📀 Which ANSYS version are you using?

ACP / WB 2025 R1

🐍 Which Python version are you using?

3.9

📦 Installed packages

accessible-pygments==0.0.5
aiohappyeyeballs==2.4.3
aiohttp==3.11.6
aiosignal==1.3.1
alabaster==1.0.0
-e git+https://github.com/ansys-internal/pyacp.git@3ae9d16ec360754137bd5faeff3d7ed62b6a0e18#egg=ansys_acp_core
ansys-api-acp==0.2.0
ansys-api-mapdl==0.5.2
ansys-api-mechanical==0.1.2
ansys-api-platform-instancemanagement==1.1.0
ansys-api-tools-filetransfer==0.1.1
ansys-dpf-composites==0.6.1
ansys-dpf-core==0.13.2
ansys-mapdl-core==0.68.6
ansys-mapdl-reader==0.54.1
ansys-math-core==0.2.0
ansys-mechanical-core==0.11.10
ansys-mechanical-env==0.1.8
ansys-mechanical-stubs==0.1.4
ansys-platform-instancemanagement==1.1.2
ansys-pythonnet==3.1.0rc4
ansys-sphinx-theme==1.2.1
ansys-tools-filetransfer==0.1.0
ansys-tools-local-product-launcher==0.1.0
ansys-tools-path==0.7.0
ansys-tools-visualization-interface==0.5.0
anyio==4.6.2.post1
appdirs==1.4.4
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
arrow==1.3.0
asttokens==2.4.1
async-timeout==5.0.1
attrs==24.2.0
babel==2.16.0
backports.entry-points-selectable==1.3.0
beautifulsoup4==4.12.3
black==24.10.0
bleach==6.2.0
cachetools==5.5.0
certifi==2024.8.30
cffi==1.17.1
cfgv==3.4.0
charset-normalizer==3.4.0
click==8.1.7
clr-loader==0.2.6
colorama==0.4.6
comm==0.2.2
contourpy==1.3.1
coverage==7.6.7
cycler==0.12.1
debugpy==1.8.8
decopatch==1.4.10
decorator==5.1.1
defusedxml==0.7.1
distlib==0.3.9
docker==7.1.0
docutils==0.21.2
exceptiongroup==1.2.2
executing==2.1.0
fastjsonschema==2.20.0
filelock==3.16.1
fonttools==4.55.0
fqdn==1.5.1
frozenlist==1.5.0
geomdl==5.3.1
google-api-core==2.23.0
google-api-python-client==2.153.0
google-auth==2.36.0
google-auth-httplib2==0.2.0
googleapis-common-protos==1.66.0
grpcio==1.68.0
grpcio-health-checking==1.62.3
httplib2==0.22.0
hypothesis==6.119.3
identify==2.6.2
idna==3.10
imagesize==1.4.1
importlib_metadata==8.5.0
iniconfig==2.0.0
ipykernel==6.29.5
ipython==8.29.0
ipywidgets==8.1.5
isoduration==20.11.0
jedi==0.19.2
Jinja2==3.1.4
jsonpointer==3.0.0
jsonschema==4.23.0
jsonschema-specifications==2024.10.1
jupyter-events==0.10.0
jupyter_client==8.6.3
jupyter_core==5.7.2
jupyter_server==2.14.2
jupyter_server_proxy==4.4.0
jupyter_server_terminals==0.5.3
jupyterlab_pygments==0.3.0
jupyterlab_widgets==3.0.13
kiwisolver==1.4.7
makefun==1.15.6
MarkupSafe==3.0.2
matplotlib==3.9.2
matplotlib-inline==0.1.7
mistune==3.0.2
more-itertools==10.5.0
msgpack==1.1.0
multidict==6.1.0
mypy==1.13.0
mypy-extensions==1.0.0
nbclient==0.10.0
nbconvert==7.16.4
nbformat==5.10.4
nest-asyncio==1.6.0
networkx==3.4.2
nodeenv==1.9.1
numpy==1.26.4
numpydoc==1.8.0
overrides==7.7.0
packaging==24.2
pandocfilters==1.5.1
parso==0.8.4
pathspec==0.12.1
pdf2image==1.17.0
pillow==11.0.0
platformdirs==4.3.6
pluggy==1.5.0
pooch==1.8.2
pre_commit==4.0.1
prometheus_client==0.21.0
prompt_toolkit==3.0.48
propcache==0.2.0
proto-plus==1.25.0
protobuf==4.25.5
psutil==6.1.0
pure_eval==0.2.3
py-cpuinfo==9.0.0
pyansys-tools-versioning==0.6.0
pyasn1==0.6.1
pyasn1_modules==0.4.1
pycparser==2.22
pydata-sphinx-theme==0.16.0
Pygments==2.18.0
pyiges==0.3.1
pypandoc==1.14
pyparsing==3.2.0
pytest==8.3.3
pytest-benchmark==5.1.0
pytest-cases==3.8.6
pytest-cov==6.0.0
python-dateutil==2.9.0.post0
python-json-logger==2.0.7
pyvista==0.44.1
pywin32==308
pywinpty==2.0.14
PyYAML==6.0.2
pyzmq==26.2.0
referencing==0.35.1
requests==2.32.3
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rpds-py==0.21.0
rsa==4.9
scipy==1.14.1
scooby==0.10.0
Send2Trash==1.8.3
simpervisor==1.0.0
six==1.16.0
sniffio==1.3.1
snowballstemmer==2.2.0
sortedcontainers==2.4.0
soupsieve==2.6
Sphinx==8.1.3
sphinx-autodoc-typehints==2.5.0
sphinx-copybutton==0.5.2
sphinx-gallery==0.18.0
sphinx-jinja==2.0.2
sphinx_design==0.6.1
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-htmlhelp==2.1.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==2.0.0
sphinxcontrib-serializinghtml==2.0.0
stack-data==0.6.3
tabulate==0.9.0
terminado==0.18.1
tinycss2==1.4.0
tomli==2.1.0
tornado==6.4.1
tqdm==4.67.0
traitlets==5.14.3
trame==3.7.0
trame-client==3.5.0
trame-server==3.2.3
trame-vtk==2.8.12
trame-vuetify==2.7.2
types-protobuf==5.28.3.20241030
types-python-dateutil==2.9.0.20241003
typing_extensions==4.12.2
uri-template==1.3.0
uritemplate==4.1.1
urllib3==2.2.3
virtualenv==20.27.1
vtk==9.3.1
wcwidth==0.2.13
webcolors==24.11.1
webencodings==0.5.1
websocket-client==1.8.0
websockets==13.1
widgetsnbextension==4.0.13
wslink==2.2.1
yarl==1.17.2
zipp==3.21.0
@roosre roosre added the feature New feature or request label Nov 29, 2024
@roosre roosre added this to the 2025R2 release milestone Nov 29, 2024
@greschd greschd added the needs-backend-changes Needs changes in the ACP gRPC server backend label Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request needs-backend-changes Needs changes in the ACP gRPC server backend
Projects
None yet
Development

No branches or pull requests

2 participants