Skip to content

Commit

Permalink
Fix incorrectly reduced variables in nimhd test (#235)
Browse files Browse the repository at this point in the history
Type of PR: 
Bug fix

Description:
Required for #217 

In a93bc90, as part of implementing MPI support for nimhd tests, the L2 error variables were reduced across tasks.

There is a typo resulting in the `v_x` and `B_y` error being overwritten by the density error. This produces a test failure due to the tolerance not being met.

In df72df1, NICIL 2.1 was added to phantom, where the tolerance for `B_y` was changed to `tolb=3.1d-2`. This was change was made possibly because the apparent improved accuracy was wrongly attributed to improvements to the code, rather than because the the density error was overwriting the `B_y` error.

`tolb` has been reverted to the original value of `1.1d-1`.

Testing:
```
make MPI=yes SETUP=testnimhd OPENMP=no phantomtest
mpirun -n 4 bin/phantomtest nimhd
```

Did you run the bots? no, not required
  • Loading branch information
conradtchan committed Feb 17, 2022
1 parent d40b5a6 commit 20779bd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/tests/test_nonidealmhd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ subroutine test_standingshock(ntests,npass)
real :: t,dt,dtext,dtnew
real :: dexact,bexact,vexact,L2d,L2v,L2b,dx
real :: leftstate(8),rightstate(8),exact_x(51),exact_d(51),exact_vx(51),exact_by(51)
real, parameter :: told = 2.1d-2, tolv=3.1d-2, tolb=3.1d-2
real, parameter :: told = 2.1d-2, tolv=3.1d-2, tolb=1.1d-1
logical :: valid_dt
logical, parameter :: print_output = .false.
logical :: valid_bdy_rho,valid_bdy_v
Expand Down Expand Up @@ -498,8 +498,8 @@ subroutine test_standingshock(ntests,npass)
endif
npts = int(reduceall_mpi('+',npts))
L2d = reduceall_mpi('+',L2d)
L2v = reduceall_mpi('+',L2d)
L2b = reduceall_mpi('+',L2d)
L2v = reduceall_mpi('+',L2v)
L2b = reduceall_mpi('+',L2b)
if (npts > 0) then
L2d = sqrt(L2d/npts)
L2v = sqrt(L2v/npts)
Expand Down

0 comments on commit 20779bd

Please sign in to comment.