# 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 IcfdControlImposedMove 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.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

_ICFDCONTROLIMPOSEDMOVE_CARD0 = (
    FieldSchema("pid", int, 0, 10, None),
    FieldSchema("lcvx", int, 10, 10, None),
    FieldSchema("lcvy", int, 20, 10, None),
    FieldSchema("lcvz", int, 30, 10, None),
    FieldSchema("vadt", int, 40, 10, 0),
)

_ICFDCONTROLIMPOSEDMOVE_CARD1 = (
    FieldSchema("alphal", int, 0, 10, None),
    FieldSchema("betal", int, 10, 10, None),
    FieldSchema("gammal", int, 20, 10, None),
    FieldSchema("alphag", int, 30, 10, None),
    FieldSchema("betag", int, 40, 10, None),
    FieldSchema("gammag", int, 50, 10, None),
    FieldSchema("vadr", int, 60, 10, 0),
)

_ICFDCONTROLIMPOSEDMOVE_CARD2 = (
    FieldSchema("ptid", int, 0, 10, 0),
    FieldSchema("x1", float, 10, 10, 1.0),
    FieldSchema("y1", float, 20, 10, 0.0),
    FieldSchema("z1", float, 30, 10, 0.0),
    FieldSchema("x2", float, 40, 10, 0.0),
    FieldSchema("y2", float, 50, 10, 1.0),
    FieldSchema("z2", float, 60, 10, 0.0),
)

_ICFDCONTROLIMPOSEDMOVE_CARD3 = (
    FieldSchema("ptido", int, 0, 10, 0),
    FieldSchema("axe", int, 10, 10, 0),
    FieldSchema("ptidv", int, 20, 10, 0),
)

