#if GMX_QMMM_MOPAC
/* mopac interface routines */
-void
- F77_FUNC(domldt, DOMLDT) (int *nrqmat, int labels[], char keywords[]);
+void F77_FUNC(domldt, DOMLDT)(int* nrqmat, int labels[], char keywords[]);
-void
- F77_FUNC(domop, DOMOP) (int *nrqmat, double qmcrd[], int *nrmmat,
- double mmchrg[], double mmcrd[], double qmgrad[],
- double mmgrad[], double *energy, double qmcharges[]);
+void F77_FUNC(domop, DOMOP)(int* nrqmat,
+ double qmcrd[],
+ int* nrmmat,
+ double mmchrg[],
+ double mmcrd[],
+ double qmgrad[],
+ double mmgrad[],
+ double* energy,
+ double qmcharges[]);
#else /* GMX_QMMM_MOPAC */
// Stub definitions to make compilation succeed when not configured
// issue fatal errors here, because that introduces problems with
// tools suggesting and prohibiting noreturn attributes.
-static void F77_FUNC(domldt, DOMLDT) (int * /*unused*/, int /*unused*/[], char /*unused*/[])
-{
-}
+static void F77_FUNC(domldt, DOMLDT)(int* /*unused*/, int /*unused*/[], char /*unused*/[]) {}
-static void F77_FUNC(domop, DOMOP) (int * /*unused*/, double /*unused*/[], int * /*unused*/,
- double /*unused*/[], double /*unused*/[], double /*unused*/[],
- double /*unused*/[], double * /*unused*/, double /*unused*/[])
+static void F77_FUNC(domop, DOMOP)(int* /*unused*/,
+ double /*unused*/[],
+ int* /*unused*/,
+ double /*unused*/[],
+ double /*unused*/[],
+ double /*unused*/[],
+ double /*unused*/[],
+ double* /*unused*/,
+ double /*unused*/[])
{
}
#endif
-void init_mopac(t_QMrec *qm)
+void init_mopac(t_QMrec* qm)
{
/* initializes the mopac routines ans sets up the semiempirical
* computation by calling moldat(). The inline mopac routines can
* structure or find a transition state at PM3 level, gaussian is
* used instead.
*/
- char
- *keywords;
+ char* keywords;
if (!GMX_QMMM_MOPAC)
{
- gmx_fatal(FARGS, "Cannot call MOPAC unless linked against it. Use cmake -DGMX_QMMM_PROGRAM=MOPAC, and ensure that linking will work correctly.");
+ gmx_fatal(FARGS,
+ "Cannot call MOPAC unless linked against it. Use cmake -DGMX_QMMM_PROGRAM=MOPAC, "
+ "and ensure that linking will work correctly.");
}
snew(keywords, 240);
- if (!qm->bSH) /* if rerun then grad should not be done! */
+ if (!qm->bSH) /* if rerun then grad should not be done! */
{
- sprintf(keywords, "PRECISE GEO-OK CHARGE=%d GRAD MMOK ANALYT %s\n",
- qm->QMcharge,
+ sprintf(keywords, "PRECISE GEO-OK CHARGE=%d GRAD MMOK ANALYT %s\n", qm->QMcharge,
eQMmethod_names[qm->QMmethod]);
}
else
{
sprintf(keywords, "PRECISE GEO-OK CHARGE=%d SINGLET GRAD %s C.I.=(%d,%d) root=2 MECI \n",
- qm->QMcharge,
- eQMmethod_names[qm->QMmethod],
- qm->CASorbitals, qm->CASelectrons/2);
+ qm->QMcharge, eQMmethod_names[qm->QMmethod], qm->CASorbitals, qm->CASelectrons / 2);
}
- F77_FUNC(domldt, DOMLDT) (&qm->nrQMatoms, qm->atomicnumberQM, keywords);
+ F77_FUNC(domldt, DOMLDT)(&qm->nrQMatoms, qm->atomicnumberQM, keywords);
fprintf(stderr, "keywords are: %s\n", keywords);
free(keywords);
} /* init_mopac */
-real call_mopac(t_QMrec *qm, t_MMrec *mm, rvec f[], rvec fshift[])
+real call_mopac(t_QMrec* qm, t_MMrec* mm, rvec f[], rvec fshift[])
{
/* do the actual QMMM calculation using directly linked mopac subroutines
*/
double /* always double as the MOPAC routines are always compiled in
double precission! */
- *qmcrd = nullptr, *qmchrg = nullptr, *mmcrd = nullptr, *mmchrg = nullptr,
- *qmgrad, *mmgrad = nullptr, energy = 0;
- int
- i, j;
- real
- QMener = 0.0;
- snew(qmcrd, 3*(qm->nrQMatoms));
- snew(qmgrad, 3*(qm->nrQMatoms));
+ *qmcrd = nullptr,
+ *qmchrg = nullptr, *mmcrd = nullptr, *mmchrg = nullptr, *qmgrad, *mmgrad = nullptr,
+ energy = 0;
+ int i, j;
+ real QMener = 0.0;
+ snew(qmcrd, 3 * (qm->nrQMatoms));
+ snew(qmgrad, 3 * (qm->nrQMatoms));
/* copy the data from qr into the arrays that are going to be used
* in the fortran routines of MOPAC
*/
{
for (j = 0; j < DIM; j++)
{
- qmcrd[3*i+j] = static_cast<double>(qm->xQM[i][j])*10;
+ qmcrd[3 * i + j] = static_cast<double>(qm->xQM[i][j]) * 10;
}
}
if (mm->nrMMatoms)
* conceptual problems with semi-empirical QM in combination with
* point charges that we need to solve first....
*/
- gmx_fatal(FARGS, "At present only ONIOM is allowed in combination"
+ gmx_fatal(FARGS,
+ "At present only ONIOM is allowed in combination"
" with MOPAC QM subroutines\n");
}
else
*/
snew(qmchrg, qm->nrQMatoms);
- F77_FUNC(domop, DOMOP) (&qm->nrQMatoms, qmcrd, &mm->nrMMatoms,
- mmchrg, mmcrd, qmgrad, mmgrad, &energy, qmchrg);
+ F77_FUNC(domop, DOMOP)
+ (&qm->nrQMatoms, qmcrd, &mm->nrMMatoms, mmchrg, mmcrd, qmgrad, mmgrad, &energy, qmchrg);
/* add the gradients to the f[] array, and also to the fshift[].
* the mopac gradients are in kCal/angstrom.
*/
{
for (j = 0; j < DIM; j++)
{
- f[i][j] = static_cast<real>(10)*CAL2JOULE*qmgrad[3*i+j];
- fshift[i][j] = static_cast<real>(10)*CAL2JOULE*qmgrad[3*i+j];
+ f[i][j] = static_cast<real>(10) * CAL2JOULE * qmgrad[3 * i + j];
+ fshift[i][j] = static_cast<real>(10) * CAL2JOULE * qmgrad[3 * i + j];
}
}
- QMener = static_cast<real>CAL2JOULE*energy;
+ QMener = static_cast<real> CAL2JOULE * energy;
/* do we do something with the mulliken charges?? */
free(qmchrg);
return (QMener);
}
-real call_mopac_SH(t_QMrec *qm, t_MMrec *mm, rvec f[], rvec fshift[])
+real call_mopac_SH(t_QMrec* qm, t_MMrec* mm, rvec f[], rvec fshift[])
{
/* do the actual SH QMMM calculation using directly linked mopac
subroutines */
double /* always double as the MOPAC routines are always compiled in
double precission! */
- *qmcrd = nullptr, *qmchrg = nullptr, *mmcrd = nullptr, *mmchrg = nullptr,
- *qmgrad, *mmgrad = nullptr, energy = 0;
- int
- i, j;
- real
- QMener = 0.0;
-
- snew(qmcrd, 3*(qm->nrQMatoms));
- snew(qmgrad, 3*(qm->nrQMatoms));
+ *qmcrd = nullptr,
+ *qmchrg = nullptr, *mmcrd = nullptr, *mmchrg = nullptr, *qmgrad, *mmgrad = nullptr,
+ energy = 0;
+ int i, j;
+ real QMener = 0.0;
+
+ snew(qmcrd, 3 * (qm->nrQMatoms));
+ snew(qmgrad, 3 * (qm->nrQMatoms));
/* copy the data from qr into the arrays that are going to be used
* in the fortran routines of MOPAC
*/
{
for (j = 0; j < DIM; j++)
{
- qmcrd[3*i+j] = static_cast<double>(qm->xQM[i][j])*10;
+ qmcrd[3 * i + j] = static_cast<double>(qm->xQM[i][j]) * 10;
}
}
if (mm->nrMMatoms)
*/
snew(qmchrg, qm->nrQMatoms);
- F77_FUNC(domop, DOMOP) (&qm->nrQMatoms, qmcrd, &mm->nrMMatoms,
- mmchrg, mmcrd, qmgrad, mmgrad, &energy, qmchrg);
+ F77_FUNC(domop, DOMOP)
+ (&qm->nrQMatoms, qmcrd, &mm->nrMMatoms, mmchrg, mmcrd, qmgrad, mmgrad, &energy, qmchrg);
/* add the gradients to the f[] array, and also to the fshift[].
* the mopac gradients are in kCal/angstrom.
*/
{
for (j = 0; j < DIM; j++)
{
- f[i][j] = static_cast<real>(10)*CAL2JOULE*qmgrad[3*i+j];
- fshift[i][j] = static_cast<real>(10)*CAL2JOULE*qmgrad[3*i+j];
+ f[i][j] = static_cast<real>(10) * CAL2JOULE * qmgrad[3 * i + j];
+ fshift[i][j] = static_cast<real>(10) * CAL2JOULE * qmgrad[3 * i + j];
}
}
- QMener = static_cast<real>CAL2JOULE*energy;
+ QMener = static_cast<real> CAL2JOULE * energy;
}
free(qmgrad);
free(qmcrd);