File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,17 @@ void Grid_MeshBall::init_meshball(void)
4040 // select a ball in a cubic.
4141 double pos[3 ];
4242 double r2=0.0 ;
43- const double rcut2 = this ->meshball_radius * this ->meshball_radius ;
43+
44+ // ------------------------------------------------------------------
45+ // const double rcut2 = this->meshball_radius * this->meshball_radius;
46+ // qianrui fix a bug and add 0.001 2022-4-30
47+ // Sometimes r2 is equal to rcut2, for example they are 36.
48+ // However, r2 is either 35.99.. or 36.0..001, which makes count != this->meshball_ncells
49+ // and segment fault.
50+ // I do not know how to solve it and this may occurs in somewhere else in ABACUS.
51+ // May some genius can give a better solution.
52+ // ------------------------------------------------------------------
53+ const double rcut2 = this ->meshball_radius * this ->meshball_radius + 0.001 ;
4454
4555 // -------------------------------------------------------------------
4656 // calculate twice, the first time find the number of mesh points,
You can’t perform that action at this time.
0 commit comments