Ejemplo n.º 1
0
    def Initialize(self):
        self.DEM_parameters["problem_name"].SetString('benchmark' + str(benchmark_number))
        #self.end_time = slt.end_time
        #self.dt = slt.dt
        #self.graph_print_interval = slt.graph_print_interval
        super(DEMBenchamarksAnalysisStage, self).Initialize()

        Logger.PrintInfo("DEM","Computing points in the curve...", 1 + self.number_of_points_in_the_graphic - self.iteration, "point(s) left to finish....",'\n')
        list_of_nodes_ids = [1]
        if self.nodeplotter:
            os.chdir(self.main_path)
            self.plotter = plot_variables.variable_plotter(self.spheres_model_part, list_of_nodes_ids, benchmark_number)
            self.tang_plotter = plot_variables.tangential_force_plotter(self.spheres_model_part, list_of_nodes_ids, self.iteration)
Ejemplo n.º 2
0
        list_of_nodes.append(node)
'''
print(len(list_of_nodes))
print("")
##############################################DEBUGGING

step = 0

list_of_nodes_ids = []

for node in spheres_model_part.Nodes:
    list_of_nodes_ids.append(node.Id)

if nodeplotter:  #Related to debugging
    os.chdir(main_path)
    plotter = plot_variables.variable_plotter(
        spheres_model_part, list_of_nodes_ids)  #Related to debugging


def cross_product(a, b):  #Related to debugging
    c = [
        a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2],
        a[0] * b[1] - a[1] * b[0]
    ]
    return c


def Debugging_rotation():  #Related to debugging
    ang_vel = 0.5 * math.pi
    angular_velocity = [0, 0, ang_vel]
    rotation_matrix = [[
        math.cos(ang_vel * time), -1.0 * math.sin(ang_vel * time), 0
Ejemplo n.º 3
0
        list_of_nodes.append(node)
'''
print(len(list_of_nodes))
print("")
##############################################DEBUGGING

step = 0

list_of_nodes_ids = []

for node in spheres_model_part.Nodes:
    list_of_nodes_ids.append(node.Id)

if nodeplotter: #Related to debugging
    os.chdir(main_path)
    plotter = plot_variables.variable_plotter(spheres_model_part, list_of_nodes_ids) #Related to debugging
    
def cross_product(a, b): #Related to debugging
    c = [a[1]*b[2] - a[2]*b[1], a[2]*b[0] - a[0]*b[2], a[0]*b[1] - a[1]*b[0]]
    return c
    
def Debugging_rotation(): #Related to debugging
    ang_vel = 0.5 * math.pi
    angular_velocity = [0, 0, ang_vel]
    rotation_matrix = [[math.cos(ang_vel * time), -1.0 * math.sin(ang_vel * time), 0], [math.sin(ang_vel * time), math.cos(ang_vel * time), 0], [0,0,1]]
    time_dt = time - dt #
    rotation_matrix_minus_dt = [[math.cos(ang_vel * time_dt), -1.0 * math.sin(ang_vel * time_dt), 0], [math.sin(ang_vel * time_dt), math.cos(ang_vel * time_dt), 0], [0,0,1]] #
    centroid = [0.0, 0.0, 0.0]
    relative_initial_node_coords, relative_node_coords, relative_node_coords_dt = [0]*3, [0]*3, [0]*3
    sum, sum_dt = 0, 0
        
Ejemplo n.º 4
0
    print("Computing points in the curve...",
          1 + number_of_points_in_the_graphic - iteration,
          "point(s) left to finish....", '\n')

    mesh_motion = DEMFEMUtilities()

    # creating a Post Utils object that executes several post-related tasks
    post_utils = DEM_procedures.PostUtils(DEM_parameters, spheres_model_part)

    list_of_nodes_ids = [1]

    if nodeplotter:
        os.chdir(main_path)
        plotter = plot_variables.variable_plotter(
            spheres_model_part,
            list_of_nodes_ids)  #Related to the benchmark in Chung, Ooi

    step = 0

    while (time < final_time):
        #
        #SLS dt   = spheres_model_part.ProcessInfo.GetValue(DELTA_TIME) # Possible modifications of DELTA_TIME
        time = time + dt
        step += 1

        spheres_model_part.ProcessInfo[TIME] = time
        spheres_model_part.ProcessInfo[DELTA_TIME] = dt
        spheres_model_part.ProcessInfo[TIME_STEPS] = step

        rigid_face_model_part.ProcessInfo[TIME] = time
