Skip to content

Commit

Permalink
include level 0 maxfield to capture no j damping effect
Browse files Browse the repository at this point in the history
  • Loading branch information
RevathiJambunathan committed Feb 28, 2024
1 parent ea0babc commit 3afca6d
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions Examples/Tests/particles_in_pml/analysis_particles_in_pml_2dmr.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,19 @@
ds = yt.load( filename )

# Check that the field is low enough
ad0 = ds.covering_grid(level=1, left_edge=ds.domain_left_edge, dims=ds.domain_dimensions)
Ex_array = ad0[('mesh','Ex')].to_ndarray()
Ey_array = ad0[('mesh','Ey')].to_ndarray()
Ez_array = ad0[('mesh','Ez')].to_ndarray()
max_Efield = max(Ex_array.max(), Ey_array.max(), Ez_array.max())
print( "max_Efield = %s" %max_Efield )
ad0 = ds.covering_grid(level=0, left_edge=ds.domain_left_edge, dims=ds.domain_dimensions)
Ex_array_lev0 = ad0[('mesh','Ex')].to_ndarray()
Ey_array_lev0 = ad0[('mesh','Ey')].to_ndarray()
Ez_array_lev0 = ad0[('mesh','Ez')].to_ndarray()
max_Efield_lev0 = max(Ex_array_lev0.max(), Ey_array_lev0.max(), Ez_array_lev0.max())
print( "max_Efield level0 = %s" %max_Efield_lev0 )

ad1 = ds.covering_grid(level=1, left_edge=ds.domain_left_edge, dims=ds.domain_dimensions)
Ex_array_lev1 = ad1[('mesh','Ex')].to_ndarray()
Ey_array_lev1 = ad1[('mesh','Ey')].to_ndarray()
Ez_array_lev1 = ad1[('mesh','Ez')].to_ndarray()
max_Efield_lev1 = max(Ex_array_lev1.max(), Ey_array_lev1.max(), Ez_array_lev1.max())
print( "max_Efield level1 = %s" %max_Efield_lev1 )

# The field associated with the particle does not have
# the same amplitude in 2d and 3d
Expand All @@ -54,7 +61,8 @@
raise ValueError("Unknown dimensionality")

print("tolerance_abs: " + str(tolerance_abs))
assert max_Efield < tolerance_abs
assert max_Efield_lev0 < tolerance_abs
assert max_Efield_lev1 < tolerance_abs

test_name = os.path.split(os.getcwd())[1]
checksumAPI.evaluate_checksum(test_name, filename)

0 comments on commit 3afca6d

Please sign in to comment.