Skip to content

Unable to Extract "DAMP" Material Property Using mapdl_material_properties in Ansys DPF #2197

Open
@KristianKvistIbsen

Description

@KristianKvistIbsen

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

I am encountering an issue when attempting to extract the "DAMP" material property using the mapdl_material_properties operator in Ansys DPF. Despite defining a constant structural damping coefficient of 0.2 in the material properties, the operator consistently returns only zero values.

Here is the Python script I used to extract the "DAMP" property:

from ansys.dpf import core as dpf
import numpy as np

from settings.config import USER_SETTINGS

# Load model
model0 = dpf.Model(USER_SETTINGS['model0Path'] + r"\file.rst")
full_mesh = model0.metadata.meshed_region
mats = full_mesh.property_field("mat")

# Operator instantiation
op = dpf.operators.result.mapdl_material_properties()
op.inputs.properties_name.connect("DAMP")
op.inputs.materials.connect(mats)
op.inputs.data_sources.connect(model0)

# Get properties value
my_properties_value = op.outputs.properties_value()
print(my_properties_value[0].data)

The output from the above script is an array of zeros:

DPFArray([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0.])

Additional Information

I have verified that the damping property is correctly defined in the input file. Here is an excerpt showing the material property assignment:
MP,DMPS,23,0.2, ! Constant structural damping coefficient
MP,DENS,23,7850, ! kg m^-3
MP,EX,23,200000000000, ! Pa
MP,NUXY,23,0.3,
MP,ALPX,23,1.2e-05, ! C^-1
MP,KXX,23,60.5, ! W m^-1 C^-1
MP,C,23,434, ! J kg^-1 C^-1
MP,RSVX,23,1.7e-07, ! kg m^3 A^-2 s^-3

To investigate further, I wrote a screening script to check all available material properties and identify which ones return non-zero values. Here is the script:

from ansys.dpf import core as dpf
import numpy as np

from settings.config import USER_SETTINGS

# Load model
model0 = dpf.Model(USER_SETTINGS['model0Path'] + r"\file.rst")
full_mesh = model0.metadata.meshed_region
mats = full_mesh.property_field("mat")

# List of property names to test
property_names = [
    "EX", "EY", "EZ",  # Young's modulus in X, Y, Z directions
    "NUXY", "NUYZ", "NUXZ",  # Poisson's ratios
    "GXY", "GYZ", "GXZ",  # Shear moduli
    "DENS",  # Density
    "ALPX", "ALPY", "ALPZ",  # Thermal expansion coefficients
    "DMPR",  # Damping ratio
    "DMPS",  # Constant structural damping
    "MU",  # Coefficient of friction
    "VISC",  # Viscosity
    "KXX", "KYY", "KZZ",  # Thermal conductivity
    "C", "CREF",  # Specific heat, reference specific heat
    "RSVX", "RSVY", "RSVZ",  # Resistivity
    "MURX", "MURY", "MURZ",  # Relative permeability
    "PRXY", "PRYZ", "PRXZ",  # Plastic Poisson's ratio
    "SIGXT", "SIGXC", "SIGYT", "SIGYC",  # Tensile/compressive strengths
    "EMIS",  # Thermal emissivity
    "BKIN", "MKIN",  # Bilinear and multilinear kinematic hardening
    "CREEP",  # Creep constants
    "PIEZ",  # Piezoelectric matrix
    "SONC",  # Speed of sound
    "ENTH",  # Enthalpy
    "DMPRAT", "DMPSTR", "DMPEXT", "DAMP", "DMPR", "DMPS"  # Damping-related properties
]

non_zero_properties = {}

