diff --git a/codegen/generate.py b/codegen/generate.py index 40a13d84b..e27ca1a68 100644 --- a/codegen/generate.py +++ b/codegen/generate.py @@ -100,12 +100,17 @@ class Insertion: card: typing.Dict = None -def get_card(source: str, identity: str): - if source != "additional-cards": - # TODO - allow getting option from elsewhere, like a given keywords/card index - # or a new location entirely - raise Exception() - return ADDITIONAL_CARDS[identity] +def get_card(setting: typing.Dict[str, str]): + source = setting["source"] + if source == "kwd-data": + data = KWDM_INSTANCE.get_keyword_data_dict(setting["keyword-name"]) + card = data[setting["card-index"]] + return card + + if source == "additional-cards": + return ADDITIONAL_CARDS[setting["card-name"]] + + raise Exception() def get_classname(keyword: str): @@ -190,7 +195,7 @@ def handle_card_sets(kwd_data, settings): def handle_replace_cards(kwd_data, settings): for card_settings in settings: index = card_settings["index"] - replacement = get_card(card_settings["card"]["source"], card_settings["card"]["card-name"]) + replacement = get_card(card_settings["card"]) replacement["index"] = index kwd_data["cards"][index] = replacement @@ -198,7 +203,7 @@ def handle_replace_cards(kwd_data, settings): def handle_insert_cards(kwd_data, settings): for card_settings in settings: index = card_settings["index"] - card = get_card(card_settings["card"]["source"], card_settings["card"]["card-name"]) + card = get_card(card_settings["card"]) insertion = Insertion(index, "", card) kwd_data["card_insertions"].append(insertion) @@ -280,6 +285,8 @@ def handle_override_field(kwd_data, settings): field["default"] = setting["default"] if "options" in setting: field["options"] = setting["options"] + if "new-name" in setting: + field["name"] = setting["new-name"] def handle_rename_property(kwd_data, settings): for setting in settings: @@ -311,7 +318,7 @@ def handle_override_subkeyword(kwd_data, settings) -> None: def handle_add_option(kwd_data, settings): def expand(card): - card = get_card(card["source"], card["card-name"]) + card = get_card(card) if "active" in card: card["func"] = card["active"] return card @@ -672,7 +679,10 @@ def get_loader(): def match_wildcard(keyword, wildcard): assert wildcard["type"] == "prefix" + exclusions = set(wildcard.get("exclusions", [])) for pattern in wildcard["patterns"]: + if keyword in exclusions: + continue if keyword.startswith(f"{pattern}"): return True return False diff --git a/codegen/manifest.json b/codegen/manifest.json index 449cfc3c6..7f596e77d 100644 --- a/codegen/manifest.json +++ b/codegen/manifest.json @@ -19,6 +19,19 @@ ] } }, + { + "type": "prefix", + "patterns": ["BOUNDARY_PRESCRIBED_MOTION"], + "exclusions": ["BOUNDARY_PRESCRIBED_MOTION_SET_SEGMENT"], + "generation-options": { + "conditional-card": [ + { + "index": 1, + "func": "abs(self.dof) in [9, 10, 11] or self.vad==4" + } + ] + } + }, { "type": "prefix", "patterns": ["CONSTRAINED_NODAL_RIGID_BODY"], @@ -95,6 +108,33 @@ } } ], + "CONSTRAINED_BEAM_IN_SOLID": { + "generation-options": { + "add-option": [ + { + "card-order": 1, + "title-order": 0, + "cards": [ + { + "source": "kwd-data", + "keyword-name": "CONSTRAINED_BEAM_IN_SOLID", + "card-index": 0 + } + ], + "option-name": "ID" + } + ], + "skip-card": 0, + "override-field": [ + { + "index": 1, + "name": "ncoup ", + "new-name": "ncoup" + } + ] + }, + "comment": "TODO - the option name is either ID or TITLE, but there is no way in pydyna to have a union option" + }, "DEFINE_TRANSFORMATION": { "generation-options": { "duplicate-card": [ diff --git a/doc/changelog/668.fixed.md b/doc/changelog/668.fixed.md new file mode 100644 index 000000000..8ac3e0a2b --- /dev/null +++ b/doc/changelog/668.fixed.md @@ -0,0 +1 @@ +fix: Fix BOUNDARY_PRESCRIBED_MOTION and CONSTRAINED_BEAM_IN_SOLID \ No newline at end of file diff --git a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion.py b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion.py index 48f9a41d7..c80ca6c99 100644 --- a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion.py +++ b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion.py @@ -132,6 +132,7 @@ def __init__(self, **kwargs): kwargs.get("node2", 0 if use_lspp_defaults() else None) ), ], + lambda: abs(self.dof) in [9, 10, 11] or self.vad==4, ), ] diff --git a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_edge_uvw.py b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_edge_uvw.py index 62230edee..e85d4ca53 100644 --- a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_edge_uvw.py +++ b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_edge_uvw.py @@ -132,6 +132,7 @@ def __init__(self, **kwargs): kwargs.get("node2", 0 if use_lspp_defaults() else None) ), ], + lambda: abs(self.dof) in [9, 10, 11] or self.vad==4, ), Card( [ diff --git a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_face_xyz.py b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_face_xyz.py index 1840e0d88..406ba19a0 100644 --- a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_face_xyz.py +++ b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_face_xyz.py @@ -132,6 +132,7 @@ def __init__(self, **kwargs): kwargs.get("node2", 0 if use_lspp_defaults() else None) ), ], + lambda: abs(self.dof) in [9, 10, 11] or self.vad==4, ), Card( [ diff --git a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_node.py b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_node.py index fdae60475..d39015b02 100644 --- a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_node.py +++ b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_node.py @@ -132,6 +132,7 @@ def __init__(self, **kwargs): kwargs.get("node2", 0 if use_lspp_defaults() else None) ), ], + lambda: abs(self.dof) in [9, 10, 11] or self.vad==4, ), ] diff --git a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_point_uvw.py b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_point_uvw.py index 9e4f1412b..f5204fe45 100644 --- a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_point_uvw.py +++ b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_point_uvw.py @@ -132,6 +132,7 @@ def __init__(self, **kwargs): kwargs.get("node2", 0 if use_lspp_defaults() else None) ), ], + lambda: abs(self.dof) in [9, 10, 11] or self.vad==4, ), Card( [ diff --git a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_rigid.py b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_rigid.py index 6b198473f..37e4287bd 100644 --- a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_rigid.py +++ b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_rigid.py @@ -132,6 +132,7 @@ def __init__(self, **kwargs): kwargs.get("node2", 0 if use_lspp_defaults() else None) ), ], + lambda: abs(self.dof) in [9, 10, 11] or self.vad==4, ), ] diff --git a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_rigid_bndout2dynain.py b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_rigid_bndout2dynain.py index ba944b0a1..1b6818b6d 100644 --- a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_rigid_bndout2dynain.py +++ b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_rigid_bndout2dynain.py @@ -132,6 +132,7 @@ def __init__(self, **kwargs): kwargs.get("node2", 0 if use_lspp_defaults() else None) ), ], + lambda: abs(self.dof) in [9, 10, 11] or self.vad==4, ), Card( [ diff --git a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_rigid_local.py b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_rigid_local.py index abd21663e..1a350d53e 100644 --- a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_rigid_local.py +++ b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_rigid_local.py @@ -132,6 +132,7 @@ def __init__(self, **kwargs): kwargs.get("node2", 0 if use_lspp_defaults() else None) ), ], + lambda: abs(self.dof) in [9, 10, 11] or self.vad==4, ), ] diff --git a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_rigid_local_bndout2dynain.py b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_rigid_local_bndout2dynain.py index 86ad06db2..0042ac281 100644 --- a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_rigid_local_bndout2dynain.py +++ b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_rigid_local_bndout2dynain.py @@ -132,6 +132,7 @@ def __init__(self, **kwargs): kwargs.get("node2", 0 if use_lspp_defaults() else None) ), ], + lambda: abs(self.dof) in [9, 10, 11] or self.vad==4, ), Card( [ diff --git a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_set.py b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_set.py index ad57928d1..110841957 100644 --- a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_set.py +++ b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_set.py @@ -132,6 +132,7 @@ def __init__(self, **kwargs): kwargs.get("node2", 0 if use_lspp_defaults() else None) ), ], + lambda: abs(self.dof) in [9, 10, 11] or self.vad==4, ), ] diff --git a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_set_box.py b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_set_box.py index ee6cafb69..1dc1f147b 100644 --- a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_set_box.py +++ b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_set_box.py @@ -118,6 +118,7 @@ def __init__(self, **kwargs): kwargs.get("lcbchk", 0 if use_lspp_defaults() else None) ), ], + lambda: abs(self.dof) in [9, 10, 11] or self.vad==4, ), Card( [ diff --git a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_set_edge_uvw.py b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_set_edge_uvw.py index 8c710a829..48ec5168f 100644 --- a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_set_edge_uvw.py +++ b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_set_edge_uvw.py @@ -132,6 +132,7 @@ def __init__(self, **kwargs): kwargs.get("node2", 0 if use_lspp_defaults() else None) ), ], + lambda: abs(self.dof) in [9, 10, 11] or self.vad==4, ), Card( [ diff --git a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_set_face_xyz.py b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_set_face_xyz.py index 4a33cc6a9..2ef63e2f5 100644 --- a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_set_face_xyz.py +++ b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_set_face_xyz.py @@ -132,6 +132,7 @@ def __init__(self, **kwargs): kwargs.get("node2", 0 if use_lspp_defaults() else None) ), ], + lambda: abs(self.dof) in [9, 10, 11] or self.vad==4, ), Card( [ diff --git a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_set_line.py b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_set_line.py index 170c81c5d..6d8cf03a6 100644 --- a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_set_line.py +++ b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_set_line.py @@ -132,6 +132,7 @@ def __init__(self, **kwargs): kwargs.get("node2", 0 if use_lspp_defaults() else None) ), ], + lambda: abs(self.dof) in [9, 10, 11] or self.vad==4, ), Card( [ diff --git a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_set_point_uvw.py b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_set_point_uvw.py index e3a4c4a67..69298fc73 100644 --- a/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_set_point_uvw.py +++ b/src/ansys/dyna/core/keywords/keyword_classes/auto/boundary_prescribed_motion_set_point_uvw.py @@ -132,6 +132,7 @@ def __init__(self, **kwargs): kwargs.get("node2", 0 if use_lspp_defaults() else None) ), ], + lambda: abs(self.dof) in [9, 10, 11] or self.vad==4, ), Card( [ diff --git a/src/ansys/dyna/core/keywords/keyword_classes/auto/constrained_beam_in_solid.py b/src/ansys/dyna/core/keywords/keyword_classes/auto/constrained_beam_in_solid.py index 9d3921e51..ec70b7d42 100644 --- a/src/ansys/dyna/core/keywords/keyword_classes/auto/constrained_beam_in_solid.py +++ b/src/ansys/dyna/core/keywords/keyword_classes/auto/constrained_beam_in_solid.py @@ -23,6 +23,7 @@ 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 ConstrainedBeamInSolid(KeywordBase): @@ -30,28 +31,14 @@ class ConstrainedBeamInSolid(KeywordBase): keyword = "CONSTRAINED" subkeyword = "BEAM_IN_SOLID" + option_specs = [ + OptionSpec("ID", 1, 0), + ] def __init__(self, **kwargs): super().__init__(**kwargs) + kwargs["parent"] = self self._cards = [ - Card( - [ - Field( - "coupid", - int, - 0, - 10, - kwargs.get("coupid") - ), - Field( - "title", - str, - 10, - 70, - kwargs.get("title") - ), - ], - ), Card( [ Field( @@ -97,11 +84,11 @@ def __init__(self, **kwargs): kwargs.get("unused") ), Field( - "ncoup ", + "ncoup", int, 60, 10, - kwargs.get("ncoup ") + kwargs.get("ncoup") ), Field( "cdir", @@ -172,47 +159,51 @@ def __init__(self, **kwargs): ), ], ), + OptionCardSet( + option_spec = ConstrainedBeamInSolid.option_specs[0], + cards = [ + Card( + [ + Field( + "coupid", + int, + 0, + 10, + kwargs.get("coupid") + ), + Field( + "title", + str, + 10, + 70, + kwargs.get("title") + ), + ], + ), + ], + **kwargs + ), ] - @property - def coupid(self) -> typing.Optional[int]: - """Get or set the Coupling card ID number - """ # nopep8 - return self._cards[0].get_value("coupid") - - @coupid.setter - def coupid(self, value: int) -> None: - self._cards[0].set_value("coupid", value) - - @property - def title(self) -> typing.Optional[str]: - """Get or set the A description of this coupling definition - """ # nopep8 - return self._cards[0].get_value("title") - - @title.setter - def title(self, value: str) -> None: - self._cards[0].set_value("title", value) - @property def bside(self) -> typing.Optional[int]: """Get or set the Part or part set ID of the Lagrangian beam structure(see *PART,* SET_PART) """ # nopep8 - return self._cards[1].get_value("bside") + return self._cards[0].get_value("bside") @bside.setter def bside(self, value: int) -> None: - self._cards[1].set_value("bside", value) + self._cards[0].set_value("bside", value) @property def ssid(self) -> typing.Optional[int]: """Get or set the Part or part set ID of the Lagrangian solid elements or thick shell element(see *PART,* SET_PART) """ # nopep8 - return self._cards[1].get_value("ssid") + return self._cards[0].get_value("ssid") @ssid.setter def ssid(self, value: int) -> None: - self._cards[1].set_value("ssid", value) + self._cards[0].set_value("ssid", value) @property def bstyp(self) -> int: @@ -220,13 +211,13 @@ def bstyp(self) -> int: EQ.0: part set ID (PSID). EQ.1: part ID (PID). """ # nopep8 - return self._cards[1].get_value("bstyp") + return self._cards[0].get_value("bstyp") @bstyp.setter def bstyp(self, value: int) -> None: if value not in [0, 1]: raise Exception("""bstyp must be one of {0,1}""") - self._cards[1].set_value("bstyp", value) + self._cards[0].set_value("bstyp", value) @property def sstyp(self) -> int: @@ -234,23 +225,23 @@ def sstyp(self) -> int: EQ.0: part set ID (PSID). EQ.1: part ID (PID). """ # nopep8 - return self._cards[1].get_value("sstyp") + return self._cards[0].get_value("sstyp") @sstyp.setter def sstyp(self, value: int) -> None: if value not in [0, 1]: raise Exception("""sstyp must be one of {0,1}""") - self._cards[1].set_value("sstyp", value) + self._cards[0].set_value("sstyp", value) @property - def ncoup_(self) -> typing.Optional[int]: + def ncoup(self) -> typing.Optional[int]: """Get or set the Number of coupling points generated in one beam element. If set to 0, coupling only happens at beam nodes. Otherwise, coupling is done at both the beam nodes and those automatically generated coupling points """ # nopep8 - return self._cards[1].get_value("ncoup ") + return self._cards[0].get_value("ncoup") - @ncoup_.setter - def ncoup_(self, value: int) -> None: - self._cards[1].set_value("ncoup ", value) + @ncoup.setter + def ncoup(self, value: int) -> None: + self._cards[0].set_value("ncoup", value) @property def cdir(self) -> typing.Optional[int]: @@ -258,11 +249,11 @@ def cdir(self) -> typing.Optional[int]: EQ.0: default, constraint applied along all directions. EQ.1: Constraint only applied along normal directions; along the beam axial direction there is no constraint """ # nopep8 - return self._cards[1].get_value("cdir") + return self._cards[0].get_value("cdir") @cdir.setter def cdir(self, value: int) -> None: - self._cards[1].set_value("cdir", value) + self._cards[0].set_value("cdir", value) @property def start(self) -> float: @@ -270,11 +261,11 @@ def start(self) -> float: LT.0: Start time is set to |START|. When negative, start time is followed during the dynamic relaxation phase of the calculation. After dynamic relaxation has completed, coupling is activated regardless of the value of END.EQ.0: Start time is inactive, meaning coupling is always active GT.0 : If END = -9999, START is interpreted as the curve or table ID defining multiple pairs of start - time and end - time.Otherwise, if END > 0, start time applies both duringand after dynamic relaxation. """ # nopep8 - return self._cards[2].get_value("start") + return self._cards[1].get_value("start") @start.setter def start(self, value: float) -> None: - self._cards[2].set_value("start", value) + self._cards[1].set_value("start", value) @property def end(self) -> float: @@ -282,11 +273,11 @@ def end(self) -> float: LT.0: If END = -9999, START is interpreted as the curve or table ID defining multiple pairs of start-time and end-time. Otherwise, negative END indicates that coupling is inactive during dynamic relaxation. After dynamic relaxation the start and end times are followed and set to |START| and |END|, respectively.EQ.0: END defaults to 1020. GT.0 : END sets the time at which the coupling is deactivated. """ # nopep8 - return self._cards[2].get_value("end") + return self._cards[1].get_value("end") @end.setter def end(self, value: float) -> None: - self._cards[2].set_value("end", value) + self._cards[1].set_value("end", value) @property def axfor_(self) -> typing.Optional[int]: @@ -294,21 +285,21 @@ def axfor_(self) -> typing.Optional[int]: GE.0: OFF EQ.-n: n is the function ID in *DEFINE_FUNCTION """ # nopep8 - return self._cards[2].get_value("axfor ") + return self._cards[1].get_value("axfor ") @axfor_.setter def axfor_(self, value: int) -> None: - self._cards[2].set_value("axfor ", value) + self._cards[1].set_value("axfor ", value) @property def pssf(self) -> float: """Get or set the Penalty spring stiffness scale factor. Only available in penalty form. """ # nopep8 - return self._cards[2].get_value("pssf") + return self._cards[1].get_value("pssf") @pssf.setter def pssf(self, value: float) -> None: - self._cards[2].set_value("pssf", value) + self._cards[1].set_value("pssf", value) @property def xint(self) -> typing.Optional[int]: @@ -319,9 +310,29 @@ def xint(self) -> typing.Optional[int]: This field can be used together with NCOUP. In that case, in each element, we will take the larger number of coupling points from these two options. """ # nopep8 - return self._cards[2].get_value("xint") + return self._cards[1].get_value("xint") @xint.setter def xint(self, value: int) -> None: - self._cards[2].set_value("xint", value) + self._cards[1].set_value("xint", value) + + @property + def coupid(self) -> typing.Optional[int]: + """Get or set the Coupling card ID number + """ # nopep8 + return self._cards[2].cards[0].get_value("coupid") + + @coupid.setter + def coupid(self, value: int) -> None: + self._cards[2].cards[0].set_value("coupid", value) + + @property + def title(self) -> typing.Optional[str]: + """Get or set the A description of this coupling definition + """ # nopep8 + return self._cards[2].cards[0].get_value("title") + + @title.setter + def title(self, value: str) -> None: + self._cards[2].cards[0].set_value("title", value) diff --git a/tests/test_keywords.py b/tests/test_keywords.py index 6485bc5eb..4bbf2ff78 100644 --- a/tests/test_keywords.py +++ b/tests/test_keywords.py @@ -205,6 +205,18 @@ def test_read_keyword_no_defaults(): assert m.n == None # LSPP default for `n` is 0. +@pytest.mark.keywords +def test_boundary_prescribed_motion_set(ref_string): + b = kwd.BoundaryPrescribedMotionSet() + assert(b.write() == ref_string.test_boundary_prescribed_motion_set) + + +@pytest.mark.keywords +def test_constrained_beam_in_solid(ref_string): + b = kwd.ConstrainedBeamInSolid(ncoup=1) + assert(b.write() == ref_string.test_constrained_beam_in_solid) + + @pytest.mark.keywords def test_hourglass(ref_string): h = kwd.Hourglass() diff --git a/tests/testfiles/keywords/reference_string.py b/tests/testfiles/keywords/reference_string.py index b8f1a9a62..55898875d 100644 --- a/tests/testfiles/keywords/reference_string.py +++ b/tests/testfiles/keywords/reference_string.py @@ -155,6 +155,16 @@ 69000314 13 *END""" +test_boundary_prescribed_motion_set = """*BOUNDARY_PRESCRIBED_MOTION_SET +$# nsid dof vad lcid sf vid death birth + 0 0 1.0 1e+28 0.0""" + +test_constrained_beam_in_solid = """*CONSTRAINED_BEAM_IN_SOLID +$# bside ssid bstyp sstyp unused unused ncoup cdir + 0 0 1 +$# start end unused axfor unused pssf unused xint + 0.0 1e+21 0.1 """ + test_hourglass_title = """*HOURGLASS_TITLE $# title hello