[cig-commits] r22041 - in short/3D/PyLith/trunk/libsrc/pylith: faults topology
knepley at geodynamics.org
knepley at geodynamics.org
Fri May 10 20:35:35 PDT 2013
Author: knepley
Date: 2013-05-10 20:35:34 -0700 (Fri, 10 May 2013)
New Revision: 22041
Removed:
short/3D/PyLith/trunk/libsrc/pylith/faults/TopologyVisitors.cc
short/3D/PyLith/trunk/libsrc/pylith/faults/TopologyVisitors.hh
Modified:
short/3D/PyLith/trunk/libsrc/pylith/faults/CohesiveTopology.cc
short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesive.cc
short/3D/PyLith/trunk/libsrc/pylith/faults/Makefile.am
short/3D/PyLith/trunk/libsrc/pylith/faults/TopologyOps.cc
short/3D/PyLith/trunk/libsrc/pylith/topology/SubMesh.cc
Log:
Removed TopologyVisitors
Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/CohesiveTopology.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/CohesiveTopology.cc 2013-05-11 03:22:48 UTC (rev 22040)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/CohesiveTopology.cc 2013-05-11 03:35:34 UTC (rev 22041)
@@ -21,7 +21,6 @@
#include "CohesiveTopology.hh" // implementation of object methods
#include "TopologyOps.hh" // USES TopologyOps
-#include "TopologyVisitors.hh" // USES TopologyVisitors
#include "pylith/topology/SubMesh.hh" // USES SubMesh
#include <cassert> // USES assert()
Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesive.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesive.cc 2013-05-11 03:22:48 UTC (rev 22040)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesive.cc 2013-05-11 03:35:34 UTC (rev 22041)
@@ -146,11 +146,6 @@
assert(3 == mesh->dimension());
throw std::logic_error("Support for UCD fault files no longer implemented.");
} // if/else
- } catch (const ALE::Exception& err) {
- std::ostringstream msg;
- msg << "Error occurred while adjusting topology to create cohesive cells for fault '" << label() << "'.\n"
- << err.message();
- throw std::runtime_error(msg.str());
} catch (const std::exception& err) {
std::ostringstream msg;
msg << "Error occurred while adjusting topology to create cohesive cells for fault '" << label() << "'.\n"
Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/Makefile.am 2013-05-11 03:22:48 UTC (rev 22040)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/Makefile.am 2013-05-11 03:35:34 UTC (rev 22041)
@@ -46,9 +46,7 @@
faultsfwd.hh
noinst_HEADERS = \
- TopologyOps.hh \
- TopologyVisitors.hh \
- TopologyVisitors.cc
+ TopologyOps.hh
# End of file
Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/TopologyOps.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/TopologyOps.cc 2013-05-11 03:22:48 UTC (rev 22040)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/TopologyOps.cc 2013-05-11 03:35:34 UTC (rev 22041)
@@ -20,8 +20,6 @@
#include "TopologyOps.hh" // implementation of object methods
-#include "TopologyVisitors.hh" // USES ClassifyVisitor
-
#include <cassert> // USES assert()
// ----------------------------------------------------------------------
Deleted: short/3D/PyLith/trunk/libsrc/pylith/faults/TopologyVisitors.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/TopologyVisitors.cc 2013-05-11 03:22:48 UTC (rev 22040)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/TopologyVisitors.cc 2013-05-11 03:35:34 UTC (rev 22041)
@@ -1,270 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-// ----------------------------------------------------------------------
-template<typename Sieve, typename Renumbering>
-pylith::faults::ReplaceVisitor<Sieve,Renumbering>::ReplaceVisitor(
- Renumbering& r,
- const int size,
- const int debug) :
- renumbering(r),
- size(size),
- i(0),
- debug(debug)
-{ // constructor
- this->points = new point_type[this->size];
- this->mapped = false;
-} // constructor
-
-// ----------------------------------------------------------------------
-template<typename Sieve, typename Renumbering>
-pylith::faults::ReplaceVisitor<Sieve,Renumbering>::~ReplaceVisitor()
-{ // destructor
- delete[] this->points;
-} // destructor
-
-// ----------------------------------------------------------------------
-template<typename Sieve, typename Renumbering>
-void
-pylith::faults::ReplaceVisitor<Sieve,Renumbering>::visitPoint(
- const point_type& point)
-{ // visitPoint
- if (i >= this->size)
- throw ALE::Exception("Too many points for ReplaceVisitor");
- if (this->renumbering.find(point) != this->renumbering.end()) {
- if (debug)
- std::cout << " point " << this->renumbering[point] << std::endl;
- points[i] = this->renumbering[point];
- this->mapped = true;
- } else {
- if (debug) std::cout << " point " << point << std::endl;
- points[i] = point;
- } // if/else
- ++i;
-} // visitPoint
-
-// ----------------------------------------------------------------------
-template<typename Sieve, typename Renumbering>
-void
-pylith::faults::ReplaceVisitor<Sieve,Renumbering>::visitArrow(
- const typename Sieve::arrow_type&)
-{ // visitArrow
-} // visitArrow
-
-// ----------------------------------------------------------------------
-template<typename Sieve, typename Renumbering>
-inline
-const typename Sieve::point_type*
-pylith::faults::ReplaceVisitor<Sieve,Renumbering>::getPoints(void)
-{ // getPoints
- return this->points;
-} // getPoints
-
-// ----------------------------------------------------------------------
-template<typename Sieve, typename Renumbering>
-inline
-bool
-pylith::faults::ReplaceVisitor<Sieve,Renumbering>::mappedPoint(void)
-{ // mappedPoint
- return this->mapped;
-} // mappedPoint
-
-// ----------------------------------------------------------------------
-template<typename Sieve, typename Renumbering>
-inline
-void
-pylith::faults::ReplaceVisitor<Sieve,Renumbering>::clear(void)
-{ // clear
- this->i = 0; this->mapped = false;
-} // clear
-
-
-// ClassifyVisitor ------------------------------------------------------
-template<typename Sieve>
-pylith::faults::ClassifyVisitor<Sieve>::ClassifyVisitor(const Sieve& s,
- const PointSet& rC,
- const PointSet& nrC,
- const point_type& fC,
- const int fS,
- const int debug) :
- sieve(s),
- replaceCells(rC),
- noReplaceCells(nrC),
- firstCohesiveCell(fC),
- faceSize(fS),
- debug(debug),
- modified(false),
- setupMode(true),
- size(0)
-{ // constructor
- pR.setSize(s.getMaxConeSize());
-} // constructor
-
-// ----------------------------------------------------------------------
-template<typename Sieve>
-pylith::faults::ClassifyVisitor<Sieve>::~ClassifyVisitor(void)
-{ // destructor
-} // destructor
-
-// ----------------------------------------------------------------------
-template<typename Sieve>
-void
-pylith::faults::ClassifyVisitor<Sieve>::visitPoint(const point_type& point)
-{ // visitPoint
- if (this->setupMode) {
- if (replaceCells.find(point) != replaceCells.end())
- vReplaceCells.insert(point);
- if (noReplaceCells.find(point) != noReplaceCells.end())
- vNoReplaceCells.insert(point);
- if (point >= firstCohesiveCell) return;
- this->modified = true;
- this->size++;
- return;
- } // if
- bool classified = false;
-
- if (debug) {
- std::cout << "Checking neighbor " << point << std::endl;
- ALE::ISieveVisitor::PointRetriever<Sieve> pR(9);
-
- sieve.cone(point, pR);
- for(int i = 0; i < pR.getSize(); ++i) {
- std::cout << " cone point " << pR.getPoints()[i] << std::endl;
- }
- }
- if (vReplaceCells.find(point) != vReplaceCells.end()) {
- if (debug)
- std::cout << " already in replaceCells" << std::endl;
- return;
- } // if
- if (vNoReplaceCells.find(point) != vNoReplaceCells.end()) {
- if (debug)
- std::cout << " already in noReplaceCells" << std::endl;
- return;
- } // if
- if (point >= firstCohesiveCell) {
- if (debug)
- std::cout << " already a cohesive cell" << std::endl;
- return;
- } // if
- // If neighbor shares a face with anyone in replaceCells, then add
- for (typename PointSet::const_iterator c_iter = vReplaceCells.begin();
- c_iter != vReplaceCells.end();
- ++c_iter) {
- sieve.meet(*c_iter, point, pR);
-
- if (pR.getSize() == faceSize) {
- if (debug)
- std::cout << " Scheduling " << point << " for replacement"
- << std::endl;
- vReplaceCells.insert(point);
- modified = true;
- classified = true;
- pR.clear();
- break;
- } // if
- pR.clear();
- } // for
- if (classified)
- return;
- // It is unclear whether taking out the noReplace cells will speed this up
- for (typename PointSet::const_iterator c_iter = vNoReplaceCells.begin();
- c_iter != vNoReplaceCells.end();
- ++c_iter) {
- sieve.meet(*c_iter, point, pR);
-
- if (pR.getSize() == faceSize) {
- if (debug)
- std::cout << " Scheduling " << point << " for no replacement"
- << std::endl;
- vNoReplaceCells.insert(point);
- modified = true;
- classified = true;
- pR.clear();
- break;
- } // for
- pR.clear();
- } // for
-} // visitPoint
-
-// ----------------------------------------------------------------------
-template<typename Sieve>
-inline
-void
-pylith::faults::ClassifyVisitor<Sieve>::visitArrow(const typename Sieve::arrow_type&)
-{ // visitArrow
-} // visitArrow
-
-// ----------------------------------------------------------------------
-template<typename Sieve>
-inline
-const std::set<typename Sieve::point_type>&
-pylith::faults::ClassifyVisitor<Sieve>::getReplaceCells(void) const
-{ // getReplaceCells
- return this->vReplaceCells;
-} // getReplaceCells
-
-// ----------------------------------------------------------------------
-template<typename Sieve>
-inline
-const std::set<typename Sieve::point_type>&
-pylith::faults::ClassifyVisitor<Sieve>::getNoReplaceCells() const
-{ // getNoReplaceCells
- return this->vNoReplaceCells;
-} // getNoReplaceCells
-
-// ----------------------------------------------------------------------
-template<typename Sieve>
-inline
-bool
-pylith::faults::ClassifyVisitor<Sieve>::getModified() const
-{ // getModified
- return this->modified;
-} // getModified
-
-// ----------------------------------------------------------------------
-template<typename Sieve>
-inline
-int
-pylith::faults::ClassifyVisitor<Sieve>::getSize() const
-{ // getSize
- return this->size;
-} // getSize
-
-// ----------------------------------------------------------------------
-template<typename Sieve>
-inline
-void
-pylith::faults::ClassifyVisitor<Sieve>::setMode(const bool isSetup)
-{ // setMode
- this->setupMode = isSetup;
-} // setMode
-
-// ----------------------------------------------------------------------
-template<typename Sieve>
-inline
-void
-pylith::faults::ClassifyVisitor<Sieve>::reset(void)
-{ // reset
- this->modified = false;
-} // reset
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/libsrc/pylith/faults/TopologyVisitors.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/TopologyVisitors.hh 2013-05-11 03:22:48 UTC (rev 22040)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/TopologyVisitors.hh 2013-05-11 03:35:34 UTC (rev 22041)
@@ -1,98 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2013 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/** @file libsrc/faults/TopologyVisitors.hh
- *
- * @brief C++ objects for visitors to topology data structures.
- */
-
-#if !defined(pylith_faults_topologyvisitors_hh)
-#define pylith_faults_topologyvisitors_hh
-
-// Include directives ---------------------------------------------------
-#include "faultsfwd.hh" // forward declarations
-
-// ReplaceVisitor -------------------------------------------------------
-/// Visitor for replacement.
-template<typename Sieve, typename Renumbering>
-class pylith::faults::ReplaceVisitor {
-private:
- typedef typename Sieve::point_type point_type;
-protected:
- Renumbering& renumbering;
- const int size;
- int i;
- const int debug;
- point_type *points;
- bool mapped;
-public:
- ReplaceVisitor(Renumbering& r,
- const int size,
- const int debug =0);
- ~ReplaceVisitor(void);
- void visitPoint(const point_type& point);
- void visitArrow(const typename Sieve::arrow_type&);
- const point_type *getPoints(void);
- bool mappedPoint(void);
- void clear(void);
-};
-
-// ClassifyVisitor ------------------------------------------------------
-/// Visitor for classification.
-template<typename Sieve>
-class pylith::faults::ClassifyVisitor {
-public:
- typedef typename Sieve::point_type point_type;
- typedef std::set<point_type> PointSet;
-protected:
- const Sieve& sieve;
- const PointSet& replaceCells;
- const PointSet& noReplaceCells;
- const point_type firstCohesiveCell;
- const int faceSize;
- const int debug;
- PointSet vReplaceCells;
- PointSet vNoReplaceCells;
- bool modified;
- bool setupMode;
- int size;
- ALE::ISieveVisitor::PointRetriever<Sieve> pR;
-public:
- ClassifyVisitor(const Sieve& s,
- const PointSet& rC,
- const PointSet& nrC,
- const point_type& fC,
- const int fS,
- const int debug =0);
- ~ClassifyVisitor(void);
- void visitPoint(const point_type& point);
- void visitArrow(const typename Sieve::arrow_type&);
- const PointSet& getReplaceCells() const;
- const PointSet& getNoReplaceCells() const;
- bool getModified() const;
- int getSize() const;
- void setMode(const bool isSetup);
- void reset();
-};
-
-#include "TopologyVisitors.cc" // template definitions
-
-#endif // pylith_faults_topologyvisitors_hh
-
-
-// End of file
Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/SubMesh.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/SubMesh.cc 2013-05-11 03:22:48 UTC (rev 22040)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/SubMesh.cc 2013-05-11 03:35:34 UTC (rev 22041)
@@ -26,8 +26,6 @@
#include "pylith/utils/petscfwd.h" // USES PetscVec
#include "pylith/utils/error.h" // USES PYLITH_CHECK_ERROR
-#include <Selection.hh> // USES ALE::Selection
-
#include <stdexcept> // USES std::runtime_error
#include <sstream> // USES std::ostringstream
#include <cassert> // USES assert()
More information about the CIG-COMMITS
mailing list