class IcfdControlImposedMove(KeywordBase):
    """DYNA ICFD_CONTROL_IMPOSED_MOVE keyword"""

    keyword = "ICFD"
    subkeyword = "CONTROL_IMPOSED_MOVE"
    _link_fields = {
        "lcvx": LinkType.DEFINE_CURVE,
        "lcvy": LinkType.DEFINE_CURVE,
        "lcvz": LinkType.DEFINE_CURVE,
        "alphal": LinkType.DEFINE_CURVE,
        "betal": LinkType.DEFINE_CURVE,
        "gammal": LinkType.DEFINE_CURVE,
        "alphag": LinkType.DEFINE_CURVE,
        "betag": LinkType.DEFINE_CURVE,
        "gammag": LinkType.DEFINE_CURVE,
    }

    def __init__(self, **kwargs):
        """Initialize the IcfdControlImposedMove class."""
        super().__init__(**kwargs)
        self._cards = [
            Card.from_field_schemas_with_defaults(
                _ICFDCONTROLIMPOSEDMOVE_CARD0,
                **kwargs,
            ),            Card.from_field_schemas_with_defaults(
                _ICFDCONTROLIMPOSEDMOVE_CARD1,
                **kwargs,
            ),            Card.from_field_schemas_with_defaults(
                _ICFDCONTROLIMPOSEDMOVE_CARD2,
                **kwargs,
            ),            Card.from_field_schemas_with_defaults(
                _ICFDCONTROLIMPOSEDMOVE_CARD3,
                **kwargs,
            ),        ]
    @property
    def pid(self) -> typing.Optional[int]:
        """Get or set the This can be any part ID referenced in *ICFD_PART or *ICFD_PART_VOL. If PID = 0,then the whole volume mesh will be used.
        """ # nopep8
        return self._cards[0].get_value("pid")

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

    @property
    def lcvx(self) -> typing.Optional[int]:
        """Get or set the LCID for the velocity in the three directions (X,Y,Z).
        """ # nopep8
        return self._cards[0].get_value("lcvx")

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

    @property
    def lcvy(self) -> typing.Optional[int]:
        """Get or set the LCID for the velocity in the three directions (X,Y,Z).
        """ # nopep8
        return self._cards[0].get_value("lcvy")

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

    @property
    def lcvz(self) -> typing.Optional[int]:
        """Get or set the LCID for the velocity in the three directions (X,Y,Z).
        """ # nopep8
        return self._cards[0].get_value("lcvz")

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

    @property
    def vadt(self) -> int:
        """Get or set the Velocity/Displacements flag for translation components
        EQ.0:Prescribe Velocity
        EQ.1:Prescribe Displacements
        """ # nopep8
        return self._cards[0].get_value("vadt")

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

    @property
    def alphal(self) -> typing.Optional[int]:
        """Get or set the LCID for the three Euler angle rotational velocities in the local reference frame.
        """ # nopep8
        return self._cards[1].get_value("alphal")

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

    @property
    def betal(self) -> typing.Optional[int]:
        """Get or set the LCID for the three Euler angle rotational velocities in the local reference frame.
        """ # nopep8
        return self._cards[1].get_value("betal")

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

    @property
    def gammal(self) -> typing.Optional[int]:
        """Get or set the LCID for the three Euler angle rotational velocities in the local reference frame.
        """ # nopep8
        return self._cards[1].get_value("gammal")

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

    @property
    def alphag(self) -> typing.Optional[int]:
        """Get or set the LCID for the three Euler angle rotational velocities in the global reference frame.
        """ # nopep8
        return self._cards[1].get_value("alphag")

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

    @property
    def betag(self) -> typing.Optional[int]:
        """Get or set the LCID for the three Euler angle rotational velocities in the global reference frame.
        """ # nopep8
        return self._cards[1].get_value("betag")

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

    @property
    def gammag(self) -> typing.Optional[int]:
        """Get or set the LCID for the three Euler angle rotational velocities in the global reference frame.
        """ # nopep8
        return self._cards[1].get_value("gammag")

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

    @property
    def vadr(self) -> int:
        """Get or set the Velocity/Displacements flag for rotation components
        EQ.0:Prescribe Velocity
        EQ.1:Prescribe Displacements
        """ # nopep8
        return self._cards[1].get_value("vadr")

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

    @property
    def ptid(self) -> int:
        """Get or set the Point ID for the origin of the local reference frame.If not defined, the barycenter of the volume mesh will be used.
        """ # nopep8
        return self._cards[2].get_value("ptid")

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

    @property
    def x1(self) -> float:
        """Get or set the Three components of the local reference X1 axis./n If not defined, the global x axis will be used.
        """ # nopep8
        return self._cards[2].get_value("x1")

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

    @property
    def y1(self) -> float:
        """Get or set the Three components of the local reference X1 axis./n If not defined, the global x axis will be used.
        """ # nopep8
        return self._cards[2].get_value("y1")

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

    @property
    def z1(self) -> float:
        """Get or set the Three components of the local reference X1 axis./n If not defined, the global x axis will be used.
        """ # nopep8
        return self._cards[2].get_value("z1")

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

    @property
    def x2(self) -> float:
        """Get or set the Three components of the local reference X2 axis./n If not defined, the global y axis will be used.
        """ # nopep8
        return self._cards[2].get_value("x2")

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

    @property
    def y2(self) -> float:
        """Get or set the Three components of the local reference X2 axis./n If not defined, the global y axis will be used.
        """ # nopep8
        return self._cards[2].get_value("y2")

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

    @property
    def z2(self) -> float:
        """Get or set the Three components of the local reference X2 axis./n If not defined, the global y axis will be used.
        """ # nopep8
        return self._cards[2].get_value("z2")

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

    @property
    def ptido(self) -> int:
        """Get or set the Point ID (See ICFD_DEFINE_POINT) for the center of rotation.
        """ # nopep8
        return self._cards[3].get_value("ptido")

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

    @property
    def axe(self) -> int:
        """Get or set the Rotation axis (X=1, Y=2, Z=3).
        """ # nopep8
        return self._cards[3].get_value("axe")

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

    @property
    def ptidv(self) -> int:
        """Get or set the Point ID (See ICFD_DEFINE_POINT) for the rotation velocity. If point is static, no rotation will occur.
        """ # nopep8
        return self._cards[3].get_value("ptidv")

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

