1"""Module with different functions useful when defining boundary conditions (fix) or connections (pin, rigid or springs). \n
11 Function that fixes the x, y movements and the rotation of one node.
13 @param NodeID (int): ID of the node to be fixed
15 @exception NegativeValue: The ID of NodeID needs to be a positive integer.
17 if NodeID < 1:
raise NegativeValue()
22def Pin(NodeRID: int, NodeCID: int):
24 Function that constrains the translational DOF with a multi-point constraint.
26 @param NodeRID (int): Node ID which will be retained by the multi-point constraint
27 @param NodeCID (int): Node ID which will be constrained by the multi-point constraint
29 @exception WrongArgument: The IDs passed needs to be different.
30 @exception NegativeValue: The ID of NodeRID needs to be a positive integer.
31 @exception NegativeValue: The ID of NodeCID needs to be a positive integer.
33 if NodeCID == NodeRID:
raise WrongArgument()
34 if NodeRID < 1:
raise NegativeValue()
35 if NodeCID < 1:
raise NegativeValue()
39 equalDOF(NodeRID, NodeCID, 1, 2)
42def RotationalSpring(ElementID: int, NodeRID: int, NodeCID: int, MatID: int, Rigid =
False):
44 Function that defines a zero-length spring and constrains the translations DOFs of the spring. Can be used also to create rigid connections.
46 @param ElementID (int): ID of the zerolength element that models the spring
47 @param NodeRID (int): Node ID which will be retained by the multi-point constraint
48 @param NodeCID (int): Node ID which will be constrained by the multi-point constraint
49 @param MatID (int): ID of the material model chosen
50 @param Rigid (bool, optional): Optional argument that transforms the joint
in a completely rigid connection. Defaults to
False.
52 @exception NegativeValue: The ID of ElementID needs to be a positive integer.
53 @exception NegativeValue: The ID of NodeCID needs to be a positive integer.
54 @exception NegativeValue: The ID of NodeRID needs to be a positive integer.
55 @exception WrongArgument: The IDs of the nodes passed needs to be different.
56 @exception NegativeValue: The ID of MatID needs to be a positive integer.
58 if ElementID < 1:
raise NegativeValue()
59 if NodeCID < 1:
raise NegativeValue()
60 if NodeRID < 1:
raise NegativeValue()
61 if NodeCID == NodeRID:
raise WrongArgument()
62 if MatID < 1:
raise NegativeValue()
66 element(
"zeroLength", ElementID, NodeRID, NodeCID,
"-mat", MatID,
"-dir", 6)
71 equalDOF(NodeRID, NodeCID, 1, 2, 3)
def Pin(int NodeRID, int NodeCID)
Function that constrains the translational DOF with a multi-point constraint.
def RotationalSpring(int ElementID, int NodeRID, int NodeCID, int MatID, Rigid=False)
Function that defines a zero-length spring and constrains the translations DOFs of the spring.
def RigidSupport(int NodeID)
Function that fixes the x, y movements and the rotation of one node.