[cig-commits] r21537 - short/3D/PyLith/trunk/libsrc/pylith/bc

brad at geodynamics.org brad at geodynamics.org
Thu Mar 14 11:57:55 PDT 2013


Author: brad
Date: 2013-03-14 11:57:54 -0700 (Thu, 14 Mar 2013)
New Revision: 21537

Modified:
   short/3D/PyLith/trunk/libsrc/pylith/bc/AbsorbingDampers.cc
   short/3D/PyLith/trunk/libsrc/pylith/bc/Neumann.cc
Log:
Removed some copies.

Modified: short/3D/PyLith/trunk/libsrc/pylith/bc/AbsorbingDampers.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/bc/AbsorbingDampers.cc	2013-03-14 18:47:28 UTC (rev 21536)
+++ short/3D/PyLith/trunk/libsrc/pylith/bc/AbsorbingDampers.cc	2013-03-14 18:57:54 UTC (rev 21537)
@@ -161,10 +161,10 @@
   for(PetscInt c = cStart; c < cEnd; ++c) {
     // Compute geometry information for current cell
     coordsVisitor.getClosure(&coordsCell, &coordsSize, c);
-    for (PetscInt i=0; i < coordsSize; ++i) { // :TODO: Remove copy.
+    for (int i=0; i < coordsSize; ++i) { // :TODO: Remove copy
       coordinatesCell[i] = coordsCell[i];
     } // for
-    _quadrature->computeGeometry(coordinatesCell, c);
+    _quadrature->computeGeometry(coordsCell, coordsSize, c);
     coordsVisitor.restoreClosure(&coordsCell, &coordsSize, c);
 
     const PetscInt doff = dampingConstsVisitor.sectionOffset(c);
@@ -272,7 +272,6 @@
   submeshIS.deallocate();
   
 #if !defined(PRECOMPUTE_GEOMETRY)
-  scalar_array coordinatesCell(numBasis*spaceDim);
   PetscScalar* coordsCell = NULL;
   PetscInt coordsSize = 0;
 topology::CoordsVisitor coordsVisitor(dmSubMesh);
@@ -297,10 +296,7 @@
 #error("Code for PRECOMPUTE_GEOMETRY not implemented.")
 #else
     coordsVisitor.getClosure(&coordsCell, &coordsSize, c);
-    for (PetscInt i=0; i < coordsSize; ++i) { // :TODO: Remove copy.
-      coordinatesCell[i] = coordsCell[i];
-    } // for
-    _quadrature->computeGeometry(coordinatesCell, c);
+    _quadrature->computeGeometry(coordsCell, coordsSize, c);
     coordsVisitor.restoreClosure(&coordsCell, &coordsSize, c);
 #endif
 
@@ -420,7 +416,6 @@
 #if !defined(PRECOMPUTE_GEOMETRY)
   PetscScalar *coordsCell = NULL;
   PetscInt coordsSize = 0;
-  scalar_array coordinatesCell(numBasis*spaceDim);
   topology::CoordsVisitor coordsVisitor(dmSubMesh);
 #endif
 
@@ -438,10 +433,7 @@
 #error("Code for PRECOMPUTE_GEOMETRY not implemented.")
 #else
     coordsVisitor.getClosure(&coordsCell, &coordsSize, c);
-    for (PetscInt i=0; i < coordsSize; ++i) { // :TODO: Remove copy.
-      coordinatesCell[i] = coordsCell[i];
-    } // for
-    _quadrature->computeGeometry(coordinatesCell, c);
+    _quadrature->computeGeometry(coordsCell, coordsSize, c);
     coordsVisitor.restoreClosure(&coordsCell, &coordsSize, c);
 #endif
 
@@ -562,7 +554,6 @@
 #if !defined(PRECOMPUTE_GEOMETRY)
   PetscScalar *coordsCell = NULL;
   PetscInt coordsSize = 0;
-  scalar_array coordinatesCell(numBasis*spaceDim);
   topology::CoordsVisitor coordsVisitor(dmSubMesh);
 #endif
 
@@ -580,10 +571,7 @@
 #error("Code for PRECOMPUTE_GEOMETRY not implemented")
 #else
     coordsVisitor.getClosure(&coordsCell, &coordsSize, c);
-    for (PetscInt i = 0; i < coordsSize; ++i) { // :TODO: Remove copy.
-      coordinatesCell[i] = coordsCell[i];
-    } // for
-    _quadrature->computeGeometry(coordinatesCell, c);
+    _quadrature->computeGeometry(coordsCell, coordsSize, c);
     coordsVisitor.restoreClosure(&coordsCell, &coordsSize, c);
 #endif
 #if defined(DETAILED_EVENT_LOGGING)
@@ -698,7 +686,6 @@
   submeshIS.deallocate();
   
 #if !defined(PRECOMPUTE_GEOMETRY)
-  scalar_array coordinatesCell(numBasis*spaceDim);
   PetscScalar* coordsCell = NULL;
   PetscInt coordsSize = 0;
   topology::CoordsVisitor coordsVisitor(dmSubMesh);
@@ -718,10 +705,7 @@
 #error("Code for PRECOMPUTE_GEOMETRY not implemented");
 #else
     coordsVisitor.getClosure(&coordsCell, &coordsSize, c);
-    for (PetscInt i = 0; i < coordsSize; ++i) { // :TODO: Remove copy.
-      coordinatesCell[i] = coordsCell[i];
-    } // for
-    _quadrature->computeGeometry(coordinatesCell, c);
+    _quadrature->computeGeometry(coordsCell, coordsSize, c);
     coordsVisitor.restoreClosure(&coordsCell, &coordsSize, c);
 #endif
 #if defined(DETAILED_EVENT_LOGGING)

Modified: short/3D/PyLith/trunk/libsrc/pylith/bc/Neumann.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/bc/Neumann.cc	2013-03-14 18:47:28 UTC (rev 21536)
+++ short/3D/PyLith/trunk/libsrc/pylith/bc/Neumann.cc	2013-03-14 18:57:54 UTC (rev 21537)
@@ -119,7 +119,6 @@
   submeshIS.deallocate();
 
 #if !defined(PRECOMPUTE_GEOMETRY)
-  scalar_array coordinatesCell(numBasis*spaceDim);
   PetscScalar* coordsCell = NULL;
   PetscInt coordsSize = 0;
   topology::CoordsVisitor coordsVisitor(dmSubMesh);
@@ -131,10 +130,7 @@
 #error("Code for PRECOMPUTE_GEOMETRY not implemented.")
 #else
     coordsVisitor.getClosure(&coordsCell, &coordsSize, c);
-    for (PetscInt i=0; i < coordsSize; ++i) { // :TODO: Remove copy.
-      coordinatesCell[i] = coordsCell[i];
-    } // for
-    _quadrature->computeGeometry(coordinatesCell, c);
+    _quadrature->computeGeometry(coordsCell, coordsSize, c);
     coordsVisitor.restoreClosure(&coordsCell, &coordsSize, c);
 #endif
 
@@ -410,7 +406,6 @@
   PetscScalar* valueArray = valueVisitor.localArray();
 
   // Get coordinates
-  scalar_array coordinatesCell(numBasis*spaceDim);
   PetscScalar* coordsCell = NULL;
   PetscInt coordsSize = 0;
   topology::CoordsVisitor coordsVisitor(dmSubMesh);
@@ -434,10 +429,7 @@
 #error("Code for PRECOMPUTE_GEOMETRY not implemented.")
 #else
     coordsVisitor.getClosure(&coordsCell, &coordsSize, c);
-    for (PetscInt i = 0; i < coordsSize; ++i) { // :TODO: Remove copy.
-      coordinatesCell[i] = coordsCell[i];
-    } // for
-    _quadrature->computeGeometry(coordinatesCell, c);
+    _quadrature->computeGeometry(coordsCell, coordsSize, c);
     coordsVisitor.restoreClosure(&coordsCell, &coordsSize, c);
 #endif
     const scalar_array& quadPtsNondim = _quadrature->quadPts();



More information about the CIG-COMMITS mailing list