Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug with ES solver and MR: E_aux=E_fp in UpdateAuxilaryData #4922

Merged
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
9ee80aa
Removal of asserttion which prevented from usung the averaged PSATD a…
oshapoval Apr 12, 2024
301d7f9
Merge remote-tracking branch 'origin/development' into development
oshapoval May 8, 2024
dcc64ff
Merge remote-tracking branch 'origin/development' into development
oshapoval May 10, 2024
f53ef4b
Clean-up
oshapoval May 10, 2024
b4fb38a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 10, 2024
8b30b0d
Fixed to arr_aux(j,k,l) = fine when ES solve is used
oshapoval May 14, 2024
88959b2
Removed temporary print statements
oshapoval May 14, 2024
85b507e
Merge remote-tracking branch 'origin/development' into mr_fix_auxilar…
oshapoval May 14, 2024
e0b20ad
Fixed aftermerge conflicts.
oshapoval May 14, 2024
93076c3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 14, 2024
96d7cd5
Clean-up
oshapoval May 14, 2024
8bed4e3
Merge remote-tracking branch 'origin/development' into mr_fix_auxilar…
oshapoval May 14, 2024
fc6aaa1
Merge branch 'mr_fix_auxilary_update_es_solver' of https://github.com…
oshapoval May 14, 2024
8e1db1c
Added CI test ElectrostaticSphereEB_RZ_MR_lev_1 to check the fields o…
oshapoval May 14, 2024
9f52fdf
Updated becnmarks for ElectrostaticSphereLabFrame_MR_emass_10
oshapoval May 14, 2024
c8c492c
Imported regular expression (re) in the analysis script.
oshapoval May 14, 2024
825966f
Fixed typo
oshapoval May 15, 2024
db1c845
United two CI tests for different levels of MR in one test.
oshapoval May 17, 2024
4a11552
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 17, 2024
432847e
Updated CI test ElectrostaticSphereEB_RZ_MR and the corresponding ana…
oshapoval May 22, 2024
b35a2e0
Merge remote-tracking branch 'origin/development' into mr_fix_auxilar…
oshapoval May 22, 2024
7595cbc
Merge branch 'mr_fix_auxilary_update_es_solver' of https://github.com…
oshapoval May 22, 2024
4011ea4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 22, 2024
4eb23bd
Clean-up
oshapoval May 22, 2024
a43ab6f
Merge branch 'mr_fix_auxilary_update_es_solver' of https://github.com…
oshapoval May 22, 2024
b108843
Do deepcopy for lev>0 and collocated grid
oshapoval Jun 5, 2024
c46b6da
Merge remote-tracking branch 'origin/development' into mr_fix_auxilar…
oshapoval Jun 5, 2024
1609c3d
Merge `development` into `mr_fix_auxilary_update_es_solver`
EZoni Jul 3, 2024
e5f0de6
Fix bugs to resolve failure of CI tests
EZoni Jul 5, 2024
947cae4
Preserve plotfile output, update benchmark file
EZoni Jul 5, 2024
bdaea6a
Working on CI test
EZoni Jul 8, 2024
341a5b8
Update benchmark of `ElectrostaticSphereEB_RZ_MR`
EZoni Jul 9, 2024
350e39a
Merge `development` into `mr_fix_auxilary_update_es_solver`
EZoni Jul 9, 2024
0b5ffcb
Merge `development` into `mr_fix_auxilary_update_es_solver`
EZoni Jul 11, 2024
4c61951
Initialize with value all `aux`, `cax` fields
EZoni Jul 15, 2024
9407bf9
Merge `EZoni_init_cax_fields` into `mr_fix_auxilary_update_es_solver`
EZoni Jul 15, 2024
3173927
Merge `development` into `mr_fix_auxilary_update_es_solver`
EZoni Jul 15, 2024
bacbe36
Remove changes related to averaged Galilean PSATD with PML
EZoni Jul 16, 2024
da88784
Remove style changes (e.g., changes to empty lines)
EZoni Jul 16, 2024
eb3d193
Replace `MFIter`/`ParallelFor` loop with simple copy
EZoni Jul 17, 2024
3dc91e5
Apply suggestions from code review
EZoni Jul 17, 2024
74527bf
Revert part of the code to its previous, equivalent state
RemiLehe Jul 18, 2024
e526756
Merge `development` into `mr_fix_auxilary_update_es_solver`
EZoni Jul 22, 2024
b9ade22
Removed DeepCopy & no need for ghost cells in temp phi_cp.
oshapoval Jul 22, 2024
d86f61a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 22, 2024
77ee327
Update Source/ablastr/fields/PoissonSolver.H
WeiqunZhang Jul 23, 2024
8c37648
Add inline comments
EZoni Jul 25, 2024
30b7965
Update analysis script
EZoni Jul 25, 2024
fd6dc18
Use `TilingIfNotGPU`, `growntilebox` in E loop
EZoni Jul 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 43 additions & 30 deletions Examples/Tests/electrostatic_sphere_eb/analysis_rz.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,39 +31,52 @@
fn = sys.argv[1]
ds = yt.load( fn )

