[cig-commits] r7230 - in short/3D/PyLith/trunk:
doc/userguide/governingeqns libsrc/faults libsrc/materials
knepley at geodynamics.org
knepley at geodynamics.org
Thu Jun 14 09:03:44 PDT 2007
Author: knepley
Date: 2007-06-14 09:03:43 -0700 (Thu, 14 Jun 2007)
New Revision: 7230
Modified:
short/3D/PyLith/trunk/doc/userguide/governingeqns/governingeqns.lyx
short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc
short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.hh
short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc
short/3D/PyLith/trunk/libsrc/materials/Material.cc
Log:
Small fixes and removed cohesive cells from VTK
Modified: short/3D/PyLith/trunk/doc/userguide/governingeqns/governingeqns.lyx
===================================================================
--- short/3D/PyLith/trunk/doc/userguide/governingeqns/governingeqns.lyx 2007-06-14 16:00:31 UTC (rev 7229)
+++ short/3D/PyLith/trunk/doc/userguide/governingeqns/governingeqns.lyx 2007-06-14 16:03:43 UTC (rev 7230)
@@ -658,7 +658,7 @@
We construct the weak form by multiplying the wave equation by a trial function
and setting the integral over the domain to zero.
- The trial function is a piecewise differential vector field,
+ The trial function is a piecewise differentiable vector field,
\begin_inset Formula $\phi_{i}$
\end_inset
Modified: short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc 2007-06-14 16:00:31 UTC (rev 7229)
+++ short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc 2007-06-14 16:03:43 UTC (rev 7230)
@@ -168,6 +168,7 @@
const int numCorners = sieve->nCone(*mesh->heightStratum(0)->begin(), mesh->depth())->size();
const int faceSize = _numFaceVertices(*mesh->heightStratum(0)->begin(), mesh);
int *indices = new int[faceSize];
+ const int firstCohesiveCell = newPoint;
for(Mesh::label_sequence::iterator f_iter = faces->begin();
f_iter != faces->end();
@@ -257,6 +258,10 @@
} // for
delete [] indices;
mesh->stratify();
+ const ALE::Obj<Mesh::label_type>& label = mesh->createLabel(std::string("censored depth"));
+ const ALE::Obj<std::set<Mesh::point_type> > modifiedPoints = new std::set<Mesh::point_type>();
+ _computeCensoredDepth(mesh, label, mesh->getSieve(), mesh->getSieve()->roots(), firstCohesiveCell, modifiedPoints);
+ label->view("");
if (debug)
mesh->view("Mesh with Cohesive Elements");
@@ -370,5 +375,33 @@
return true;
} // _faceOrientation
+template<class InputPoints>
+void
+pylith::faults::CohesiveTopology::_computeCensoredDepth(const ALE::Obj<Mesh>& mesh,
+ const ALE::Obj<Mesh::label_type>& depth,
+ const ALE::Obj<Mesh::sieve_type>& sieve,
+ const ALE::Obj<InputPoints>& points,
+ const Mesh::point_type& firstCohesiveCell,
+ const ALE::Obj<std::set<Mesh::point_type> >& modifiedPoints)
+{
+ modifiedPoints->clear();
+ for(typename InputPoints::iterator p_iter = points->begin(); p_iter != points->end(); ++p_iter) {
+ if (*p_iter >= firstCohesiveCell) continue;
+ // Compute the max depth of the points in the cone of p, and add 1
+ int d0 = mesh->getValue(depth, *p_iter, -1);
+ int d1 = mesh->getMaxValue(depth, sieve->cone(*p_iter), -1) + 1;
+
+ if(d1 != d0) {
+ mesh->setValue(depth, *p_iter, d1);
+ modifiedPoints->insert(*p_iter);
+ }
+ }
+ // FIX: We would like to avoid the copy here with support()
+ if(modifiedPoints->size() > 0) {
+ _computeCensoredDepth(mesh, depth, sieve, sieve->support(modifiedPoints), firstCohesiveCell, modifiedPoints);
+ }
+};
+
+
// End of file
Modified: short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.hh 2007-06-14 16:00:31 UTC (rev 7229)
+++ short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.hh 2007-06-14 16:03:43 UTC (rev 7230)
@@ -53,7 +53,6 @@
// PRIVATE METHODS ////////////////////////////////////////////////////
private :
-
/** Get number of vertices on face.
*
* @param cell Finite-element cell
@@ -81,6 +80,15 @@
const int indices[],
const int oppositeVertex);
+ template<class InputPoints>
+ static
+ void _computeCensoredDepth(const ALE::Obj<Mesh>& mesh,
+ const ALE::Obj<Mesh::label_type>& depth,
+ const ALE::Obj<Mesh::sieve_type>& sieve,
+ const ALE::Obj<InputPoints>& points,
+ const Mesh::point_type& firstCohesiveCell,
+ const ALE::Obj<std::set<Mesh::point_type> >& modifiedPoints);
+
}; // class CohesiveTopology
#endif // pylith_faults_cohesivetopology_hh
Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc 2007-06-14 16:00:31 UTC (rev 7229)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc 2007-06-14 16:03:43 UTC (rev 7230)
@@ -24,6 +24,8 @@
#include "spatialdata/geocoords/CoordSys.hh" // USES CoordSys
+#include <Distribution.hh> // USES completeSection
+
#include <math.h> // USES pow(), sqrt()
#include <assert.h> // USES assert()
#include <sstream> // USES std::ostringstream
@@ -198,9 +200,7 @@
} // for
// Assemble orientation information
- // FIX THIS
- //const ALE::Obj<Mesh>& bundle = orientation.b;
- //ALE::Distribution<Mesh>::completeSection(bundle, orientation);
+ ALE::Distribution<Mesh>::completeSection(mesh, _orientation);
// Loop over vertices, make orientation information unit magnitude
double_array vertexDir(orientationSize);
Modified: short/3D/PyLith/trunk/libsrc/materials/Material.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/Material.cc 2007-06-14 16:00:31 UTC (rev 7229)
+++ short/3D/PyLith/trunk/libsrc/materials/Material.cc 2007-06-14 16:03:43 UTC (rev 7230)
@@ -46,7 +46,7 @@
// Python db object owns database, so just set pointer to null
_db = 0;
- delete _parameters; _parameters = 0;
+ if (_parameters) {delete _parameters;}; _parameters = 0;
} // destructor
// ----------------------------------------------------------------------
@@ -77,7 +77,8 @@
} // if
// Create sections to hold parameters for physical properties
- delete _parameters; _parameters = new topology::FieldsManager(mesh);
+ if (_parameters) {delete _parameters;};
+ _parameters = new topology::FieldsManager(mesh);
assert(0 != _parameters);
const int numQuadPts = quadrature->numQuadPts();
More information about the cig-commits
mailing list