mirror of
https://github.com/edoverg/modeconverter.git
synced 2026-10-14 23:06:39 +00:00
another parameter test
This commit is contained in:
+3
-3
@@ -16,15 +16,15 @@ for filename in input_files:
|
|||||||
# Extract time from filename (e.g., "metapeg_v2-ex-000050.00.h5" → 50.00)
|
# Extract time from filename (e.g., "metapeg_v2-ex-000050.00.h5" → 50.00)
|
||||||
time = float(filename.split("-")[-1].split(".h5")[0])
|
time = float(filename.split("-")[-1].split(".h5")[0])
|
||||||
times.append(time)
|
times.append(time)
|
||||||
data.append(Ex)
|
data.append(Ex[:,0,:])
|
||||||
print(f"Loaded {filename}, time={time}")
|
print(f"Loaded {filename}, time={time}")
|
||||||
print(len(data))
|
print(len(data))
|
||||||
# Create animation
|
# Create animation
|
||||||
fig, ax = plt.subplots()
|
fig, ax = plt.subplots()
|
||||||
x = np.linspace(-4, 4) #assuming x is the last dimension
|
x = np.linspace(-4, 4) #assuming x is the last dimension
|
||||||
z = np.linspace(-3, 3) #assuming z is the first dimension
|
z = np.linspace(-3, 3) #assuming z is the first dimension
|
||||||
max_clim = np.max([np.abs(data[i][:,0,:]) for i in range(len(data))])
|
max_clim = np.max([np.abs(data[i]) for i in range(len(data))])
|
||||||
min_clim = np.min([np.abs(data[i][:,0,:]) for i in range(len(data))])
|
min_clim = np.min([np.abs(data[i]) for i in range(len(data))])
|
||||||
print(max_clim)
|
print(max_clim)
|
||||||
def animate(frame):
|
def animate(frame):
|
||||||
ax.clear()
|
ax.clear()
|
||||||
|
|||||||
+4
-4
@@ -409,10 +409,10 @@ def normalization_sim() -> np.ndarray:
|
|||||||
norm_near2far = norm_sim.add_near2far(frequencies, *NearRegions)
|
norm_near2far = norm_sim.add_near2far(frequencies, *NearRegions)
|
||||||
|
|
||||||
norm_sim.run(
|
norm_sim.run(
|
||||||
mp.at_every(1,mp.in_volume(
|
#mp.at_every(1,mp.in_volume(
|
||||||
mp.Volume(center=mp.Vector3(), size=physical_domains_size),
|
# mp.Volume(center=mp.Vector3(), size=physical_domains_size),
|
||||||
mp.output_efield_x
|
# mp.output_efield_x
|
||||||
)),
|
#)),
|
||||||
#mp.at_every(20,record_fields),
|
#mp.at_every(20,record_fields),
|
||||||
until_after_sources=stop_cond
|
until_after_sources=stop_cond
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user