# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

"""Module providing the MatHoneycomb class."""
import typing
from ansys.dyna.core.lib.card import Card, Field, Flag
from ansys.dyna.core.lib.field_schema import FieldSchema
from ansys.dyna.core.lib.option_card import OptionCardSet, OptionSpec
from ansys.dyna.core.lib.keyword_base import KeywordBase
from ansys.dyna.core.lib.keyword_base import LinkType
from ansys.dyna.core.keywords.keyword_classes.auto.define.define_curve import DefineCurve

_MATHONEYCOMB_CARD0 = (
    FieldSchema("mid", int, 0, 10, None),
    FieldSchema("ro", float, 10, 10, None),
    FieldSchema("e", float, 20, 10, None),
    FieldSchema("pr", float, 30, 10, None),
    FieldSchema("sigy", float, 40, 10, None),
    FieldSchema("vf", float, 50, 10, None),
    FieldSchema("mu", float, 60, 10, 0.05),
    FieldSchema("bulk", float, 70, 10, 0.0),
)

_MATHONEYCOMB_CARD1 = (
    FieldSchema("lca", int, 0, 10, None),
    FieldSchema("lcb", int, 10, 10, 0),
    FieldSchema("lcc", int, 20, 10, 0),
    FieldSchema("lcs", int, 30, 10, 0),
    FieldSchema("lcab", int, 40, 10, 0),
    FieldSchema("lcbc", int, 50, 10, 0),
    FieldSchema("lcca", int, 60, 10, 0),
    FieldSchema("lcsr", int, 70, 10, 0),
)

_MATHONEYCOMB_CARD2 = (
    FieldSchema("eaau", float, 0, 10, None),
    FieldSchema("ebbu", float, 10, 10, None),
    FieldSchema("eccu", float, 20, 10, None),
    FieldSchema("gabu", float, 30, 10, None),
    FieldSchema("gbcu", float, 40, 10, None),
    FieldSchema("gcau", float, 50, 10, None),
    FieldSchema("aopt", float, 60, 10, None),
    FieldSchema("macf", int, 70, 10, 1),
)

_MATHONEYCOMB_CARD3 = (
    FieldSchema("xp", float, 0, 10, None),
    FieldSchema("yp", float, 10, 10, None),
    FieldSchema("zp", float, 20, 10, None),
    FieldSchema("a1", float, 30, 10, None),
    FieldSchema("a2", float, 40, 10, None),
    FieldSchema("a3", float, 50, 10, None),
)

_MATHONEYCOMB_CARD4 = (
    FieldSchema("d1", float, 0, 10, None),
    FieldSchema("d2", float, 10, 10, None),
    FieldSchema("d3", float, 20, 10, None),
    FieldSchema("tsef", float, 30, 10, None),
    FieldSchema("ssef", float, 40, 10, None),
    FieldSchema("v1", float, 50, 10, None),
    FieldSchema("v2", float, 60, 10, None),
    FieldSchema("v3", float, 70, 10, None),
)

_MATHONEYCOMB_OPTION0_CARD0 = (
    FieldSchema("title", str, 0, 80, None),
)

