[cig-commits] r18082 - in short/3D/PyLith/branches/v1.5-stable/libsrc: faults meshio topology
brad at geodynamics.org
brad at geodynamics.org
Tue Mar 8 20:17:46 PST 2011
Author: brad
Date: 2011-03-08 20:17:45 -0800 (Tue, 08 Mar 2011)
New Revision: 18082
Modified:
short/3D/PyLith/branches/v1.5-stable/libsrc/faults/CohesiveTopology.cc
short/3D/PyLith/branches/v1.5-stable/libsrc/faults/CohesiveTopology.hh
short/3D/PyLith/branches/v1.5-stable/libsrc/faults/FaultCohesive.cc
short/3D/PyLith/branches/v1.5-stable/libsrc/faults/FaultCohesive.hh
short/3D/PyLith/branches/v1.5-stable/libsrc/faults/TopologyOps.cc
short/3D/PyLith/branches/v1.5-stable/libsrc/faults/TopologyOps.hh
short/3D/PyLith/branches/v1.5-stable/libsrc/meshio/MeshBuilder.cc
short/3D/PyLith/branches/v1.5-stable/libsrc/meshio/MeshBuilder.hh
short/3D/PyLith/branches/v1.5-stable/libsrc/meshio/UCDFaultFile.cc
short/3D/PyLith/branches/v1.5-stable/libsrc/meshio/UCDFaultFile.hh
short/3D/PyLith/branches/v1.5-stable/libsrc/topology/Distributor.cc
Log:
Patch from trunk.
Modified: short/3D/PyLith/branches/v1.5-stable/libsrc/faults/CohesiveTopology.cc
===================================================================
--- short/3D/PyLith/branches/v1.5-stable/libsrc/faults/CohesiveTopology.cc 2011-03-08 23:41:38 UTC (rev 18081)
+++ short/3D/PyLith/branches/v1.5-stable/libsrc/faults/CohesiveTopology.cc 2011-03-09 04:17:45 UTC (rev 18082)
@@ -41,7 +41,7 @@
// ----------------------------------------------------------------------
void
pylith::faults::CohesiveTopology::createFault(topology::SubMesh* faultMesh,
- ALE::Obj<FlexMesh>& faultBoundary,
+ ALE::Obj<SieveFlexMesh>& faultBoundary,
const topology::Mesh& mesh,
const ALE::Obj<topology::Mesh::IntSection>& groupField,
const bool flipFault)
@@ -66,11 +66,11 @@
const ALE::Obj<SieveSubMesh::sieve_type> ifaultSieve =
new SieveMesh::sieve_type(sieve->comm(), sieve->debug());
assert(!ifaultSieve.isNull());
- ALE::Obj<FlexMesh> fault =
- new FlexMesh(mesh.comm(), mesh.dimension()-1, mesh.debug());
+ ALE::Obj<SieveFlexMesh> fault =
+ new SieveFlexMesh(mesh.comm(), mesh.dimension()-1, mesh.debug());
assert(!fault.isNull());
- ALE::Obj<FlexMesh::sieve_type> faultSieve =
- new FlexMesh::sieve_type(sieve->comm(), sieve->debug());
+ ALE::Obj<SieveFlexMesh::sieve_type> faultSieve =
+ new SieveFlexMesh::sieve_type(sieve->comm(), sieve->debug());
assert(!faultSieve.isNull());
const int debug = mesh.debug();
@@ -105,7 +105,7 @@
if (debug)
fault->view("Fault mesh");
- faultBoundary = ALE::Selection<FlexMesh>::boundary(fault);
+ faultBoundary = ALE::Selection<SieveFlexMesh>::boundary(fault);
if (debug)
faultBoundary->view("Fault boundary mesh");
@@ -126,7 +126,7 @@
void
pylith::faults::CohesiveTopology::create(topology::Mesh* mesh,
const topology::SubMesh& faultMesh,
- const ALE::Obj<FlexMesh>& faultBoundary,
+ const ALE::Obj<SieveFlexMesh>& faultBoundary,
const ALE::Obj<topology::Mesh::IntSection>& groupField,
const int materialId,
int& firstFaultVertex,
@@ -138,8 +138,8 @@
assert(!faultBoundary.isNull());
assert(!groupField.isNull());
- typedef ALE::SieveAlg<FlexMesh> sieveAlg;
- typedef ALE::Selection<FlexMesh> selection;
+ typedef ALE::SieveAlg<SieveFlexMesh> sieveAlg;
+ typedef ALE::Selection<SieveFlexMesh> selection;
// Memory logging
ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
@@ -424,7 +424,7 @@
// This completes the set of cells scheduled to be replaced
TopologyOps::PointSet replaceCellsBase(replaceCells);
- const ALE::Obj<FlexMesh::label_sequence>& faultBdVerts =
+ const ALE::Obj<SieveFlexMesh::label_sequence>& faultBdVerts =
faultBoundary->depthStratum(0);
assert(!faultBdVerts.isNull());
TopologyOps::PointSet faultBdVertices;
@@ -701,8 +701,8 @@
const ALE::Obj<SieveMesh::sieve_type> ifaultSieve =
new SieveMesh::sieve_type(sieve->comm(), sieve->debug());
assert(!ifaultSieve.isNull());
- ALE::Obj<FlexMesh> fault =
- new FlexMesh(mesh.comm(), mesh.dimension()-1, mesh.debug());
+ ALE::Obj<SieveFlexMesh> fault =
+ new SieveFlexMesh(mesh.comm(), mesh.dimension()-1, mesh.debug());
assert(!fault.isNull());
ALE::Obj<SieveFlexMesh::sieve_type> faultSieve =
new SieveFlexMesh::sieve_type(sieve->comm(), sieve->debug());
Modified: short/3D/PyLith/branches/v1.5-stable/libsrc/faults/CohesiveTopology.hh
===================================================================
--- short/3D/PyLith/branches/v1.5-stable/libsrc/faults/CohesiveTopology.hh 2011-03-08 23:41:38 UTC (rev 18081)
+++ short/3D/PyLith/branches/v1.5-stable/libsrc/faults/CohesiveTopology.hh 2011-03-09 04:17:45 UTC (rev 18082)
@@ -28,7 +28,7 @@
#include "faultsfwd.hh" // forward declarations
#include "pylith/topology/Mesh.hh" // USES Mesh::IntSection
-#include "pylith/utils/sievetypes.hh" // USE ALE::Obj
+#include "pylith/utils/sievetypes.hh" // USE ALE::Obj and SieveFlexMesh
// CohesiveTopology -----------------------------------------------------
/// Creation of cohesive cells.
@@ -37,7 +37,6 @@
private :
typedef pylith::topology::Mesh::SieveMesh::point_type point_type;
- typedef ALE::Mesh<PetscInt,PetscScalar> FlexMesh;
// PUBLIC METHODS /////////////////////////////////////////////////////
public :
@@ -54,7 +53,7 @@
*/
static
void createFault(topology::SubMesh* faultMesh,
- ALE::Obj<FlexMesh>& faultBoundary,
+ ALE::Obj<SieveFlexMesh>& faultBoundary,
const topology::Mesh& mesh,
const ALE::Obj<topology::Mesh::IntSection>& groupField,
const bool flipFault =false);
@@ -76,7 +75,7 @@
static
void create(topology::Mesh* mesh,
const topology::SubMesh& faultMesh,
- const ALE::Obj<FlexMesh>& faultBoundary,
+ const ALE::Obj<SieveFlexMesh>& faultBoundary,
const ALE::Obj<topology::Mesh::IntSection>& groupField,
const int materialId,
int& firstFaultVertex,
Modified: short/3D/PyLith/branches/v1.5-stable/libsrc/faults/FaultCohesive.cc
===================================================================
--- short/3D/PyLith/branches/v1.5-stable/libsrc/faults/FaultCohesive.cc 2011-03-08 23:41:38 UTC (rev 18081)
+++ short/3D/PyLith/branches/v1.5-stable/libsrc/faults/FaultCohesive.cc 2011-03-09 04:17:45 UTC (rev 18082)
@@ -120,7 +120,7 @@
assert(std::string("") != label());
topology::SubMesh faultMesh;
- ALE::Obj<FlexMesh> faultBoundary;
+ ALE::Obj<SieveFlexMesh> faultBoundary;
// Get group of vertices associated with fault
const ALE::Obj<topology::Mesh::SieveMesh>& sieveMesh = mesh->sieveMesh();
Modified: short/3D/PyLith/branches/v1.5-stable/libsrc/faults/FaultCohesive.hh
===================================================================
--- short/3D/PyLith/branches/v1.5-stable/libsrc/faults/FaultCohesive.hh 2011-03-08 23:41:38 UTC (rev 18081)
+++ short/3D/PyLith/branches/v1.5-stable/libsrc/faults/FaultCohesive.hh 2011-03-09 04:17:45 UTC (rev 18082)
@@ -38,7 +38,6 @@
public feassemble::Integrator<feassemble::Quadrature<topology::SubMesh> >
{ // class FaultCohesive
friend class TestFaultCohesive; // unit testing
- typedef ALE::Mesh<PetscInt,PetscScalar> FlexMesh;
// PUBLIC METHODS /////////////////////////////////////////////////////
public :
Modified: short/3D/PyLith/branches/v1.5-stable/libsrc/faults/TopologyOps.cc
===================================================================
--- short/3D/PyLith/branches/v1.5-stable/libsrc/faults/TopologyOps.cc 2011-03-08 23:41:38 UTC (rev 18081)
+++ short/3D/PyLith/branches/v1.5-stable/libsrc/faults/TopologyOps.cc 2011-03-09 04:17:45 UTC (rev 18082)
@@ -129,11 +129,11 @@
const int firstCell,
const PointSet& faultVertices,
const ALE::Obj<SieveMesh>& mesh,
- const ALE::Obj<FlexMesh::arrow_section_type>& orientation,
- const ALE::Obj<FlexMesh::sieve_type>& faultSieve,
+ const ALE::Obj<SieveFlexMesh::arrow_section_type>& orientation,
+ const ALE::Obj<SieveFlexMesh::sieve_type>& faultSieve,
const bool flipFault)
{
- typedef ALE::Selection<FlexMesh> selection;
+ typedef ALE::Selection<SieveFlexMesh> selection;
const ALE::Obj<SieveMesh::sieve_type>& sieve = mesh->getSieve();
const PointSet::const_iterator fvBegin = faultVertices.begin();
const PointSet::const_iterator fvEnd = faultVertices.end();
@@ -141,7 +141,7 @@
int curVertex = 0;
int newElement = curCell + dim*faultVertices.size();
int o = 1;
- FlexMesh::point_type f = firstCell;
+ SieveFlexMesh::point_type f = firstCell;
const int debug = mesh->debug();
ALE::Obj<PointSet> face = new PointSet();
int numCorners = 0; // The number of vertices in a mesh cell
@@ -232,26 +232,26 @@
if (2 == dim && 4 == faceSize){
if (debug) std::cout << " Adding hex face " << f << std::endl;
- ALE::SieveBuilder<FlexMesh>::buildHexFaces(
+ ALE::SieveBuilder<SieveFlexMesh>::buildHexFaces(
faultSieve, orientation, dim, curElement,
bdVertices, oFaultFaces, f, o);
} else if ((1 == dim && 3 == faceSize) ||
(2 == dim && 9 == faceSize)){
if (debug) std::cout << " Adding quadratic hex face " << f
<< std::endl;
- ALE::SieveBuilder<FlexMesh>::buildQuadraticHexFaces(
+ ALE::SieveBuilder<SieveFlexMesh>::buildQuadraticHexFaces(
faultSieve, orientation, dim, curElement,
bdVertices, oFaultFaces, f, o);
} else if ((1 == dim && 3 == faceSize) ||
(2 == dim && 6 == faceSize)){
if (debug) std::cout << " Adding quadratic tri face " << f
<< std::endl;
- ALE::SieveBuilder<FlexMesh>::buildQuadraticTetFaces(
+ ALE::SieveBuilder<SieveFlexMesh>::buildQuadraticTetFaces(
faultSieve, orientation, dim, curElement,
bdVertices, oFaultFaces, f, o);
} else {
if (debug) std::cout << " Adding simplicial face " << f << std::endl;
- ALE::SieveBuilder<FlexMesh>::buildFaces(
+ ALE::SieveBuilder<SieveFlexMesh>::buildFaces(
faultSieve, orientation, dim, curElement,
bdVertices, oFaultFaces, f, o);
}
@@ -276,10 +276,10 @@
const int faultVertices[],
const int faultCells[],
const ALE::Obj<SieveMesh>& mesh,
- const ALE::Obj<FlexMesh::arrow_section_type>& orientation,
- const ALE::Obj<FlexMesh::sieve_type>& faultSieve)
+ const ALE::Obj<SieveFlexMesh::arrow_section_type>& orientation,
+ const ALE::Obj<SieveFlexMesh::sieve_type>& faultSieve)
{
- typedef ALE::Selection<FlexMesh> selection;
+ typedef ALE::Selection<SieveFlexMesh> selection;
int faceSize = 0; // The number of vertices in a mesh face
int curCell = firstCell;
int curVertex = 0;
@@ -312,10 +312,10 @@
// Create face
if (faceSize != dim+1) {
if (debug) std::cout << " Adding hex face " << f << std::endl;
- ALE::SieveBuilder<FlexMesh>::buildHexFaces(faultSieve, orientation, dim, curElement, bdVertices, oFaultFaces, f, o);
+ ALE::SieveBuilder<SieveFlexMesh>::buildHexFaces(faultSieve, orientation, dim, curElement, bdVertices, oFaultFaces, f, o);
} else {
if (debug) std::cout << " Adding simplicial face " << f << std::endl;
- ALE::SieveBuilder<FlexMesh>::buildFaces(faultSieve, orientation, dim, curElement, bdVertices, oFaultFaces, f, o);
+ ALE::SieveBuilder<SieveFlexMesh>::buildFaces(faultSieve, orientation, dim, curElement, bdVertices, oFaultFaces, f, o);
}
// Add arrow to cells
faultSieve->addArrow(face, faultCells[face*2+0]);
@@ -327,21 +327,21 @@
void
pylith::faults::TopologyOps::orientFaultSieve(const int dim,
const ALE::Obj<SieveMesh>& mesh,
- const ALE::Obj<FlexMesh::arrow_section_type>& orientation,
- const ALE::Obj<FlexMesh>& fault)
+ const ALE::Obj<SieveFlexMesh::arrow_section_type>& orientation,
+ const ALE::Obj<SieveFlexMesh>& fault)
{
assert(!mesh.isNull());
assert(!orientation.isNull());
assert(!fault.isNull());
- typedef ALE::Selection<FlexMesh> selection;
+ typedef ALE::Selection<SieveFlexMesh> selection;
// Must check the orientation here
- const ALE::Obj<FlexMesh::sieve_type>& faultSieve = fault->getSieve();
+ const ALE::Obj<SieveFlexMesh::sieve_type>& faultSieve = fault->getSieve();
assert(!faultSieve.isNull());
const SieveMesh::point_type firstFaultCell =
*fault->heightStratum(1)->begin();
- const ALE::Obj<FlexMesh::label_sequence>& fFaces = fault->heightStratum(2);
+ const ALE::Obj<SieveFlexMesh::label_sequence>& fFaces = fault->heightStratum(2);
assert(!fFaces.isNull());
const int numFaultFaces = fFaces->size();
const int faultDepth = fault->depth()-1; // Depth of fault cells
@@ -392,21 +392,21 @@
// Loop over new cells
for(PointSet::iterator c_iter = loopCells->begin(); c_iter != loopCells->end(); ++c_iter) {
// Loop over edges of this cell
- const ALE::Obj<FlexMesh::sieve_type::traits::coneSequence>& cone = faultSieve->cone(*c_iter);
- const FlexMesh::sieve_type::traits::coneSequence::iterator eBegin = cone->begin();
- const FlexMesh::sieve_type::traits::coneSequence::iterator eEnd = cone->end();
+ const ALE::Obj<SieveFlexMesh::sieve_type::traits::coneSequence>& cone = faultSieve->cone(*c_iter);
+ const SieveFlexMesh::sieve_type::traits::coneSequence::iterator eBegin = cone->begin();
+ const SieveFlexMesh::sieve_type::traits::coneSequence::iterator eEnd = cone->end();
- for(FlexMesh::sieve_type::traits::coneSequence::iterator e_iter = eBegin; e_iter != eEnd; ++e_iter) {
+ for(SieveFlexMesh::sieve_type::traits::coneSequence::iterator e_iter = eBegin; e_iter != eEnd; ++e_iter) {
if (facesSeen.find(*e_iter) != facesSeen.end()) continue;
facesSeen.insert(*e_iter);
if (debug) std::cout << " Checking orientation of fault face " << *e_iter << std::endl;
- const ALE::Obj<FlexMesh::sieve_type::traits::supportSequence>& support = faultSieve->support(*e_iter);
- FlexMesh::sieve_type::traits::supportSequence::iterator s_iter = support->begin();
+ const ALE::Obj<SieveFlexMesh::sieve_type::traits::supportSequence>& support = faultSieve->support(*e_iter);
+ SieveFlexMesh::sieve_type::traits::supportSequence::iterator s_iter = support->begin();
// Throw out boundary fault faces
if (support->size() < 2) continue;
- FlexMesh::point_type cellA = *s_iter; ++s_iter;
- FlexMesh::point_type cellB = *s_iter;
+ SieveFlexMesh::point_type cellA = *s_iter; ++s_iter;
+ SieveFlexMesh::point_type cellB = *s_iter;
bool flippedA = (flippedCells.find(cellA) != flippedCells.end());
bool flippedB = (flippedCells.find(cellB) != flippedCells.end());
bool seenA = (cellsSeen.find(cellA) != cellsSeen.end());
@@ -417,10 +417,10 @@
if (debug) std::cout << " neighboring cells " << cellA << " and " << cellB << std::endl;
// In 1D, just check that vertices match
if (dim == 1) {
- const ALE::Obj<FlexMesh::sieve_type::traits::coneSequence>& coneA = faultSieve->cone(cellA);
- FlexMesh::sieve_type::traits::coneSequence::iterator iterA = coneA->begin();
- const ALE::Obj<FlexMesh::sieve_type::traits::coneSequence>& coneB = faultSieve->cone(cellB);
- FlexMesh::sieve_type::traits::coneSequence::iterator iterB = coneB->begin();
+ const ALE::Obj<SieveFlexMesh::sieve_type::traits::coneSequence>& coneA = faultSieve->cone(cellA);
+ SieveFlexMesh::sieve_type::traits::coneSequence::iterator iterA = coneA->begin();
+ const ALE::Obj<SieveFlexMesh::sieve_type::traits::coneSequence>& coneB = faultSieve->cone(cellB);
+ SieveFlexMesh::sieve_type::traits::coneSequence::iterator iterB = coneB->begin();
int posA, posB;
for(posA = 0; posA < 2; ++posA, ++iterA) if (*iterA == *e_iter) break;
@@ -444,9 +444,9 @@
}
} else if (dim == 2) {
// Check orientation
- ALE::MinimalArrow<FlexMesh::sieve_type::point_type,FlexMesh::sieve_type::point_type> arrowA(*e_iter, cellA);
+ ALE::MinimalArrow<SieveFlexMesh::sieve_type::point_type,SieveFlexMesh::sieve_type::point_type> arrowA(*e_iter, cellA);
const int oA = orientation->restrictPoint(arrowA)[0];
- ALE::MinimalArrow<FlexMesh::sieve_type::point_type,FlexMesh::sieve_type::point_type> arrowB(*e_iter, cellB);
+ ALE::MinimalArrow<SieveFlexMesh::sieve_type::point_type,SieveFlexMesh::sieve_type::point_type> arrowB(*e_iter, cellB);
const int oB = orientation->restrictPoint(arrowB)[0];
const bool mismatch = (oA == oB);
@@ -484,8 +484,8 @@
for(PointSet::const_iterator f_iter = flippedCells.begin(); f_iter != flippedCells.end(); ++f_iter) {
if (debug) std::cout << " Reversing fault face " << *f_iter << std::endl;
faceVertices.clear();
- const ALE::Obj<FlexMesh::sieve_type::traits::coneSequence>& cone = faultSieve->cone(*f_iter);
- for(FlexMesh::sieve_type::traits::coneSequence::iterator v_iter = cone->begin(); v_iter != cone->end(); ++v_iter) {
+ const ALE::Obj<SieveFlexMesh::sieve_type::traits::coneSequence>& cone = faultSieve->cone(*f_iter);
+ for(SieveFlexMesh::sieve_type::traits::coneSequence::iterator v_iter = cone->begin(); v_iter != cone->end(); ++v_iter) {
faceVertices.insert(faceVertices.begin(), *v_iter);
}
faultSieve->clearCone(*f_iter);
@@ -497,7 +497,7 @@
if (dim > 1) {
// Here, they are edges, not vertices
for(PointArray::const_iterator e_iter = faceVertices.begin(); e_iter != faceVertices.end(); ++e_iter) {
- ALE::MinimalArrow<FlexMesh::sieve_type::point_type,FlexMesh::sieve_type::point_type> arrow(*e_iter, *f_iter);
+ ALE::MinimalArrow<SieveFlexMesh::sieve_type::point_type,SieveFlexMesh::sieve_type::point_type> arrow(*e_iter, *f_iter);
int o = orientation->restrictPoint(arrow)[0];
if (debug) std::cout << " Reversing orientation of " << *e_iter <<"-->"<<*f_iter << " from " << o << " to " << -(o+1) << std::endl;
@@ -507,26 +507,26 @@
}
}
flippedCells.clear();
- const FlexMesh::label_sequence::iterator fFacesBegin = fFaces->begin();
- const FlexMesh::label_sequence::iterator fFacesEnd = fFaces->end();
- for(FlexMesh::label_sequence::iterator e_iter = fFacesBegin; e_iter != fFacesEnd; ++e_iter) {
+ const SieveFlexMesh::label_sequence::iterator fFacesBegin = fFaces->begin();
+ const SieveFlexMesh::label_sequence::iterator fFacesEnd = fFaces->end();
+ for(SieveFlexMesh::label_sequence::iterator e_iter = fFacesBegin; e_iter != fFacesEnd; ++e_iter) {
if (debug) std::cout << " Checking orientation of fault face " << *e_iter << std::endl;
// for each face get the support (2 fault cells)
- const ALE::Obj<FlexMesh::sieve_type::traits::supportSequence>& support = faultSieve->support(*e_iter);
- FlexMesh::sieve_type::traits::supportSequence::iterator s_iter = support->begin();
+ const ALE::Obj<SieveFlexMesh::sieve_type::traits::supportSequence>& support = faultSieve->support(*e_iter);
+ SieveFlexMesh::sieve_type::traits::supportSequence::iterator s_iter = support->begin();
// Throw out boundary fault faces
if (support->size() > 1) {
- FlexMesh::point_type cellA = *s_iter; ++s_iter;
- FlexMesh::point_type cellB = *s_iter;
+ SieveFlexMesh::point_type cellA = *s_iter; ++s_iter;
+ SieveFlexMesh::point_type cellB = *s_iter;
if (debug) std::cout << " neighboring cells " << cellA << " and " << cellB << std::endl;
// In 1D, just check that vertices match
if (dim == 1) {
- const ALE::Obj<FlexMesh::sieve_type::traits::coneSequence>& coneA = faultSieve->cone(cellA);
- FlexMesh::sieve_type::traits::coneSequence::iterator iterA = coneA->begin();
- const ALE::Obj<FlexMesh::sieve_type::traits::coneSequence>& coneB = faultSieve->cone(cellB);
- FlexMesh::sieve_type::traits::coneSequence::iterator iterB = coneB->begin();
+ const ALE::Obj<SieveFlexMesh::sieve_type::traits::coneSequence>& coneA = faultSieve->cone(cellA);
+ SieveFlexMesh::sieve_type::traits::coneSequence::iterator iterA = coneA->begin();
+ const ALE::Obj<SieveFlexMesh::sieve_type::traits::coneSequence>& coneB = faultSieve->cone(cellB);
+ SieveFlexMesh::sieve_type::traits::coneSequence::iterator iterB = coneB->begin();
int posA, posB;
for(posA = 0; posA < 2; ++posA, ++iterA) if (*iterA == *e_iter) break;
@@ -540,9 +540,9 @@
}
} else {
// Check orientation
- ALE::MinimalArrow<FlexMesh::sieve_type::point_type,FlexMesh::sieve_type::point_type> arrowA(*e_iter, cellA);
+ ALE::MinimalArrow<SieveFlexMesh::sieve_type::point_type,SieveFlexMesh::sieve_type::point_type> arrowA(*e_iter, cellA);
const int oA = orientation->restrictPoint(arrowA)[0];
- ALE::MinimalArrow<FlexMesh::sieve_type::point_type,FlexMesh::sieve_type::point_type> arrowB(*e_iter, cellB);
+ ALE::MinimalArrow<SieveFlexMesh::sieve_type::point_type,SieveFlexMesh::sieve_type::point_type> arrowB(*e_iter, cellB);
const int oB = orientation->restrictPoint(arrowB)[0];
if (oA == oB) {
Modified: short/3D/PyLith/branches/v1.5-stable/libsrc/faults/TopologyOps.hh
===================================================================
--- short/3D/PyLith/branches/v1.5-stable/libsrc/faults/TopologyOps.hh 2011-03-08 23:41:38 UTC (rev 18081)
+++ short/3D/PyLith/branches/v1.5-stable/libsrc/faults/TopologyOps.hh 2011-03-09 04:17:45 UTC (rev 18082)
@@ -28,6 +28,7 @@
#include "faultsfwd.hh" // forward declarations
#include "pylith/topology/Mesh.hh" // USES Mesh
+#include "pylith/utils/sievetypes.hh" // USE SieveFlexMesh
// TopologyOps ----------------------------------------------------------
/// Helper object for creation of cohesive cells.
@@ -41,7 +42,6 @@
typedef std::vector<SieveMesh::sieve_type::point_type> PointArray;
typedef std::pair<SieveMesh::sieve_type::point_type, int> oPoint_type;
typedef std::vector<oPoint_type> oPointArray;
- typedef ALE::Mesh<PetscInt,PetscScalar> FlexMesh;
// PUBLIC METHODS /////////////////////////////////////////////////////
public :
@@ -80,8 +80,8 @@
const int firstCell,
const PointSet& faultVertices,
const ALE::Obj<SieveMesh>& mesh,
- const ALE::Obj<FlexMesh::arrow_section_type>& orientation,
- const ALE::Obj<FlexMesh::sieve_type>& faultSieve,
+ const ALE::Obj<SieveFlexMesh::arrow_section_type>& orientation,
+ const ALE::Obj<SieveFlexMesh::sieve_type>& faultSieve,
const bool flipFault);
static
@@ -91,14 +91,14 @@
const int faultVertices[],
const int faultCells[],
const ALE::Obj<SieveMesh>& mesh,
- const ALE::Obj<FlexMesh::arrow_section_type>& orientation,
- const ALE::Obj<FlexMesh::sieve_type>& faultSieve);
+ const ALE::Obj<SieveFlexMesh::arrow_section_type>& orientation,
+ const ALE::Obj<SieveFlexMesh::sieve_type>& faultSieve);
static
void orientFaultSieve(const int dim,
const ALE::Obj<SieveMesh>& mesh,
- const ALE::Obj<FlexMesh::arrow_section_type>& orientation,
- const ALE::Obj<FlexMesh>& fault);
+ const ALE::Obj<SieveFlexMesh::arrow_section_type>& orientation,
+ const ALE::Obj<SieveFlexMesh>& fault);
}; // class CohesiveTopology
#endif // pylith_faults_cohesivetopology_hh
Modified: short/3D/PyLith/branches/v1.5-stable/libsrc/meshio/MeshBuilder.cc
===================================================================
--- short/3D/PyLith/branches/v1.5-stable/libsrc/meshio/MeshBuilder.cc 2011-03-08 23:41:38 UTC (rev 18081)
+++ short/3D/PyLith/branches/v1.5-stable/libsrc/meshio/MeshBuilder.cc 2011-03-09 04:17:45 UTC (rev 18082)
@@ -119,16 +119,16 @@
sieve->symmetrize();
} else {
// Same old thing
- ALE::Obj<FlexMesh::sieve_type> s =
- new FlexMesh::sieve_type(sieve->comm(), sieve->debug());
+ ALE::Obj<SieveFlexMesh::sieve_type> s =
+ new SieveFlexMesh::sieve_type(sieve->comm(), sieve->debug());
- ALE::SieveBuilder<FlexMesh>::buildTopology(s, meshDim,
+ ALE::SieveBuilder<SieveFlexMesh>::buildTopology(s, meshDim,
numCells,
const_cast<int*>(&cells[0]),
numVertices,
interpolate,
numCorners);
- std::map<FlexMesh::point_type,FlexMesh::point_type> renumbering;
+ std::map<SieveFlexMesh::point_type,SieveFlexMesh::point_type> renumbering;
ALE::ISieveConverter::convertSieve(*s, *sieve, renumbering);
} // if/else
logger.stagePop();
@@ -194,7 +194,7 @@
// Set vertices and cells for fault mesh.
void
pylith::meshio::MeshBuilder::buildFaultMesh(const ALE::Obj<SieveMesh>& fault,
- ALE::Obj<FlexMesh>& faultBd,
+ ALE::Obj<SieveFlexMesh>& faultBd,
const double_array& coordinates,
const int numVertices,
const int spaceDim,
@@ -226,10 +226,10 @@
if (0 == rank) {
assert(coordinates.size() == numVertices*spaceDim);
assert(cells.size() == numCells*numCorners);
- ALE::Obj<FlexMesh::sieve_type> s =
- new FlexMesh::sieve_type(sieve->comm(), sieve->debug());
+ ALE::Obj<SieveFlexMesh::sieve_type> s =
+ new SieveFlexMesh::sieve_type(sieve->comm(), sieve->debug());
- ALE::SieveBuilder<FlexMesh>::buildTopology(s, meshDim,
+ ALE::SieveBuilder<SieveFlexMesh>::buildTopology(s, meshDim,
numCells,
const_cast<int*>(&cells[0]),
numVertices,
@@ -245,23 +245,23 @@
s->addArrow(c+firstCell, faceCells[c*2+1]);
} // for
- FlexMesh::renumbering_type& renumbering = fault->getRenumbering();
+ SieveFlexMesh::renumbering_type& renumbering = fault->getRenumbering();
ALE::ISieveConverter::convertSieve(*s, *sieve, renumbering, false);
ALE::ISieveConverter::convertOrientation(*s, *sieve, renumbering,
fault->getArrowSection("orientation").ptr());
- Obj<FlexMesh> tmpMesh =
- new FlexMesh(fault->comm(), dim, fault->debug());
- faultBd = ALE::Selection<FlexMesh>::boundary(tmpMesh);
+ Obj<SieveFlexMesh> tmpMesh =
+ new SieveFlexMesh(fault->comm(), dim, fault->debug());
+ faultBd = ALE::Selection<SieveFlexMesh>::boundary(tmpMesh);
logger.stagePop();
logger.stagePush("FaultStratification");
fault->stratify();
logger.stagePop();
} else {
- Obj<FlexMesh> tmpMesh =
- new FlexMesh(fault->comm(), dim, fault->debug());
- faultBd = ALE::Selection<FlexMesh>::boundary(tmpMesh);
+ Obj<SieveFlexMesh> tmpMesh =
+ new SieveFlexMesh(fault->comm(), dim, fault->debug());
+ faultBd = ALE::Selection<SieveFlexMesh>::boundary(tmpMesh);
logger.stagePop();
logger.stagePush("FaultStratification");
Modified: short/3D/PyLith/branches/v1.5-stable/libsrc/meshio/MeshBuilder.hh
===================================================================
--- short/3D/PyLith/branches/v1.5-stable/libsrc/meshio/MeshBuilder.hh 2011-03-08 23:41:38 UTC (rev 18081)
+++ short/3D/PyLith/branches/v1.5-stable/libsrc/meshio/MeshBuilder.hh 2011-03-09 04:17:45 UTC (rev 18082)
@@ -34,6 +34,7 @@
#include "spatialdata/units/unitsfwd.hh" // USES Nondimensional
#include "pylith/topology/Mesh.hh" // USES Mesh
+#include "pylith/utils/sievetypes.hh" // USE SieveFlexMesh
// MeshBuilder ----------------------------------------------------------
/// Helper class for constructing Sieve mesh data structures.
@@ -42,7 +43,6 @@
// PUBLIC TYPEDEFS ////////////////////////////////////////////////////
public :
- typedef ALE::Mesh<PetscInt,PetscScalar> FlexMesh;
// PUBLIC MEMBERS ///////////////////////////////////////////////////////
public :
@@ -92,7 +92,7 @@
*/
static
void buildFaultMesh(const ALE::Obj<topology::Mesh::SieveMesh>& fault,
- ALE::Obj<FlexMesh>& faultBd,
+ ALE::Obj<SieveFlexMesh>& faultBd,
const double_array& coordinates,
const int numVertices,
const int spaceDim,
Modified: short/3D/PyLith/branches/v1.5-stable/libsrc/meshio/UCDFaultFile.cc
===================================================================
--- short/3D/PyLith/branches/v1.5-stable/libsrc/meshio/UCDFaultFile.cc 2011-03-08 23:41:38 UTC (rev 18081)
+++ short/3D/PyLith/branches/v1.5-stable/libsrc/meshio/UCDFaultFile.cc 2011-03-09 04:17:45 UTC (rev 18082)
@@ -63,7 +63,7 @@
void
pylith::meshio::UCDFaultFile::read(const char* filename,
topology::SubMesh* faultMesh,
- ALE::Obj<FlexMesh>& faultBoundary,
+ ALE::Obj<SieveFlexMesh>& faultBoundary,
const topology::Mesh& mesh)
{ // read
assert(0 != faultMesh);
Modified: short/3D/PyLith/branches/v1.5-stable/libsrc/meshio/UCDFaultFile.hh
===================================================================
--- short/3D/PyLith/branches/v1.5-stable/libsrc/meshio/UCDFaultFile.hh 2011-03-08 23:41:38 UTC (rev 18081)
+++ short/3D/PyLith/branches/v1.5-stable/libsrc/meshio/UCDFaultFile.hh 2011-03-09 04:17:45 UTC (rev 18082)
@@ -30,7 +30,7 @@
#include "pylith/topology/topologyfwd.hh" // USES Mesh, SubMesh
-#include "pylith/utils/sievetypes.hh" // USES ALE::Obj, ALE::Mesh
+#include "pylith/utils/sievetypes.hh" // USES ALE::Obj, SieveFlexMesh
// UCDFaultFile ---------------------------------------------------------
/** @brief C++ object for reading a fault mesh from a UCD file.
@@ -44,7 +44,6 @@
class pylith::meshio::UCDFaultFile
{ // UCDFaultFile
friend class TestUCDFaultFile; // unit testing
- typedef ALE::Mesh<PetscInt,PetscScalar> FlexMesh;
// PUBLIC METHODS ///////////////////////////////////////////////////////
public :
@@ -71,7 +70,7 @@
static
void read(const char* filename,
topology::SubMesh* faultMesh,
- ALE::Obj<FlexMesh>& faultBoundary,
+ ALE::Obj<SieveFlexMesh>& faultBoundary,
const topology::Mesh& mesh);
}; // UCDFaultFile
Modified: short/3D/PyLith/branches/v1.5-stable/libsrc/topology/Distributor.cc
===================================================================
--- short/3D/PyLith/branches/v1.5-stable/libsrc/topology/Distributor.cc 2011-03-08 23:41:38 UTC (rev 18081)
+++ short/3D/PyLith/branches/v1.5-stable/libsrc/topology/Distributor.cc 2011-03-09 04:17:45 UTC (rev 18082)
@@ -223,6 +223,8 @@
}
if (origSieveMesh->getIntSections()->size() > 0) {
ALE::Obj<std::set<std::string> > names = origSieveMesh->getIntSections();
+ const int numVertices = newSieveMesh->depthStratum(0)->size();
+ const int numCells = newSieveMesh->heightStratum(0)->size();
assert(!names.isNull());
std::set<std::string>::const_iterator namesBegin = names->begin();
@@ -237,11 +239,23 @@
newSieveMesh->getIntSection(*n_iter);
assert(!newSection.isNull());
- // We assume all integer sections are complete sections
- newSection->setChart(newSieveMesh->getSieve()->getChart());
+ // We assume all integer sections are supported on either cells or vertices
+ SieveMesh::point_type firstPoint;
+ IntSection::chart_type::const_iterator chartEnd = origSection->getChart().end();
+ for(IntSection::chart_type::const_iterator c_iter = origSection->getChart().begin(); c_iter != chartEnd; ++c_iter) {
+ if (origSection->getFiberDimension(*c_iter)) {
+ firstPoint = *c_iter;
+ break;
+ } // if
+ }
+ if (origSieveMesh->height(firstPoint) == 0) {
+ newSection->setChart(IntSection::chart_type(0, numCells));
+ } else {
+ newSection->setChart(IntSection::chart_type(numCells, numCells+numVertices));
+ } // if/else
DistributionType::distributeSection(origSection, partition, renumbering,
- sendMeshOverlap, recvMeshOverlap,
- newSection);
+ sendMeshOverlap, recvMeshOverlap,
+ newSection);
#if 0 // DEBUGGING
std::string serialName("Serial ");
std::string parallelName("Parallel ");
More information about the CIG-COMMITS
mailing list