[cig-commits] [commit] knepley/fix-dm-composition, next: Field: Setup DM field objects (2bae138)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Wed Jun 25 17:20:07 PDT 2014
Repository : https://github.com/geodynamics/pylith
On branches: knepley/fix-dm-composition,next
Link : https://github.com/geodynamics/pylith/compare/9e9b3eb32aeee3851bb285945375cc28a2c0fdcf...ffaa715d19b1a8a79173ca5af7d64b65529244c8
>---------------------------------------------------------------
commit 2bae13870c3a01dd4a1acceca3c441956f78eb01
Author: Matthew G. Knepley <knepley at gmail.com>
Date: Wed Jun 25 17:16:23 2014 -0700
Field: Setup DM field objects
>---------------------------------------------------------------
2bae13870c3a01dd4a1acceca3c441956f78eb01
libsrc/pylith/topology/Field.cc | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libsrc/pylith/topology/Field.cc b/libsrc/pylith/topology/Field.cc
index b1a390e..7dec198 100644
--- a/libsrc/pylith/topology/Field.cc
+++ b/libsrc/pylith/topology/Field.cc
@@ -1257,10 +1257,14 @@ pylith::topology::Field::subfieldsSetup(void)
PetscSection section = NULL;
PetscErrorCode err = DMGetDefaultSection(_dm, §ion);PYLITH_CHECK_ERROR(err);assert(section);
err = PetscSectionSetNumFields(section, _subfieldComps.size());PYLITH_CHECK_ERROR(err);
+ err = DMSetNumFields(_dm, _subfieldComps.size());PYLITH_CHECK_ERROR(err);
for(std::map<std::string, int>::const_iterator f_iter = _subfieldComps.begin(); f_iter != _subfieldComps.end(); ++f_iter) {
+ PetscObject fobj;
const PetscInt index = subfieldMetadata(f_iter->first.c_str()).index;
err = PetscSectionSetFieldName(section, index, f_iter->first.c_str());PYLITH_CHECK_ERROR(err);
err = PetscSectionSetFieldComponents(section, index, f_iter->second);PYLITH_CHECK_ERROR(err);
+ err = DMGetField(_dm, index, &fobj);PYLITH_CHECK_ERROR(err);assert(section);
+ err = PetscObjectSetName(fobj, f_iter->first.c_str());PYLITH_CHECK_ERROR(err);
} // for
PYLITH_METHOD_END;
More information about the CIG-COMMITS
mailing list