[cig-commits] [commit] knepley/feature-petsc-fe: Field: Pass along DS with DMClone, I am not sure this is the right thing to do (7cffe15)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Thu Oct 16 13:44:44 PDT 2014
Repository : https://github.com/geodynamics/pylith
On branch : knepley/feature-petsc-fe
Link : https://github.com/geodynamics/pylith/compare/0000000000000000000000000000000000000000...eed9adc756a4f472f6890e591d3d92bba741a9a0
>---------------------------------------------------------------
commit 7cffe15f3fb0cea21829509b9dbd6c90fdd9d969
Author: Matthew G. Knepley <knepley at gmail.com>
Date: Thu Oct 16 15:40:31 2014 -0500
Field: Pass along DS with DMClone, I am not sure this is the right thing to do
>---------------------------------------------------------------
7cffe15f3fb0cea21829509b9dbd6c90fdd9d969
libsrc/pylith/topology/Field.cc | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/libsrc/pylith/topology/Field.cc b/libsrc/pylith/topology/Field.cc
index 1ee105d..6b38057 100644
--- a/libsrc/pylith/topology/Field.cc
+++ b/libsrc/pylith/topology/Field.cc
@@ -49,12 +49,15 @@ pylith::topology::Field::Field(const Mesh& mesh) :
_metadata["default"].dimsOkay = false;
if (mesh.dmMesh()) {
PetscDM dm = mesh.dmMesh();assert(dm);
+ PetscDS prob = NULL;
PetscVec coordVec = NULL;
PetscSection s = NULL;
PetscErrorCode err;
err = DMDestroy(&_dm);PYLITH_CHECK_ERROR(err);
err = DMClone(dm, &_dm);PYLITH_CHECK_ERROR(err);
+ err = DMGetDS(dm, &prob);PYLITH_CHECK_ERROR(err);
+ err = DMSetDS(_dm, prob);PYLITH_CHECK_ERROR(err);
err = DMGetCoordinatesLocal(dm, &coordVec);PYLITH_CHECK_ERROR(err);
if (coordVec) {
PetscDM coordDM=NULL, newCoordDM=NULL;
@@ -935,10 +938,13 @@ pylith::topology::Field::createScatterWithBC(const Mesh& mesh,
} // if
PetscSection section = NULL, newSection = NULL, gsection = NULL;
+ PetscDS prob = NULL;
PetscSF sf = NULL;
err = DMDestroy(&sinfo.dm);PYLITH_CHECK_ERROR(err);
err = DMClone(_dm, &sinfo.dm);PYLITH_CHECK_ERROR(err);
+ err = DMGetDS(_dm, &prob);PYLITH_CHECK_ERROR(err);
+ err = DMSetDS(sinfo.dm, prob);PYLITH_CHECK_ERROR(err);
err = DMGetDefaultSection(_dm, §ion);PYLITH_CHECK_ERROR(err);
err = PetscSectionClone(section, &newSection);PYLITH_CHECK_ERROR(err);
err = DMSetDefaultSection(sinfo.dm, newSection);PYLITH_CHECK_ERROR(err);
@@ -982,6 +988,7 @@ pylith::topology::Field::createScatterWithBC(const Mesh& mesh,
PetscDM dm = mesh.dmMesh();assert(dm);
PetscSection section = NULL, newSection = NULL, gsection = NULL, subSection = NULL;
+ PetscDS prob = NULL;
PetscSF sf = NULL;
PetscDMLabel subpointMap = NULL, subpointMapF = NULL;
PetscInt dim, dimF, pStart, pEnd, qStart, qEnd, cEnd, cMax, vEnd, vMax;
@@ -1036,6 +1043,8 @@ pylith::topology::Field::createScatterWithBC(const Mesh& mesh,
err = DMDestroy(&sinfo.dm);PYLITH_CHECK_ERROR(err);
err = DMClone(_dm, &sinfo.dm);PYLITH_CHECK_ERROR(err);
+ err = DMGetDS(_dm, &prob);PYLITH_CHECK_ERROR(err);
+ err = DMSetDS(sinfo.dm, prob);PYLITH_CHECK_ERROR(err);
err = PetscSectionClone(section, &newSection);PYLITH_CHECK_ERROR(err);
err = DMSetDefaultSection(sinfo.dm, newSection);PYLITH_CHECK_ERROR(err);
err = PetscSectionDestroy(&newSection);PYLITH_CHECK_ERROR(err);
More information about the CIG-COMMITS
mailing list