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

fix: BOUNDARY_PRESCRIBED_MOTION_*_ID option and CONTROL_MPP_DECOMPOSITION_TRANSFORMATION (Issue #696) #701

Merged
merged 4 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions codegen/additional-cards.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
{"name": "ID", "type": "integer", "default": null, "position": 0, "width": 10, "help": "ID keyword option"}
]
},
"ID_HEADING": {
"fields": [
{"name": "ID", "type": "integer", "default": null, "position": 0, "width": 10, "help": "ID keyword option"},
{"name": "HEADING", "type": "string", "default": null, "position": 10, "width": 70, "help": "Descriptor. We suggest using unique descriptions."}
]
},
"BLANK": {
"fields": [
{"name": "__blank1", "type": "integer", "default": null, "position": 0, "used": false, "width": 10, "help": ""},
Expand Down
66 changes: 66 additions & 0 deletions codegen/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,56 @@
]
}
},
{
"type": "prefix",
"patterns": ["BOUNDARY_PRESCRIBED_MOTION_NODE",
"BOUNDARY_PRESCRIBED_MOTION_SET",
"BOUNDARY_PRESCRIBED_MOTION_SET_SEGMENT",
"BOUNDARY_PRESCRIBED_MOTION_RIGID",
"BOUNDARY_PRESCRIBED_MOTION_RIGID_LOCAL"
],
"exclusions": ["BOUNDARY_PRESCRIBED_MOTION_SET_BOX",
"BOUNDARY_PRESCRIBED_MOTION_SET_EDGE_UVW",
"BOUNDARY_PRESCRIBED_MOTION_SET_FACE_XYZ",
"BOUNDARY_PRESCRIBED_MOTION_SET_LINE",
"BOUNDARY_PRESCRIBED_MOTION_SET_POINT_UVW",
"BOUNDARY_PRESCRIBED_MOTION_SET_LINE"
],
"generation-options": {
"add-option": [
{
"card-order": -2,
"title-order": 1,
"cards": [
{
"source": "additional-cards",
"card-name": "ID_HEADING"
}
],
"option-name": "ID"
}
]
}
},
{
"type": "prefix",
"patterns": ["BOUNDARY_SPC_NODE", "BOUNDARY_SPC_SET"],
"generation-options": {
"add-option": [
{
"card-order": -2,
"title-order": 1,
"cards": [
{
"source": "additional-cards",
"card-name": "ID_HEADING"
}
],
"option-name": "ID"
}
]
}
},
{
"type": "prefix",
"patterns": ["CONSTRAINED_NODAL_RIGID_BODY"],
Expand Down Expand Up @@ -481,6 +531,22 @@
},
"comment": "a mix of conditional, variable length, and duplicate cards"
},
"CONTROL_MPP_DECOMPOSITION_TRANSFORMATION" : {
"generation-options": {
"conditional-card": [
{
"index": 1,
"func": "not self.transformation.empty and self.transformation['type'].iloc[-1] in ['VEC3', 'C2R', 'S2R', 'MAT']"
}
],
"duplicate-card-group": [
{
"indices": [0, 1],
"overall-name": "transformation"
}
]
}
},
"CONTROL_REFERENCE_CONFIGURAION": {
"type": "multiple",
"generations": [
Expand Down
1 change: 1 addition & 0 deletions doc/changelog/701.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fix: BOUNDARY_PRESCRIBED_MOTION_*_ID option and CONTROL_MPP_DECOMPOSITION_TRANSFORMATION (Issue #696)
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,21 @@
import typing
from ansys.dyna.core.lib.card import Card, Field, Flag
from ansys.dyna.core.lib.config import use_lspp_defaults
from ansys.dyna.core.lib.option_card import OptionCardSet, OptionSpec
from ansys.dyna.core.lib.keyword_base import KeywordBase

class BoundaryPrescribedMotionNode(KeywordBase):
"""DYNA BOUNDARY_PRESCRIBED_MOTION_NODE keyword"""

keyword = "BOUNDARY"
subkeyword = "PRESCRIBED_MOTION_NODE"
option_specs = [
OptionSpec("ID", -2, 1),
]

def __init__(self, **kwargs):
super().__init__(**kwargs)
kwargs["parent"] = self
self._cards = [
Card(
[
Expand Down Expand Up @@ -134,6 +139,30 @@ def __init__(self, **kwargs):
],
lambda: abs(self.dof) in [9, 10, 11] or self.vad==4,
),
OptionCardSet(
option_spec = BoundaryPrescribedMotionNode.option_specs[0],
cards = [
Card(
[
Field(
"id",
int,
0,
10,
kwargs.get("id")
),
Field(
"heading",
str,
10,
70,
kwargs.get("heading")
),
],
),
],
**kwargs
),
]

@property
Expand Down Expand Up @@ -292,3 +321,23 @@ def node2(self) -> int:
def node2(self, value: int) -> None:
self._cards[1].set_value("node2", value)

@property
def id(self) -> typing.Optional[int]:
"""Get or set the ID keyword option
""" # nopep8
return self._cards[2].cards[0].get_value("id")

@id.setter
def id(self, value: int) -> None:
self._cards[2].cards[0].set_value("id", value)

@property
def heading(self) -> typing.Optional[str]:
"""Get or set the Descriptor. We suggest using unique descriptions.
""" # nopep8
return self._cards[2].cards[0].get_value("heading")

@heading.setter
def heading(self, value: str) -> None:
self._cards[2].cards[0].set_value("heading", value)

Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,21 @@
import typing
from ansys.dyna.core.lib.card import Card, Field, Flag
from ansys.dyna.core.lib.config import use_lspp_defaults
from ansys.dyna.core.lib.option_card import OptionCardSet, OptionSpec
from ansys.dyna.core.lib.keyword_base import KeywordBase

class BoundaryPrescribedMotionRigid(KeywordBase):
"""DYNA BOUNDARY_PRESCRIBED_MOTION_RIGID keyword"""

keyword = "BOUNDARY"
subkeyword = "PRESCRIBED_MOTION_RIGID"
option_specs = [
OptionSpec("ID", -2, 1),
]

def __init__(self, **kwargs):
super().__init__(**kwargs)
kwargs["parent"] = self
self._cards = [
Card(
[
Expand Down Expand Up @@ -134,6 +139,30 @@ def __init__(self, **kwargs):
],
lambda: abs(self.dof) in [9, 10, 11] or self.vad==4,
),
OptionCardSet(
option_spec = BoundaryPrescribedMotionRigid.option_specs[0],
cards = [
Card(
[
Field(
"id",
int,
0,
10,
kwargs.get("id")
),
Field(
"heading",
str,
10,
70,
kwargs.get("heading")
),
],
),
],
**kwargs
),
]

@property
Expand Down Expand Up @@ -292,3 +321,23 @@ def node2(self) -> int:
def node2(self, value: int) -> None:
self._cards[1].set_value("node2", value)

@property
def id(self) -> typing.Optional[int]:
"""Get or set the ID keyword option
""" # nopep8
return self._cards[2].cards[0].get_value("id")

@id.setter
def id(self, value: int) -> None:
self._cards[2].cards[0].set_value("id", value)

@property
def heading(self) -> typing.Optional[str]:
"""Get or set the Descriptor. We suggest using unique descriptions.
""" # nopep8
return self._cards[2].cards[0].get_value("heading")

@heading.setter
def heading(self, value: str) -> None:
self._cards[2].cards[0].set_value("heading", value)

Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,21 @@
import typing
from ansys.dyna.core.lib.card import Card, Field, Flag
from ansys.dyna.core.lib.config import use_lspp_defaults
from ansys.dyna.core.lib.option_card import OptionCardSet, OptionSpec
from ansys.dyna.core.lib.keyword_base import KeywordBase

class BoundaryPrescribedMotionRigidBndout2Dynain(KeywordBase):
"""DYNA BOUNDARY_PRESCRIBED_MOTION_RIGID_BNDOUT2DYNAIN keyword"""

keyword = "BOUNDARY"
subkeyword = "PRESCRIBED_MOTION_RIGID_BNDOUT2DYNAIN"
option_specs = [
OptionSpec("ID", -2, 1),
]

def __init__(self, **kwargs):
super().__init__(**kwargs)
kwargs["parent"] = self
self._cards = [
Card(
[
Expand Down Expand Up @@ -145,6 +150,30 @@ def __init__(self, **kwargs):
),
],
),
OptionCardSet(
option_spec = BoundaryPrescribedMotionRigidBndout2Dynain.option_specs[0],
cards = [
Card(
[
Field(
"id",
int,
0,
10,
kwargs.get("id")
),
Field(
"heading",
str,
10,
70,
kwargs.get("heading")
),
],
),
],
**kwargs
),
]

@property
Expand Down Expand Up @@ -317,3 +346,23 @@ def prmr(self) -> typing.Optional[str]:
def prmr(self, value: str) -> None:
self._cards[2].set_value("prmr", value)

@property
def id(self) -> typing.Optional[int]:
"""Get or set the ID keyword option
""" # nopep8
return self._cards[3].cards[0].get_value("id")

@id.setter
def id(self, value: int) -> None:
self._cards[3].cards[0].set_value("id", value)

@property
def heading(self) -> typing.Optional[str]:
"""Get or set the Descriptor. We suggest using unique descriptions.
""" # nopep8
return self._cards[3].cards[0].get_value("heading")

@heading.setter
def heading(self, value: str) -> None:
self._cards[3].cards[0].set_value("heading", value)

Loading
Loading