[cig-commits] [commit] knepley/upgrade-petsc-interface: Setup topology::StratumIS interface to take arg to filter to cells only. New functionality NOT IMPLEMENTED. (70e98ee)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Mon Nov 11 19:26:44 PST 2013
Repository : ssh://geoshell/pylith
On branch : knepley/upgrade-petsc-interface
Link : https://github.com/geodynamics/pylith/compare/4829f3cf356e30c9c893222f879af32b1f73a245...70e98ee8a2f7a96f12d544487cc44287b37d1496
>---------------------------------------------------------------
commit 70e98ee8a2f7a96f12d544487cc44287b37d1496
Author: Brad Aagaard <baagaard at usgs.gov>
Date: Mon Nov 11 19:29:17 2013 -0800
Setup topology::StratumIS interface to take arg to filter to cells only. New functionality NOT IMPLEMENTED.
>---------------------------------------------------------------
70e98ee8a2f7a96f12d544487cc44287b37d1496
libsrc/pylith/feassemble/IntegratorElasticity.cc | 8 +++-----
libsrc/pylith/materials/Material.cc | 2 +-
libsrc/pylith/topology/Stratum.hh | 3 ++-
libsrc/pylith/topology/Stratum.icc | 11 ++++++++---
4 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/libsrc/pylith/feassemble/IntegratorElasticity.cc b/libsrc/pylith/feassemble/IntegratorElasticity.cc
index 3478fb8..78c9a62 100644
--- a/libsrc/pylith/feassemble/IntegratorElasticity.cc
+++ b/libsrc/pylith/feassemble/IntegratorElasticity.cc
@@ -114,7 +114,7 @@ pylith::feassemble::IntegratorElasticity::initialize(const topology::Mesh& mesh)
// Setup index set for material.
PetscDM dmMesh = mesh.dmMesh();assert(dmMesh);
if (!_materialIS) {
- delete _materialIS; _materialIS = new topology::StratumIS(dmMesh, "material-id", _material->id());assert(_materialIS);
+ delete _materialIS; _materialIS = new topology::StratumIS(dmMesh, "material-id", _material->id());assert(_materialIS); // :TODO: FIX THIS
} // if
// Compute geometry for quadrature operations.
@@ -261,21 +261,19 @@ pylith::feassemble::IntegratorElasticity::verifyConfiguration(const topology::Me
} // if
PetscDM dmMesh = mesh.dmMesh();assert(dmMesh);
- topology::StratumIS materialIS(dmMesh, "material-id", _material->id());
+ topology::StratumIS materialIS(dmMesh, "material-id", _material->id()); // :TODO: FIX THIS
const PetscInt* cells = materialIS.points();
const PetscInt numCells = materialIS.size();
const int numCorners = _quadrature->refGeometry().numCorners();
- PetscInt cStart, cEnd, vStart, vEnd;
+ PetscInt vStart, vEnd;
PetscErrorCode err;
- err = DMPlexGetHeightStratum(dmMesh, 0, &cStart, &cEnd);PYLITH_CHECK_ERROR(err);
err = DMPlexGetDepthStratum(dmMesh, 0, &vStart, &vEnd);PYLITH_CHECK_ERROR(err);
for(PetscInt c = 0; c < numCells; ++c) {
const PetscInt cell = cells[c];
PetscInt cellNumCorners = 0, closureSize, *closure = NULL;
- if ((cell < cStart) || (cell >= cEnd)) continue;
err = DMPlexGetTransitiveClosure(dmMesh, cell, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
for (PetscInt cl = 0; cl < closureSize*2; cl += 2) {
if ((closure[cl] >= vStart) && (closure[cl] < vEnd)) ++cellNumCorners;
diff --git a/libsrc/pylith/materials/Material.cc b/libsrc/pylith/materials/Material.cc
index 4ea41a0..e5aee74 100644
--- a/libsrc/pylith/materials/Material.cc
+++ b/libsrc/pylith/materials/Material.cc
@@ -128,7 +128,7 @@ pylith::materials::Material::initialize(const topology::Mesh& mesh,
// Get cells associated with material
PetscDM dmMesh = mesh.dmMesh();assert(dmMesh);
- delete _materialIS; _materialIS = new topology::StratumIS(dmMesh, "material-id", _id);assert(_materialIS);
+ delete _materialIS; _materialIS = new topology::StratumIS(dmMesh, "material-id", _id);assert(_materialIS); // :TODO: FIX THIS
const PetscInt numCells = _materialIS->size();
const PetscInt* cells = _materialIS->points();
diff --git a/libsrc/pylith/topology/Stratum.hh b/libsrc/pylith/topology/Stratum.hh
index 1f46d61..d9abd32 100644
--- a/libsrc/pylith/topology/Stratum.hh
+++ b/libsrc/pylith/topology/Stratum.hh
@@ -106,7 +106,8 @@ public :
*/
StratumIS(const PetscDM dmMesh,
const char* label,
- const int id);
+ const int id,
+ const bool includeOnlyCells =false);
/// Default destructor.
~StratumIS(void);
diff --git a/libsrc/pylith/topology/Stratum.icc b/libsrc/pylith/topology/Stratum.icc
index 7dc912e..f8df592 100644
--- a/libsrc/pylith/topology/Stratum.icc
+++ b/libsrc/pylith/topology/Stratum.icc
@@ -87,13 +87,18 @@ pylith::topology::Stratum::size(void) const
inline
pylith::topology::StratumIS::StratumIS(const PetscDM dmMesh,
const char* label,
- const int id)
+ const int id,
+ const bool includeOnlyCells)
{ // constructor
assert(dmMesh);
PetscErrorCode err;
err = DMPlexGetStratumIS(dmMesh, label, id, &_indexSet);PYLITH_CHECK_ERROR(err);assert(_indexSet);
- err = ISGetSize(_indexSet, &_size);PYLITH_CHECK_ERROR(err);assert(_size >= 0);
- err = ISGetIndices(_indexSet, &_points);PYLITH_CHECK_ERROR(err);assert(!_size || _points);
+ if (!includeOnlyCells) {
+ err = ISGetSize(_indexSet, &_size);PYLITH_CHECK_ERROR(err);assert(_size >= 0);
+ err = ISGetIndices(_indexSet, &_points);PYLITH_CHECK_ERROR(err);assert(!_size || _points);
+ } else {
+ // :TODO: Matt add stuff here
+ } // if/else
} // constructor
// ----------------------------------------------------------------------
More information about the CIG-COMMITS
mailing list