The multifab L2 norm routines simply return sum(a dot a). Thus, when you sum up norms from each grid you do NOT need to take them to the ^NORM power. The cell count (i.e. volume) scaling is performed lower
The formula is now implemented correctly, for p!=0:
L^p = ( 1/Ncell sum (phi_f - phi_c)^p ) ^(1/p)
(note that using cell volume instead of 1/Ncell accomplishes the proper scaling as well, which is what the code does)
Additional background
Checklist
The proposed changes:
[x] fix a bug or incorrect behavior in AMReX
[ ] add new capabilities to AMReX
[ ] changes answers in the test suite to more than roundoff level
[ ] are likely to significantly affect the results of downstream AMReX users
[ ] include documentation in the code and/or rst files, if appropriate
Summary
The multifab L2 norm routines simply return sum(a dot a). Thus, when you sum up norms from each grid you do NOT need to take them to the ^NORM power. The cell count (i.e. volume) scaling is performed lower
The formula is now implemented correctly, for p!=0:
L^p = ( 1/Ncell sum (phi_f - phi_c)^p ) ^(1/p)
(note that using cell volume instead of 1/Ncell accomplishes the proper scaling as well, which is what the code does)
Additional background
Checklist
The proposed changes: