383 #ifdef MEM_OPT_VERSION 384 typename ElemTraits<T>::signature *allSigs;
386 int32 **tuplesByAtom;
390 const P *tupleValues;
393 #ifdef MEM_OPT_VERSION 394 allSigs = ElemTraits<T>::get_sig_pointer(node->
molecule);
396 T::getMoleculePointers(node->
molecule,
397 &numTuples, &tuplesByAtom, &tupleStructs);
400 T::getParameterPointers(node->
parameters, &tupleValues);
411 Real invLesFactor = lesOn ?
428 for ( ai = ai.begin(); ai != ai.end(); ai++ )
436 for (
int j=0; j < numAtoms; j++)
439 #ifdef MEM_OPT_VERSION 440 typename ElemTraits<T>::signature *thisAtomSig =
441 &allSigs[ElemTraits<T>::get_sig_id(atomExt[j])];
443 T::getTupleInfo(thisAtomSig, &numTuples, &allTuples);
444 for(
int k=0; k<numTuples; k++) {
445 T t(atomExt[j].
id, &allTuples[k], tupleValues);
448 int32 *curTuple = tuplesByAtom[atomExt[j].
id];
449 for( ; *curTuple != -1; ++curTuple) {
450 T t(&tupleStructs[*curTuple],tupleValues);
454 int homepatch = aid[0].
pid;
461 int fep_tuple_type = 0;
462 for (i=1; i < T::size; i++) {
464 samepatch = samepatch && ( homepatch == aid[i].
pid );
474 if (sdScaling && is_fep_sd) {
475 for (i=0; i < num_unpert_bonds; i++) {
477 && t.atomID[0]==unpert_bonds[i].atom1
478 && t.atomID[1]==unpert_bonds[i].atom2) is_fep_sd = 0;
480 for (i=0; i < num_unpert_angles; i++) {
482 && t.atomID[0]==unpert_angles[i].atom1
483 && t.atomID[1]==unpert_angles[i].atom2
484 && t.atomID[2]==unpert_angles[i].atom3) is_fep_sd = 0;
486 for (i=0; i < num_unpert_dihedrals; i++) {
488 && t.atomID[0]==unpert_dihedrals[i].atom1
489 && t.atomID[1]==unpert_dihedrals[i].atom2
490 && t.atomID[2]==unpert_dihedrals[i].atom3
491 && t.atomID[3]==unpert_dihedrals[i].atom4) is_fep_sd = 0;
494 if (T::size < 4 && !soluteScalingAll) has_ss =
false;
495 if ( samepatch )
continue;
496 t.scale = (!has_les && !has_ss) ? 1.0 : ( has_les ? invLesFactor : soluteScalingFactor );
497 if (is_fep_ss) t.scale = (fep_tuple_type == 4) ? OneMinusLambda : Lambda;
498 if (is_fep_sd && sdScaling) t.scale = (fep_tuple_type == 4 || fep_tuple_type == 2) ? OneMinusLambda : Lambda;
500 for (i=1; i < T::size; i++) {
505 for (i=0; i < T::size; i++) {
508 #ifdef MEM_OPT_VERSION 511 iout <<
iWARN <<
"Tuple " << *curTuple <<
" with atoms ";
514 for( erri = 0; erri < T::size; erri++ ) {
515 iout << t.atomID[erri] <<
"(" << aid[erri].
pid <<
") ";
517 iout <<
"missing patch " << aid[i].
pid <<
"\n" <<
endi;
520 t.localIndex[i] = aid[i].
index;
523 #ifdef MEM_OPT_VERSION 528 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