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

luis at geodynamics.org luis at geodynamics.org
Wed Feb 20 05:12:33 PST 2008


Author: luis
Date: 2008-02-20 05:12:33 -0800 (Wed, 20 Feb 2008)
New Revision: 11195

Modified:
   cs/benchmark/cigma/trunk/src/CompareCmd.cpp
Log:
Cleaning up CompareCmd::run()
 * Purged some old comments
 * No longer need dofs_a[] array


Modified: cs/benchmark/cigma/trunk/src/CompareCmd.cpp
===================================================================
--- cs/benchmark/cigma/trunk/src/CompareCmd.cpp	2008-02-20 13:12:31 UTC (rev 11194)
+++ cs/benchmark/cigma/trunk/src/CompareCmd.cpp	2008-02-20 13:12:33 UTC (rev 11195)
@@ -272,15 +272,17 @@
     assert(quadrature != 0);
     assert(field_a != 0);
     assert(field_b != 0);
+
+    // make sure the field dimensions match
+    // XXX: need graceful failure mode
     assert(field_a->n_dim() == field_a->n_dim());
     assert(field_a->n_rank() == field_b->n_rank());
-    //assert(writer != 0);
 
-
     Cell *cell_a = field_a->fe->cell;
     Cell *cell_b = field_b->fe->cell;
     assert(cell_a->n_celldim() == cell_b->n_celldim());
 
+
     // indices
     int e,q;
     int i,j;
@@ -288,27 +290,25 @@
     // dimensions
     int nel = mesh->nel;
     int nq = quadrature->n_points();
-    //int celldim = cell_a->n_celldim();
     int ndofs = cell_a->n_nodes();
     int valdim = field_a->n_rank();
 
     // local data;
-    //double *jxw = new double[nq]; // XXX: instead, use memory allocated by field_a->fe
     double *jxw = field_a->fe->jxw;
-    double *dofs_a = new double[ndofs * valdim];
     double *phi_a = new double[nq * valdim]; // XXX: not needed when using tabulation
     double *phi_b = new double[nq * valdim];
     
     // norm
     double L2 = 0.0;
-    //double *epsilon = new double[nel]; // XXX: instead, use memory allocated by residuals member
     double *epsilon = residuals->epsilon;
 
 
-    // XXX: what about case (mesh != field_a->meshPart)?
-    //FE *fe;
+    // XXX: don't forget about the case when (mesh != field_a->meshPart)
+    // Regardless, this cell pointer needs to come from the integrating
+    // mesh object, not from field_a.
     Cell *cell = cell_a;
 
+
     // start timer
     Timer timer;
     if (verbose)
@@ -320,6 +320,8 @@
         std::cout << timer;
     }
 
+    // XXX: time to move this main loop into its own function
+    // so we can use polymorphic dispatch on the argument types
     for (e = 0; e < nel; e++)
     {
         // update cell data
@@ -330,16 +332,12 @@
 
 
         // ... calculate phi_a[]
-        //
-        // XXX: time to move this main loop into its own function
-        // so we can use polymorphic dispatch on the argument types
-        //
         // XXX: using eval() -- applicable in general (Field obj)
         //for (q = 0; q < nq; q++)
         //{
         //    field_a->eval((*quadrature)[q], &phi_a[valdim*q]);
         //}
-        //
+
         // ... calculate phi_a[]
         // XXX: using tabulation -- applicable to FE_Field obj
         field_a->tabulate_element(e, phi_a);
@@ -393,9 +391,8 @@
 
 
     /* clean up */
-    //delete [] phi_a;
+    delete [] phi_a;
     delete [] phi_b;
-    delete [] dofs_a;
 
 
     return 0;



More information about the cig-commits mailing list