mirror of
https://github.com/edoverg/modeconverter.git
synced 2026-10-14 23:06:39 +00:00
solved conflict on folder creation among multiple processes
This commit is contained in:
+4
-3
@@ -15,8 +15,9 @@ from PIL import Image
|
|||||||
import pickle
|
import pickle
|
||||||
mp.verbosity(3)
|
mp.verbosity(3)
|
||||||
|
|
||||||
if not os.path.exists("results"):
|
if mp.am_master():
|
||||||
os.makedirs("results")
|
if not os.path.exists("results"):
|
||||||
|
os.makedirs("results")
|
||||||
|
|
||||||
###### PHYSICS SETUP ######
|
###### PHYSICS SETUP ######
|
||||||
RESOLUTION = 20 #pixels per meep unit length (1um)
|
RESOLUTION = 20 #pixels per meep unit length (1um)
|
||||||
@@ -423,7 +424,7 @@ def normalization_sim() -> np.ndarray:
|
|||||||
#norm_sim.plot2D(output_plane=view_2D_plane, fields=mp.Ex, ax=ax)
|
#norm_sim.plot2D(output_plane=view_2D_plane, fields=mp.Ex, ax=ax)
|
||||||
#plt.savefig("results/fields_after_norm_sim.pdf")
|
#plt.savefig("results/fields_after_norm_sim.pdf")
|
||||||
#plt.close()
|
#plt.close()
|
||||||
|
|
||||||
ref_fields = np.array(
|
ref_fields = np.array(
|
||||||
[norm_sim.get_farfield(norm_near2far, point) for point in ff_points]
|
[norm_sim.get_farfield(norm_near2far, point) for point in ff_points]
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user