OpenSeesPyAssistant 1.1
OpenSeesPy for everyone
ElasticElement Class Reference

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

Inheritance diagram for ElasticElement:
MemberModel ElasticElementSteelIShape

Public Member Functions

def __init__ (self, int iNode_ID, int jNode_ID, A, E, Iy, int geo_transf_ID, 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, 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

 A
 
 data
 
 E
 
 element_array
 
 element_ID
 
 geo_transf_ID
 
 Initialized
 
 iNode_ID
 
 Iy
 
 jNode_ID
 
 section_name_tag
 

Detailed Description

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

Parameters
MemberModelParent abstract class.

Definition at line 496 of file MemberModel.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
int  iNode_ID,
int  jNode_ID,
  A,
  E,
  Iy,
int  geo_transf_ID,
  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.
A(float): Area of the member.
E(float): Young modulus.
Iy(float): Second moment of inertia (strong axis).
geo_transf_ID(int): A geometric transformation (for more information, see OpenSeesPy documentation).
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.
NegativeValueA needs to be positive.
NegativeValueE needs to be positive.
NegativeValueIy needs to be positive.
NegativeValueID needs to be a positive integer.
NegativeValueID needs to be a positive integer.

Reimplemented in ElasticElementSteelIShape.

Definition at line 502 of file MemberModel.py.

502 def __init__(self, iNode_ID: int, jNode_ID: int, A, E, Iy, geo_transf_ID: int, ele_ID = -1):
503 """
504 Constructor of the class.
505
506 @param iNode_ID (int): ID of the first end node.
507 @param jNode_ID (int): ID of the second end node.
508 @param A (float): Area of the member.
509 @param E (float): Young modulus.
510 @param Iy (float): Second moment of inertia (strong axis).
511 @param geo_transf_ID (int): A geometric transformation (for more information, see OpenSeesPy documentation).
512 @param ele_ID (int, optional): Optional ID of the element. Defaults to -1, e.g. use IDConvention to define it.
513
514 @exception NegativeValue: ID needs to be a positive integer.
515 @exception NegativeValue: ID needs to be a positive integer.
516 @exception NegativeValue: A needs to be positive.
517 @exception NegativeValue: E needs to be positive.
518 @exception NegativeValue: Iy needs to be positive.
519 @exception NegativeValue: ID needs to be a positive integer.
520 @exception NegativeValue: ID needs to be a positive integer.
521 """
522 # Check
523 if iNode_ID < 1: raise NegativeValue()
524 if jNode_ID < 1: raise NegativeValue()
525 if A < 0: raise NegativeValue()
526 if E < 0: raise NegativeValue()
527 if Iy < 0: raise NegativeValue()
528 if geo_transf_ID < 1: raise NegativeValue()
529 if ele_ID != -1 and ele_ID < 1: raise NegativeValue()
530
531 # Arguments
532 self.iNode_ID = iNode_ID
533 self.jNode_ID = jNode_ID
534 self.A = A
535 self.E = E
536 self.Iy = Iy
537 self.geo_transf_ID = geo_transf_ID
538
539 # Initialized the parameters that are dependent from others
540 self.section_name_tag = "None"
541 self.Initialized = False
542 self.ReInit(ele_ID = -1)
543

Member Function Documentation

◆ CreateMember()

def CreateMember (   self)

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

Definition at line 605 of file MemberModel.py.

605 def CreateMember(self):
606 """
607 Method that initialises the member by calling the OpenSeesPy commands through various functions.
608 """
609 self.element_array = [[self.element_ID, self.iNode_ID, self.jNode_ID]]
610
611 # Define element
612 element("elasticBeamColumn", self.element_ID, self.iNode_ID, self.jNode_ID, self.A, self.E, self.Iy, self.geo_transf_ID)
613
614 # Update class
615 self.Initialized = True
616 self.UpdateStoredData()
617
618

◆ 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 619 of file MemberModel.py.

619 def Record(self, name_txt: str, data_dir: str, force_rec=True, def_rec=True, time_rec=True):
620 """
621 Implementation of the homonym abstract method.
622 See parent class MemberModel for detailed information.
623 """
624 super().Record(self.element_ID, name_txt, data_dir, force_rec=force_rec, def_rec=def_rec, time_rec=time_rec)
625
626
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 627 of file MemberModel.py.

627 def RecordNodeDef(self, name_txt: str, data_dir: str, time_rec=True):
628 """
629 Implementation of the homonym abstract method.
630 See parent class MemberModel for detailed information.
631 """
632 super().RecordNodeDef(self.iNode_ID, self.jNode_ID, name_txt, data_dir, time_rec=time_rec)
633
634

◆ ReInit()

def ReInit (   self,
  ele_ID = -1 
)

Implementation of the homonym abstract method.

See parent class DataManagement for detailed information.

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

Definition at line 544 of file MemberModel.py.

544 def ReInit(self, ele_ID = -1):
545 """
546 Implementation of the homonym abstract method.
547 See parent class DataManagement for detailed information.
548
549 @param ele_ID (int, optional): Optional ID of the element. Defaults to -1, e.g. use IDConvention to define it.
550 """
551 # Members
552 if self.section_name_tag != "None": self.section_name_tag = self.section_name_tag + " (modified)"
553
554 # element ID
555 self.element_ID = IDConvention(self.iNode_ID, self.jNode_ID) if ele_ID == -1 else ele_ID
556
557 # Data storage for loading/saving
558 self.UpdateStoredData()
559
560
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 579 of file MemberModel.py.

579 def ShowInfo(self, plot = False, block = False):
580 """
581 Implementation of the homonym abstract method.
582 See parent class DataManagement for detailed information.
583
584 @param plot (bool, optional): Option to show the plot of the material model. Defaults to False.
585 @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.
586 """
587 print("")
588 print("Requested info for ElasticElement member model, ID = {}".format(self.element_ID))
589 print("Section associated {} ".format(self.section_name_tag))
590 print("Area A = {} mm2".format(self.A/mm2_unit))
591 print("Young modulus E = {} GPa".format(self.E/GPa_unit))
592 print("Moment of inertia Iy = {} mm4".format(self.Iy/mm4_unit))
593 print("Geometric transformation = {}".format(self.geo_transf_ID))
594 print("")
595
596 if plot:
597 if self.Initialized:
598 plot_member(self.element_array, "Elastic Element, ID = {}".format(self.element_ID))
599 if block:
600 plt.show()
601 else:
602 print("The ElasticElement is not initialized (node and elements not created), ID = {}".format(self.element_ID))
603
604
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 562 of file MemberModel.py.

562 def UpdateStoredData(self):
563 """
564 Implementation of the homonym abstract method.
565 See parent class DataManagement for detailed information.
566 """
567 self.data = [["INFO_TYPE", "ElasticElement"], # Tag for differentiating different data
568 ["element_ID", self.element_ID],
569 ["section_name_tag", self.section_name_tag],
570 ["A", self.A],
571 ["E", self.E],
572 ["Iy", self.Iy],
573 ["iNode_ID", self.iNode_ID],
574 ["jNode_ID", self.jNode_ID],
575 ["tranf_ID", self.geo_transf_ID],
576 ["Initialized", self.Initialized]]
577
578

Member Data Documentation

◆ A

A

Definition at line 534 of file MemberModel.py.

◆ data

data

Definition at line 567 of file MemberModel.py.

◆ E

E

Definition at line 535 of file MemberModel.py.

◆ element_array

element_array

Definition at line 609 of file MemberModel.py.

◆ element_ID

element_ID

Definition at line 555 of file MemberModel.py.

◆ geo_transf_ID

geo_transf_ID

Definition at line 537 of file MemberModel.py.

◆ Initialized

Initialized

Definition at line 541 of file MemberModel.py.

◆ iNode_ID

iNode_ID

Definition at line 532 of file MemberModel.py.

◆ Iy

Iy

Definition at line 536 of file MemberModel.py.

◆ jNode_ID

jNode_ID

Definition at line 533 of file MemberModel.py.

◆ section_name_tag

section_name_tag

Definition at line 540 of file MemberModel.py.


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