Ejemplo n.º 5
0
        print("Computing points in the curve...",
              1 + number_of_points_in_the_graphic - iteration,
              "point(s) left to finish....", '\n')

        mesh_motion = DEMFEMUtilities()

        # creating a Post Utils object that executes several post-related tasks
        post_utils = DEM_procedures.PostUtils(DEM_parameters,
                                              spheres_model_part)

        list_of_nodes_ids = [1]

        if nodeplotter:
            os.chdir(main_path)
            plotter = plot_variables.variable_plotter(
                spheres_model_part, list_of_nodes_ids)  #Related to Benchmarks
            tang_plotter = plot_variables.tangential_force_plotter(
                spheres_model_part, list_of_nodes_ids,
                iteration)  #Related to Benchmarks

        step = 0

        while (time < final_time):
            #
            #SLS dt   = spheres_model_part.ProcessInfo.GetValue(DELTA_TIME) # Possible modifications of DELTA_TIME
            time = time + dt
            step += 1

            spheres_model_part.ProcessInfo[TIME] = time
            spheres_model_part.ProcessInfo[DELTA_TIME] = dt
            spheres_model_part.ProcessInfo[TIME_STEPS] = step
Ejemplo n.º 6
0
        report.Prepare(timer,DEM_parameters.ControlTime)

        procedures.ModelData(spheres_model_part, solver)

        materialTest.PrintChart()
        materialTest.PrepareDataForGraph()

        post_utils = DEM_procedures.PostUtils(DEM_parameters, spheres_model_part)

        print("Computing points in the curve...", 1 + number_of_points_in_the_graphic - iteration, "point(s) left to finish....",'\n')

        list_of_nodes_ids = [1]

        if nodeplotter:
            os.chdir(main_path)
            plotter = plot_variables.variable_plotter(spheres_model_part, list_of_nodes_ids) #Related to Benchmarks
            tang_plotter = plot_variables.tangential_force_plotter(spheres_model_part, list_of_nodes_ids, iteration) #Related to Benchmarks

        step = 0

        ##############################################################################
        #    MAIN LOOP                                                               #
        ##############################################################################
        report.total_steps_expected = int(final_time / dt)
        KRATOSprint(report.BeginReport(timer))

        while (time < final_time):

            #SLS dt   = spheres_model_part.ProcessInfo.GetValue(DELTA_TIME) # Possible modifications of DELTA_TIME
            time = time + dt
            step += 1
Ejemplo n.º 7
0
    report.total_steps_expected = int(final_time / dt)

    KRATOSprint(report.BeginReport(timer))

    print("Computing points in the curve...", 1 + number_of_points_in_the_graphic - iteration, "point(s) left to finish....",'\n')

    mesh_motion = DEMFEMUtilities()

    # creating a Post Utils object that executes several post-related tasks
    post_utils = DEM_procedures.PostUtils(DEM_parameters, spheres_model_part)
    
    list_of_nodes_ids = [1]
       
    if nodeplotter:
        os.chdir(main_path)
        plotter = plot_variables.variable_plotter(spheres_model_part, list_of_nodes_ids) #Related to the benchmark in Chung, Ooi
    
    step = 0  

    while (time < final_time):
        #
        #SLS dt   = spheres_model_part.ProcessInfo.GetValue(DELTA_TIME) # Possible modifications of DELTA_TIME
        time = time + dt
        step += 1

        spheres_model_part.ProcessInfo[TIME]            = time
        spheres_model_part.ProcessInfo[DELTA_TIME]      = dt
        spheres_model_part.ProcessInfo[TIME_STEPS]      = step

        rigid_face_model_part.ProcessInfo[TIME]         = time
        rigid_face_model_part.ProcessInfo[DELTA_TIME]   = dt