compute reduce/region min y seems bug

Hi there. compute reduce/region with min y result to incorrect value

This computes must be with same result, but not.

region reduc block INF INF INF INF INF INF
compute 1 all reduce/region reduc min y
compute 2 all reduce min y

“max y” works correct.

There is easy input for reproduce

units metal
dimension 3
boundary s s p
atom_style atomic
lattice fcc 3.52
region box block 0 20 0 20 0 20 units box
create_box 1 box
create_atoms 1 box
pair_style eam/alloy
pair_coeff * * Mishin-Ni-Al-2009.eam.alloy Ni

region reduc block INF INF INF INF INF INF

compute 1 all reduce/region reduc min y
compute 2 all reduce/region reduc max y
compute 3 all reduce min y
compute 4 all reduce max y
thermo_style custom step c_1 c_2 c_3 c_4
fix 1 all nve
run 1

Hi there. compute reduce/region with min y result to incorrect value

Step 1 2 3 4
       0 -1e+20 19.36 0 19.36
       1 -1e+20 19.360286 -0.00028600135 19.360286
__________________________________________

I got this on win and linux versions, on both gpu and cpu runs.

yes, this is a bug. some features were added to compute reduce without
updating compute reduce/region accordingly.

you need the following change to make your input run correctly:

diff --git a/src/compute_reduce_region.cpp b/src/compute_reduce_region.cpp
index 420a85c..6a30fcb 100644
--- a/src/compute_reduce_region.cpp
+++ b/src/compute_reduce_region.cpp
@@ -28,7 +28,7 @@

using namespace LAMMPS_NS;

-enum{SUM,MINN,MAXX,AVE};
+enum{SUM,SUMSQ,MINN,MAXX,AVE,AVESQ};
enum{X,V,F,COMPUTE,FIX,VARIABLE};
enum{PERATOM,LOCAL};

axel.

will be fixed in next patch -

thanks,

Steve