OpenSeesPyAssistant 1.1
OpenSeesPy for everyone
Connections.py
Go to the documentation of this file.
1"""Module with different functions useful when defining boundary conditions (fix) or connections (pin, rigid or springs). \n
2Carmine Schipani, 2021
3"""
4
5from openseespy.opensees import *
7
8
9def RigidSupport(NodeID: int):
10 """
11 Function that fixes the x, y movements and the rotation of one node.
12
13 @param NodeID (int): ID of the node to be fixed
14
15 @exception NegativeValue: The ID of NodeID needs to be a positive integer.
16 """
17 if NodeID < 1: raise NegativeValue()
18
19 fix(NodeID, 1, 1, 1)
20
21
22def Pin(NodeRID: int, NodeCID: int):
23 """
24 Function that constrains the translational DOF with a multi-point constraint.
25
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
28
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.
32 """
33 if NodeCID == NodeRID: raise WrongArgument()
34 if NodeRID < 1: raise NegativeValue()
35 if NodeCID < 1: raise NegativeValue()
36
37 # Constrain the translational DOF with a multi-point constraint
38 # retained constrained DOF_1 DOF_2
39 equalDOF(NodeRID, NodeCID, 1, 2)
40
41
42def RotationalSpring(ElementID: int, NodeRID: int, NodeCID: int, MatID: int, Rigid = False):
43 """
44 Function that defines a zero-length spring and constrains the translations DOFs of the spring. Can be used also to create rigid connections.
45
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.
51
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.
57 """
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()
63
64 if not Rigid:
65 # Zero length element (spring)
66 element("zeroLength", ElementID, NodeRID, NodeCID, "-mat", MatID, "-dir", 6)
67
68 # Constrain the translational DOF with a multi-point constraint
69 Pin(NodeRID, NodeCID)
70 else:
71 equalDOF(NodeRID, NodeCID, 1, 2, 3)
72
73
74
75
def Pin(int NodeRID, int NodeCID)
Function that constrains the translational DOF with a multi-point constraint.
Definition: Connections.py:22
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.
Definition: Connections.py:42
def RigidSupport(int NodeID)
Function that fixes the x, y movements and the rotation of one node.
Definition: Connections.py:9