Skip to content

Commit b88c832

Browse files
author
Han Wang
committed
fix bug when compiling with float32
1 parent 8f09de9 commit b88c832

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

source/lib/include/Ewald.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ rec_err_esti(const VALUETYPE & test_q,
8181
template <typename VALUETYPE>
8282
void
8383
cmpt_k(vector<int> & KK,
84-
const SimulationRegion<VALUETYPE>& region,
84+
const SimulationRegion<double>& region,
8585
const EwaldParameters<VALUETYPE>& param)
8686
{
8787
const double * boxt_ = region.getBoxTensor();
@@ -154,7 +154,8 @@ EwaldReciprocal(VALUETYPE & ener,
154154
for (int ii = 0; ii < natoms; ++ii){
155155
int thread_id = omp_get_thread_num();
156156
double ir[3];
157-
region.phys2Inter(ir, &coord[ii*3]);
157+
double tmpcoord[3] = {coord[ii*3], coord[ii*3+1], coord[ii*3+2]};
158+
region.phys2Inter(ir, tmpcoord);
158159
for (int mm0 = -KK[0]/2; mm0 <= KK[0]/2; ++mm0){
159160
double mr[3];
160161
mr[0] = ir[0] * mm0;

0 commit comments

Comments
 (0)