[cig-commits] r6927 - in short/3D/PyLith/trunk: libsrc
libsrc/faults libsrc/feassemble libsrc/materials
libsrc/topology unittests/libtests/materials
brad at geodynamics.org
brad at geodynamics.org
Fri May 18 15:27:57 PDT 2007
Author: brad
Date: 2007-05-18 15:27:56 -0700 (Fri, 18 May 2007)
New Revision: 6927
Added:
short/3D/PyLith/trunk/libsrc/topology/FieldsManager.cc
short/3D/PyLith/trunk/libsrc/topology/FieldsManager.hh
Removed:
short/3D/PyLith/trunk/libsrc/feassemble/ParameterManager.cc
short/3D/PyLith/trunk/libsrc/feassemble/ParameterManager.hh
Modified:
short/3D/PyLith/trunk/libsrc/Makefile.am
short/3D/PyLith/trunk/libsrc/faults/BruneSlipFn.cc
short/3D/PyLith/trunk/libsrc/faults/SlipTimeFn.cc
short/3D/PyLith/trunk/libsrc/faults/SlipTimeFn.hh
short/3D/PyLith/trunk/libsrc/feassemble/Integrator.hh
short/3D/PyLith/trunk/libsrc/feassemble/Makefile.am
short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.cc
short/3D/PyLith/trunk/libsrc/materials/Material.cc
short/3D/PyLith/trunk/libsrc/materials/Material.hh
short/3D/PyLith/trunk/libsrc/topology/Makefile.am
short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticMaterial.cc
short/3D/PyLith/trunk/unittests/libtests/materials/TestMaterial.cc
Log:
Changed name of feassemble::ParameterManager to topology::FieldsManager to reflect more general role (in preparation for more general use).
Modified: short/3D/PyLith/trunk/libsrc/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/libsrc/Makefile.am 2007-05-18 19:08:31 UTC (rev 6926)
+++ short/3D/PyLith/trunk/libsrc/Makefile.am 2007-05-18 22:27:56 UTC (rev 6927)
@@ -45,7 +45,6 @@
feassemble/Quadrature2D.cc \
feassemble/Quadrature2Din3D.cc \
feassemble/Quadrature3D.cc \
- feassemble/ParameterManager.cc \
materials/Material.cc \
materials/ElasticStress1D.cc \
materials/ElasticStrain1D.cc \
@@ -66,6 +65,7 @@
meshio/SolutionIO.cc \
meshio/SolutionIOVTK.cc \
topology/CellGeometry.cc \
+ topology/FieldsManager.cc \
topology/GeometryPoint1D.cc \
topology/GeometryPoint2D.cc \
topology/GeometryPoint3D.cc \
Modified: short/3D/PyLith/trunk/libsrc/faults/BruneSlipFn.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/BruneSlipFn.cc 2007-05-18 19:08:31 UTC (rev 6926)
+++ short/3D/PyLith/trunk/libsrc/faults/BruneSlipFn.cc 2007-05-18 22:27:56 UTC (rev 6927)
@@ -14,7 +14,7 @@
#include "BruneSlipFn.hh" // implementation of object methods
-#include "pylith/feassemble/ParameterManager.hh" // USES ParameterManager
+#include "pylith/topology/FieldsManager.hh" // USES FieldsManager
#include "pylith/utils/array.hh" // USES double_array
#include "spatialdata/spatialdb/SpatialDB.hh" // USES SpatialDB
@@ -75,7 +75,7 @@
// Create and allocate sections for parameters
delete _parameters;
- _parameters = new feassemble::ParameterManager(faultMesh);
+ _parameters = new topology::FieldsManager(faultMesh);
if (0 == _parameters)
throw std::runtime_error("Could not create manager for parameters of "
"Brune slip time function.");
Modified: short/3D/PyLith/trunk/libsrc/faults/SlipTimeFn.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/SlipTimeFn.cc 2007-05-18 19:08:31 UTC (rev 6926)
+++ short/3D/PyLith/trunk/libsrc/faults/SlipTimeFn.cc 2007-05-18 22:27:56 UTC (rev 6927)
@@ -14,7 +14,7 @@
#include "SlipTimeFn.hh" // implementation of object methods
-#include "pylith/feassemble/ParameterManager.hh" // USES ParameterManager
+#include "pylith/topology/FieldsManager.hh" // USES FieldsManager
// ----------------------------------------------------------------------
// Default constructor.
Modified: short/3D/PyLith/trunk/libsrc/faults/SlipTimeFn.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/SlipTimeFn.hh 2007-05-18 19:08:31 UTC (rev 6926)
+++ short/3D/PyLith/trunk/libsrc/faults/SlipTimeFn.hh 2007-05-18 22:27:56 UTC (rev 6927)
@@ -29,8 +29,8 @@
class TestSlipTimeFn; // unit testing
} // faults
- namespace feassemble {
- class ParameterManager; // HOLDSA ParameterManager
+ namespace topology {
+ class FieldsManager; // HOLDSA FieldsManager
} // feassemble
} // pylith
@@ -104,7 +104,7 @@
protected :
/// Parameters for slip time function
- feassemble::ParameterManager* _parameters;
+ topology::FieldsManager* _parameters;
}; // class SlipTimeFn
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Integrator.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Integrator.hh 2007-05-18 19:08:31 UTC (rev 6926)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Integrator.hh 2007-05-18 22:27:56 UTC (rev 6927)
@@ -32,7 +32,6 @@
class TestIntegrator;
class Quadrature; // HOLDSA Quadrature
- class ParameterManager; // HOLDSA ParameterManager
} // feassemble
} // pylith
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Makefile.am 2007-05-18 19:08:31 UTC (rev 6926)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Makefile.am 2007-05-18 22:27:56 UTC (rev 6927)
@@ -35,8 +35,7 @@
Quadrature2Din3D.hh \
Quadrature2Din3D.icc \
Quadrature3D.hh \
- Quadrature3D.icc \
- ParameterManager.hh
+ Quadrature3D.icc
noinst_HEADERS =
Deleted: short/3D/PyLith/trunk/libsrc/feassemble/ParameterManager.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/ParameterManager.cc 2007-05-18 19:08:31 UTC (rev 6926)
+++ short/3D/PyLith/trunk/libsrc/feassemble/ParameterManager.cc 2007-05-18 22:27:56 UTC (rev 6927)
@@ -1,70 +0,0 @@
-// -*- C++ -*-
-//
-// ======================================================================
-//
-// Brad T. Aagaard
-// U.S. Geological Survey
-//
-// {LicenseText}
-//
-// ======================================================================
-//
-
-#include <portinfo>
-
-#include "ParameterManager.hh" // implementation of class methods
-
-#include <stdexcept> // USES std::runtime_error
-#include <sstream> // USES std::ostringstream
-#include <assert.h> // USES assert()
-
-// ----------------------------------------------------------------------
-// Constructor
-pylith::feassemble::ParameterManager::ParameterManager(
- const ALE::Obj<Mesh>& mesh) :
- _mesh(mesh)
-{ // constructor
-} // constructor
-
-// ----------------------------------------------------------------------
-// Destructor
-pylith::feassemble::ParameterManager::~ParameterManager(void)
-{ // destructor
-} // destructor
-
-// ----------------------------------------------------------------------
-// Add parameter.
-void
-pylith::feassemble::ParameterManager::addReal(const char* name)
-{ // addReal
- assert(!_mesh.isNull());
-
- map_real_type::iterator iter = _real.find(name);
- if (iter != _real.end()) {
- std::ostringstream msg;
- msg << "Could not add parameter '" << name
- << "'. Parameter already exists.";
- throw std::runtime_error(msg.str());
- } // if
-
- ALE::Obj<real_section_type> parameter =
- new real_section_type(_mesh->comm(), _mesh->debug());
- _real[name] = parameter;
-} // addReal
-
-// ----------------------------------------------------------------------
-// Get parameter.
-const ALE::Obj<pylith::real_section_type>&
-pylith::feassemble::ParameterManager::getReal(const char* name)
-{ // getReal
- map_real_type::const_iterator iter = _real.find(name);
- if (iter == _real.end()) {
- std::ostringstream msg;
- msg << "Could not find parameter '" << name << "'.";
- throw std::runtime_error(msg.str());
- } // if
- return _real[name];
-} // getReal
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/libsrc/feassemble/ParameterManager.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/ParameterManager.hh 2007-05-18 19:08:31 UTC (rev 6926)
+++ short/3D/PyLith/trunk/libsrc/feassemble/ParameterManager.hh 2007-05-18 22:27:56 UTC (rev 6927)
@@ -1,91 +0,0 @@
-// -*- C++ -*-
-//
-// ======================================================================
-//
-// Brad T. Aagaard
-// U.S. Geological Survey
-//
-// {LicenseText}
-//
-// ======================================================================
-//
-
-/**
- * @file pylith/feassemble/ParameterManager.hh
- *
- * @brief Object for managing fields associated with parameters for
- * finite-elements.
- *
- * The parameter manager stores the fields associated with parameters
- * for physical properties or boundary conditions.
- */
-
-#if !defined(pylith_feassemble_parametermanager_hh)
-#define pylith_feassemble_parametermanager_hh
-
-#include <map> // HASA std::map
-#include <string> // USES std::string
-
-#include "pylith/utils/sievetypes.hh" // USES PETSc Mesh
-
-namespace pylith {
- namespace feassemble {
- class ParameterManager;
- class TestParameterManager;
- } // feassemble
-} // pylith
-
-class pylith::feassemble::ParameterManager
-{ // ParameterManager
- friend class TestParameterManager; // unit testing
-
-// PUBLIC MEMBERS ///////////////////////////////////////////////////////
-public :
-
- /// Constructor
- ParameterManager(const ALE::Obj<Mesh>& mesh);
-
- /// Destructor
- ~ParameterManager(void);
-
- /** Add parameter.
- *
- * @param name Name of parameter field
- */
- void addReal(const char* name);
-
- /** Get parameter.
- *
- * @param name Name of parameter field
- */
- const ALE::Obj<real_section_type>& getReal(const char* name);
-
-// NOT IMPLEMENTED //////////////////////////////////////////////////////
-private :
-
- /// Not implemented
- ParameterManager(const ParameterManager& m);
-
- /// Not implemented
- const ParameterManager& operator=(const ParameterManager&);
-
-// PRIVATE TYPEDEFS /////////////////////////////////////////////////////
-private :
-
- typedef std::map< std::string, ALE::Obj<real_section_type> > map_real_type;
-
-// PRIVATE MEMBERS //////////////////////////////////////////////////////
-private :
-
- /// PETSc mesh associated with fields
- const ALE::Obj<Mesh>& _mesh;
-
- /// Map for parameters stored as real fields
- map_real_type _real;
-
-}; // ParameterManager
-
-#endif // pylith_feassemble_parametermanager_hh
-
-
-// End of file
Modified: short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.cc 2007-05-18 19:08:31 UTC (rev 6926)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.cc 2007-05-18 22:27:56 UTC (rev 6927)
@@ -14,7 +14,7 @@
#include "ElasticMaterial.hh" // implementation of object methods
-#include "pylith/feassemble/ParameterManager.hh" // USES ParameterManager
+#include "pylith/topology/FieldsManager.hh" // USES FieldsManager
#include "pylith/utils/array.hh" // USES double_array
#include <petscmesh.h> // USES Mesh
Modified: short/3D/PyLith/trunk/libsrc/materials/Material.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/Material.cc 2007-05-18 19:08:31 UTC (rev 6926)
+++ short/3D/PyLith/trunk/libsrc/materials/Material.cc 2007-05-18 22:27:56 UTC (rev 6927)
@@ -14,8 +14,8 @@
#include "Material.hh" // implementation of object methods
-#include "pylith/feassemble/ParameterManager.hh" // USES ParameterManager
-#include "pylith/feassemble/Quadrature.hh" // USES ParameterManager
+#include "pylith/topology/FieldsManager.hh" // USES FieldsManager
+#include "pylith/feassemble/Quadrature.hh" // USES Quadrature
#include "pylith/utils/array.hh" // USES double_array, std::vector
#include "spatialdata/spatialdb/SpatialDB.hh" // USES SpatialDB
@@ -86,7 +86,7 @@
} // if
// Create sections to hold parameters for physical properties
- delete _parameters; _parameters = new feassemble::ParameterManager(mesh);
+ delete _parameters; _parameters = new topology::FieldsManager(mesh);
assert(0 != _parameters);
const int numQuadPts = quadrature->numQuadPts();
Modified: short/3D/PyLith/trunk/libsrc/materials/Material.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/Material.hh 2007-05-18 19:08:31 UTC (rev 6926)
+++ short/3D/PyLith/trunk/libsrc/materials/Material.hh 2007-05-18 22:27:56 UTC (rev 6927)
@@ -33,9 +33,12 @@
} // materials
namespace feassemble {
- class ParameterManager; // HOLDSA ParameterManager
class Quadrature; // USES Quadrature
} // feassemble
+
+ namespace topology {
+ class FieldsManager; // HOLDSA FieldsManager
+ } // feassemble
} // pylith
/// Namespace for spatialdata package
@@ -176,7 +179,7 @@
protected :
///< Manager of parameters for physical properties of material
- pylith::feassemble::ParameterManager* _parameters;
+ topology::FieldsManager* _parameters;
int _dimension; ///< Spatial dimension associated with material
Copied: short/3D/PyLith/trunk/libsrc/topology/FieldsManager.cc (from rev 6926, short/3D/PyLith/trunk/libsrc/feassemble/ParameterManager.cc)
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/ParameterManager.cc 2007-05-18 19:08:31 UTC (rev 6926)
+++ short/3D/PyLith/trunk/libsrc/topology/FieldsManager.cc 2007-05-18 22:27:56 UTC (rev 6927)
@@ -0,0 +1,69 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#include <portinfo>
+
+#include "FieldsManager.hh" // implementation of class methods
+
+#include <stdexcept> // USES std::runtime_error
+#include <sstream> // USES std::ostringstream
+#include <assert.h> // USES assert()
+
+// ----------------------------------------------------------------------
+// Constructor
+pylith::topology::FieldsManager::FieldsManager(const ALE::Obj<Mesh>& mesh) :
+ _mesh(mesh)
+{ // constructor
+} // constructor
+
+// ----------------------------------------------------------------------
+// Destructor
+pylith::topology::FieldsManager::~FieldsManager(void)
+{ // destructor
+} // destructor
+
+// ----------------------------------------------------------------------
+// Add field.
+void
+pylith::topology::FieldsManager::addReal(const char* name)
+{ // addReal
+ assert(!_mesh.isNull());
+
+ map_real_type::iterator iter = _real.find(name);
+ if (iter != _real.end()) {
+ std::ostringstream msg;
+ msg << "Could not add field '" << name
+ << "', because it already exists.";
+ throw std::runtime_error(msg.str());
+ } // if
+
+ ALE::Obj<real_section_type> field =
+ new real_section_type(_mesh->comm(), _mesh->debug());
+ _real[name] = field;
+} // addReal
+
+// ----------------------------------------------------------------------
+// Get field.
+const ALE::Obj<pylith::real_section_type>&
+pylith::topology::FieldsManager::getReal(const char* name)
+{ // getReal
+ map_real_type::const_iterator iter = _real.find(name);
+ if (iter == _real.end()) {
+ std::ostringstream msg;
+ msg << "Could not find field '" << name << "'.";
+ throw std::runtime_error(msg.str());
+ } // if
+ return _real[name];
+} // getReal
+
+
+// End of file
Copied: short/3D/PyLith/trunk/libsrc/topology/FieldsManager.hh (from rev 6926, short/3D/PyLith/trunk/libsrc/feassemble/ParameterManager.hh)
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/ParameterManager.hh 2007-05-18 19:08:31 UTC (rev 6926)
+++ short/3D/PyLith/trunk/libsrc/topology/FieldsManager.hh 2007-05-18 22:27:56 UTC (rev 6927)
@@ -0,0 +1,88 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+/**
+ * @file pylith/topology/FieldsManager.hh
+ *
+ * @brief Object for managing fields associated with the fields
+ * defined over a finite-element mesh.
+ */
+
+#if !defined(pylith_topology_fieldsmanager_hh)
+#define pylith_topology_fieldsmanager_hh
+
+#include <map> // HASA std::map
+#include <string> // USES std::string
+
+#include "pylith/utils/sievetypes.hh" // USES PETSc Mesh
+
+namespace pylith {
+ namespace topology {
+ class FieldsManager;
+ class TestFieldsManager;
+ } // topology
+} // pylith
+
+class pylith::topology::FieldsManager
+{ // FieldsManager
+ friend class TestFieldsManager; // unit testing
+
+// PUBLIC MEMBERS ///////////////////////////////////////////////////////
+public :
+
+ /// Constructor
+ FieldsManager(const ALE::Obj<Mesh>& mesh);
+
+ /// Destructor
+ ~FieldsManager(void);
+
+ /** Add fields.
+ *
+ * @param name Name of fields field
+ */
+ void addReal(const char* name);
+
+ /** Get fields.
+ *
+ * @param name Name of fields field
+ */
+ const ALE::Obj<real_section_type>& getReal(const char* name);
+
+// NOT IMPLEMENTED //////////////////////////////////////////////////////
+private :
+
+ /// Not implemented
+ FieldsManager(const FieldsManager& m);
+
+ /// Not implemented
+ const FieldsManager& operator=(const FieldsManager&);
+
+// PRIVATE TYPEDEFS /////////////////////////////////////////////////////
+private :
+
+ typedef std::map< std::string, ALE::Obj<real_section_type> > map_real_type;
+
+// PRIVATE MEMBERS //////////////////////////////////////////////////////
+private :
+
+ /// PETSc mesh associated with fields
+ const ALE::Obj<Mesh>& _mesh;
+
+ /// Map for fieldss stored as real fields
+ map_real_type _real;
+
+}; // FieldsManager
+
+#endif // pylith_topology_fieldsmanager_hh
+
+
+// End of file
Modified: short/3D/PyLith/trunk/libsrc/topology/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/Makefile.am 2007-05-18 19:08:31 UTC (rev 6926)
+++ short/3D/PyLith/trunk/libsrc/topology/Makefile.am 2007-05-18 22:27:56 UTC (rev 6927)
@@ -16,6 +16,7 @@
subpkginclude_HEADERS = \
CellGeometry.hh \
CellGeometry.icc \
+ FieldsManager.hh \
GeometryPoint1D.hh \
GeometryPoint2D.hh \
GeometryPoint3D.hh \
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticMaterial.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticMaterial.cc 2007-05-18 19:08:31 UTC (rev 6926)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticMaterial.cc 2007-05-18 22:27:56 UTC (rev 6927)
@@ -19,7 +19,7 @@
#include "pylith/materials/ElasticIsotropic3D.hh" // USES ElasticIsotropic3D
#include "pylith/utils/array.hh" // USES double_array
-#include "pylith/feassemble/ParameterManager.hh" // USES ParameterManager
+#include "pylith/topology/FieldsManager.hh" // USES FieldsManager
// ----------------------------------------------------------------------
CPPUNIT_TEST_SUITE_REGISTRATION( pylith::materials::TestElasticMaterial );
@@ -79,7 +79,7 @@
ElasticIsotropic3D material;
ElasticIsotropic3DData data;
delete material._parameters;
- material._parameters = new feassemble::ParameterManager(mesh);
+ material._parameters = new topology::FieldsManager(mesh);
const int numQuadPts = 2;
const int fiberDim = numQuadPts; // number of values in field per cell
@@ -160,7 +160,7 @@
ElasticIsotropic3D material;
ElasticIsotropic3DData data;
delete material._parameters;
- material._parameters = new feassemble::ParameterManager(mesh);
+ material._parameters = new topology::FieldsManager(mesh);
const int numQuadPts = 2;
const int fiberDim = numQuadPts; // number of values in field per cell
@@ -270,7 +270,7 @@
ElasticIsotropic3D material;
ElasticIsotropic3DData data;
delete material._parameters;
- material._parameters = new feassemble::ParameterManager(mesh);
+ material._parameters = new topology::FieldsManager(mesh);
const int numQuadPts = 2;
const int fiberDim = numQuadPts; // number of values in field per cell
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/TestMaterial.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/TestMaterial.cc 2007-05-18 19:08:31 UTC (rev 6926)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/TestMaterial.cc 2007-05-18 22:27:56 UTC (rev 6927)
@@ -19,7 +19,7 @@
#include "pylith/materials/ElasticIsotropic3D.hh" // USES ElasticIsotropic3D
#include "pylith/utils/array.hh" // USES double_array
#include "pylith/feassemble/Quadrature1D.hh" // USES Quadrature1D
-#include "pylith/feassemble/ParameterManager.hh" // USES ParameterManager
+#include "pylith/topology/FieldsManager.hh" // USES FieldsManager
#include "spatialdata/spatialdb/SimpleDB.hh" // USES SimpleDB
#include "spatialdata/spatialdb/SimpleIOAscii.hh" // USES SimpleIOAscii
More information about the cig-commits
mailing list