 #endif
     // arrays.
     double vec[NEQ][NDIM];
-    double mat[NDIM][NDIM], matinv[NDIM][NDIM];
+    double vmt[NDIM][NDIM];
+    double mat[NDIM][NDIM], mvt[NDIM][NDIM];
     // iterators.
-    int ifc, icl, jcl, ieq;
+    int ifc, icl, jcl, ieq, it, jt;
 #ifdef __CUDACC__
     if (ibnd < nbnd) {
         pfacn = facn + ibnd*BFREL;

    double len;
#endif
    // arrays.
    double mat[NDIM][NDIM], matinv[NDIM][NDIM];
    double mom[NDIM];
    // iterators.
    int ifc, icl, jcl;

    int *pfacn, *pfccls;
    double *pidsoln, *pjdsoln, *pdsoln;
    double *pfcnml;
    double (*pten)[NDIM];
#if NDIM == 3
    int *pfcnds;
    double *pndcrd, *pfccnd;
