OpenSeesPyAssistant 1.1
OpenSeesPy for everyone
ForceBasedElement Class Reference

Class that handles the storage and manipulation of a force-based element's information (mechanical and geometrical parameters, etc) and the initialisation in the model. More...

Inheritance diagram for ForceBasedElement:
MemberModel ForceBasedElementFibersCircRCCircShape ForceBasedElementFibersIShapeSteelIShape ForceBasedElementFibersRectRCRectShape

Public Member Functions

def __init__ (self, int iNode_ID, int jNode_ID, int fiber_ID, int geo_transf_ID, new_integration_ID=-1, Ip=5, integration_type="Lobatto", max_iter=MAX_ITER_INTEGRATION, tol=TOL_INTEGRATION, ele_ID=-1)
 Constructor of the class. More...
 
def CreateMember (self)
 Method that initialises the member by calling the OpenSeesPy commands through various functions. More...
 
def Record (self, str name_txt, str data_dir, force_rec=True, def_rec=True, time_rec=True)
 Implementation of the homonym abstract method. More...
 
def RecordNodeDef (self, str name_txt, str data_dir, time_rec=True)
 Implementation of the homonym abstract method. More...
 
def ReInit (self, new_integration_ID, ele_ID=-1)
 Implementation of the homonym abstract method. More...
 
def ShowInfo (self, plot=False, block=False)
 Implementation of the homonym abstract method. More...
 
def UpdateStoredData (self)
 Implementation of the homonym abstract method. More...
 
def Record (self, ele_ID, str name_txt, str data_dir, force_rec=True, def_rec=True, time_rec=True)
 Abstract method that records the forces, deformation and time of the member associated with the class. More...
 
def RecordNodeDef (self, int iNode_ID, int jNode_ID, str name_txt, str data_dir, time_rec=True)
 Abstract method that records the deformation and time of the member's nodes associated with the class. More...
 

Public Attributes

 data
 
 element_array
 
 element_ID
 
 fiber_ID
 
 geo_transf_ID
 
 Initialized
 
 iNode_ID
 
 integration_type
 
 Ip
 
 jNode_ID
 
 max_iter
 
 new_integration_ID
 
 section_name_tag
 
 tol
 

Detailed Description

Class that handles the storage and manipulation of a force-based element's information (mechanical and geometrical parameters, etc) and the initialisation in the model.

Parameters
MemberModelParent abstract class.

Definition at line 964 of file MemberModel.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
int  iNode_ID,
int  jNode_ID,
int  fiber_ID,
int  geo_transf_ID,
  new_integration_ID = -1,
  Ip = 5,
  integration_type = "Lobatto",
  max_iter = MAX_ITER_INTEGRATION,
  tol = TOL_INTEGRATION,
  ele_ID = -1 
)

Constructor of the class.

Parameters
iNode_ID(int): ID of the first end node.
jNode_ID(int): ID of the second end node.
fiber_ID(int): ID of the fiber section.
geo_transf_ID(int): The geometric transformation (for more information, see OpenSeesPy documentation).
new_integration_ID(int, optional): ID of the integration technique. Defaults to -1, e.g. computed in ReInit().
Ip(int, optional): Number of integration points (min. 3). Defaults to 5.
integration_type(str, optional): Integration type. FOr more information, see OpenSeesPy documentation. Defaults to "Lobatto".
max_iter(int, optional): Maximal number of iteration to reach the integretion convergence. Defaults to MAX_ITER_INTEGRATION (Units).
tol(float, optional): Tolerance for the integration convergence. Defaults to TOL_INTEGRATION (Units).
ele_ID(int, optional): Optional ID of the element. Defaults to -1, e.g. use IDConvention to define it.
Exceptions
NegativeValueID needs to be a positive integer.
NegativeValueID needs to be a positive integer.
NegativeValueID needs to be a positive integer.
NegativeValueID needs to be a positive integer.
NegativeValueID needs to be a positive integer, if different from -1.
NegativeValueIp needs to be a positive integer bigger than 3, if different from -1.
NegativeValuemax_iter needs to be a positive integer.
NegativeValuetol needs to be positive.
NegativeValueID needs to be a positive integer, if different from -1.

