Restructure 2D simulation pipeline to support isolated subdirectory-based device management and output directory relocation

This commit is contained in:
pchang718
2026-06-25 22:09:55 +08:00
parent 44b41698e8
commit 978b8d94d4
33 changed files with 2515 additions and 482 deletions
+5 -5
View File
@@ -28,7 +28,7 @@ recon_logic = """
if v_current >= next_recon_v:
state_data = save_state(device)
seed_data = {"voltage": v_current, "step_size": step_size, "state": state_data}
seed_filename = f"seed_{int(next_recon_v)}V.pkl"
seed_filename = f"{OUT_DIR}seed_{int(next_recon_v)}V.pkl"
with open(seed_filename, "wb") as f:
pickle.dump(seed_data, f)
print(f"\\n--- RECON PROBE at {v_current:.2f} V ---")
@@ -58,15 +58,15 @@ recon_logic = """
ia_p_p12 = devsim.get_contact_current(device=device, contact="MT1_P12_Si", equation="HoleContinuityEquation")
av_curr = ia_n_si + ia_p_si + ia_n_p12 + ia_p_p12
print(f"Avalanche Current at {v_current:.2f} V: {av_curr:.4e} A")
with open("recon_avalanche.log", "a") as f:
with open(f"{OUT_DIR}recon_avalanche.log", "a") as f:
f.write(f"{v_current:.2f}\\t{av_curr:.4e}\\n")
else:
print("Avalanche failed to converge.")
with open("recon_avalanche.log", "a") as f:
with open(f"{OUT_DIR}recon_avalanche.log", "a") as f:
f.write(f"{v_current:.2f}\\tFAILED\\n")
except devsim.error:
print("Avalanche failed to converge.")
with open("recon_avalanche.log", "a") as f:
with open(f"{OUT_DIR}recon_avalanche.log", "a") as f:
f.write(f"{v_current:.2f}\\tFAILED\\n")
# Restore state and Turn OFF Avalanche
@@ -90,7 +90,7 @@ current_list = [0.0]
# Recon variables
next_recon_v = 50.0
with open("recon_avalanche.log", "w") as f:
with open(f"{OUT_DIR}recon_avalanche.log", "w") as f:
f.write("Voltage(V)\\tAvalancheCurrent(A)\\n")
"""