for prop_name in property_names:
    mat_prop = dpf.operators.result.mapdl_material_properties()
    mat_prop.inputs.materials.connect(mats)
    mat_prop.inputs.properties_name.connect(prop_name)
    mat_prop.inputs.data_sources.connect(model0)
    
    prop_field = mat_prop.outputs.properties_value.get_data()
    
    if prop_field and prop_field[0].data.size > 0:
        data = prop_field[0].data
        if not np.all(data == 0):
            non_zero_properties[prop_name] = data
            print(f"{prop_name}: {data}")
        else:
            print(f"{prop_name}: All zeros")
    else:
        print(f"{prop_name}: No data returned")

print("\nProperties that are not all zeros:")
for prop_name, data in non_zero_properties.items():
    print(f"{prop_name}: {data}")

# List of non-zero property names
non_zero_list = list(non_zero_properties.keys())
print("\nList of non-zero properties:")
print(non_zero_list)

The screening script revealed that the only properties returning non-zero values are: ['EX', 'NUXY', 'DENS', 'ALPX', 'KXX', 'C', 'RSVX']

Notably, all damping-related properties ("DAMP", "DMPS", "DMPR", etc.) return zero values, despite the input file confirming that DMPS is assigned as 0.2.

Please find more information on expected behavior at https://discuss.ansys.com/discussion/comment/6102#Comment_6102

Thank you for your time and assistance.

Best regards,

Kristian

Steps To Reproduce

(PLEASE SEE MAIN TEXT FOR MORE INFORMATION ON REPRODUCTION)

from ansys.dpf import core as dpf
import numpy as np

from settings.config import USER_SETTINGS

# Load model
model0 = dpf.Model(USER_SETTINGS['model0Path'] + r"\file.rst")
full_mesh = model0.metadata.meshed_region
mats = full_mesh.property_field("mat")

# Operator instantiation
op = dpf.operators.result.mapdl_material_properties()
op.inputs.properties_name.connect("DAMP")
op.inputs.materials.connect(mats)
op.inputs.data_sources.connect(model0)

# Get properties value
my_properties_value = op.outputs.properties_value()
print(my_properties_value[0].data)

Which Operating System causes the issue?

Windows

Which DPF/Ansys version are you using?

Ansys 2024 R2

Which Python version causes the issue?

3.11

Installed packages