Reimplemented in ForceBasedElementFibersCircRCCircShape, ForceBasedElementFibersIShapeSteelIShape, and ForceBasedElementFibersRectRCRectShape.

Definition at line 970 of file MemberModel.py.

971 new_integration_ID = -1, Ip = 5, integration_type = "Lobatto", max_iter = MAX_ITER_INTEGRATION, tol = TOL_INTEGRATION, ele_ID = -1):
972 """
973 Constructor of the class.
974
975 @param iNode_ID (int): ID of the first end node.
976 @param jNode_ID (int): ID of the second end node.
977 @param fiber_ID (int): ID of the fiber section.
978 @param geo_transf_ID (int): The geometric transformation (for more information, see OpenSeesPy documentation).
979 @param new_integration_ID (int, optional): ID of the integration technique. Defaults to -1, e.g. computed in ReInit().
980 @param Ip (int, optional): Number of integration points (min. 3). Defaults to 5.
981 @param integration_type (str, optional): Integration type. FOr more information, see OpenSeesPy documentation.
982 Defaults to "Lobatto".
983 @param max_iter (int, optional): Maximal number of iteration to reach the integretion convergence. Defaults to MAX_ITER_INTEGRATION (Units).
984 @param tol (float, optional): Tolerance for the integration convergence. Defaults to TOL_INTEGRATION (Units).
985 @param ele_ID (int, optional): Optional ID of the element. Defaults to -1, e.g. use IDConvention to define it.
986
987 @exception NegativeValue: ID needs to be a positive integer.
988 @exception NegativeValue: ID needs to be a positive integer.
989 @exception NegativeValue: ID needs to be a positive integer.
990 @exception NegativeValue: ID needs to be a positive integer.
991 @exception NegativeValue: ID needs to be a positive integer, if different from -1.
992 @exception NegativeValue: Ip needs to be a positive integer bigger than 3, if different from -1.
993 @exception NegativeValue: max_iter needs to be a positive integer.
994 @exception NegativeValue: tol needs to be positive.
995 @exception NegativeValue: ID needs to be a positive integer, if different from -1.
996 """
997 # Check
998 if iNode_ID < 1: raise NegativeValue()
999 if jNode_ID < 1: raise NegativeValue()
1000 if fiber_ID < 1: raise NegativeValue()
1001 if geo_transf_ID < 1: raise NegativeValue()
1002 if new_integration_ID != -1 and new_integration_ID < 1: raise NegativeValue()
1003 if Ip != -1 and Ip < 3: raise NegativeValue()
1004 if max_iter < 0: raise NegativeValue()
1005 if tol < 0: raise NegativeValue()
1006 if ele_ID != -1 and ele_ID < 1: raise NegativeValue()
1007
1008 # Arguments
1009 self.iNode_ID = iNode_ID
1010 self.jNode_ID = jNode_ID
1011 self.fiber_ID = fiber_ID
1012 self.geo_transf_ID = geo_transf_ID
1013 self.Ip = Ip
1014 self.integration_type = integration_type
1015 self.max_iter = max_iter
1016 self.tol = tol
1017
1018 # Initialized the parameters that are dependent from others
1019 self.section_name_tag = "None"
1020 self.Initialized = False
1021 self.ReInit(new_integration_ID, ele_ID)
1022
1023

Member Function Documentation

◆ CreateMember()

def CreateMember (   self)

Method that initialises the member by calling the OpenSeesPy commands through various functions.

Definition at line 1092 of file MemberModel.py.

