return angle;
}
+static char *get_atomtype_name_AB(t_atom *atom,gpp_atomtype_t atype)
+{
+ char *name;
+
+ name = get_atomtype_name(atom->type,atype);
+
+ /* When using the decoupling option, atom types are changed
+ * to decoupled for the non-bonded interactions, but the virtual
+ * sites constructions should be based on the "normal" interactions.
+ * So we return the state B atom type name if the state A atom
+ * type is the decoupled one. We should actually check for the atom
+ * type number, but that's not passed here. So we check for
+ * the decoupled atom type name. This should not cause trouble
+ * as this code is only used for topologies with v-sites without
+ * parameters generated by pdb2gmx.
+ */
+ if (strcmp(name,"decoupled") == 0)
+ {
+ name = get_atomtype_name(atom->typeB,atype);
+ }
+
+ return name;
+}
+
static gmx_bool calc_vsite3_param(gpp_atomtype_t atype,
t_param *param, t_atoms *at,
int nrbond, t_mybonded *bonds,
for (i=0; i<4; i++)
fprintf(debug,"atom %u type %s ",
param->a[i]+1,
- get_atomtype_name(at->atom[param->a[i]].type,atype));
+ get_atomtype_name_AB(&at->atom[param->a[i]],atype));
fprintf(debug,"\n");
}
bXH3 =
- ( (gmx_strncasecmp(get_atomtype_name(at->atom[param->AK].type,atype),"MNH",3)==0) &&
- (gmx_strncasecmp(get_atomtype_name(at->atom[param->AL].type,atype),"MNH",3)==0) ) ||
- ( (gmx_strncasecmp(get_atomtype_name(at->atom[param->AK].type,atype),"MCH3",4)==0) &&
- (gmx_strncasecmp(get_atomtype_name(at->atom[param->AL].type,atype),"MCH3",4)==0) );
+ ( (gmx_strncasecmp(get_atomtype_name_AB(&at->atom[param->AK],atype),"MNH",3)==0) &&
+ (gmx_strncasecmp(get_atomtype_name_AB(&at->atom[param->AL],atype),"MNH",3)==0) ) ||
+ ( (gmx_strncasecmp(get_atomtype_name_AB(&at->atom[param->AK],atype),"MCH3",4)==0) &&
+ (gmx_strncasecmp(get_atomtype_name_AB(&at->atom[param->AL],atype),"MCH3",4)==0) );
bjk = get_bond_length(nrbond, bonds, param->AJ, param->AK);
bjl = get_bond_length(nrbond, bonds, param->AJ, param->AL);
int i;
for (i=0; i<4; i++)
fprintf(debug,"atom %u type %s ",
- param->a[i]+1,get_atomtype_name(at->atom[param->a[i]].type,atype));
+ param->a[i]+1,get_atomtype_name_AB(&at->atom[param->a[i]],atype));
fprintf(debug,"\n");
}
bXH3 =
- ( (gmx_strncasecmp(get_atomtype_name(at->atom[param->AK].type,atype),"MNH",3)==0) &&
- (gmx_strncasecmp(get_atomtype_name(at->atom[param->AL].type,atype),"MNH",3)==0) ) ||
- ( (gmx_strncasecmp(get_atomtype_name(at->atom[param->AK].type,atype),"MCH3",4)==0) &&
- (gmx_strncasecmp(get_atomtype_name(at->atom[param->AL].type,atype),"MCH3",4)==0) );
+ ( (gmx_strncasecmp(get_atomtype_name_AB(&at->atom[param->AK],atype),"MNH",3)==0) &&
+ (gmx_strncasecmp(get_atomtype_name_AB(&at->atom[param->AL],atype),"MNH",3)==0) ) ||
+ ( (gmx_strncasecmp(get_atomtype_name_AB(&at->atom[param->AK],atype),"MCH3",4)==0) &&
+ (gmx_strncasecmp(get_atomtype_name_AB(&at->atom[param->AL],atype),"MCH3",4)==0) );
/* check if construction parity must be swapped */
bSwapParity = ( param->C1 == -1 );