OpenSeesPyAssistant 1.1
OpenSeesPy for everyone
DataManagement Class Reference

Abstract parent class for data management. More...

Inheritance diagram for DataManagement:

Public Member Functions

def ReInit (self)
 Abstract method that computes the value of the parameters with respect of the arguments. More...
 
def SaveData (self, f)
 Function that lists in the command window and saves in a opened file text "f" the data from the "self" class that calls it. More...
 
def ShowInfo (self)
 Abstract method that shows the data stored in the class in the command window. More...
 
def UpdateStoredData (self)
 Abstract method used to define and update the self.data member variable. More...
 

Detailed Description

Abstract parent class for data management.

Using the associated MATLAB class
LOAD_CLASS.m
for the postprocessing in MATLAB, allowing for simpler and more reliable data management because the parameters from the OpenSeesPy analysis are imported automatically.

Definition at line 11 of file DataManagement.py.

Member Function Documentation

◆ ReInit()

def ReInit (   self)

Abstract method that computes the value of the parameters with respect of the arguments.


Use after changing the value of argument inside the class (to update the values accordingly).
This function can be very useful in combination with the function "deepcopy()" from the module "copy".
Be careful that the parameter self.Initialized is also copied, thus it is safer to copy the class before the method that calls the actual OpenSees commands (and initialise the object).

Definition at line 56 of file DataManagement.py.

56 def ReInit(self):
57 """
58 Abstract method that computes the value of the parameters with respect of the arguments. \n
59 Use after changing the value of argument inside the class (to update the values accordingly). \n
60 This function can be very useful in combination with the function "deepcopy()" from the module "copy". \n
61 Be careful that the parameter self.Initialized is also copied, thus it is safer to copy the class before the method that calls the actual OpenSees commands (and initialise the object).
62 """
63 pass
64

◆ SaveData()

def SaveData (   self,
  f 
)

Function that lists in the command window and saves in a opened file text "f" the data from the "self" class that calls it.

Example: call this function after this line:
with open(FileName, 'w') as f:

Parameters
f(io.TextIOWrapper): Opened file to write into
Exceptions
WrongDimensionThe number of lists in the list self.data needs to be 2

Definition at line 20 of file DataManagement.py.

20 def SaveData(self, f):
21 """
22 Function that lists in the command window and saves in a opened file text "f" the data from the "self" class that calls it.
23 Example: call this function after this line: \n
24 with open(FileName, 'w') as f:
25
26 @param f (io.TextIOWrapper): Opened file to write into
27
28 @exception WrongDimension: The number of lists in the list self.data needs to be 2
29 """
30 if len(self.data[0]) != 2: raise WrongDimension()
31
32 delimiter = "##############################" # 30 times #
33 col_delimiter = "\t" # tab
34 for data_line in self.data:
35 f.write('\n')
36 for col in data_line:
37 if type(col) == np.ndarray:
38 tmp_str = np.array_str(col, max_line_width = np.inf)
39 else:
40 tmp_str = str(col)
41 f.write(tmp_str)
42 f.write(col_delimiter)
43 f.write('\n')
44 f.write('NEW INFO SECTION DELIMITER \t')
45 f.write(delimiter)
46

◆ ShowInfo()

def ShowInfo (   self)

Abstract method that shows the data stored in the class in the command window.

In some cases, it's possible to plot some information (for example the curve of the material model).

Definition at line 48 of file DataManagement.py.

48 def ShowInfo(self):
49 """
50 Abstract method that shows the data stored in the class in the command window.
51 In some cases, it's possible to plot some information (for example the curve of the material model).
52 """
53 pass
54

◆ UpdateStoredData()

def UpdateStoredData (   self)

Abstract method used to define and update the self.data member variable.


This member variable (self.data) is a list of lists with 2 entries (info_name and info_value) and for each list is stored a different member variable of the class.
Useful to debug the model, export data, copy object.

Definition at line 66 of file DataManagement.py.

66 def UpdateStoredData(self):
67 """
68 Abstract method used to define and update the self.data member variable. \n
69 This member variable (self.data) is a list of lists with 2 entries (info_name and info_value)
70 and for each list is stored a different member variable of the class. \n
71 Useful to debug the model, export data, copy object.
72 """
73 pass

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