Loading 6b_restart_precrack_density/restart.py +9 −5 Original line number Diff line number Diff line import sys import numpy as np import mechnet as mn import shutil from multiprocessing import Pool sys.path.append("/home/lpyka/hierarchical_interface/") from lib.push_data import push_data_to, copy_runfile_to Loading Loading @@ -31,21 +32,24 @@ def rerun_simulation(restart_data_zipped): if __name__ == "__main__": list_of_seeds = [] offset = 5 crack_lenght = 20 crack_lenght = 10 restart_data_zipped = [] for seed in range(1000, 1010): filepath = f"/FASTTEMP/p7/lpyka/hierarchical_interface/6_precrack_density_offset/a_{crack_lenght}/FDB_PARSOL_SIRC-FCVC_SOG-IVCG_HFBA_CPC-NIC_-_{seed}.h5" for seed in range(1010, 1050): origin_path = f"/FASTTEMP/p7/lpyka/hierarchical_interface/5_precracked/a_{crack_lenght}/FDB_PARSOL_SIRC-FCVC_SOG-IVCG_HFBA_CPC-NIC_-_{seed}.h5" filepath = f"/FASTTEMP/p7/lpyka/rerun/FDB_PARSOL_SIRC-FCVC_SOG-IVCG_HFBA_CPC-NIC_-_{seed}.h5" shutil.move(origin_path, filepath) grouppath_bundle = mn.datman.bundle_all_sub_groups(filepath, ["simulationdata"], flaglist=[["partial", True]]) path_to_simdata_group = grouppath_bundle[0] restart_data_zipped.append([seed, filepath, path_to_simdata_group]) with Pool(10) as p: with Pool(50) as p: results = p.map(rerun_simulation, restart_data_zipped) # for data in results: # mn.datman.save_simulation_output(data[0], data[1], data[2], data[3], targetdirectory="./", suffix="", overwritemode=False) #print(data[1]["current_data"]["stiffnessmatrix"].toarray()) destination = f"/FASTTEMP/p7/lpyka/hierarchical_interface/6_precrack_density_offset/a_{crack_lenght}" destination = f"/FASTTEMP/p7/lpyka/hierarchical_interface/5_precracked/a_{crack_lenght}" push_data_to(destination) copy_runfile_to(runfile_name=__file__, destination=destination) print(f"done with crack_lenght {crack_length}") Loading Loading
6b_restart_precrack_density/restart.py +9 −5 Original line number Diff line number Diff line import sys import numpy as np import mechnet as mn import shutil from multiprocessing import Pool sys.path.append("/home/lpyka/hierarchical_interface/") from lib.push_data import push_data_to, copy_runfile_to Loading Loading @@ -31,21 +32,24 @@ def rerun_simulation(restart_data_zipped): if __name__ == "__main__": list_of_seeds = [] offset = 5 crack_lenght = 20 crack_lenght = 10 restart_data_zipped = [] for seed in range(1000, 1010): filepath = f"/FASTTEMP/p7/lpyka/hierarchical_interface/6_precrack_density_offset/a_{crack_lenght}/FDB_PARSOL_SIRC-FCVC_SOG-IVCG_HFBA_CPC-NIC_-_{seed}.h5" for seed in range(1010, 1050): origin_path = f"/FASTTEMP/p7/lpyka/hierarchical_interface/5_precracked/a_{crack_lenght}/FDB_PARSOL_SIRC-FCVC_SOG-IVCG_HFBA_CPC-NIC_-_{seed}.h5" filepath = f"/FASTTEMP/p7/lpyka/rerun/FDB_PARSOL_SIRC-FCVC_SOG-IVCG_HFBA_CPC-NIC_-_{seed}.h5" shutil.move(origin_path, filepath) grouppath_bundle = mn.datman.bundle_all_sub_groups(filepath, ["simulationdata"], flaglist=[["partial", True]]) path_to_simdata_group = grouppath_bundle[0] restart_data_zipped.append([seed, filepath, path_to_simdata_group]) with Pool(10) as p: with Pool(50) as p: results = p.map(rerun_simulation, restart_data_zipped) # for data in results: # mn.datman.save_simulation_output(data[0], data[1], data[2], data[3], targetdirectory="./", suffix="", overwritemode=False) #print(data[1]["current_data"]["stiffnessmatrix"].toarray()) destination = f"/FASTTEMP/p7/lpyka/hierarchical_interface/6_precrack_density_offset/a_{crack_lenght}" destination = f"/FASTTEMP/p7/lpyka/hierarchical_interface/5_precracked/a_{crack_lenght}" push_data_to(destination) copy_runfile_to(runfile_name=__file__, destination=destination) print(f"done with crack_lenght {crack_length}") Loading