Example #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.")                        
Example #2
0
 def __init__(self, PD_deck, PD_problem, y):
     self.len_x = len(PD_problem.x)
     self.Modulus = PD_deck.get_elastic_material_properties()
     self.compute_ext_state(PD_deck, PD_problem, y)
     self.compute_ext_state(PD_deck, PD_problem, y )
     self.compute_T(PD_deck, PD_problem, y)
     self.compute_Ts(PD_deck, PD_problem)
Example #3
0
    def __init__(self, PD_deck):
        # Import initial data
        self.get_pd_nodes(PD_deck)
        self.compute_b(PD_deck)
        self.compute_horizon(PD_deck)

        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)))
        # For viscoelasticity
        self.Modulus, self.Relaxation_Time = PD_deck.get_viscoelastic_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)))
Example #4
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)
Example #5
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 t_n in range(1, int(PD_deck.Num_TimeStep)):         
                
                #Madenci approach
                for x_i in range(0, 1):
                    b[x_i, t_n] = -self.ramp_loading( PD_deck, t_n )                    

                for x_i in range(len(self.x) - 1, len(self.x) ):
                    b[x_i, t_n] = self.ramp_loading( PD_deck, t_n )

        else:
            logger.error(
                "There is a problem with the Boundary Conditions in your XML deck.")
        # print b
        self.b = b