{
type = ffparams->ntypes;
}
- if (debug)
- {
- fprintf(debug, "copying newparam to ffparams->iparams[%d] (ntypes=%d)\n",
- type, ffparams->ntypes);
- }
memcpy(&ffparams->iparams[type], &newparam, (size_t)sizeof(newparam));
ffparams->ntypes++;
*maxtypes += 1000;
srenew(ffparams->functype, *maxtypes);
srenew(ffparams->iparams, *maxtypes);
- if (debug)
- {
- fprintf(debug, "%s, line %d: srenewed idef->functype and idef->iparams to %d\n",
- __FILE__, __LINE__, *maxtypes);
- }
}
type = enter_params(ffparams, ftype, p->param[k].c, comb, reppow, start, bAppend);
/* Type==-1 is used as a signal that this interaction is all-zero and should not be added. */
}
}
- if (debug)
- {
- fprintf(debug, "%s, line %d: There are %d functypes in idef\n",
- __FILE__, __LINE__, ffp->ntypes);
- }
-
ffp->fudgeQQ = fudgeQQ;
}
}
if (p[index[i]].a[0] == p[index[i]].a[1])
{
- if (debug)
- {
- fprintf(debug,
- "Something VERY strange is going on in rm2par (gen_ad.c)\n"
- "a[0] %d a[1] %d a[2] %d a[3] %d\n",
- p[i].a[0], p[i].a[1], p[i].a[2], p[i].a[3]);
- }
strcpy(p[i].s, "");
}
else if (index[i] > i)
}
nbd = nb_dist(nnb, i, l1);
- if (debug)
- {
- fprintf(debug, "Distance (%d-%d) = %d\n", i+1, l1+1, nbd);
- }
if (nbd == 3)
{
i1 = std::min(i, l1);
}
-static void dump_ab(FILE *out, int natom, const int nab[], t_hack *ab[], bool bHeader)
-{
- int i, j;
-
-#define SS(s) (s) ? (s) : "-"
- /* dump ab */
- if (bHeader)
- {
- fprintf(out, "ADDBLOCK (t_hack) natom=%d\n"
- "%4s %2s %-4s %-4s %2s %-4s %-4s %-4s %-4s %1s %s\n",
- natom, "atom", "nr", "old", "new", "tp", "ai", "aj", "ak", "al", "a", "x");
- }
- for (i = 0; i < natom; i++)
- {
- for (j = 0; j < nab[i]; j++)
- {
- fprintf(out, "%4d %2d %-4s %-4s %2d %-4s %-4s %-4s %-4s %s %g %g %g\n",
- i+1, ab[i][j].nr, SS(ab[i][j].oname), SS(ab[i][j].nname),
- ab[i][j].tp,
- SS(ab[i][j].ai()), SS(ab[i][j].aj()),
- SS(ab[i][j].ak()), SS(ab[i][j].al()),
- ab[i][j].atom ? "+" : "",
- ab[i][j].newx[XX], ab[i][j].newx[YY], ab[i][j].newx[ZZ]);
- }
- }
-#undef SS
-}
-
static t_hackblock *get_hackblocks(t_atoms *pdba, int nah, t_hackblock ah[],
int nterpairs,
t_hackblock **ntdb, t_hackblock **ctdb,
/* must be either hdb entry (tp>0) or add from tdb (oname==NULL)
and first control aton (AI) matches this atom or
delete/replace from tdb (oname!=NULL) and oname matches this atom */
- if (debug)
- {
- fprintf(debug, " %s", hbr->hack[j].oname ? hbr->hack[j].oname : hbr->hack[j].ai());
- }
if (!bIgnore &&
( ( ( hbr->hack[j].tp > 0 || hbr->hack[j].oname == nullptr ) &&
strcmp(atomname, hbr->hack[j].oname) == 0) ) )
{
/* now expand all hacks for this atom */
- if (debug)
- {
- fprintf(debug, " +%dh", hbr->hack[j].nr);
- }
srenew(*abi, *nabi + hbr->hack[j].nr);
for (k = 0; k < hbr->hack[j].nr; k++)
{
expand_hackblocks_one(&hb[pdba->atom[i].resind], *pdba->atomname[i],
&nab[i], &ab[i], bN, bC);
}
- if (debug)
- {
- fprintf(debug, "\n");
- }
}
static int check_atoms_present(t_atoms *pdba, const int nab[], t_hack *ab[])
{
/* We found the added atom. */
ab[i][j].bAlreadyPresent = TRUE;
- if (debug)
- {
- fprintf(debug, "Atom '%s' in residue '%s' %d is already present\n",
- ab[i][j].nname,
- *pdba->resinfo[rnr].name, pdba->resinfo[rnr].nr);
- }
}
else
{
nab = *nabptr;
ab = *abptr;
bKeep_ab = TRUE;
- if (debug)
- {
- fprintf(debug, "pointer to ab found\n");
- }
}
else
{
{
/* WOW, everything was already figured out */
bUpdate_pdba = FALSE;
- if (debug)
- {
- fprintf(debug, "pointer to non-null ab found\n");
- }
}
else
{
bUpdate_pdba = TRUE;
/* first get all the hackblocks for each residue: */
hb = get_hackblocks(pdba, nah, ah, nterpairs, ntdb, ctdb, rN, rC);
- if (debug)
- {
- dump_hb(debug, pdba->nres, hb);
- }
/* expand the hackblocks to atom level */
snew(nab, natoms);
free_t_hackblock(pdba->nres, &hb);
}
- if (debug)
- {
- fprintf(debug, "before calc_all_pos\n");
- dump_ab(debug, natoms, nab, ab, TRUE);
- }
-
/* Now calc the positions */
calc_all_pos(pdba, *xptr, nab, ab, bCheckMissing);
- if (debug)
- {
- fprintf(debug, "after calc_all_pos\n");
- dump_ab(debug, natoms, nab, ab, TRUE);
- }
-
if (bUpdate_pdba)
{
/* we don't have to add atoms that are already present in pdba,
so we will remove them from the ab (t_hack) */
nadd = check_atoms_present(pdba, nab, ab);
- if (debug)
- {
- fprintf(debug, "removed add hacks that were already in pdba:\n");
- dump_ab(debug, natoms, nab, ab, TRUE);
- fprintf(debug, "will be adding %d atoms\n", nadd);
- }
/* Copy old atoms, making space for new ones */
snew(newpdba, 1);
{
nadd = 0;
}
- if (debug)
- {
- fprintf(debug, "snew xn for %d old + %d new atoms %d total)\n",
- natoms, nadd, natoms+nadd);
- }
if (nadd == 0)
{
srenew(newpdba->atomname, natoms+nadd);
}
}
- if (debug)
- {
- fprintf(debug, "(%3d) %3d %4s %4s%3d %3d",
- i+1, newi+1, *pdba->atomname[i],
- *pdba->resinfo[pdba->atom[i].resind].name,
- pdba->resinfo[pdba->atom[i].resind].nr, nab[i]);
- }
if (bUpdate_pdba)
{
copy_atom(pdba, i, newpdba, newi);
{
newpdba->atom[newi].resind = pdba->atom[i].resind;
}
- if (debug)
- {
- fprintf(debug, " + %d", newi+1);
- }
}
if (ab[i][j].nname != nullptr &&
(ab[i][j].oname == nullptr ||
}
newi++;
i += nalreadypresent;
- if (debug)
- {
- fprintf(debug, "\n");
- }
}
}
if (bUpdate_pdba)
}
else if (defs[i].def)
{
- if (debug)
- {
- fprintf(debug, "Overriding define %s\n", name);
- }
sfree(defs[i].def);
}
if (value && strlen(value) > 0)
i++;
}
}
- if (debug)
- {
- fprintf(debug, "GMXCPP: added %d command line arguments\n", i);
- }
snew(cpp, 1);
*handle = cpp;
{
gmx_fatal(FARGS, "Topology include file \"%s\" not found", filenm);
}
- if (nullptr != debug)
- {
- fprintf(debug, "GMXCPP: cpp file open %s\n", cpp->fn);
- }
/* If the file name has a path component, we need to change to that
* directory. Note that we - just as C - always use UNIX path separators
* internally in include file names.
snew(cpp->cwd, STRLEN);
gmx_getcwd(cpp->cwd, STRLEN);
- if (nullptr != debug)
- {
- fprintf(debug, "GMXCPP: cwd %s\n", cpp->cwd);
- }
gmx_chdir(cpp->path);
-
- if (nullptr != debug)
- {
- fprintf(debug, "GMXCPP: chdir to %s\n", cpp->path);
- }
}
cpp->line_len = 0;
cpp->line = nullptr;
cpp->parent = nullptr;
if (cpp->fp == nullptr)
{
- if (nullptr != debug)
- {
- fprintf(debug, "GMXCPP: opening file %s\n", cpp->fn);
- }
cpp->fp = fopen(cpp->fn, "r");
}
if (cpp->fp == nullptr)
strncpy(inc_fn, dval+i0, len);
inc_fn[len] = '\0';
- if (debug)
- {
- fprintf(debug, "Going to open include file '%s' i0 = %d, strlen = %d\n",
- inc_fn, i0, len);
- }
/* Open include file and store it as a child in the handle structure */
status = cpp_open_file(inc_fn, &(handle->child), nullptr);
sfree(inc_fn);
}
strcpy(handle->line, buf);
handle->line_nr++;
- }
- /* Now we've read a line! */
- if (debug)
- {
- fprintf(debug, "%s : %4d : %s\n", handle->fn, handle->line_nr, buf);
- }
+ } /* Now we've read a line! */
/* Process directives if this line contains one */
if (find_directive(buf, &dname, &dval))
{
return eCPP_FILE_NOT_OPEN;
}
- if (debug)
- {
- fprintf(debug, "GMXCPP: closing file %s\n", handle->fn);
- }
fclose(handle->fp);
if (nullptr != handle->cwd)
{
- if (nullptr != debug)
- {
- fprintf(debug, "GMXCPP: chdir to %s\n", handle->cwd);
- }
gmx_chdir(handle->cwd);
}
case EINTR:
return eCPP_INTERRUPT;
default:
- if (debug)
- {
- fprintf(debug, "Strange stuff closing file, errno = %d", errno);
- }
return eCPP_UNKNOWN;
}
}
{
if (strcmp(*ga->atomname[i], name) == 0)
{
- if (nullptr != debug)
- {
- fprintf(debug, "Trying to add atomtype %s again. Skipping it.\n", name);
- }
break;
}
}
if (i == nn)
{
- if (debug)
- {
- fprintf(debug, "Renumbering atomtype %d to %d\n", thistype, nn);
- }
if (nn == ntype)
{
gmx_fatal(FARGS, "Atomtype horror n = %d, %s, %d", nn, __FILE__, __LINE__);
snew(new_atomnumber, nat);
snew(new_atomname, nat);
-
/* We now have a list of unique atomtypes in typelist */
- if (debug)
- {
- pr_ivec(debug, 0, "typelist", typelist, nat, TRUE);
- }
-
/* Renumber nlist */
nbsnew = nullptr;
snew(nbsnew, plist[ftype].nr);
nr_of_sortables += nnb->nrexcl[i][nre];
}
- if (debug)
- {
- fprintf(debug, "nr_of_sortables: %d\n", nr_of_sortables);
- }
/* make space for sortable array */
snew(s, nr_of_sortables);
/* cleanup temporary space */
sfree (s);
}
- if (debug)
- {
- print_blocka(debug, "Exclusions", "Atom", "Excluded", excl);
- }
}
/*! \brief Return true of neighbor is already present in some exclusion level
int i, n, nab, nah;
t_hackblock *aah;
- if (debug)
- {
- fprintf(debug, "Hydrogen Database (%s):\n", hfn);
- }
-
fflib_filename_base(hfn, filebase, STRLEN);
/* Currently filebase is read and set, but not used.
* hdb entries from any hdb file and be applied to rtp entries
nah, line);
break;
}
- if (debug)
- {
- fprintf(debug, "%s", buf);
- }
srenew(aah, nah+1);
clear_t_hackblock(&aah[nah]);
aah[nah].name = gmx_strdup(buf);
if (sscanf(line+n, "%d", &nab) == 1)
{
- if (debug)
- {
- fprintf(debug, " %d\n", nab);
- }
snew(aah[nah].hack, nab);
aah[nah].nhack = nab;
for (i = 0; (i < nab); i++)
qsort(aah, nah, (size_t)sizeof(**ah), compaddh);
}
- /*
- if (debug)
- dump_h_db(hfn,nah,aah);
- */
-
*nahptr = nah;
*ah = aah;
}
hb->nra = k;
}
-static void pr_hbonds(FILE *fp, t_blocka *hb, t_atoms *pdba)
-{
- int i, j, k, j0, j1;
-
- fprintf(fp, "Dumping all hydrogen bonds!\n");
- for (i = 0; (i < hb->nr); i++)
- {
- j0 = hb->index[i];
- j1 = hb->index[i+1];
- for (j = j0; (j < j1); j++)
- {
- k = hb->a[j];
- fprintf(fp, "%5s%4d%5s - %5s%4d%5s\n",
- *pdba->resinfo[pdba->atom[i].resind].name,
- pdba->resinfo[pdba->atom[i].resind].nr, *pdba->atomname[i],
- *pdba->resinfo[pdba->atom[k].resind].name,
- pdba->resinfo[pdba->atom[k].resind].nr, *pdba->atomname[k]);
- }
- }
-}
-
static bool chk_hbonds(int i, t_atoms *pdba, rvec x[],
const bool ad[], bool hbond[], rvec xh,
real angle, real dist)
a = RAD2DEG * acos(cos_angle(nh, oh));
if ((d2 < dist2) && (a > angle))
{
- if (debug)
- {
- fprintf(debug,
- "HBOND between %s%d-%s and %s%d-%s is %g nm, %g deg\n",
- *pdba->resinfo[pdba->atom[i].resind].name,
- pdba->resinfo[pdba->atom[i].resind].nr, *pdba->atomname[i],
- *pdba->resinfo[pdba->atom[aj].resind].name,
- pdba->resinfo[pdba->atom[aj].resind].nr, *pdba->atomname[aj],
- std::sqrt(d2), a);
- }
hbond[i] = TRUE;
bHB = TRUE;
}
}
fprintf(stderr, " %d donors and %d acceptors were found.\n", nd, na);
chk_allhb(pdba, x, hb, donor, acceptor, dist);
- if (debug)
- {
- pr_hbonds(debug, hb, pdba);
- }
fprintf(stderr, "There are %d hydrogen bonds\n", hb->nra);
/* Now do the HIS stuff */
gpp_atomtype_t atype;
gmx_residuetype_t*rt;
const char *top_fn;
- char fn[256], itp_fn[STRLEN], posre_fn[STRLEN], buf_fn[STRLEN];
+ char itp_fn[STRLEN], posre_fn[STRLEN], buf_fn[STRLEN];
char molname[STRLEN], title[STRLEN];
char *c, forcefield[STRLEN], ffdir[STRLEN];
char ffname[STRLEN], suffix[STRLEN], buf[STRLEN];
&symtab, bVerbose);
}
- if (debug)
- {
- if (nch == 1)
- {
- sprintf(fn, "chain.pdb");
- }
- else
- {
- sprintf(fn, "chain_%c%d.pdb", cc->chainid, cc->chainnum);
- }
- write_sto_conf(fn, title, pdba, x, nullptr, ePBC, box);
- }
-
-
for (i = 0; i < cc->nterpairs; i++)
{
/* Generate Hydrogen atoms (and termini) in the sequence */
printf("Generating any missing hydrogen atoms and/or adding termini.\n");
- natom = add_h(&pdba, &x, nah, ah,
- cc->nterpairs, cc->ntdb, cc->ctdb, cc->r_start, cc->r_end, bAllowMissing,
- nullptr, nullptr, TRUE, FALSE);
+ add_h(&pdba, &x, nah, ah,
+ cc->nterpairs, cc->ntdb, cc->ctdb, cc->r_start, cc->r_end, bAllowMissing,
+ nullptr, nullptr, TRUE, FALSE);
printf("Now there are %d residues with %d atoms\n",
pdba->nres, pdba->nr);
- if (debug)
- {
- write_pdbfile(debug, title, pdba, x, ePBC, box, ' ', 0, nullptr, TRUE);
- }
-
- if (debug)
- {
- for (i = 0; (i < natom); i++)
- {
- fprintf(debug, "Res %s%d atom %d %s\n",
- *(pdba->resinfo[pdba->atom[i].resind].name),
- pdba->resinfo[pdba->atom[i].resind].nr, i+1, *pdba->atomname[i]);
- }
- }
strcpy(posre_fn, ftp2fn(efITP, NFILE, fnm));
cc->pdba = pdba;
cc->x = x;
- if (debug)
- {
- if (cc->chainid == ' ')
- {
- sprintf(fn, "chain.pdb");
- }
- else
- {
- sprintf(fn, "chain_%c.pdb", cc->chainid);
- }
- write_sto_conf(fn, "", pdba, x, nullptr, ePBC, box);
- }
}
if (watermodel == nullptr)
i0 = 0;
snew(*cgnr, at->nr);
qt = 0;
- prevcg = NOTSET;
curcg = 0;
cg = -1;
- j = NOTSET;
for (i = 0; (i < at->nr); i++)
{
}
if (at->atom[i].m == 0)
{
- if (debug)
- {
- fprintf(debug, "atom %d%s: curcg=%d, prevcg=%d, cg=%d\n",
- i+1, *(at->atomname[i]), curcg, prevcg,
- j == NOTSET ? NOTSET : restp[resind].cgnr[j]);
- }
qt = 0;
prevcg = cg;
name = *(at->atomname[i]);
}
else
{
- if (debug)
- {
- fprintf(debug, "atom %d%s: curcg=%d, qt=%g, is_int=%s\n",
- i+1, *(at->atomname[i]), curcg, qt, gmx::boolToString(is_int(qt)));
- }
cg = -1;
if (is_int(qt))
{
int k;
const char *Hnum = "123456";
- /*if (debug)
- {
- fprintf(debug,"adding atom(s) %s to atom %s in res %d%s in rtp\n",
- hack->nname,
- * restp->atomname[at_start], resnr, restp->resname);
- }*/
strcpy(buf, hack->nname);
buf[strlen(buf)+1] = '\0';
if (hack->nr > 1)
{
/* oname != NULL */
if ( (*hb)[i].hack[j].nname == nullptr)
- {
- /* we're deleting */
- if (debug)
- {
- fprintf(debug, "deleting atom %s from res %d%s in rtp\n",
- *(*restp)[i].atomname[l],
- i+1, (*restp)[i].resname);
- }
+ { /* we're deleting */
/* shift the rest */
(*restp)[i].natom--;
for (k = l; k < (*restp)[i].natom; k++)
}
else /* nname != NULL */
{ /* we're replacing */
- if (debug)
- {
- fprintf(debug, "replacing atom %s by %s in res %d%s in rtp\n",
- *(*restp)[i].atomname[l], (*hb)[i].hack[j].nname,
- i+1, (*restp)[i].resname);
- }
snew( (*restp)[i].atomname[l], 1);
(*restp)[i].atom[l] = *(*hb)[i].hack[j].atom;
*(*restp)[i].atomname[l] = gmx_strdup((*hb)[i].hack[j].nname);
init_plist(plist);
gmx_residuetype_init(&rt);
- if (debug)
- {
- print_resall(debug, atoms->nres, restp, atype);
- dump_hb(debug, atoms->nres, hb);
- }
-
/* Make bonds */
at2bonds(&(plist[F_BONDS]), hb,
atoms, *x,
bool bRest;
char warn_buf[STRLEN];
- if (debug)
- {
- fprintf(debug, "Starting numbering %d groups of type %d\n", ng, gtype);
- }
-
title = gtypes[gtype];
snew(cbuf, natoms);
{
grps->nm_ind[grps->nr++] = gid;
}
- if (debug)
- {
- fprintf(debug, "Found gid %d for group %s\n", gid, ptrs[i]);
- }
/* Now go over the atoms in the group */
for (j = block->index[gid]; (j < block->index[gid+1]); j++)
/* Correct for VCM removal according to the fraction of each VCM
* group present in this TC group.
*/
- nrdf_uc = nrdf_tc[i];
- if (debug)
- {
- fprintf(debug, "T-group[%d] nrdf_uc = %g\n", i, nrdf_uc);
- }
+ nrdf_uc = nrdf_tc[i];
nrdf_tc[i] = 0;
for (j = 0; j < groups->grps[egcVCM].nr+1; j++)
{
nrdf_tc[i] += nrdf_uc*((double)na_vcm[j]/(double)na_tot)*
(nrdf_vcm[j] - nrdf_vcm_sub[j])/nrdf_vcm[j];
}
- if (debug)
- {
- fprintf(debug, " nrdf_vcm[%d] = %g, nrdf = %g\n",
- j, nrdf_vcm[j], nrdf_tc[i]);
- }
}
}
}
in = fflib_open(rrdb);
- if (debug)
- {
- fprintf(debug, "%9s %5s", "Residue", "atoms");
- for (i = 0; i < ebtsNR; i++)
- {
- fprintf(debug, " %10s", btsNames[i]);
- }
- fprintf(debug, "\n");
- }
snew(header_settings, 1);
/* these bonded parameters will overwritten be when *
gmx_fatal(FARGS, "No atoms found in .rtp file in residue %s\n",
rrtp[nrtp].resname);
}
- if (debug)
- {
- fprintf(debug, "%3d %5s %5d",
- nrtp+1, rrtp[nrtp].resname, rrtp[nrtp].natom);
- for (i = 0; i < ebtsNR; i++)
- {
- fprintf(debug, " %10d", rrtp[nrtp].rb[i].nb);
- }
- fprintf(debug, "\n");
- }
firstrtp = -1;
for (i = 0; i < nrtp; i++)
res1 = *pdba->resinfo[pdba->atom[a1].resind].name;
res2 = *pdba->resinfo[pdba->atom[a2].resind].name;
- if (debug)
- {
- fprintf(stderr, "Checking %s-%d %s-%d and %s-%d %s-%d: %g ",
- res1, pdba->resinfo[pdba->atom[a1].resind].nr, at1, a1+1,
- res2, pdba->resinfo[pdba->atom[a2].resind].nr, at2, a2+1, d);
- }
-
for (i = 0; (i < nsb); i++)
{
*index_sb = i;
*bSwap = FALSE;
if ((0.9*sb[i].length < d) && (1.1*sb[i].length > d))
{
- if (debug)
- {
- fprintf(stderr, "%g\n", sb[i].length);
- }
return TRUE;
}
}
*bSwap = TRUE;
if ((0.9*sb[i].length < d) && (1.1*sb[i].length > d))
{
- if (debug)
- {
- fprintf(stderr, "%g\n", sb[i].length);
- }
return TRUE;
}
}
}
- if (debug)
- {
- fprintf(stderr, "\n");
- }
return FALSE;
}
}
in = fflib_open(fn);
- if (debug)
- {
- fprintf(debug, "Opened %s\n", fn);
- }
tb = *tbptr;
nb = *ntbptr - 1;
}
}
/* Return the dissocation energy corresponding to the best match, if we have
- * found one. Do some debug output anyway.
+ * found one.
*/
if (ibest == -1)
{
- if (debug)
- {
- fprintf(debug, "MORSE: Couldn't find E_diss for bond %s - %s, using default %g\n", ai, aj, ediss);
- }
return ediss;
}
else
{
- if (debug)
- {
- fprintf(debug, "MORSE: Dissoc. E (%10.3f) for bond %4s-%4s taken from bond %4s-%4s\n",
- t2m[ibest].e_diss, ai, aj, t2m[ibest].ai, t2m[ibest].aj);
- }
return t2m[ibest].e_diss;
}
}
/* First get the data */
t2m = read_dissociation_energies(&n2m);
- if (debug)
- {
- fprintf(debug, "MORSE: read %d dissoc energies\n", n2m);
- }
if (n2m <= 0)
{
fprintf(stderr, "No dissocation energies read\n");
for (i = 0; (i < d_maxdir); i++)
{
- if (debug)
- {
- fprintf(debug, "%20s: ", dir2str((directive)i));
- }
if (necessary[i])
{
directive d;
do
{
d = necessary[i][j++];
- if (debug)
- {
- fprintf(debug, "%20s ", dir2str(d));
- }
}
while (d != d_none);
}
- if (debug)
- {
- fprintf(debug, "\n");
- }
}
}
*DS = nullptr;
}
fprintf(stderr, "Generating 1-4 interactions: fudge = %g\n", fudge);
- if (debug)
- {
- fprintf(debug, "Fudge factor for 1-4 interactions: %g\n", fudge);
- fprintf(debug, "Holy Cow! there are %d types\n", ntp);
- }
snew(pairs->param, pairs->nr);
for (i = 0; (i < ntp); i++)
{
else
{
/* Directive found */
- if (debug)
- {
- fprintf(debug, "found directive '%s'\n", dir2str(newd));
- }
if (DS_Check_Order (DS, newd))
{
DS_Push (&DS, newd);
warning_error_and_exit(wi, errbuf, FARGS);
}
pt = xl[j].ptype;
- if (debug)
- {
- fprintf(debug, "ptype: %s\n", ptype_str[pt]);
- }
atom->q = q;
atom->m = m;
static void push_cg(t_block *block, int *lastindex, int index, int a)
{
- if (debug)
- {
- fprintf (debug, "Index %d, Atom %d\n", index, a);
- }
-
if (((block->nr) && (*lastindex != index)) || (!block->nr))
{
/* add a new block */
}
}
}
- if (debug)
- {
- fprintf(debug, "mB=%g, qB=%g, typeB=%d\n", mB, qB, typeB);
- }
push_cg(cgs, lastcg, cgnumber, nr);
}
else
{
- if (debug)
- {
- fprintf(debug, "Unbound atom %d\n", i-1);
- }
return;
}
strcpy(base, "%*d");
b2->nr, excl->nr);
warning_error_and_exit(wi, errbuf, FARGS);
}
- else if (debug)
- {
- fprintf(debug, "Entering merge_excl\n");
- }
/* First copy all entries from excl to b2 */
b_to_b2(excl, b2);
qtot = 0;
- if (debug)
- {
- fprintf(debug, "This molecule has %d atoms and %d residues\n",
- at->nr, at->nres);
- }
-
if (at->nres)
{
/* if the information is present... */
real bjk, bjl, a = -1, b = -1;
/* check if this is part of a NH3 , NH2-umbrella or CH3 group,
* i.e. if atom k and l are dummy masses (MNH* or MCH3*) */
- if (debug)
- {
- int i;
- for (i = 0; i < 4; i++)
- {
- fprintf(debug, "atom %d type %s ",
- param->a[i]+1,
- get_atomtype_name_AB(&at->atom[param->a[i]], atype));
- }
- fprintf(debug, "\n");
- }
bXH3 =
( (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) ) ||
param->c0() = a;
param->c1() = b;
- if (debug)
- {
- fprintf(debug, "params for vsite3 %d: %g %g\n",
- param->ai()+1, param->c0(), param->c1());
- }
-
return bError;
}
param->c0() = rk / (rk + rl);
param->c1() = -bij; /* 'bond'-length for fixed distance vsite */
- if (debug)
- {
- fprintf(debug, "params for vsite3fd %d: %g %g\n",
- param->ai()+1, param->c0(), param->c1());
- }
return bError;
}
param->c0() = 360 - param->c0();
}
- if (debug)
- {
- fprintf(debug, "params for vsite3fad %d: %g %g\n",
- param->ai()+1, param->c0(), param->c1());
- }
return bError;
}
/* check if this is part of a NH2-umbrella, NH3 or CH3 group,
* i.e. if atom k and l are dummy masses (MNH* or MCH3*) */
- if (debug)
- {
- int i;
- for (i = 0; i < 4; i++)
- {
- fprintf(debug, "atom %d type %s ",
- param->a[i]+1, get_atomtype_name_AB(&at->atom[param->a[i]], atype));
- }
- fprintf(debug, "\n");
- }
bXH3 =
( (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) ) ||
{
param->c2() = c;
}
- if (debug)
- {
- fprintf(debug, "params for vsite3out %d: %g %g %g\n",
- param->ai()+1, param->c0(), param->c1(), param->c2());
- }
return bError;
}
param->c0() = cl;
param->c1() = cm;
param->c2() = -bij;
- if (debug)
- {
- fprintf(debug, "params for vsite4fd %d: %g %g %g\n",
- param->ai()+1, param->c0(), param->c1(), param->c2());
- }
}
return bError;
param->c1() = b;
param->c2() = bij;
- if (debug)
- {
- fprintf(debug, "params for vsite4fdn %d: %g %g %g\n",
- param->ai()+1, param->c0(), param->c1(), param->c2());
- }
}
return bError;
bFirst = TRUE;
nvsite = 0;
- if (debug)
- {
- fprintf(debug, "\nCalculating parameters for virtual sites\n");
- }
/* Make a reverse list to avoid ninteractions^2 operations */
at2vb = make_at2vsitebond(atoms->nr, plist);
sfree(idihs);
} /* if bSet */
} /* for i */
- if (debug && plist[ftype].nr)
- {
- fprintf(stderr, "Calculated parameters for %d out of %d %s atoms\n",
- nrset, plist[ftype].nr, interaction_function[ftype].longname);
- }
- } /* if IF_VSITE */
+ } /* if IF_VSITE */
}
done_at2vsitebond(atoms->nr, at2vb);
{
fprintf(stderr, "Setting particle type to V for virtual sites\n");
}
- if (debug)
- {
- fprintf(stderr, "checking %d functypes\n", F_NRE);
- }
for (ftype = 0; ftype < F_NRE; ftype++)
{
il = &molt->ilist[ftype];
bAllFD = TRUE;
/* check if all virtual sites are constructed from the same atoms */
nvsite = 0;
- if (debug)
- {
- fprintf(debug, "constr %d %d:", ps->param[i].ai()+1, ps->param[i].aj()+1);
- }
for (k = 0; (k < 2) && !bKeep && !bRemove; k++)
{
/* for all atoms in the bond */
bAllFD = bAllFD && bThisFD;
if (bThisFD || bThisOUT)
{
- if (debug)
- {
- fprintf(debug, " %s", bThisOUT ? "out" : "fd");
- }
oatom = ps->param[i].a[1-k]; /* the other atom */
if (vsite_type[oatom] == NOTSET &&
oatom == plist[pindex[atom].ftype].param[pindex[atom].parnr].aj())
{
nOut++;
}
- if (debug)
- {
- fprintf(debug, " D-AI");
- }
}
}
if (!bRemove)
if (!bPresent)
{
bKeep = TRUE;
- if (debug)
- {
- fprintf(debug, " !present");
- }
}
}
}
else
{
bKeep = TRUE;
- if (debug)
- {
- fprintf(debug, " !same#at");
- }
}
}
}
/* if we have no virtual sites in this bond, keep it */
if (nvsite == 0)
{
- if (debug)
- {
- fprintf(debug, " no vsite");
- }
bKeep = TRUE;
}
if (!bUsed)
{
bKeep = TRUE;
- if (debug)
- {
- fprintf(debug, " !used");
- }
}
}
}
if (!bPresent)
{
bKeep = TRUE;
- if (debug)
- {
- fprintf(debug, " !bonded");
- }
}
}
}
if (bKeep)
{
- if (debug)
- {
- fprintf(debug, " keeping");
- }
/* now copy the bond to the new array */
ps->param[kept_i] = ps->param[i];
kept_i++;
{
nremoved++;
}
- if (debug)
- {
- fprintf(debug, "\n");
- }
}
if (nremoved)
/* store construction atoms of first vsite */
vsnral = NRAL(pindex[atom].ftype) - 1;
first_atoms = plist[pindex[atom].ftype].param[pindex[atom].parnr].a + 1;
- if (debug)
- {
- fprintf(debug, "dih w. vsite: %d %d %d %d\n",
- ps->param[i].ai()+1, ps->param[i].aj()+1,
- ps->param[i].ak()+1, ps->param[i].al()+1);
- fprintf(debug, "vsite %d from: %d %d %d\n",
- atom+1, first_atoms[0]+1, first_atoms[1]+1, first_atoms[2]+1);
- }
}
else
{
if (!bUsed)
{
bKeep = TRUE;
- if (debug)
- {
- fprintf(debug, "unused atom in dih: %d\n", atom+1);
- }
}
}
}
}
}
- if (debug)
- {
- for (i = 0; i < natoms; i++)
- {
- fprintf(debug, "atom %d vsite_type %s\n", i,
- vsite_type[i] == NOTSET ? "NOTSET" :
- interaction_function[vsite_type[i]].name);
- }
- }
-
/* remove interactions that include virtual sites */
for (ftype = 0; ftype < F_NRE; ftype++)
{
add_param_to_list (bond, &b);
nbond[i]++;
nbond[j]++;
- if (debug)
- {
- fprintf(debug, "Bonding atoms %s-%d and %s-%d\n",
- *atoms->atomname[i], i+1, *atoms->atomname[j], j+1);
- }
}
}
}
{
set_pbc(&pbc, epbcXYZ, box);
}
- if (debug)
- {
- pr_rvecs(debug, 0, "X2TOP", box, DIM);
- }
for (i = 0; (i < ang->nr); i++)
{
ai = ang->param[i].ai();
ak = ang->param[i].ak();
th = RAD2DEG*bond_angle(x[ai], x[aj], x[ak], bPBC ? &pbc : nullptr,
r_ij, r_kj, &costh, &t1, &t2);
- if (debug)
- {
- fprintf(debug, "X2TOP: ai=%3d aj=%3d ak=%3d r_ij=%8.3f r_kj=%8.3f th=%8.3f\n",
- ai, aj, ak, norm(r_ij), norm(r_kj), th);
- }
ang->param[i].c0() = th;
}
for (i = 0; (i < dih->nr); i++)
al = dih->param[i].al();
ph = RAD2DEG*dih_angle(x[ai], x[aj], x[ak], x[al], bPBC ? &pbc : nullptr,
r_ij, r_kj, r_kl, m, n, &t1, &t2, &t3);
- if (debug)
- {
- fprintf(debug, "X2TOP: ai=%3d aj=%3d ak=%3d al=%3d r_ij=%8.3f r_kj=%8.3f r_kl=%8.3f ph=%8.3f\n",
- ai, aj, ak, al, norm(r_ij), norm(r_kj), norm(r_kl), ph);
- }
dih->param[i].c0() = ph;
}
}