1092 def CreateMember(self):
1093 """
1094 Method that initialises the member by calling the OpenSeesPy commands through various functions.
1095 """
1096 self.element_array = [[self.element_ID, self.iNode_ID, self.jNode_ID]]
1097
1098 # Define integration type
1099 beamIntegration(self.integration_type, self.new_integration_ID, self.fiber_ID, self.Ip)
1100
1101 # Define element
1102 element('forceBeamColumn', self.element_ID, self.iNode_ID, self.jNode_ID, self.geo_transf_ID, self.new_integration_ID, '-iter', self.max_iter, self.tol)
1103
1104 # Update class
1105 self.Initialized = True
1106 self.UpdateStoredData()
1107
1108

◆ Record()

def Record (   self,
str  name_txt,
str  data_dir,
  force_rec = True,
  def_rec = True,
  time_rec = True 
)

Implementation of the homonym abstract method.

See parent class MemberModel for detailed information.

Reimplemented from MemberModel.

Definition at line 1109 of file MemberModel.py.

1109 def Record(self, name_txt: str, data_dir: str, force_rec=True, def_rec=True, time_rec=True):
1110 """
1111 Implementation of the homonym abstract method.
1112 See parent class MemberModel for detailed information.
1113 """
1114 super().Record(self.element_ID, name_txt, data_dir, force_rec=force_rec, def_rec=def_rec, time_rec=time_rec)
1115
1116
Module for the member model.
Definition: MemberModel.py:1

◆ RecordNodeDef()

def RecordNodeDef (   self,
str  name_txt,
str  data_dir,
  time_rec = True 
)

Implementation of the homonym abstract method.

See parent class MemberModel for detailed information.

Reimplemented from MemberModel.

Definition at line 1117 of file MemberModel.py.

1117 def RecordNodeDef(self, name_txt: str, data_dir: str, time_rec=True):
1118 """
1119 Implementation of the homonym abstract method.
1120 See parent class MemberModel for detailed information.
1121 """
1122 super().RecordNodeDef(self.iNode_ID, self.jNode_ID, name_txt, data_dir, time_rec=time_rec)
1123
1124

◆ ReInit()

def ReInit (   self,
  new_integration_ID,
  ele_ID = -1 
)

Implementation of the homonym abstract method.

See parent class DataManagement for detailed information.

Parameters
new_integration_ID(int): ID of the integration technique.
ele_ID(int, optional): Optional ID of the element. Defaults to -1, e.g. use IDConvention to define it.

Definition at line 1024 of file MemberModel.py.

1024 def ReInit(self, new_integration_ID, ele_ID = -1):
1025 """
1026 Implementation of the homonym abstract method.
1027 See parent class DataManagement for detailed information.
1028
1029 @param new_integration_ID (int): ID of the integration technique.
1030 @param ele_ID (int, optional): Optional ID of the element. Defaults to -1, e.g. use IDConvention to define it.
1031 """
1032 # Precompute some members
1033 self.element_ID = IDConvention(self.iNode_ID, self.jNode_ID) if ele_ID == -1 else ele_ID
1034
1035 # Arguments
1036 self.new_integration_ID = self.element_ID if new_integration_ID == -1 else new_integration_ID
1037
1038 # Members
1039 if self.section_name_tag != "None": self.section_name_tag = self.section_name_tag + " (modified)"
1040
1041 # Data storage for loading/saving
1042 self.UpdateStoredData()
1043
1044
Module with the parent abstract class DataManagement.
def IDConvention(int prefix, int suffix, n_zeros_between=0)
Function used to construct IDs for elements and offgrid nodes.

◆ ShowInfo()

def ShowInfo (   self,
  plot = False,
  block = False 
)

Implementation of the homonym abstract method.

See parent class DataManagement for detailed information.

Parameters
plot(bool, optional): Option to show the plot of the material model. Defaults to False.
block(bool, optional): Option to wait the user command 'plt.show()' (avoiding the stop of the program everytime that a plot should pop up). Defaults to False.

