491 |
|
|
492 |
|
template<typename T> void ZConstraint<T>::resetZ() |
493 |
|
{ |
494 |
+ |
|
495 |
+ |
double pos[3]; |
496 |
|
double deltaZ; |
497 |
|
double mzOfZCons; //total sum of m*z of z-constrain molecules |
498 |
|
double mzOfUncons; //total sum of m*z of unconstrain molecuels; |
536 |
|
//update z coordinate |
537 |
|
zconsAtoms = zconsMols[i]->getMyAtoms(); |
538 |
|
for(int j =0; j < zconsMols[i]->getNAtoms(); j++){ |
539 |
< |
zconsAtoms[j]->setZ(zconsAtoms[j]->getZ() + deltaZ); |
539 |
> |
zconsAtoms[j]->getPos(pos); |
540 |
> |
pos[2] += deltaZ; |
541 |
> |
zconsAtoms[j]->setPos(pos); |
542 |
|
} |
543 |
|
|
544 |
|
//calculate z constrain force |