Skip to content

Reading *DEFINE_TABLE from a deckΒ #769

@puneethbagaria

Description

@puneethbagaria

πŸ” Before submitting the issue

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

🐞 Description of the bug

table = deck1.get(type="DEFINE", filter=lambda kwd: (kwd.subkeyword == "TABLE" and kwd.tbid == tbid)) returns only the first line in *DEFINE_TABLE keyword and not the complete set of curves used.
For example:

*DEFINE_TABLE
$: label
10000001
$: Scale factors
1.0E-6
9.9999997E-5
0.001
0.0099999998
0.1
$:

For such an input, the command returns only the first strain rate reference.

table
Out[21]:
[*DEFINE_TABLE
$# tbid sfa offa
10000001
$# value lcid
1e-06 ]

Also, is it possible to extract the complete set (*DEFINE_TABLE + curves below it) with any command?

πŸ“ Steps to reproduce

`def read_deck(filename):
deck = Deck()
deck.append(kwd.Include(filename=filename))
deck = deck.expand()
return deck

deckFile = r'D:\01_DEV\src' + os.sep + "MAT_024_LCSS_TABLE.k"

deck1 = read_deck(deckFile)

mid = 10000001

mat1 = deck1.get(type = "MAT", filter=lambda kwd: kwd.mid == mid)
lcss = mat1[0].lcss
table = deck1.get(type="DEFINE", filter=lambda kwd: (kwd.subkeyword == "TABLE" and kwd.tbid == lcss))
`

πŸ’» Which operating system are you using?

Windows

πŸ“€ Which ANSYS version are you using?

No response

🐍 Which Python version are you using?

3.9

πŸ“¦ Installed packages

ansys-api-dyna==0.4.2
ansys-dpf-core==0.13.6
# Editable install with no version control (ansys-dpf-server_2025_1_pre0==2025.1rc0)
-e d:\01_dev\01_dpf\ansys_dpf_server_win_v2025.1.pre0
ansys-dyna-core==0.7.1
ansys-tools-path==0.7.1
appdirs==1.4.4
asttokens==3.0.0
certifi==2025.1.31
charset-normalizer==3.4.1
click==8.1.8
cloudpickle==3.1.1
colorama==0.4.6
comm==0.2.2
contourpy==1.3.1
cycler==0.12.1
debugpy==1.8.13
decorator==5.2.1
executing==2.2.0
fonttools==4.56.0
grpcio==1.71.0
hollerith==0.6.0
idna==3.10
importlib_metadata==8.6.1
ipykernel==6.29.5
ipython==8.34.0
jedi==0.19.2
jupyter_client==8.6.3
jupyter_core==5.7.2
kiwisolver==1.4.8
matplotlib==3.10.1
matplotlib-inline==0.1.7
nest-asyncio==1.6.0
numpy==2.2.4
packaging==24.2
pandas==2.2.3
parso==0.8.4
pillow==11.1.0
platformdirs==4.3.7
pooch==1.8.2
prompt_toolkit==3.0.50
protobuf==5.29.4
psutil==7.0.0
pure_eval==0.2.3
Pygments==2.19.1
pyparsing==3.2.1
python-dateutil==2.9.0.post0
pytz==2025.1
pyvista==0.44.2
pywin32==310
pyzmq==26.3.0
requests==2.32.3
scooby==0.10.0
setuptools==77.0.1
six==1.17.0
spyder-kernels==2.5.2
stack-data==0.6.3
tornado==6.4.2
tqdm==4.67.1
traitlets==5.14.3
transformations==2025.1.1
typing_extensions==4.12.2
tzdata==2025.1
urllib3==2.3.0
vtk==9.3.1
wcwidth==0.2.13
zipp==3.21.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    KeywordsAnything related to keyword subpackagebugDefects or glitches reported by users or developers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions