[cig-commits] r16464 - short/3D/PyLith/trunk/libsrc/faults
brad at geodynamics.org
brad at geodynamics.org
Tue Mar 30 14:40:35 PDT 2010
Author: brad
Date: 2010-03-30 14:40:34 -0700 (Tue, 30 Mar 2010)
New Revision: 16464
Modified:
short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc
Log:
Fixed bug in setting chart (args is max+1).
Modified: short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc 2010-03-30 21:39:56 UTC (rev 16463)
+++ short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc 2010-03-30 21:40:34 UTC (rev 16464)
@@ -792,14 +792,23 @@
assert(!fCoordinates.isNull());
const ALE::Obj<SieveMesh::label_sequence>& vertices =
sieveMesh->depthStratum(0);
+ assert(!vertices.isNull());
const SieveMesh::label_sequence::iterator vBegin = vertices->begin();
const SieveMesh::label_sequence::iterator vEnd = vertices->end();
- fCoordinates->setChart(topology::Mesh::RealSection::chart_type(faultSieveMesh->heightStratum(0)->size(),
- faultSieveMesh->getSieve()->getChart().max()));
+ const ALE::Obj<SieveMesh::label_sequence>& fvertices =
+ faultSieveMesh->depthStratum(0);
+ assert(!fvertices.isNull());
+ const point_type fvMin = *std::min_element(fvertices->begin(),
+ fvertices->end());
+ const point_type fvMax = *std::max_element(fvertices->begin(),
+ fvertices->end());
+
+ fCoordinates->setChart(topology::Mesh::RealSection::chart_type(fvMin,
+ fvMax+1));
for (SieveMesh::label_sequence::iterator v_iter = vBegin;
- v_iter != vEnd;
- ++v_iter) {
+ v_iter != vEnd;
+ ++v_iter) {
if (fRenumbering.find(*v_iter) == fRenumberingEnd)
continue;
fCoordinates->setFiberDimension(fRenumbering[*v_iter],
@@ -824,13 +833,9 @@
const ALE::Obj<topology::Mesh::RealSection>& fCoordinatesDim =
faultSieveMesh->getRealSection("coordinates_dimensioned");
assert(!fCoordinatesDim.isNull());
- const ALE::Obj<SieveMesh::label_sequence>& vertices =
- sieveMesh->depthStratum(0);
- const SieveMesh::label_sequence::iterator vBegin = vertices->begin();
- const SieveMesh::label_sequence::iterator vEnd = vertices->end();
- fCoordinatesDim->setChart(topology::Mesh::RealSection::chart_type(faultSieveMesh->heightStratum(0)->size(),
- faultSieveMesh->getSieve()->getChart().max()));
+ fCoordinatesDim->setChart(topology::Mesh::RealSection::chart_type(fvMin,
+ fvMax+1));
for (SieveMesh::label_sequence::iterator v_iter = vBegin;
v_iter != vEnd;
++v_iter) {
@@ -845,9 +850,9 @@
++v_iter) {
if (fRenumbering.find(*v_iter) == fRenumberingEnd)
continue;
- fCoordinatesDim->updatePoint(fRenumbering[*v_iter],
- coordinatesDim->restrictPoint(*v_iter));
- }
+ fCoordinatesDim->updatePoint(fRenumbering[*v_iter],
+ coordinatesDim->restrictPoint(*v_iter));
+ } // for
//faultSieveMesh->view("Parallel fault mesh");
} // if
More information about the CIG-COMMITS
mailing list