[cig-commits] r21566 - short/3D/PyLith/trunk/libsrc/pylith/bc
brad at geodynamics.org
brad at geodynamics.org
Tue Mar 19 10:40:16 PDT 2013
Author: brad
Date: 2013-03-19 10:40:15 -0700 (Tue, 19 Mar 2013)
New Revision: 21566
Modified:
short/3D/PyLith/trunk/libsrc/pylith/bc/BCIntegratorSubMesh.cc
short/3D/PyLith/trunk/libsrc/pylith/bc/BoundaryCondition.cc
Log:
Updated verifyConfiguration() to use PETSc DM.
Modified: short/3D/PyLith/trunk/libsrc/pylith/bc/BCIntegratorSubMesh.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/bc/BCIntegratorSubMesh.cc 2013-03-19 13:32:42 UTC (rev 21565)
+++ short/3D/PyLith/trunk/libsrc/pylith/bc/BCIntegratorSubMesh.cc 2013-03-19 17:40:15 UTC (rev 21566)
@@ -93,13 +93,12 @@
const PetscInt cStart = heightStratum.begin();
const PetscInt cEnd = heightStratum.end();
- throw std::logic_error("BCIntegratorSubMesh::verifyConfiguration(mesh) not implemented for PETSc dm.");
-#if 0 // :MATT: Update this for PETSc dm
-
// Make sure surface cells are compatible with quadrature.
- const int boundaryDepth = sieveSubMesh->depth()-1; // depth of bndry cells // UPDATE THIS
+ PetscInt depth = 0;
+ PetscErrorCode err = DMPlexGetDepth(dmSubMesh, &depth);CHECK_PETSC_ERROR(err);
for (PetscInt c = cStart; c < cEnd; ++c) {
- const int cellNumCorners = sieveSubMesh->getNumCellCorners(c, boundaryDepth); // UPDATE THIS
+ PetscInt cellNumCorners = 0;
+ err = DMPlexGetConeSize(dmSubMesh, c, &cellNumCorners);CHECK_PETSC_ERROR(err);
if (numCorners != cellNumCorners) {
std::ostringstream msg;
msg << "Quadrature is incompatible with cell for boundary condition '"
@@ -110,7 +109,6 @@
throw std::runtime_error(msg.str());
} // if
} // for
-#endif
} // verifyConfiguration
Modified: short/3D/PyLith/trunk/libsrc/pylith/bc/BoundaryCondition.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/bc/BoundaryCondition.cc 2013-03-19 13:32:42 UTC (rev 21565)
+++ short/3D/PyLith/trunk/libsrc/pylith/bc/BoundaryCondition.cc 2013-03-19 17:40:15 UTC (rev 21566)
@@ -50,18 +50,15 @@
void
pylith::bc::BoundaryCondition::verifyConfiguration(const topology::Mesh& mesh) const
{ // verifyConfiguration
- throw std::logic_error(":MATT: TODO - BoundaryCondition::verifyConfiguration(mesh) needs to be updated for PETSc dm.");
-#if 0 // :MATT: Update this for PETSc dm.
- const ALE::Obj<topology::Mesh::SieveMesh>& sieveMesh = mesh.sieveMesh();
- assert(!sieveMesh.isNull());
-
- if (!sieveMesh->hasIntSection(_label)) {
+ const PetscDM dmMesh = mesh.dmMesh();assert(dmMesh);
+ PetscBool hasLabel = PETSC_FALSE;
+ PetscErrorCode err = DMPlexHasLabel(dmMesh, _label.c_str(), &hasLabel);CHECK_PETSC_ERROR(err);
+ if (!hasLabel) {
std::ostringstream msg;
msg << "Mesh missing group of vertices '" << _label
<< "' for boundary condition.";
throw std::runtime_error(msg.str());
} // if
-#endif
} // verifyConfiguration
More information about the CIG-COMMITS
mailing list