Definition at line 1066 of file MemberModel.py.

1066 def ShowInfo(self, plot = False, block = False):
1067 """
1068 Implementation of the homonym abstract method.
1069 See parent class DataManagement for detailed information.
1070
1071 @param plot (bool, optional): Option to show the plot of the material model. Defaults to False.
1072 @param block (bool, optional): Option to wait the user command 'plt.show()' (avoiding the stop of the program everytime that a plot should pop up). Defaults to False.
1073 """
1074 print("")
1075 print("Requested info for ForceBasedElement member model, ID = {}".format(self.element_ID))
1076 print("Fiber associated, ID = {} ".format(self.fiber_ID))
1077 print("Integration type '{}', ID = {}".format(self.integration_type, self.new_integration_ID))
1078 print("Section associated {} ".format(self.section_name_tag))
1079 print("Number of integration points along the element Ip = {}, max iter = {}, tol = {}".format(self.Ip, self.max_iter, self.tol))
1080 print("Geometric transformation = {}".format(self.geo_transf_ID))
1081 print("")
1082
1083 if plot:
1084 if self.Initialized:
1085 plot_member(self.element_array, "ForceBased Element, ID = {}".format(self.element_ID))
1086 if block:
1087 plt.show()
1088 else:
1089 print("The ForceBasedElement is not initialized (element not created), ID = {}".format(self.element_ID))
1090
1091
def plot_member(list element_array, member_name="Member name not defined", show_element_ID=True, show_node_ID=True)
Function that plots a set of elements.

◆ UpdateStoredData()

def UpdateStoredData (   self)

Implementation of the homonym abstract method.

See parent class DataManagement for detailed information.

Definition at line 1046 of file MemberModel.py.

1046 def UpdateStoredData(self):
1047 """
1048 Implementation of the homonym abstract method.
1049 See parent class DataManagement for detailed information.
1050 """
1051 self.data = [["INFO_TYPE", "ForceBasedElement"], # Tag for differentiating different data
1052 ["element_ID", self.element_ID],
1053 ["section_name_tag", self.section_name_tag],
1054 ["Ip", self.Ip],
1055 ["iNode_ID", self.iNode_ID],
1056 ["jNode_ID", self.jNode_ID],
1057 ["fiber_ID", self.fiber_ID],
1058 ["new_integration_ID", self.new_integration_ID],
1059 ["integration_type", self.integration_type],
1060 ["tol", self.tol],
1061 ["max_iter", self.max_iter],
1062 ["tranf_ID", self.geo_transf_ID],
1063 ["Initialized", self.Initialized]]
1064
1065

Member Data Documentation

◆ data

data

Definition at line 1051 of file MemberModel.py.

◆ element_array

element_array

Definition at line 1096 of file MemberModel.py.

◆ element_ID

element_ID

Definition at line 1033 of file MemberModel.py.

◆ fiber_ID

fiber_ID

Definition at line 1011 of file MemberModel.py.

◆ geo_transf_ID

geo_transf_ID

Definition at line 1012 of file MemberModel.py.

◆ Initialized

Initialized

Definition at line 1020 of file MemberModel.py.

◆ iNode_ID

iNode_ID

Definition at line 1009 of file MemberModel.py.

◆ integration_type

integration_type

Definition at line 1014 of file MemberModel.py.

◆ Ip

Ip

Definition at line 1013 of file MemberModel.py.

◆ jNode_ID

jNode_ID

Definition at line 1010 of file MemberModel.py.

◆ max_iter

max_iter

Definition at line 1015 of file MemberModel.py.

◆ new_integration_ID

new_integration_ID

Definition at line 1036 of file MemberModel.py.

◆ section_name_tag

section_name_tag

Definition at line 1019 of file MemberModel.py.

◆ tol

tol

Definition at line 1016 of file MemberModel.py.


The documentation for this class was generated from the following file: