[cig-commits] [commit] knepley/upgrade-petsc-interface: Really fixed copying the metadata when extracting subfields. (03bb552)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Thu Nov 14 14:58:22 PST 2013


Repository : ssh://geoshell/pylith

On branch  : knepley/upgrade-petsc-interface
Link       : https://github.com/geodynamics/pylith/compare/391968f6bec7319b47b311e9a68289b2574756f2...03bb552c194562c46f162b594767dd78ecd2b624

>---------------------------------------------------------------

commit 03bb552c194562c46f162b594767dd78ecd2b624
Author: Brad Aagaard <baagaard at usgs.gov>
Date:   Thu Nov 14 15:00:55 2013 -0800

    Really fixed copying the metadata when extracting subfields.


>---------------------------------------------------------------

03bb552c194562c46f162b594767dd78ecd2b624
 libsrc/pylith/topology/Field.cc | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/libsrc/pylith/topology/Field.cc b/libsrc/pylith/topology/Field.cc
index d9eace0..08d2c08 100644
--- a/libsrc/pylith/topology/Field.cc
+++ b/libsrc/pylith/topology/Field.cc
@@ -1349,14 +1349,6 @@ pylith::topology::Field::copySubfield(const Field& field,
 { // copySubfield
   PYLITH_METHOD_BEGIN;
 
-  const Metadata& subfieldMetadata = const_cast<Field&>(field).subfieldMetadata(name);
-  const int subfieldIndex = subfieldMetadata.index;assert(subfieldIndex >= 0);
-
-  PetscErrorCode err;
-  _metadata.clear();
-  _metadata["default"] = subfieldMetadata;
-  label(subfieldMetadata.label.c_str()); // Use method to insure propagation to subsidiary objects
-
   // Check compatibility of sections
   const int srcSize = field.chartSize();
   const int dstSize = chartSize();
@@ -1365,6 +1357,14 @@ pylith::topology::Field::copySubfield(const Field& field,
   } // if
   assert(_localVec && field._localVec);
 
+  const Metadata& subfieldMetadata = const_cast<Field&>(field).subfieldMetadata(name);
+  const int subfieldIndex = subfieldMetadata.index;assert(subfieldIndex >= 0);
+
+  _metadata.clear();
+  _metadata["default"] = subfieldMetadata;
+  label(subfieldMetadata.label.c_str()); // Use method to insure propagation to subsidiary objects
+
+  PetscErrorCode err;
   const PetscSection& fieldSection = field.petscSection();
   const PetscSection& subfieldSection = this->petscSection();
 



More information about the CIG-COMMITS mailing list