git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@8933 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2012-10-10 15:09:05 +00:00
parent 43a5f76cdc
commit 88de4f6760
3 changed files with 14 additions and 20 deletions

View File

@ -780,14 +780,13 @@ void PPPM::set_grid()
// reduce it until accuracy target is met
if (!gridflag) {
if (differentiation_flag == 1) {
h = h_x = h_y = h_z = 4.0/g_ewald;
int count = 0;
while (1) {
// set grid dimension
nx_pppm = static_cast<int> (xprd/h_x);
ny_pppm = static_cast<int> (yprd/h_y);
nz_pppm = static_cast<int> (zprd_slab/h_z);
@ -796,7 +795,8 @@ void PPPM::set_grid()
if (ny_pppm <= 1) ny_pppm = 2;
if (nz_pppm <= 1) nz_pppm = 2;
//set local grid dimension
// set local grid dimension
int npey_fft,npez_fft;
if (nz_pppm >= nprocs) {
npey_fft = 1;
@ -814,20 +814,18 @@ void PPPM::set_grid()
nzhi_fft = (me_z+1)*nz_pppm/npez_fft - 1;
double df_kspace = compute_df_kspace();
count++;
// break loop if the accuracy has been reached or
// too many loops have been performed
// if too many loops have been performed
if (df_kspace <= accuracy) break;
if (count > 500) error->all(FLERR, "Could not compute grid size!");
if (count > 500) error->all(FLERR,"Could not compute PPPM grid size");
h *= 0.95;
h_x = h_y = h_z = h;
}
} else {
double err;
h_x = h_y = h_z = 1.0/g_ewald;
@ -1000,6 +998,7 @@ double PPPM::compute_qopt()
}
}
}
double qopt_all;
MPI_Allreduce(&qopt,&qopt_all,1,MPI_DOUBLE,MPI_SUM,world);
return qopt_all;
@ -1053,9 +1052,7 @@ double PPPM::newton_raphson_f()
double df_rspace = 2.0*q2*exp(-g_ewald*g_ewald*cutoff*cutoff) /
sqrt(natoms*cutoff*xprd*yprd*zprd);
double df_kspace = compute_df_kspace();
return df_rspace - df_kspace;
}

View File

@ -81,7 +81,8 @@ class PPPM : public KSpace {
double *gf_b;
FFT_SCALAR **rho1d,**rho_coeff,**drho1d,**drho_coeff;
double *sf_precoeff1, *sf_precoeff2, *sf_precoeff3, *sf_precoeff4, *sf_precoeff5, *sf_precoeff6;
double *sf_precoeff1, *sf_precoeff2, *sf_precoeff3;
double *sf_precoeff4, *sf_precoeff5, *sf_precoeff6;
double sf_coeff[6]; // coefficients for calculating ad self-forces
double **acons;

View File

@ -45,8 +45,8 @@ class KSpace : protected Pointers {
int proxyflag; // 1 if a proxy solver
double g_ewald,g_ewald_6;
int nx_pppm,ny_pppm,nz_pppm;
int nx_pppm_6,ny_pppm_6,nz_pppm_6;
int nx_pppm,ny_pppm,nz_pppm; // global FFT grid for Coulombics
int nx_pppm_6,ny_pppm_6,nz_pppm_6; // global FFT grid for dispersion
int nx_msm_max,ny_msm_max,nz_msm_max;
int group_group_enable; // 1 if style supports group/group calculation
@ -69,14 +69,10 @@ class KSpace : protected Pointers {
virtual void compute(int, int) = 0;
virtual void compute_group_group(int, int, int) {};
virtual int pack_forward(int, FFT_SCALAR *,
int, int, int, int, int, int) {return 0;};
virtual void unpack_forward(int, FFT_SCALAR *,
int, int, int, int, int, int) {};
virtual int pack_reverse(int, FFT_SCALAR *,
int, int, int, int, int, int) {return 0;};
virtual void unpack_reverse(int, FFT_SCALAR *,
int, int, int, int, int, int) {};
virtual int pack_forward(int, FFT_SCALAR *, int, int *) {return 0;};
virtual void unpack_forward(int, FFT_SCALAR *, int, int *) {};
virtual int pack_reverse(int, FFT_SCALAR *, int, int *) {return 0;};
virtual void unpack_reverse(int, FFT_SCALAR *, int, int *) {};
virtual int timing(int, double &, double &) {return 0;}
virtual int timing_1d(int, double &) {return 0;}