diff options
Diffstat (limited to 'Examples/Modules/RigidInjection/analysis_rigid_injection_LabFrame.py')
-rwxr-xr-x | Examples/Modules/RigidInjection/analysis_rigid_injection_LabFrame.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Examples/Modules/RigidInjection/analysis_rigid_injection_LabFrame.py b/Examples/Modules/RigidInjection/analysis_rigid_injection_LabFrame.py index 624fd8f7c..ee88e3225 100755 --- a/Examples/Modules/RigidInjection/analysis_rigid_injection_LabFrame.py +++ b/Examples/Modules/RigidInjection/analysis_rigid_injection_LabFrame.py @@ -18,6 +18,9 @@ the theory (with a 5% error allowed). As a help to the user, the script also compares beam width to the theory in case rigid injection is OFF (i.e., the beam starts expanding from -5 microns), in which case a warning is raised. + +Additionally, this script tests that runtime attributes are correctly initialized +with the gaussian_beam injection style. ''' import os @@ -85,5 +88,17 @@ print("tolerance_rel: " + str(tolerance_rel)) assert( error_rel < tolerance_rel ) + +### Check that user runtime attributes are correctly initialized +filename_start = filename[:-5] + '00000' +ds_start = yt.load( filename_start ) +ad_start = ds_start.all_data() +x = ad_start['beam', 'particle_position_x'] +z = ad_start['beam', 'particle_position_y'] +orig_z = ad_start['beam', 'particle_orig_z'] +center = ad_start['beam', 'particle_center'] +assert(np.array_equal(z, orig_z)) +assert(np.array_equal(1*(np.abs(x) < 5.e-7), center)) + test_name = os.path.split(os.getcwd())[1] checksumAPI.evaluate_checksum(test_name, filename) |