all_data_level_0 = ds.covering_grid(level=0,left_edge=ds.domain_left_edge, dims=ds.domain_dimensions)
phi = all_data_level_0['boxlib', 'phi'].v.squeeze()
Er = all_data_level_0['boxlib', 'Er'].v.squeeze()
def get_error_per_lev(ds, level):
if level == 1:
dims = ds.domain_dimensions * ds.refine_by**level
all_data_level = ds.covering_grid(level=level, left_edge=ds.domain_left_edge, dims=dims)
phi = all_data_level['boxlib', 'phi'].v.squeeze()
phi = phi[:,:,0]
Er = all_data_level['boxlib', 'Er'].v.squeeze()
Er = Er[:,:,0]
elif level==0:
dims = ds.domain_dimensions * ds.refine_by**level
all_data_level = ds.covering_grid(level=level, left_edge=ds.domain_left_edge, dims=dims)
phi = all_data_level['boxlib', 'phi'].v.squeeze()
Er = all_data_level['boxlib', 'Er'].v.squeeze()

Dx = ds.domain_width/ds.domain_dimensions
dr = Dx[0]
rmin = ds.domain_left_edge[0]
rmax = ds.domain_right_edge[0]
nr = phi.shape[0]
r = np.linspace(rmin+dr/2.,rmax-dr/2.,nr)
B = 1.0/np.log(0.1/0.5)
A = -B*np.log(0.5)
Dx = ds.domain_width/dims
dr = Dx[0]
rmin = ds.domain_left_edge[0]
rmax = ds.domain_right_edge[0]
nr = phi.shape[0]
Fixed Show fixed Hide fixed
r = np.linspace(rmin+dr/2.,rmax-dr/2.,nr)
B = 1.0/np.log(0.1/0.5)
A = -B*np.log(0.5)
err = 0.0
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed
errmax_phi = 0.0
errmax_Er = 0.0
for i in range(len(r)):
# outside EB and last cutcell
if r[i] > 0.1*m + dr:
phi_theory = A+B*np.log(r[i])
Er_theory = -B/float(r[i])
err = abs( phi_theory - phi[i,:] ).max() / phi_theory
if err>errmax_phi:
errmax_phi = err
err = abs( Er_theory - Er[i,:] ).max() / Er_theory
Fixed Show fixed Hide fixed
# Exclude the last inaccurate interpolation.
if err>errmax_Er and i<len(r)-1:
errmax_Er = err

err = 0.0
errmax_phi = 0.0
errmax_Er = 0.0
for i in range(len(r)):
# outside EB and last cutcell
if r[i] > 0.1*m + dr:
phi_theory = A+B*np.log(r[i])
Er_theory = -B/float(r[i])
err = abs( phi_theory - phi[i,:] ).max() / phi_theory
if err>errmax_phi:
errmax_phi = err
err = abs( Er_theory - Er[i,:] ).max() / Er_theory
# Exclude the last inaccurate interpolation.
if err>errmax_Er and i<len(r)-1:
errmax_Er = err
print('max error of phi = ', errmax_phi)
print('max error of Er = ', errmax_Er)
print('tolerance = ', tolerance)
assert(errmax_phi<tolerance and errmax_Er<tolerance)

print('max error of phi = ', errmax_phi)
print('max error of Er = ', errmax_Er)
print('tolerance = ', tolerance)
assert(errmax_phi<tolerance and errmax_Er<tolerance)
levels = [0,1]
for level in levels:
get_error_per_lev(ds,level)

test_name = os.path.split(os.getcwd())[1]
checksumAPI.evaluate_checksum(test_name, fn, do_particles=False)
EZoni marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"phi": 2036.0428085225362
},
"lev=1": {
"Er": 19519.172334977942,
"phi": 3291.0262856782897
"Er": 9563.742949788306,
"phi": 3290.9609834276607
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
"rho": 0.0
},
"lev=1": {
"Ex": 14.281015560380963,
"Ey": 14.281015560380965,
"Ez": 14.281015560380965,
"Ex": 7.170105936287823,
"Ey": 7.17010593628782,
"Ez": 7.170105936287821,
"rho": 2.6092568008333786e-10
},
"electron": {
"particle_momentum_x": 1.80842228672388e-24,
"particle_momentum_y": 1.8084222867238806e-24,
"particle_momentum_z": 1.7598771525647628e-24,
"particle_momentum_x": 9.257577597262615e-25,
"particle_momentum_y": 9.257577597262618e-25,
"particle_momentum_z": 9.257577597262624e-25,
"particle_position_x": 327.46875,
"particle_position_y": 327.46875,
"particle_position_z": 327.46875,
Expand Down
2 changes: 1 addition & 1 deletion Regression/WarpX-tests.ini
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ analysisRoutine = Examples/Tests/electrostatic_sphere_eb/analysis_rz.py
[ElectrostaticSphereEB_RZ_MR]
buildDir = .
inputFile = Examples/Tests/electrostatic_sphere_eb/inputs_rz_mr
runtime_params = warpx.abort_on_warning_threshold = medium
runtime_params = warpx.abort_on_warning_threshold = medium warpx.fine_tag_lo = 0.0 -0.5 warpx.fine_tag_hi = 0.5 0.5 amr.ref_ratio_vect = 2 2 2
dim = 2
addToCompileString = USE_EB=TRUE USE_RZ=TRUE
cmakeSetupOpts = -DWarpX_DIMS=RZ -DWarpX_EB=ON
Expand Down
Loading
Loading