about-time==4.2.1
aiohappyeyeballs==2.4.0
aiohttp==3.10.6
aiosignal==1.3.1
alabaster==1.0.0
alive-progress==3.1.5
annotated-types==0.7.0
ansys-acp-core==0.1.0
ansys-additive-core==0.19.0
ansys-additive-widgets==0.2.1
ansys-api-acp==0.2.0
ansys-api-additive==2.2.1
ansys-api-dbu==0.3.6
ansys-api-dyna==0.4.2
ansys-api-edb==1.0.10
ansys-api-fluent==0.3.32
ansys-api-geometry==0.4.16
ansys-api-mapdl==0.5.2
ansys-api-mechanical==0.1.2
ansys-api-meshing-prime==0.1.4
ansys-api-modelcenter==0.3.1
ansys-api-platform-instancemanagement==1.1.0
ansys-api-pyensight==0.4.2
ansys-api-sherlock==0.1.35
ansys-api-systemcoupling==0.2.0
ansys-api-tools-filetransfer==0.1.0
ansys-api-workbench==0.2.0
ansys-conceptev-core==0.8
ansys-dpf-composites==0.6.2
ansys-dpf-core==0.13.3
ansys-dpf-post==0.9.2
ansys-dyna-core==0.7.0
ansys-dynamicreporting-core==0.9.0
ansys-edb-core==0.1.9
ansys-engineeringworkflow-api==0.1.0
ansys-fluent-core==0.28.2
ansys-geometry-core==0.7.6
ansys-grantami-bomanalytics==2.2.0
ansys-grantami-bomanalytics-openapi==3.1.0
ansys-grantami-jobqueue==1.1.0
ansys-grantami-recordlists==1.3.0
ansys-grantami-serverapi-openapi==4.0.0
ansys-hps-client==0.9.1
ansys-mapdl-core==0.68.6
ansys-mapdl-reader==0.54.1
ansys-math-core==0.2.0
ansys-mechanical-core==0.11.11
ansys-mechanical-env==0.1.8
ansys-mechanical-stubs==0.1.5
ansys-meshing-prime==0.7.0
ansys-modelcenter-workflow==0.1.1
ansys-motorcad-core==0.7.0
ansys-openapi-common==2.1.1
ansys-optislang-core==0.9.2
ansys-platform-instancemanagement==1.1.2
ansys-pyensight-core==0.9.2
ansys-pythonnet==3.1.0rc4
ansys-rocky-core==0.3.1
ansys-seascape==0.2.0
ansys-sherlock-core==0.8.1
ansys-simai-core==0.2.5
ansys-sound-core==0.1.3
ansys-systemcoupling-core==0.8.0
ansys-tools-filetransfer==0.1.0
ansys-tools-local-product-launcher==0.1.0
ansys-tools-path==0.6.0
ansys-tools-visualization-interface==0.4.4
ansys-turbogrid-api==0.4.3
ansys-turbogrid-core==0.4.1
ansys-units==0.3.4
ansys-workbench-core==0.7.0
anyio==4.6.0
appdirs==1.4.4
arrow==1.3.0
asgiref==3.8.1
astroid==3.3.4
astropy==6.1.4
astropy-iers-data==0.2024.9.23.0.31.43
asttokens==2.4.1
asyncssh==2.17.0
atomicwrites==1.4.1
attrs==24.2.0
autopep8==2.0.4
babel==2.16.0
backoff==2.2.1
backports.entry-points-selectable==1.3.0
bcrypt==4.2.0
beartype==0.18.5
beautifulsoup4==4.12.3
binaryornot==0.4.4
black==24.8.0
bleach==6.1.0
blinker==1.8.2
bokeh==3.4.3
boto3==1.35.76
botocore==1.35.76
build==1.2.2
cachetools==5.5.0
certifi==2024.8.30
cffi==1.17.1
cftime==1.6.4.post1
chardet==5.2.0
charset-normalizer==3.3.2
click==8.1.7
climax==0.5.0
cloudpickle==3.0.0
cloup==3.0.5
clr_loader==0.2.7.post0
colorama==0.4.6
comm==0.2.2
ConfigArgParse==1.7
contourpy==1.3.0
cookiecutter==2.6.0
cryptography==43.0.1
cycler==0.12.1
dash==2.18.1
dash-bootstrap-components==1.6.0
dash-bootstrap-templates==2.0.0
dash-core-components==2.0.0
dash-html-components==2.0.0
dash-table==5.0.0
dash-vtk==0.0.9
dataclasses-json==0.6.7
debugpy==1.8.6
decorator==5.1.1
defusedxml==0.7.1
Deprecated==1.2.14
diff-match-patch==20230430
dill==0.3.8
distlib==0.3.9
Django==4.2.18
django-guardian==2.4.0
djangorestframework==3.15.2
docker==7.1.0
docstring-to-markdown==0.15
docutils==0.21.2
elementpath==4.5.0
executing==2.1.0
fabric==3.2.2
fastjsonschema==2.20.0
filelock==3.16.1
flake8==7.1.1
Flask==3.0.3
flexcache==0.3
flexparser==0.3.1
fonttools==4.54.1
fpdf2==2.7.9
frozenlist==1.4.1
geomdl==5.3.1
Glances==4.2.0
glcontext==3.0.0
gmsh==4.13.1
google-api-core==2.20.0
google-api-python-client==2.147.0
google-auth==2.35.0
google-auth-httplib2==0.2.0
googleapis-common-protos==1.65.0
grapheme==0.6.0
grpcio==1.66.1
grpcio-health-checking==1.48.2
grpcio-status==1.48.2
h11==0.14.0
h5py==3.12.1
hollerith==0.6.0
httpcore==1.0.5
httplib2==0.22.0
httpx==0.26.0
idna==3.10
imagesize==1.4.1
importlib_metadata==8.5.0
inflection==0.5.1
intervaltree==3.1.0
invoke==2.2.0
ipykernel==6.29.5
ipython==8.27.0
ipywidgets==8.1.5
isort==5.13.2
isosurfaces==0.1.2
itsdangerous==2.2.0
jaraco.classes==3.4.0
jaraco.context==6.0.1
jaraco.functools==4.0.2
jedi==0.19.1
jellyfish==1.1.0
Jinja2==3.1.4
jmespath==1.0.1
joblib==1.4.2
jsonschema==4.23.0
jsonschema-specifications==2023.12.1
jupyter_client==8.6.3
jupyter_core==5.7.2
jupyterlab_pygments==0.3.0
jupyterlab_widgets==3.0.13
keyring==25.4.1
kiwisolver==1.4.7
lambda-uploader==1.3.0
libigl==2.5.1
linkify-it-py==2.0.3
llvmlite==0.43.0
lxml==5.3.0
manim==0.18.1
ManimPango==0.6.0
mapbox_earcut==1.0.3
Markdown==3.7
markdown-it-py==3.0.0
MarkupSafe==2.1.5
marshmallow==3.22.0
marshmallow-oneofschema==3.1.1
matplotlib==3.9.2
matplotlib-inline==0.1.7
mccabe==0.7.0
mdit-py-plugins==0.4.2
mdurl==0.1.2
merry==0.3.0
meshio==5.3.5
mistune==3.0.2
moderngl==5.12.0
moderngl-window==3.1.0
more-itertools==10.5.0
mpmath==1.3.0
msal==1.31.1
msal-extensions==1.2.0
msgpack==1.1.0
multidict==6.1.0
mypy-extensions==1.0.0
narwhals==1.25.0
nbclient==0.10.0
nbconvert==7.16.4
nbformat==5.10.4
nest-asyncio==1.6.0
netCDF4==1.7.2
networkx==3.4.2
nh3==0.2.18
nltk==3.9.1
numba==0.60.0
numpy==1.26.4
numpy-stl==3.2.0
numpydoc==1.8.0
open3d==0.19.0
overrides==7.7.0
packaging==24.1
pandas==2.2.3
pandocfilters==1.5.1
panel==1.4.4
param==2.1.1
paramiko==3.5.0
parso==0.8.4
pathspec==0.12.1
patsy==1.0.1
pdf2image==1.17.0
pexpect==4.9.0
pickleshare==0.7.5
pillow==10.4.0
Pint==0.24.3
pkginfo==1.10.0
platformdirs==4.3.6
plotly==6.0.0
pluggy==1.5.0
plumbum==1.8.3
pooch==1.8.2
portalocker==2.10.1
prompt_toolkit==3.0.48
proto-plus==1.24.0
protobuf==3.20.3
psutil==6.1.1
ptyprocess==0.7.0
pure_eval==0.2.3
pyaedt==0.13.0
pyansys==2025.1.1
pyansys-tools-variableinterop==0.1.1
pyansys-tools-versioning==0.6.0
pyasn1==0.6.1
pyasn1_modules==0.4.1
pycairo==1.27.0
pycodestyle==2.12.1
pycparser==2.22
pydantic==2.9.2
pydantic_core==2.23.4
pydocstyle==6.3.0
pydub==0.25.1
pyedb==0.34.3
pyerfa==2.0.1.4
pyflakes==3.2.0
PyGithub==2.4.0
pyglet==2.1.0
PyGLM==2.7.3
pygltflib==1.16.3
Pygments==2.18.0
pygranta==2025.1.0
pyiges==0.3.1
PyJWT==2.9.0
pylint==3.3.1
pylint-venv==3.0.3
pyls-spyder==0.4.0
PyNaCl==1.5.0
pyparsing==3.1.4
pypiwin32==223
pypng==0.20220715.0
pyproject_hooks==1.1.0
PyQt5==5.15.11
PyQt5-Qt5==5.15.2
PyQt5_sip==12.15.0
PyQtWebEngine==5.15.7
PyQtWebEngine-Qt5==5.15.2
Pyro5==5.15
pyshtools==4.13.1
pyspnego==0.11.1
python-dateutil==2.9.0.post0
python-dotenv==1.0.1
python-lsp-black==2.0.0
python-lsp-jsonrpc==1.1.2
python-lsp-server==1.12.0
python-pptx==0.6.19
python-slugify==8.0.4
python-utils==3.9.1
pytomlpp==1.0.13
pytoolconfig==1.3.1
pytwin==0.7.0
pytz==2024.2
pyuca==1.2
pyvista==0.43.4
pyviz_comms==3.0.3
pywin32==306
pywin32-ctypes==0.2.3
PyYAML==6.0.2
pyzmq==26.2.0
QDarkStyle==3.2.3
qstylizer==0.2.3
QtAwesome==1.3.1
qtconsole==5.6.1
QtPy==2.4.1
rainflow==3.2.0
readme_renderer==44.0
referencing==0.35.1
regex==2024.9.11
requests==2.32.3
requests-negotiate-sspi==0.5.2
requests-toolbelt==1.0.0
requests_ntlm==1.3.0
retrying==1.3.4
rfc3986==2.0.0
rich==13.8.1
robust_laplacian==1.0.0
rope==1.13.0
rpds-py==0.20.0
rpyc==6.0.1
rsa==4.9
Rtree==1.3.0
s3transfer==0.10.4
scikit-learn==1.5.2
scikit-rf==1.3.0
scipy==1.14.1
scooby==0.10.0
screeninfo==0.8.1
semver==3.0.2
serpent==1.41
setuptools==75.1.0
six==1.16.0
skia-pathops==0.8.0.post2
sniffio==1.3.1
snowballstemmer==2.2.0
sortedcontainers==2.4.0
sounddevice==0.5.1
soupsieve==2.6
Sphinx==8.0.2
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
spyder==6.0.3
spyder-kernels==3.0.2
sqlparse==0.5.1
srt==3.5.3
sseclient-py==1.8.0
sspilib==0.1.0
stack-data==0.6.3
statsmodels==0.14.4
superqt==0.6.7
svgelements==1.9.6
sympy==1.13.3
tabulate==0.9.0
tenacity==9.0.0
text-unidecode==1.3
textdistance==4.6.3
threadpoolctl==3.5.0
three-merge==0.1.1
tinycss2==1.3.0
toml==0.10.2
tomli==2.0.1
tomli_w==1.1.0
tomlkit==0.13.2
tornado==6.4.1
tqdm==4.66.5
traitlets==5.14.3
trame==3.6.5
trame-client==3.3.2
trame-server==3.2.3
trame-vtk==2.8.10
trame-vuetify==2.7.1
trimesh==4.5.3
twine==5.1.1
types-python-dateutil==2.9.0.20240906
typing-inspect==0.9.0
typing_extensions==4.12.2
tzdata==2024.2
tzlocal==5.2
uc-micro-py==1.0.3
ujson==5.10.0
uritemplate==4.1.1
urllib3==1.26.20
usd-core==24.11
virtualenv==20.28.0
vtk==9.3.1
wakepy==0.10.1
watchdog==5.0.2
wcwidth==0.2.13
webencodings==0.5.1
websockets==13.1
Werkzeug==3.0.4
whatthepatch==1.0.6
widgetsnbextension==4.0.13
WMI==1.5.1
wrapt==1.16.0
wslink==2.2.1
xarray==2024.9.0
XlsxWriter==3.2.0
xmlschema==3.4.3
xyzservices==2024.9.0
yapf==0.40.2
yarl==1.12.1
zipp==3.20.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions