[cig-commits] r11186 - cs/benchmark/cigma/trunk/src

luis at geodynamics.org luis at geodynamics.org
Tue Feb 19 20:30:37 PST 2008


Author: luis
Date: 2008-02-19 20:30:37 -0800 (Tue, 19 Feb 2008)
New Revision: 11186

Modified:
   cs/benchmark/cigma/trunk/src/Cell.cpp
Log:
Avoid using delete[] in Cell::jacobian()


Modified: cs/benchmark/cigma/trunk/src/Cell.cpp
===================================================================
--- cs/benchmark/cigma/trunk/src/Cell.cpp	2008-02-20 04:30:36 UTC (rev 11185)
+++ cs/benchmark/cigma/trunk/src/Cell.cpp	2008-02-20 04:30:37 UTC (rev 11186)
@@ -119,7 +119,7 @@
     const int celldim = n_celldim();
 
     double uvw[3] = {u,v,w};
-    double *grad = new double[nno*3];
+    double grad[nno*3];
     double *s;
 
     #define X(i)  globverts[3*(i) + 0]
@@ -148,7 +148,6 @@
                 jac[2][1] += Y(i) * s[2];
                 jac[2][2] += Z(i) * s[2];
             }
-            delete [] grad; // XXX
             return fabs(
                     + jac[0][0] * jac[1][1] * jac[2][2]
                     + jac[0][2] * jac[1][0] * jac[2][1]
@@ -190,7 +189,6 @@
                 jac[2][1] = c[1];
                 jac[2][2] = c[2];
             }
-            delete [] grad; // XXX
             return sqrt(SQR(jac[0][0] * jac[1][1] - jac[0][1] * jac[1][0]) +
                         SQR(jac[0][2] * jac[1][0] - jac[0][0] * jac[1][2]) +
                         SQR(jac[0][1] * jac[1][2] - jac[0][2] * jac[1][1]));
@@ -237,14 +235,12 @@
                 jac[2][1] = c[1];
                 jac[2][2] = c[2];
             }
-            delete [] grad; // XXX
             return sqrt(SQR(jac[0][0])+SQR(jac[0][1])+SQR(jac[0][2]));
     }
     #undef X
     #undef Y
     #undef Z
 
-    delete [] grad;
     return 0.0;
 }
 



More information about the cig-commits mailing list