class MatHoneycomb(KeywordBase):
    """DYNA MAT_HONEYCOMB keyword"""

    keyword = "MAT"
    subkeyword = "HONEYCOMB"
    option_specs = [
        OptionSpec("TITLE", -1, 1),
    ]
    _link_fields = {
        "lca": LinkType.DEFINE_CURVE,
        "lcb": LinkType.DEFINE_CURVE,
        "lcc": LinkType.DEFINE_CURVE,
        "lcs": LinkType.DEFINE_CURVE,
        "lcab": LinkType.DEFINE_CURVE,
        "lcbc": LinkType.DEFINE_CURVE,
        "lcca": LinkType.DEFINE_CURVE,
        "lcsr": LinkType.DEFINE_CURVE,
    }

    def __init__(self, **kwargs):
        """Initialize the MatHoneycomb class."""
        super().__init__(**kwargs)
        kwargs["parent"] = self
        self._cards = [
            Card.from_field_schemas_with_defaults(
                _MATHONEYCOMB_CARD0,
                **kwargs,
            ),            Card.from_field_schemas_with_defaults(
                _MATHONEYCOMB_CARD1,
                **kwargs,
            ),            Card.from_field_schemas_with_defaults(
                _MATHONEYCOMB_CARD2,
                **kwargs,
            ),            Card.from_field_schemas_with_defaults(
                _MATHONEYCOMB_CARD3,
                **kwargs,
            ),            Card.from_field_schemas_with_defaults(
                _MATHONEYCOMB_CARD4,
                **kwargs,
            ),            OptionCardSet(
                option_spec = MatHoneycomb.option_specs[0],
                cards = [
                    Card.from_field_schemas_with_defaults(
                        _MATHONEYCOMB_OPTION0_CARD0,
                        **kwargs,
                    ),
                ],
                **kwargs
            ),
        ]
    @property
    def mid(self) -> typing.Optional[int]:
        """Get or set the Material identification. A unique number has to be used.
        """ # nopep8
        return self._cards[0].get_value("mid")

    @mid.setter
    def mid(self, value: int) -> None:
        """Set the mid property."""
        self._cards[0].set_value("mid", value)

    @property
    def ro(self) -> typing.Optional[float]:
        """Get or set the Mass density.
        """ # nopep8
        return self._cards[0].get_value("ro")

    @ro.setter
    def ro(self, value: float) -> None:
        """Set the ro property."""
        self._cards[0].set_value("ro", value)

    @property
    def e(self) -> typing.Optional[float]:
        """Get or set the Young's modulus for compacted honeycomb material.
        """ # nopep8
        return self._cards[0].get_value("e")

    @e.setter
    def e(self, value: float) -> None:
        """Set the e property."""
        self._cards[0].set_value("e", value)

    @property
    def pr(self) -> typing.Optional[float]:
        """Get or set the Poisson's ratio for compacted honeycomb material.
        """ # nopep8
        return self._cards[0].get_value("pr")

    @pr.setter
    def pr(self, value: float) -> None:
        """Set the pr property."""
        self._cards[0].set_value("pr", value)

    @property
    def sigy(self) -> typing.Optional[float]:
        """Get or set the Yield stress for fully compacted honeycomb.
        """ # nopep8
        return self._cards[0].get_value("sigy")

    @sigy.setter
    def sigy(self, value: float) -> None:
        """Set the sigy property."""
        self._cards[0].set_value("sigy", value)

    @property
    def vf(self) -> typing.Optional[float]:
        """Get or set the Relative volume at which the honeycomb is fully compacted.
        """ # nopep8
        return self._cards[0].get_value("vf")

    @vf.setter
    def vf(self, value: float) -> None:
        """Set the vf property."""
        self._cards[0].set_value("vf", value)

    @property
    def mu(self) -> float:
        """Get or set the Material viscosity coefficient (default=.05) Recommended.
        """ # nopep8
        return self._cards[0].get_value("mu")

    @mu.setter
    def mu(self, value: float) -> None:
        """Set the mu property."""
        self._cards[0].set_value("mu", value)

    @property
    def bulk(self) -> float:
        """Get or set the Bulk viscosity flag:
        EQ.0.0: bulk viscosity is not used. This is recommended.
        EQ.1.0: bulk viscosity is active and MU=0. This will give results identical to previous versions of LS-DYNA.
        """ # nopep8
        return self._cards[0].get_value("bulk")

    @bulk.setter
    def bulk(self, value: float) -> None:
        """Set the bulk property."""
        if value not in [0.0, 1.0, None]:
            raise Exception("""bulk must be `None` or one of {0.0,1.0}.""")
        self._cards[0].set_value("bulk", value)

    @property
    def lca(self) -> typing.Optional[int]:
        """Get or set the Load curve ID, see *DEFINE_CURVE, for sigma-aa versus either relative volume or volumetric strain.
        """ # nopep8
        return self._cards[1].get_value("lca")

    @lca.setter
    def lca(self, value: int) -> None:
        """Set the lca property."""
        self._cards[1].set_value("lca", value)

    @property
    def lcb(self) -> int:
        """Get or set the Load curve ID, see *DEFINE_CURVE, for sigma-bb versus either relative volume or volumetric strain (default LCB=LCA).
        """ # nopep8
        return self._cards[1].get_value("lcb")

    @lcb.setter
    def lcb(self, value: int) -> None:
        """Set the lcb property."""
        self._cards[1].set_value("lcb", value)

    @property
    def lcc(self) -> int:
        """Get or set the Load curve ID, see *DEFINE_CURVE, for sigma-bb versus either relative volume or volumetric strain (default LCC=LCA).
        """ # nopep8
        return self._cards[1].get_value("lcc")

    @lcc.setter
    def lcc(self, value: int) -> None:
        """Set the lcc property."""
        self._cards[1].set_value("lcc", value)

    @property
    def lcs(self) -> int:
        """Get or set the Load curve ID, see *DEFINE_CURVE, for shear stress versus either relative volume or volumetric strain (default LCS=LCA).
        """ # nopep8
        return self._cards[1].get_value("lcs")

    @lcs.setter
    def lcs(self, value: int) -> None:
        """Set the lcs property."""
        self._cards[1].set_value("lcs", value)

    @property
    def lcab(self) -> int:
        """Get or set the Load curve ID, see *DEFINE_CURVE, for sigma-ab versus either relative volume or volumetric strain (default LCAB=LCS).
        """ # nopep8
        return self._cards[1].get_value("lcab")

    @lcab.setter
    def lcab(self, value: int) -> None:
        """Set the lcab property."""
        self._cards[1].set_value("lcab", value)

    @property
    def lcbc(self) -> int:
        """Get or set the Load curve ID, see *DEFINE_CURVE, for sigma-bc versus either relative volume or volumetric strain (default LCBC=LCS).
        """ # nopep8
        return self._cards[1].get_value("lcbc")

    @lcbc.setter
    def lcbc(self, value: int) -> None:
        """Set the lcbc property."""
        self._cards[1].set_value("lcbc", value)

    @property
    def lcca(self) -> int:
        """Get or set the Load curve ID, see *DEFINE_CURVE, or sigma-ca versus either relative volume or volumetric strain (default LCCA=LCS).
        """ # nopep8
        return self._cards[1].get_value("lcca")

    @lcca.setter
    def lcca(self, value: int) -> None:
        """Set the lcca property."""
        self._cards[1].set_value("lcca", value)

    @property
    def lcsr(self) -> int:
        """Get or set the Load curve ID, see *DEFINE_CURVE, for strain-rate effects defining the scale factor versus strain rate (optional).
        """ # nopep8
        return self._cards[1].get_value("lcsr")

    @lcsr.setter
    def lcsr(self, value: int) -> None:
        """Set the lcsr property."""
        self._cards[1].set_value("lcsr", value)

    @property
    def eaau(self) -> typing.Optional[float]:
        """Get or set the Elastic modulus Eaau in uncompressed configuration.
        """ # nopep8
        return self._cards[2].get_value("eaau")

    @eaau.setter
    def eaau(self, value: float) -> None:
        """Set the eaau property."""
        self._cards[2].set_value("eaau", value)

    @property
    def ebbu(self) -> typing.Optional[float]:
        """Get or set the Elastic modulus Ebbu in uncompressed configuration.
        """ # nopep8
        return self._cards[2].get_value("ebbu")

    @ebbu.setter
    def ebbu(self, value: float) -> None:
        """Set the ebbu property."""
        self._cards[2].set_value("ebbu", value)

    @property
    def eccu(self) -> typing.Optional[float]:
        """Get or set the Elastic modulus Eccu in uncompressed configuration.
        """ # nopep8
        return self._cards[2].get_value("eccu")

    @eccu.setter
    def eccu(self, value: float) -> None:
        """Set the eccu property."""
        self._cards[2].set_value("eccu", value)

    @property
    def gabu(self) -> typing.Optional[float]:
        """Get or set the Shear modulus Gabu in uncompressed configuration.
        """ # nopep8
        return self._cards[2].get_value("gabu")

    @gabu.setter
    def gabu(self, value: float) -> None:
        """Set the gabu property."""
        self._cards[2].set_value("gabu", value)

    @property
    def gbcu(self) -> typing.Optional[float]:
        """Get or set the Shear modulus Gbcu in uncompressed configuration.
        """ # nopep8
        return self._cards[2].get_value("gbcu")

    @gbcu.setter
    def gbcu(self, value: float) -> None:
        """Set the gbcu property."""
        self._cards[2].set_value("gbcu", value)

    @property
    def gcau(self) -> typing.Optional[float]:
        """Get or set the Shear modulus Gcau in uncompressed configuration.
        """ # nopep8
        return self._cards[2].get_value("gcau")

    @gcau.setter
    def gcau(self, value: float) -> None:
        """Set the gcau property."""
        self._cards[2].set_value("gcau", value)

    @property
    def aopt(self) -> typing.Optional[float]:
        """Get or set the Material axes option (see MAT_OPTIONTROPIC_ELASTIC, particularly the Material Directions section, for details):
        EQ.0.0:	Locally orthotropic with material axes determined by element nodes 1, 2,and 4, as with* DEFINE_COORDINATE_NODES.For shells only, the material axes are then rotated about the normal vector to the surface of the shell by the angle BETA.
        EQ.1.0 : Locally orthotropic with material axes determined by a point, P, in spaceand the global location of the element center; this is the a - direction.This option is for solid elements only.
        EQ.2.0:	Globally orthotropic with material axes determined by vectors defined below, as with* DEFINE_COORDINATE_VECTOR
        EQ.3.0 : Locally orthotropic material axes determined by a vector v and the normal vector to the plane of the element.The plane of a solid element is the midsurface between the inner surface and outer surface defined by the first four nodes and the last four nodes of the connectivity of the element, respectively.Thus, for solid elements, AOPT = 3 is only available for hexahedrons.a is determined by taking the cross product of v with the normal vector, b is determined by taking the cross product of the normal vector with a,and c is the normal vector.Then aand b are rotated about c by an angle BETA.BETA may be set in the keyword input for the element or in the input for this keyword.Note that for solids, the material axes may be switched depending on the choice of MACF.The switch may occur before or after applying BETA depending on the value of MACF.
        EQ.4.0 : Locally orthotropic in a cylindrical coordinate system with the material axes determined by a vector v,and an originating point, P, which define the centerline axis.This option is for solid elements only.
        LT.0.0 : The absolute value of AOPT is a coordinate system ID number(CID on * DEFINE_COORDINATE_OPTION).
        """ # nopep8
        return self._cards[2].get_value("aopt")

    @aopt.setter
    def aopt(self, value: float) -> None:
        """Set the aopt property."""
        self._cards[2].set_value("aopt", value)

    @property
    def macf(self) -> int:
        """Get or set the Material axes change flag for solid elements:
        EQ.1 : No change, default
        EQ.2 : Switch material axes a and b after BETA rotation
        EQ.3 : Switch material axes a and c after BETA rotation
        EQ.4 : Switch material axes b and c after BETA rotation
        EQ. - 4 : Switch material axes b and c before BETA rotation
        EQ. - 3 : Switch material axes a and c before BETA rotation
        EQ. - 2 : Switch material axes a and b before BETA rotation
        Figure Error!Reference source not found.indicates when LS - DYNA applies MACF during the process to obtain the final material axes.If BETA on * ELEMENT_SOLID_{OPTION} is defined, then that BETA is used for the rotation for all AOPT options.Otherwise, if AOPT = 3, the BETA input on Card 3 rotates the axes.For all other values of AOPT, the material axes will be switched as specified by MACF, but no BETA rotation will be performed.
        """ # nopep8
        return self._cards[2].get_value("macf")

    @macf.setter
    def macf(self, value: int) -> None:
        """Set the macf property."""
        if value not in [1, 2, 3, 4, -4, -3, -2, None]:
            raise Exception("""macf must be `None` or one of {1,2,3,4,-4,-3,-2}.""")
        self._cards[2].set_value("macf", value)

    @property
    def xp(self) -> typing.Optional[float]:
        """Get or set the x-coordinates of point p for AOPT = 1.
        """ # nopep8
        return self._cards[3].get_value("xp")

    @xp.setter
    def xp(self, value: float) -> None:
        """Set the xp property."""
        self._cards[3].set_value("xp", value)

    @property
    def yp(self) -> typing.Optional[float]:
        """Get or set the y-coordinates of point p for AOPT = 1.
        """ # nopep8
        return self._cards[3].get_value("yp")

    @yp.setter
    def yp(self, value: float) -> None:
        """Set the yp property."""
        self._cards[3].set_value("yp", value)

    @property
    def zp(self) -> typing.Optional[float]:
        """Get or set the z-coordinates of point p for AOPT = 1.
        """ # nopep8
        return self._cards[3].get_value("zp")

    @zp.setter
    def zp(self, value: float) -> None:
        """Set the zp property."""
        self._cards[3].set_value("zp", value)

    @property
    def a1(self) -> typing.Optional[float]:
        """Get or set the Component of vector a for AOPT = 2.
        """ # nopep8
        return self._cards[3].get_value("a1")

    @a1.setter
    def a1(self, value: float) -> None:
        """Set the a1 property."""
        self._cards[3].set_value("a1", value)

    @property
    def a2(self) -> typing.Optional[float]:
        """Get or set the Component of vector a for AOPT = 2.
        """ # nopep8
        return self._cards[3].get_value("a2")

    @a2.setter
    def a2(self, value: float) -> None:
        """Set the a2 property."""
        self._cards[3].set_value("a2", value)

    @property
    def a3(self) -> typing.Optional[float]:
        """Get or set the Component of vector a for AOPT = 2.
        """ # nopep8
        return self._cards[3].get_value("a3")

    @a3.setter
    def a3(self, value: float) -> None:
        """Set the a3 property."""
        self._cards[3].set_value("a3", value)

    @property
    def d1(self) -> typing.Optional[float]:
        """Get or set the Component of vector d for AOPT = 2.
        """ # nopep8
        return self._cards[4].get_value("d1")

    @d1.setter
    def d1(self, value: float) -> None:
        """Set the d1 property."""
        self._cards[4].set_value("d1", value)

    @property
    def d2(self) -> typing.Optional[float]:
        """Get or set the Component of vector d for AOPT = 2.
        """ # nopep8
        return self._cards[4].get_value("d2")

    @d2.setter
    def d2(self, value: float) -> None:
        """Set the d2 property."""
        self._cards[4].set_value("d2", value)

    @property
    def d3(self) -> typing.Optional[float]:
        """Get or set the Component of vector d for AOPT = 2.
        """ # nopep8
        return self._cards[4].get_value("d3")

    @d3.setter
    def d3(self, value: float) -> None:
        """Set the d3 property."""
        self._cards[4].set_value("d3", value)

    @property
    def tsef(self) -> typing.Optional[float]:
        """Get or set the Tensile strain at element failure (element will erode).
        """ # nopep8
        return self._cards[4].get_value("tsef")

    @tsef.setter
    def tsef(self, value: float) -> None:
        """Set the tsef property."""
        self._cards[4].set_value("tsef", value)

    @property
    def ssef(self) -> typing.Optional[float]:
        """Get or set the Shear strain at element failure (element will erode).
        """ # nopep8
        return self._cards[4].get_value("ssef")

    @ssef.setter
    def ssef(self, value: float) -> None:
        """Set the ssef property."""
        self._cards[4].set_value("ssef", value)

    @property
    def v1(self) -> typing.Optional[float]:
        """Get or set the Define components of vector v for AOPT = 3 and 4
        """ # nopep8
        return self._cards[4].get_value("v1")

    @v1.setter
    def v1(self, value: float) -> None:
        """Set the v1 property."""
        self._cards[4].set_value("v1", value)

    @property
    def v2(self) -> typing.Optional[float]:
        """Get or set the Define components of vector v for AOPT = 3 and 4
        """ # nopep8
        return self._cards[4].get_value("v2")

    @v2.setter
    def v2(self, value: float) -> None:
        """Set the v2 property."""
        self._cards[4].set_value("v2", value)

    @property
    def v3(self) -> typing.Optional[float]:
        """Get or set the Define components of vector v for AOPT = 3 and 4
        """ # nopep8
        return self._cards[4].get_value("v3")

    @v3.setter
    def v3(self, value: float) -> None:
        """Set the v3 property."""
        self._cards[4].set_value("v3", value)

    @property
    def title(self) -> typing.Optional[str]:
        """Get or set the Additional title line
        """ # nopep8
        return self._cards[5].cards[0].get_value("title")

    @title.setter
    def title(self, value: str) -> None:
        """Set the title property."""
        self._cards[5].cards[0].set_value("title", value)

        if value:
            self.activate_option("TITLE")

    @property
    def lca_link(self) -> typing.Optional[DefineCurve]:
        """Get the DefineCurve object for lca."""
        if self.deck is None:
            return None
        for kwd in self.deck.get_kwds_by_full_type("DEFINE", "CURVE"):
            if kwd.lcid == self.lca:
                return kwd
        return None

    @lca_link.setter
    def lca_link(self, value: DefineCurve) -> None:
        """Set the DefineCurve object for lca."""
        self.lca = value.lcid

    @property
    def lcb_link(self) -> typing.Optional[DefineCurve]:
        """Get the DefineCurve object for lcb."""
        if self.deck is None:
            return None
        for kwd in self.deck.get_kwds_by_full_type("DEFINE", "CURVE"):
            if kwd.lcid == self.lcb:
                return kwd
        return None

    @lcb_link.setter
    def lcb_link(self, value: DefineCurve) -> None:
        """Set the DefineCurve object for lcb."""
        self.lcb = value.lcid

    @property
    def lcc_link(self) -> typing.Optional[DefineCurve]:
        """Get the DefineCurve object for lcc."""
        if self.deck is None:
            return None
        for kwd in self.deck.get_kwds_by_full_type("DEFINE", "CURVE"):
            if kwd.lcid == self.lcc:
                return kwd
        return None

    @lcc_link.setter
    def lcc_link(self, value: DefineCurve) -> None:
        """Set the DefineCurve object for lcc."""
        self.lcc = value.lcid

    @property
    def lcs_link(self) -> typing.Optional[DefineCurve]:
        """Get the DefineCurve object for lcs."""
        if self.deck is None:
            return None
        for kwd in self.deck.get_kwds_by_full_type("DEFINE", "CURVE"):
            if kwd.lcid == self.lcs:
                return kwd
        return None

    @lcs_link.setter
    def lcs_link(self, value: DefineCurve) -> None:
        """Set the DefineCurve object for lcs."""
        self.lcs = value.lcid

    @property
    def lcab_link(self) -> typing.Optional[DefineCurve]:
        """Get the DefineCurve object for lcab."""
        if self.deck is None:
            return None
        for kwd in self.deck.get_kwds_by_full_type("DEFINE", "CURVE"):
            if kwd.lcid == self.lcab:
                return kwd
        return None

    @lcab_link.setter
    def lcab_link(self, value: DefineCurve) -> None:
        """Set the DefineCurve object for lcab."""
        self.lcab = value.lcid

    @property
    def lcbc_link(self) -> typing.Optional[DefineCurve]:
        """Get the DefineCurve object for lcbc."""
        if self.deck is None:
            return None
        for kwd in self.deck.get_kwds_by_full_type("DEFINE", "CURVE"):
            if kwd.lcid == self.lcbc:
                return kwd
        return None

    @lcbc_link.setter
    def lcbc_link(self, value: DefineCurve) -> None:
        """Set the DefineCurve object for lcbc."""
        self.lcbc = value.lcid

    @property
    def lcca_link(self) -> typing.Optional[DefineCurve]:
        """Get the DefineCurve object for lcca."""
        if self.deck is None:
            return None
        for kwd in self.deck.get_kwds_by_full_type("DEFINE", "CURVE"):
            if kwd.lcid == self.lcca:
                return kwd
        return None

    @lcca_link.setter
    def lcca_link(self, value: DefineCurve) -> None:
        """Set the DefineCurve object for lcca."""
        self.lcca = value.lcid

    @property
    def lcsr_link(self) -> typing.Optional[DefineCurve]:
        """Get the DefineCurve object for lcsr."""
        if self.deck is None:
            return None
        for kwd in self.deck.get_kwds_by_full_type("DEFINE", "CURVE"):
            if kwd.lcid == self.lcsr:
                return kwd
        return None

    @lcsr_link.setter
    def lcsr_link(self, value: DefineCurve) -> None:
        """Set the DefineCurve object for lcsr."""
        self.lcsr = value.lcid

