[cig-commits] r12787 - in short/3D/PyLith/trunk/libsrc: faults meshio
knepley at geodynamics.org
knepley at geodynamics.org
Tue Sep 2 17:44:11 PDT 2008
Author: knepley
Date: 2008-09-02 17:44:11 -0700 (Tue, 02 Sep 2008)
New Revision: 12787
Modified:
short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.cc
short/3D/PyLith/trunk/libsrc/meshio/MeshIOLagrit.cc
short/3D/PyLith/trunk/libsrc/meshio/MeshIOLagrit.hh
Log:
Small fixes for fault reading
Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.cc 2008-09-03 00:42:39 UTC (rev 12786)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.cc 2008-09-03 00:44:11 UTC (rev 12787)
@@ -70,7 +70,7 @@
//MPI_Bcast(&faultDim, 1, MPI_INT, 0, comm);
faultMesh = new Mesh(mesh->comm(), faultDim, mesh->debug());
- pylith::meshio::MeshIOLagrit::readFault(_faultMeshFilename, faultMesh, faultBd);
+ pylith::meshio::MeshIOLagrit::readFault(_faultMeshFilename, mesh, faultMesh, faultBd);
// Get group of vertices associated with fault
const ALE::Obj<int_section_type>& groupField =
Modified: short/3D/PyLith/trunk/libsrc/meshio/MeshIOLagrit.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/MeshIOLagrit.cc 2008-09-03 00:42:39 UTC (rev 12786)
+++ short/3D/PyLith/trunk/libsrc/meshio/MeshIOLagrit.cc 2008-09-03 00:44:11 UTC (rev 12787)
@@ -44,7 +44,7 @@
} // destructor
void
-pylith::meshio::MeshIOLagrit::readFault(const std::string filename, const Obj<Mesh>& fault, Obj<ALE::Mesh>& faultBd) {
+pylith::meshio::MeshIOLagrit::readFault(const std::string filename, const Obj<Mesh>& mesh, const Obj<Mesh>& fault, Obj<ALE::Mesh>& faultBd) {
int faultDim = 2;
int fSpaceDim = 0;
int numFVertices = 0;
@@ -159,10 +159,12 @@
// Renumber vertices and use zero based indices
// UCD file has one-based indices for both vertexIDs and fCells
+ // Also, vertex numbers are offset by the number of cells
+ const int numCells = mesh->heightStratum(0)->size();
for(int c = 0; c < numFCells; ++c)
for(int corner = 0; corner < numFCorners; ++corner)
fCells[c*numFCorners+corner] =
- vertexIDs[fCells[c*numFCorners+corner]-1] - 1;
+ vertexIDs[fCells[c*numFCorners+corner]-1] - 1 + numCells;
// Switch to zero based index for global cell numbering
for (int c=0; c < numFCells; ++c)
Modified: short/3D/PyLith/trunk/libsrc/meshio/MeshIOLagrit.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/MeshIOLagrit.hh 2008-09-03 00:42:39 UTC (rev 12786)
+++ short/3D/PyLith/trunk/libsrc/meshio/MeshIOLagrit.hh 2008-09-03 00:44:11 UTC (rev 12787)
@@ -114,6 +114,7 @@
// TEMPORARY
static
void readFault(const std::string filename,
+ const Obj<Mesh>& mesh,
const Obj<Mesh>& fault,
Obj<ALE::Mesh>& faultBd);
More information about the cig-commits
mailing list