375 #ifdef MEM_OPT_VERSION 376 typename ElemTraits<T>::signature *allSigs;
378 int32 **tuplesByAtom;
382 const P *tupleValues;
385 #ifdef MEM_OPT_VERSION 386 allSigs = ElemTraits<T>::get_sig_pointer(node->
molecule);
388 T::getMoleculePointers(node->
molecule,
389 &numTuples, &tuplesByAtom, &tupleStructs);
392 T::getParameterPointers(node->
parameters, &tupleValues);
403 Real invLesFactor = lesOn ?
420 for ( ai = ai.begin(); ai != ai.end(); ai++ )
428 for (
int j=0; j < numAtoms; j++)
431 #ifdef MEM_OPT_VERSION 432 typename ElemTraits<T>::signature *thisAtomSig =
433 &allSigs[ElemTraits<T>::get_sig_id(atomExt[j])];
435 T::getTupleInfo(thisAtomSig, &numTuples, &allTuples);
436 for(
int k=0; k<numTuples; k++) {
437 T t(atomExt[j].
id, &allTuples[k], tupleValues);
440 int32 *curTuple = tuplesByAtom[atomExt[j].
id];
441 for( ; *curTuple != -1; ++curTuple) {
442 T t(&tupleStructs[*curTuple],tupleValues);
446 int homepatch = aid[0].
pid;
453 int fep_tuple_type = 0;
454 for (i=1; i < T::size; i++) {
456 samepatch = samepatch && ( homepatch == aid[i].
pid );
466 if (sdScaling && is_fep_sd) {
467 for (i=0; i < num_unpert_bonds; i++) {
469 && t.atomID[0]==unpert_bonds[i].atom1
470 && t.atomID[1]==unpert_bonds[i].atom2) is_fep_sd = 0;
472 for (i=0; i < num_unpert_angles; i++) {
474 && t.atomID[0]==unpert_angles[i].atom1
475 && t.atomID[1]==unpert_angles[i].atom2
476 && t.atomID[2]==unpert_angles[i].atom3) is_fep_sd = 0;
478 for (i=0; i < num_unpert_dihedrals; i++) {
480 && t.atomID[0]==unpert_dihedrals[i].atom1
481 && t.atomID[1]==unpert_dihedrals[i].atom2
482 && t.atomID[2]==unpert_dihedrals[i].atom3
483 && t.atomID[3]==unpert_dihedrals[i].atom4) is_fep_sd = 0;
486 if (T::size < 4 && !soluteScalingAll) has_ss =
false;
487 if ( samepatch )
continue;
488 t.scale = (!has_les && !has_ss) ? 1.0 : ( has_les ? invLesFactor : soluteScalingFactor );
489 if (is_fep_ss) t.scale = (fep_tuple_type == 4) ? OneMinusLambda : Lambda;
490 if (is_fep_sd && sdScaling) t.scale = (fep_tuple_type == 4 || fep_tuple_type == 2) ? OneMinusLambda : Lambda;
492 for (i=1; i < T::size; i++) {
497 for (i=0; i < T::size; i++) {
500 #ifdef MEM_OPT_VERSION 503 iout <<
iWARN <<
"Tuple " << *curTuple <<
" with atoms ";
506 for( erri = 0; erri < T::size; erri++ ) {
507 iout << t.atomID[erri] <<
"(" << aid[erri].
pid <<
") ";
509 iout <<
"missing patch " << aid[i].
pid <<
"\n" <<
endi;
512 t.localIndex[i] = aid[i].
index;
515 #ifdef MEM_OPT_VERSION 520 for(i=0; i<T::size; i++){
Elem * find(const Elem &elem)
int num_alch_unpert_Dihedrals
static void partition(int *order, const FullAtom *atoms, int begin, int end)
Angle * alch_unpert_angles
SimParameters * simParameters
int num_alch_unpert_Bonds
std::ostream & endi(std::ostream &s)
int downstream(int pid1, int pid2)
TuplePatchList tuplePatchList
std::ostream & iWARN(std::ostream &s)
int num_alch_unpert_Angles
unsigned char get_ss_type(int anum) const
int add(const Elem &elem)
Dihedral * alch_unpert_dihedrals
BigReal soluteScalingFactor
LocalID localID(AtomID id)
unsigned char get_fep_type(int anum) const
ResizeArray< T > tupleList