Loading 7_composite_system/precracked_hierarchical.py +64 −0 Original line number Diff line number Diff line import sys import os import numpy as np import mechnet as mn from multiprocessing import Pool from functools import partial sys.path.append("/home/lpyka/hierarchical_interface/") from lib.push_data import push_data_to, copy_runfile_to from lib.my_plot_edges import plot_edges_mechnet_network os.environ["OMP_NUM_THREADS"] = "1" os.environ["OPENBLAS_NUM_THREADS"] = "1" os.environ["MKL_NUM_THREADS"] = "1" def get_edge_list(): edge_list = [] pwd = os.getcwd() with open("7_composite_system/composite/edgelist_0_seed1_0", "r") as file: line = file.readline() line = line.rstrip("\n") line = line.split(" ") data_list = [int(entry) for entry in line] edge_list.append(data_list) return edge_list def generate_coordinate_list(nx, ny, nz): coordinate_list = [] for node in range(0,nx*ny*nz): x_coordinate = (node%(nx*ny))%nx y_coordinte = (node%(nx*ny))//nx z_coordinate = node//(nx*ny) entry = [node, x_coordinate, y_coordinte, z_coordinate] coordinate_list.append(entry) return coordinate_list def get_parametercollection(seed): edge_list = get_edge_list() steps = 3 nx = 2**steps ny = nx nz = 2*(2+steps) - 2 coordinate_list = generate_coordinate_list(nx, ny, nz) par = mn.ParameterCollection() par.set_N(nx*ny*nz) par.set_edgelist(edge_list) par.set_coordinatelist(coordinate_list) Lx = nx -1 Ly = Lx Lz = nz -1 par.set_Lx(Lx) par.set_Ly(Ly) par.set_Lz(Lz) par.set_minDz(0.05) par.set_minzdirichlet({'displacement' : 0.0}) par.set_maxDz(Ly - 0.05) par.set_maxzdirichlet({'displacement' : 1.0}) par.set_thresholdrng(seed) par.set_structurerng(seed + 1_000_000) par.set_weibullparameter(4) return par if __name__ == "__main__": seed = 1000 parameter_collection = get_parametercollection(seed) No newline at end of file Loading
7_composite_system/precracked_hierarchical.py +64 −0 Original line number Diff line number Diff line import sys import os import numpy as np import mechnet as mn from multiprocessing import Pool from functools import partial sys.path.append("/home/lpyka/hierarchical_interface/") from lib.push_data import push_data_to, copy_runfile_to from lib.my_plot_edges import plot_edges_mechnet_network os.environ["OMP_NUM_THREADS"] = "1" os.environ["OPENBLAS_NUM_THREADS"] = "1" os.environ["MKL_NUM_THREADS"] = "1" def get_edge_list(): edge_list = [] pwd = os.getcwd() with open("7_composite_system/composite/edgelist_0_seed1_0", "r") as file: line = file.readline() line = line.rstrip("\n") line = line.split(" ") data_list = [int(entry) for entry in line] edge_list.append(data_list) return edge_list def generate_coordinate_list(nx, ny, nz): coordinate_list = [] for node in range(0,nx*ny*nz): x_coordinate = (node%(nx*ny))%nx y_coordinte = (node%(nx*ny))//nx z_coordinate = node//(nx*ny) entry = [node, x_coordinate, y_coordinte, z_coordinate] coordinate_list.append(entry) return coordinate_list def get_parametercollection(seed): edge_list = get_edge_list() steps = 3 nx = 2**steps ny = nx nz = 2*(2+steps) - 2 coordinate_list = generate_coordinate_list(nx, ny, nz) par = mn.ParameterCollection() par.set_N(nx*ny*nz) par.set_edgelist(edge_list) par.set_coordinatelist(coordinate_list) Lx = nx -1 Ly = Lx Lz = nz -1 par.set_Lx(Lx) par.set_Ly(Ly) par.set_Lz(Lz) par.set_minDz(0.05) par.set_minzdirichlet({'displacement' : 0.0}) par.set_maxDz(Ly - 0.05) par.set_maxzdirichlet({'displacement' : 1.0}) par.set_thresholdrng(seed) par.set_structurerng(seed + 1_000_000) par.set_weibullparameter(4) return par if __name__ == "__main__": seed = 1000 parameter_collection = get_parametercollection(seed) No newline at end of file