aboutsummaryrefslogtreecommitdiff
path: root/Examples/Modules/embedded_boundary_cube/analysis_fields.py
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/Modules/embedded_boundary_cube/analysis_fields.py')
-rwxr-xr-xExamples/Modules/embedded_boundary_cube/analysis_fields.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/Examples/Modules/embedded_boundary_cube/analysis_fields.py b/Examples/Modules/embedded_boundary_cube/analysis_fields.py
index 58dad1bb7..e4b461edd 100755
--- a/Examples/Modules/embedded_boundary_cube/analysis_fields.py
+++ b/Examples/Modules/embedded_boundary_cube/analysis_fields.py
@@ -32,7 +32,13 @@ Lx = 1
Ly = 1
Lz = 1
h_2 = (m * pi / Lx) ** 2 + (n * pi / Ly) ** 2 + (p * pi / Lz) ** 2
-t = 1.3342563807926085e-08
+
+# Open the right plot file
+filename = sys.argv[1]
+ds = yt.load(filename)
+data = ds.covering_grid(level=0, left_edge=ds.domain_left_edge, dims=ds.domain_dimensions)
+
+t = ds.current_time.to_value()
# Compute the analytic solution
Bx_th = np.zeros(ncells)
@@ -65,11 +71,6 @@ for i in range(ncells[0]):
(-Lz/2 <= z < Lz/2) *
np.cos(np.sqrt(2) * np.pi / Lx * c * t))
-# Open the right plot file
-filename = sys.argv[1]
-ds = yt.load(filename)
-data = ds.covering_grid(level=0, left_edge=ds.domain_left_edge, dims=ds.domain_dimensions)
-
rel_tol_err = 1e-1
# Compute relative l^2 error on By