[cig-commits] r11475 - cs/benchmark/cigma/trunk/src
luis at geodynamics.org
luis at geodynamics.org
Wed Mar 19 12:00:08 PDT 2008
Author: luis
Date: 2008-03-19 12:00:08 -0700 (Wed, 19 Mar 2008)
New Revision: 11475
Modified:
cs/benchmark/cigma/trunk/src/CompareCmd.cpp
Log:
Removed obsolete version of the CompareCmd::run() method
Modified: cs/benchmark/cigma/trunk/src/CompareCmd.cpp
===================================================================
--- cs/benchmark/cigma/trunk/src/CompareCmd.cpp 2008-03-19 19:00:07 UTC (rev 11474)
+++ cs/benchmark/cigma/trunk/src/CompareCmd.cpp 2008-03-19 19:00:08 UTC (rev 11475)
@@ -459,139 +459,4 @@
} // */
-/* XXX: old run() method
-int cigma::CompareCmd::run()
-{
- std::cout << "Calling cigma::CompareCmd::run()" << std::endl;
-
- assert(mesh != 0);
- 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());
-
- 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;
-
- // dimensions
- int nel = mesh->nel;
- int nq = quadrature->n_points();
- int ndofs = cell_a->n_nodes();
- int valdim = field_a->n_rank();
-
- // local data;
- double *jxw = field_a->fe->jxw;
- 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 = residuals->epsilon;
-
-
- // 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)
- {
- std::cout << std::setprecision(5);
- timer.print_header(std::cout, "elts");
- timer.start(nel);
- timer.update(0);
- 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
- mesh->select_cell(e);
-
- // obtain global points from current quadrature rule
- quadrature->apply_refmap(cell);
-
-
- // ... calculate phi_a[]
- // 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);
-
- // ... calculate phi_b[]
- for (q = 0; q < nq; q++)
- {
- field_b->eval((*quadrature)[q], &phi_b[valdim*q]);
- }
-
- // evaluate jacobian at known quadrature points
- field_a->fe->update_jxw(); // XXX: somehow, this method needs to be attached
- // to the MeshPart object, so maybe it needs its
- // own FE object after all?
-
- // ... apply quadrature rule
- double err = 0.0;
- for (q = 0; q < nq; q++)
- {
- for (i = 0; i < valdim; i++)
- {
- int qi = valdim*q + i;
- err += jxw[q] * SQR(phi_a[qi] - phi_b[qi]);
- }
- }
-
- epsilon[e] = err;
- L2 += err;
-
- // XXX: debug info
- if (verbose && ((e+1) % output_frequency == 0))
- {
- timer.update(e+1);
- std::cout << timer;
- }
- }
-
- if (verbose)
- {
- timer.update(nel);
- std::cout << timer << std::endl;
- }
-
- L2 = sqrt(L2);
- std::cout << std::setprecision(12);
- std::cout << "L2 = " << L2 << std::endl;
-
-
- // write out data
- residuals->write_vtk(output_path.c_str());
-
-
- // clean up
- delete [] phi_a;
- delete [] phi_b;
-
-
- return 0;
-} // */
-
// ---------------------------------------------------------------------------
More information about the cig-commits
mailing list