Пример #1
0
    def compute_b(self, PD_deck):
        # Build  matrix b[row = node, column = time]
        b = np.zeros((int(PD_deck.Num_Nodes), int(PD_deck.Num_TimeStep)))
        PD_deck.get_parameters_loading_ramp()
        if PD_deck.Loading_Flag == "RAMP":
            for x_i in range(0, PD_deck.Horizon_Factor):
                for t_n in range(1, int(PD_deck.Num_TimeStep)):
                    b[x_i, t_n] = -self.ramp_loading(PD_deck, t_n)
            for x_i in range(len(self.x) -
                             PD_deck.Horizon_Factor, len(self.x)):
                for t_n in range(1, int(PD_deck.Num_TimeStep)):
                    b[x_i, t_n] = self.ramp_loading(PD_deck, t_n)

        self.y = np.zeros( ( int(PD_deck.Num_Nodes), int(PD_deck.Num_TimeStep)) )
        self.y[:,0] = self.x
        self.strain = np.zeros( ( int(PD_deck.Num_TimeStep) ) )
        self.forces = np.zeros( ( int(PD_deck.Num_Nodes), int(PD_deck.Num_TimeStep)) )
        self.ext = np.zeros( ( int(PD_deck.Num_Nodes), int(PD_deck.Num_Nodes), int(PD_deck.Num_TimeStep)) )
        
        if PD_deck.Material_Flag == "ELASTIC":
            self.Modulus = PD_deck.get_material_properties()
        elif PD_deck.Material_Flag == "VISCOELASTIC":
            self.Modulus, self.Relaxation_Time = PD_deck.get_material_properties()
            self.ext_visco = np.zeros( ( int(PD_deck.Num_Nodes), int(PD_deck.Num_Nodes), len(self.Relaxation_Time), int(PD_deck.Num_TimeStep)) ) 
        else:
            logger.error("There is a problem with the Type of Material in your XML deck.")                        
Пример #2
0
 def __init__(self, PD_deck, PD_problem, y, t_n):
     self.len_x = len(PD_problem.x)
     self.Modulus, self.Relaxation_Time = PD_deck.get_material_properties()
     self.compute_ext_state(PD_deck, PD_problem, y)
     self.compute_ext_state_visco(PD_deck, PD_problem, y, t_n)
     self.compute_t_visco(PD_deck, PD_problem, y)
     self.compute_T(PD_deck, PD_problem, y)
     self.compute_Ts(PD_deck, PD_problem)