Loading plot_precrack.py +4 −3 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ def get_current_toughness_dict(filepaths_dict : dict): output_dict = {} for grid_type, path in filepaths_dict.items(): output_dict[grid_type] = {} for crack_lenght in range(10,60,10): for crack_lenght in [5,10,20,40,80]: filepath = path + f"/a_{crack_lenght}/strength" with open(filepath, 'r') as file: data_dict = {} Loading @@ -36,7 +36,7 @@ def plot_current_and_toughness(filepaths_dict : dict): hierarchical_list = [] random_reference_list = [] for crack_length in range(10,60,10): for crack_length in [5,10,20,40,80]: hierarchical_list.append([crack_length, data_dict["hierarchical"][crack_length]["ipavg"], data_dict["hierarchical"][crack_length]["ipsig"], data_dict["hierarchical"][crack_length]["tavg"], data_dict["hierarchical"][crack_length]["tsig"]]) random_reference_list.append([crack_length, data_dict["random equal density per layer"][crack_length]["ipavg"], data_dict["random equal density per layer"][crack_length]["ipsig"], Loading @@ -60,12 +60,13 @@ def plot_current_and_toughness(filepaths_dict : dict): axs[1].set_ylabel("Toughness") axs[1].legend() plt.show() fig.savefig("current_toughness_crack_lenghts.png") #fig.savefig("current_toughness_crack_lenghts.png") if __name__ == "__main__": base_path = "/FASTTEMP/p7/lpyka/hierarchical_interface" os.chdir(base_path) filepaths_dict = {"hierarchical": base_path + "/5_precracked", "random equal density per layer": base_path + "/6_precrack_density_offset"} plot_current_and_toughness(filepaths_dict=filepaths_dict) print("cut-off prevention") Loading
plot_precrack.py +4 −3 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ def get_current_toughness_dict(filepaths_dict : dict): output_dict = {} for grid_type, path in filepaths_dict.items(): output_dict[grid_type] = {} for crack_lenght in range(10,60,10): for crack_lenght in [5,10,20,40,80]: filepath = path + f"/a_{crack_lenght}/strength" with open(filepath, 'r') as file: data_dict = {} Loading @@ -36,7 +36,7 @@ def plot_current_and_toughness(filepaths_dict : dict): hierarchical_list = [] random_reference_list = [] for crack_length in range(10,60,10): for crack_length in [5,10,20,40,80]: hierarchical_list.append([crack_length, data_dict["hierarchical"][crack_length]["ipavg"], data_dict["hierarchical"][crack_length]["ipsig"], data_dict["hierarchical"][crack_length]["tavg"], data_dict["hierarchical"][crack_length]["tsig"]]) random_reference_list.append([crack_length, data_dict["random equal density per layer"][crack_length]["ipavg"], data_dict["random equal density per layer"][crack_length]["ipsig"], Loading @@ -60,12 +60,13 @@ def plot_current_and_toughness(filepaths_dict : dict): axs[1].set_ylabel("Toughness") axs[1].legend() plt.show() fig.savefig("current_toughness_crack_lenghts.png") #fig.savefig("current_toughness_crack_lenghts.png") if __name__ == "__main__": base_path = "/FASTTEMP/p7/lpyka/hierarchical_interface" os.chdir(base_path) filepaths_dict = {"hierarchical": base_path + "/5_precracked", "random equal density per layer": base_path + "/6_precrack_density_offset"} plot_current_and_toughness(filepaths_dict=filepaths_dict) print("cut-off prevention")