[cig-commits] r19831 - short/3D/PyLith/trunk/libsrc/pylith/meshio
brad at geodynamics.org
brad at geodynamics.org
Wed Mar 21 08:26:38 PDT 2012
Author: brad
Date: 2012-03-21 08:26:38 -0700 (Wed, 21 Mar 2012)
New Revision: 19831
Modified:
short/3D/PyLith/trunk/libsrc/pylith/meshio/OutputSolnPoints.cc
Log:
Fixed args for setting up point interpolation for consistency in parallel. Only proc 0 has points.
Modified: short/3D/PyLith/trunk/libsrc/pylith/meshio/OutputSolnPoints.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/meshio/OutputSolnPoints.cc 2012-03-20 23:40:21 UTC (rev 19830)
+++ short/3D/PyLith/trunk/libsrc/pylith/meshio/OutputSolnPoints.cc 2012-03-21 15:26:38 UTC (rev 19831)
@@ -119,6 +119,7 @@
const int numCells = numPoints;
const int numCorners = 1;
const bool interpolate = false;
+ // Build mesh creates mesh on proc 0
MeshBuilder::buildMesh(_pointsMesh,
&pointsArray, numPoints, spaceDim,
cells, numCells, numCorners, meshDim,
@@ -149,8 +150,10 @@
assert(_pointsMesh->sieveMesh()->hasRealSection("coordinates"));
const ALE::Obj<topology::Mesh::RealSection>& coordinatesSection = _pointsMesh->sieveMesh()->getRealSection("coordinates");
assert(!coordinatesSection.isNull());
- const PylithScalar* coordinates = coordinatesSection->restrictSpace();
- err = DMMeshInterpolationAddPoints(dm, numPoints, (PetscReal*)coordinates,
+ assert(0 == coordinatesSection->sizeWithBC() % spaceDim);
+ const int numPointsLocal = coordinatesSection->sizeWithBC() / spaceDim;
+ const PylithScalar* coordinates = (numPointsLocal) ? coordinatesSection->restrictSpace() : 0;
+ err = DMMeshInterpolationAddPoints(dm, numPointsLocal, (PetscReal*)coordinates,
_interpolator);CHECK_PETSC_ERROR(err);
err = DMMeshInterpolationSetUp(dm, _interpolator);CHECK_PETSC_ERROR(err);
err = DMDestroy(&dm);CHECK_PETSC_ERROR(err);
More information about the CIG-COMMITS
mailing list