(3) variant->aware in global par, (4) global par ignoring variants */
for (i = 0, ap = mol->atoms; i < mol->natoms; i++, ap = ATOM_NEXT(ap)) {
if (mol->par != NULL) {
- vp = ParameterLookupVdwPar(mol->par, ap->type, 0);
- /* vp = ParameterLookupVdwPar(mol->par, i, kParameterLookupLocal | kParameterLookupNoWildcard);
- if (vp == NULL)
- vp = ParameterLookupVdwPar(mol->par, ap->type, kParameterLookupLocal | kParameterLookupGlobal); */
+ vp = ParameterLookupVdwPar(mol->par, ap->type, i, 0);
if (vp != NULL) {
arena->vdw_par_i[i] = (vp - mol->par->vdwPars) + ATOMS_MAX_NUMBER * 2;
continue;
}
}
- vp = ParameterLookupVdwPar(gBuiltinParameters, ap->type, 0);
+ vp = ParameterLookupVdwPar(gBuiltinParameters, ap->type, -1, 0);
if (vp != NULL) {
arena->vdw_par_i[i] = (vp - gBuiltinParameters->vdwPars) + ATOMS_MAX_NUMBER;
continue;
}
/* Record as missing */
- vp = ParameterLookupVdwPar(par, ap->type, kParameterLookupMissing | kParameterLookupNoBaseAtomType);
+ vp = ParameterLookupVdwPar(par, ap->type, i, kParameterLookupMissing | kParameterLookupNoBaseAtomType);
if (vp == NULL) {
vp = AssignArray(&par->vdwPars, &par->nvdwPars, sizeof(VdwPar), par->nvdwPars, NULL);
vp->src = -1;
type2 = par->vdwPars[j].type1; /* Not type2 */
/* Look up the pair-specific van der Waals parameters */
if (mol->par != NULL) {
- vpp = ParameterLookupVdwPairPar(mol->par, type1, type2, 0);
+ vpp = ParameterLookupVdwPairPar(mol->par, type1, type2, type1, type2, 0);
}
if (vpp == NULL)
- vpp = ParameterLookupVdwPairPar(gBuiltinParameters, type1, type2, 0);
+ vpp = ParameterLookupVdwPairPar(gBuiltinParameters, type1, type2, type1, type2, 0);
if (vpp != NULL) {
newpar = *vpp;
} else {
}
VdwPar *
-ParameterLookupVdwPar(Parameter *par, UInt t1, Int options)
+ParameterLookupVdwPar(Parameter *par, UInt t1, Int idx1, Int options)
{
int i;
VdwPar *vp;
|| (vp->src == 0 && !(options & kParameterLookupLocal))
|| (vp->src < 0 && !(options & kParameterLookupMissing)))
continue;
- if (s_ParMatch(vp->type1, t1, -1, nowildcard))
+ if (s_ParMatch(vp->type1, t1, idx1, nowildcard))
return vp;
}
if (options & kParameterLookupNoBaseAtomType)
return NULL;
- return ParameterLookupVdwPar(par, t1 % kAtomTypeVariantBase, options | kParameterLookupNoBaseAtomType);
+ return ParameterLookupVdwPar(par, t1 % kAtomTypeVariantBase, idx1, options | kParameterLookupNoBaseAtomType);
}
VdwPairPar *
-ParameterLookupVdwPairPar(Parameter *par, UInt t1, UInt t2, Int options)
+ParameterLookupVdwPairPar(Parameter *par, UInt t1, UInt t2, Int idx1, Int idx2, Int options)
{
int i;
VdwPairPar *vp;
|| (vp->src == 0 && !(options & kParameterLookupLocal))
|| (vp->src < 0 && !(options & kParameterLookupMissing)))
continue;
- if ((s_ParMatch(vp->type1, t1, -1, nowildcard) && s_ParMatch(vp->type2, t2, -1, nowildcard))
- || (s_ParMatch(vp->type1, t2, -1, nowildcard) && s_ParMatch(vp->type2, t1, -1, nowildcard)))
+ if ((s_ParMatch(vp->type1, t1, idx1, nowildcard) && s_ParMatch(vp->type2, t2, idx2, nowildcard))
+ || (s_ParMatch(vp->type1, t2, idx2, nowildcard) && s_ParMatch(vp->type2, t1, idx1, nowildcard)))
return vp;
}
if (options & kParameterLookupNoBaseAtomType)
return NULL;
- return ParameterLookupVdwPairPar(par, t1 % kAtomTypeVariantBase, t2 % kAtomTypeVariantBase, options | kParameterLookupNoBaseAtomType);
+ return ParameterLookupVdwPairPar(par, t1 % kAtomTypeVariantBase, t2 % kAtomTypeVariantBase, idx1, idx2, options | kParameterLookupNoBaseAtomType);
}
VdwCutoffPar *
AnglePar *ParameterLookupAnglePar(Parameter *par, UInt t1, UInt t2, UInt t3, Int idx1, Int idx2, Int idx3, Int options);
TorsionPar *ParameterLookupDihedralPar(Parameter *par, UInt t1, UInt t2, UInt t3, UInt t4, Int idx1, Int idx2, Int idx3, Int idx4, Int options);
TorsionPar *ParameterLookupImproperPar(Parameter *par, UInt t1, UInt t2, UInt t3, UInt t4, Int idx1, Int idx2, Int idx3, Int idx4, Int options);
-VdwPar *ParameterLookupVdwPar(Parameter *par, UInt t1, Int options);
-VdwPairPar *ParameterLookupVdwPairPar(Parameter *par, UInt t1, UInt t2, Int options);
+VdwPar *ParameterLookupVdwPar(Parameter *par, UInt t1, Int idx1, Int options);
+VdwPairPar *ParameterLookupVdwPairPar(Parameter *par, UInt t1, UInt t2, Int idx1, Int idx2, Int options);
VdwCutoffPar *ParameterLookupVdwCutoffPar(Parameter *par, UInt t1, UInt t2, Int options);
int ElementParameterInitialize(const char *fname, char **outWarningMessage);
case kVdwParType: {
VdwPar *vp;
if (mol != NULL) {
- vp = ParameterLookupVdwPar(mol->par, t[0], flags);
+ vp = ParameterLookupVdwPar(mol->par, t[0], ii[0], flags);
if (vp != NULL) {
idx = vp - mol->par->vdwPars;
break;
}
}
- vp = ParameterLookupVdwPar(gBuiltinParameters, t[0], flags);
+ vp = ParameterLookupVdwPar(gBuiltinParameters, t[0], -1, flags);
if (vp != NULL) {
idx = vp - gBuiltinParameters->vdwPars;
is_global = 1;
case kVdwPairParType: {
VdwPairPar *vp;
if (mol != NULL) {
- vp = ParameterLookupVdwPairPar(mol->par, t[0], t[1], flags);
+ vp = ParameterLookupVdwPairPar(mol->par, t[0], t[1], ii[0], ii[1], flags);
if (vp != NULL) {
idx = vp - mol->par->vdwpPars;
break;
}
}
- vp = ParameterLookupVdwPairPar(gBuiltinParameters, t[0], t[1], flags);
+ vp = ParameterLookupVdwPairPar(gBuiltinParameters, t[0], t[1], -1, -1, flags);
if (vp != NULL) {
idx = vp - gBuiltinParameters->vdwpPars;
is_global = 1;
return ValueFromMoleculeWithParameterTypeAndIndex(mol, kImproperParType, tp - mol->par->improperPars);
}
*/
-/*
- * call-seq:
- * vdw_par(idx) -> ParameterRef
- *
- * Returns the vdw parameter for the idx-th atom.
- */
-/*
-static VALUE
-s_Molecule_VdwPar(VALUE self, VALUE val)
-{
- Molecule *mol;
- Int ival;
- VdwPar *vp;
- UInt t1;
- Data_Get_Struct(self, Molecule, mol);
- ival = NUM2INT(rb_Integer(val));
- if (ival < -mol->natoms || ival >= mol->natoms)
- rb_raise(rb_eMolbyError, "atom index (%d) out of range", ival);
- if (ival < 0)
- ival += mol->natoms;
- s_RebuildMDParameterIfNecessary(self, Qtrue);
- t1 = ATOM_AT_INDEX(mol->atoms, ival)->type;
- vp = ParameterLookupVdwPar(mol->par, t1, 0);
- if (vp == NULL)
- return Qnil;
- return ValueFromMoleculeWithParameterTypeAndIndex(mol, kVdwParType, vp - mol->par->vdwPars);
-}
-*/
/*
* call-seq: