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

Bug located in ansys-dyna-core.keywords #667

Closed
2 tasks done
svizec opened this issue Jan 14, 2025 · 3 comments · Fixed by #668 or #671
Closed
2 tasks done

Bug located in ansys-dyna-core.keywords #667

svizec opened this issue Jan 14, 2025 · 3 comments · Fixed by #668 or #671
Labels
bug Something isn't working

Comments

@svizec
Copy link

svizec commented Jan 14, 2025

🔍 Before submitting the issue

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

🐞 Description of the bug

I believe I have encountered a few bugs when setting specific keywords.

*BOUNDARY_PRESCRIBED_MOTION_SET (class BoundaryPrescribedMotionSet)
has a second card enabled by default (offset1, offset2, lrb, node1, node2), which is not in line with the LS-Dyna keyword manual. If no other option is selected, there should only be one card available (nsid, dof, vad, lcid, SF, vid, death, birth)

*CONSTRAINED_BEAM_IN_SOLID (class ConstrainedBeamInSolid)
The first card (coupid, title) should only be used when the _TITLE or _ID keyword option is defined, but the class always defines this card. Additionally, there is no title option (with ConstrainedBeamInSolid().activate_option("TITLE")) that would add the _TITLE string to the keyword or subkeyword like in other keywords. I managed to get around that by setting ConstrainedBeamInSolid().subkeyword += "_TITLE", but this is not the desired behavior.
Additionally, the ncoup value cannot be set when constructing the class, and can only be set later (different to other values that are

📝 Steps to reproduce

from ansys.dyna.core.keywords import keywords as kw

Code for the PRESCRIBED_MOTION_SET:

presrcibed_motion = kw.BoundaryPrescribedMotionSet(
    nsid=2, dof=1, vad=2, lcid=1, sf=1)

results in the keyword with an added second card:

*BOUNDARY_PRESCRIBED_MOTION_SET
$#    nsid       dof       vad      lcid        sf       vid     death     birth
         2         1         2         1       1.0               1e+28       0.0
$# offset1   offset2       lrb     node1     node2
       0.0       0.0         0         0         0

The code:

# CONSTRAINED BEAM IN SOLID
beam_in_solid = kw.ConstrainedBeamInSolid( 
    bside=fiber_pid, ssid=rubber_pid, bstyp=1, sstyp=1, cdir=1)
beam_in_solid.ncoup_ = 1 # number of coupling points

results in the keyword with the empty first card

*CONSTRAINED_BEAM_IN_SOLID
$#  coupid                                                                 title
 
$#   bside      ssid     bstyp     sstyp    unused    unused    ncoup       cdir
         1         2         1         1                             1         1
$#   start       end    unused    axfor     unused      pssf    unused      xint
       0.0     1e+21                                     0.1

💻 Which operating system are you using?

Windows

📀 Which ANSYS version are you using?

No response

🐍 Which Python version are you using?

3.12

📦 Installed packages

ansys-api-dyna==0.4.1
ansys-api-platform-instancemanagement==1.1.0
ansys-dpf-core==0.13.3
ansys-dyna-core==0.6.1
ansys-platform-instancemanagement==1.1.2
ansys-tools-path==0.7.1
appdirs==1.4.4
appnope==0.1.4
asttokens==3.0.0
cachetools==5.5.0
certifi==2024.12.14
charset-normalizer==3.4.1
click==8.1.8
colorama==0.4.6
comm==0.2.2
contourpy==1.3.1
cycler==0.12.1
debugpy==1.8.11
decorator==5.1.1
et_xmlfile==2.0.0
exceptiongroup==1.2.2
executing==2.1.0
fonttools==4.55.3
gmsh==4.13.1
google-api-core==2.24.0
google-api-python-client==2.157.0
google-auth==2.37.0
google-auth-httplib2==0.2.0
googleapis-common-protos==1.66.0
grpcio==1.69.0
hollerith==0.6.0
httplib2==0.22.0
idna==3.10
importlib_metadata==8.5.0
ipykernel==6.29.5
ipython==8.31.0
jedi==0.19.2
jupyter_client==8.6.3
jupyter_core==5.7.2
kiwisolver==1.4.8
matplotlib==3.10.0
matplotlib-inline==0.1.7
nest-asyncio==1.6.0
numpy==2.2.1
openpyxl==3.1.5
packaging==24.2
pandas==2.2.3
parso==0.8.4
pexpect==4.9.0
pillow==11.1.0
platformdirs==4.3.6
pooch==1.8.2
prompt_toolkit==3.0.48
proto-plus==1.25.0
protobuf==5.29.2
psutil==6.1.1
ptyprocess==0.7.0
pure_eval==0.2.3
pyasn1==0.6.1
pyasn1_modules==0.4.1
Pygments==2.18.0
pyparsing==3.2.1
python-dateutil==2.9.0.post0
pytz==2024.2
pyvista==0.44.2
pywin32==308
pyzmq==26.2.0
requests==2.32.3
rsa==4.9
scooby==0.10.0
setuptools==75.7.0
six==1.17.0
stack-data==0.6.3
tornado==6.4.2
tqdm==4.67.1
traitlets==5.14.3
typing_extensions==4.12.2
tzdata==2024.2
uritemplate==4.1.1
urllib3==2.3.0
vtk==9.3.1
wcwidth==0.2.13
zipp==3.21.0
@koubaa
Copy link
Collaborator

koubaa commented Jan 14, 2025

I have a partial fix in #668.

There are two outstanding issues not (yet) fixed there.

ncoup:
The keyword data we use (kwd.json) has the property name "ncoup " (with a space at the end) which gets translated to "ncoup_" to become a property but retains the space for the kwarg constructor.

TITLE option:
This is the first time I encounter a keyword having two options that are equivalent and mutually exclusive. I need to build that capability into the OptionCardSet class and then indicate that in the code generation system. #668 goes as far as removing that card by default and activating it with the "ID" option.

@koubaa
Copy link
Collaborator

koubaa commented Jan 14, 2025

update. "ncoup" is now fixed in #668. This leaves only the TITLE option issue.

@koubaa
Copy link
Collaborator

koubaa commented Jan 14, 2025

Reopening until the TITLE/ID option card is addressed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants