Skip to content

Commit

Permalink
OH cyclic
Browse files Browse the repository at this point in the history
garyzhang91 committed May 22, 2018

Unverified

No user is associated with the committer email.
1 parent e015fb1 commit 71b9623
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions energy.c
Original file line number Diff line number Diff line change
@@ -2109,24 +2109,28 @@ double global_energy(int start, int end, Chain *chain, Chaint *chaint, Biasmap *
if (mod_params->external_potential_type2 == 4) {
double CaDistance = 0.0;
double NCDistance = 0.0;
double OHDistance = 0.0;
// for first evaluation
if (start == 0 && end == 0) {
NCDistance = distance(((chain->aa) + 1)->n, ((chain->aa) + chain->NAA - 1)->c);
CaDistance = distance(((chain->aa) + 1)->ca, ((chain->aa) + chain->NAA - 1)->ca);
OHDistance = distance(((chain->aa) + 1)->h, ((chain->aa) + chain->NAA - 1)->o);
}
// if motion does not change the C-N bond, use starting conformation
else if (start > 1 && end < chain->NAA - 1) {
NCDistance = distance(((chain->aa) + 1)->n, ((chain->aa) + chain->NAA - 1)->c);
CaDistance = distance(((chain->aa) + 1)->ca, ((chain->aa) + chain->NAA - 1)->ca);
OHDistance = distance(((chain->aa) + 1)->h, ((chain->aa) + chain->NAA - 1)->o);
}
// if motion moves the C-N bond, use conformation after the motion
else {
NCDistance = distance(((chaint->aat) + 1)->n, ((chaint->aat) + chain->NAA - 1)->c);
CaDistance = distance(((chaint->aat) + 1)->ca, ((chaint->aat) + chain->NAA - 1)->ca);
OHDistance = distance(((chaint->aat) + 1)->h, ((chaint->aat) + chain->NAA - 1)->o);
}
if (1 || CaDistance > 5) ans += (sqrt(CaDistance) - 3.819)*(sqrt(CaDistance) - 3.819);
if (1 || NCDistance > 1.5 || NCDistance < 1.2) ans += 370 * (sqrt(NCDistance) - 1.345)*(sqrt(NCDistance) - 1.345)/ 0.59219;

if (1 || NCDistance > 1.5 || NCDistance < 1.2) ans += 37 * (sqrt(NCDistance) - 1.345)*(sqrt(NCDistance) - 1.345)/ 0.59219;
if (1 || OHDistance > 3.5 || OHDistance < 1.2) ans += 5 * (sqrt(CaDistance) - 3.13)*(sqrt(CaDistance) - 3.13);
}

//if (ans < externalBest) externalBest = ans;

0 comments on commit 71b9623

Please sign in to comment.