Skip to content
Snippets Groups Projects
Commit b37664b4 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

squash bug in fix srp that was incorrectly comparing cutoffs for triclinic cells

parent b5b0f67b
No related branches found
No related tags found
No related merge requests found
...@@ -264,12 +264,21 @@ void FixSRP::setup_pre_force(int zz) ...@@ -264,12 +264,21 @@ void FixSRP::setup_pre_force(int zz)
rmax = sqrt(rsqmax); rmax = sqrt(rsqmax);
double cutneighmax_srp = neighbor->cutneighmax + 0.51*rmax; double cutneighmax_srp = neighbor->cutneighmax + 0.51*rmax;
// find smallest cutghost double length0,length1,length2;
double cutghostmin = comm->cutghost[0]; if (domain->triclinic) {
if (cutghostmin > comm->cutghost[1]) double *h_inv = domain->h_inv;
cutghostmin = comm->cutghost[1]; length0 = sqrt(h_inv[0]*h_inv[0] + h_inv[5]*h_inv[5] + h_inv[4]*h_inv[4]);
if (cutghostmin > comm->cutghost[2]) length1 = sqrt(h_inv[1]*h_inv[1] + h_inv[3]*h_inv[3]);
cutghostmin = comm->cutghost[2]; length2 = h_inv[2];
} else length0 = length1 = length2 = 1.0;
// find smallest cutghost.
// comm->cutghost is stored in fractional coordinates for triclinic
double cutghostmin = comm->cutghost[0]/length0;
if (cutghostmin > comm->cutghost[1]/length1)
cutghostmin = comm->cutghost[1]/length1;
if (cutghostmin > comm->cutghost[2]/length2)
cutghostmin = comm->cutghost[2]/length2;
// stop if cutghost is insufficient // stop if cutghost is insufficient
if (cutneighmax_srp > cutghostmin){ if (cutneighmax_srp > cutghostmin){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment