[cig-commits] r14025 - in short/3D/PyLith/branches/pylith-swig: libsrc libsrc/bc libsrc/feassemble libsrc/topology libsrc/utils modulesrc/topology pylith pylith/topology unittests/pytests/topology
brad at geodynamics.org
brad at geodynamics.org
Thu Feb 5 21:23:10 PST 2009
Author: brad
Date: 2009-02-05 21:23:10 -0800 (Thu, 05 Feb 2009)
New Revision: 14025
Removed:
short/3D/PyLith/branches/pylith-swig/libsrc/topology/FieldOps.cc
short/3D/PyLith/branches/pylith-swig/libsrc/topology/FieldOps.hh
Modified:
short/3D/PyLith/branches/pylith-swig/libsrc/Makefile.am
short/3D/PyLith/branches/pylith-swig/libsrc/bc/BoundaryCondition.cc
short/3D/PyLith/branches/pylith-swig/libsrc/bc/DirichletBC.cc
short/3D/PyLith/branches/pylith-swig/libsrc/bc/DirichletBC.hh
short/3D/PyLith/branches/pylith-swig/libsrc/bc/DirichletBoundary.cc
short/3D/PyLith/branches/pylith-swig/libsrc/bc/DirichletBoundary.hh
short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/Constraint.hh
short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/Integrator.hh
short/3D/PyLith/branches/pylith-swig/libsrc/topology/Field.hh
short/3D/PyLith/branches/pylith-swig/libsrc/topology/Fields.hh
short/3D/PyLith/branches/pylith-swig/libsrc/topology/Fields.icc
short/3D/PyLith/branches/pylith-swig/libsrc/topology/MeshOps.cc
short/3D/PyLith/branches/pylith-swig/libsrc/topology/MeshOps.hh
short/3D/PyLith/branches/pylith-swig/libsrc/topology/topologyfwd.hh
short/3D/PyLith/branches/pylith-swig/libsrc/utils/sievefwd.hh
short/3D/PyLith/branches/pylith-swig/modulesrc/topology/SubMesh.i
short/3D/PyLith/branches/pylith-swig/modulesrc/topology/topology.i
short/3D/PyLith/branches/pylith-swig/pylith/Makefile.am
short/3D/PyLith/branches/pylith-swig/pylith/topology/__init__.py
short/3D/PyLith/branches/pylith-swig/unittests/pytests/topology/TestMeshField.py
Log:
Propagated changes to DirichletBC and DirichletBoundary.
Modified: short/3D/PyLith/branches/pylith-swig/libsrc/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/Makefile.am 2009-02-06 01:27:43 UTC (rev 14024)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/Makefile.am 2009-02-06 05:23:10 UTC (rev 14025)
@@ -22,6 +22,10 @@
lib_LTLIBRARIES = libpylith.la
libpylith_la_SOURCES = \
+ bc/BoundaryCondition.cc \
+ bc/DirichletBC.cc \
+ bc/DirichletBoundary.cc \
+ feassemble/Constraint.cc \
meshio/BinaryIO.cc \
meshio/GMVFile.cc \
meshio/GMVFileAscii.cc \
@@ -35,11 +39,10 @@
meshio/PsetFileBinary.cc \
topology/Mesh.cc \
topology/SubMesh.cc \
+ topology/MeshOps.cc \
utils/EventLogger.cc
-# bc/BoundaryCondition.cc \
-# bc/DirichletBC.cc \
-# bc/DirichletBoundary.cc \
+# feassemble/Integrator.cc \
# bc/Neumann.cc \
# faults/BruneSlipFn.cc \
# faults/ConstRateSlipFn.cc \
@@ -53,7 +56,6 @@
# faults/SlipTimeFn.cc \
# faults/StepSlipFn.cc \
# feassemble/CellGeometry.cc \
-# feassemble/Constraint.cc \
# feassemble/ElasticityExplicit.cc \
# feassemble/ElasticityImplicit.cc \
# feassemble/GeometryPoint1D.cc \
@@ -68,7 +70,6 @@
# feassemble/GeometryQuad2D.cc \
# feassemble/GeometryQuad3D.cc \
# feassemble/GeometryHex3D.cc \
-# feassemble/Integrator.cc \
# feassemble/IntegratorElasticity.cc \
# feassemble/Quadrature.cc \
# feassemble/Quadrature0D.cc \
@@ -99,10 +100,7 @@
# meshio/UCDFaultFile.cc \
# topology/Distributor.cc \
# topology/FieldsManager.cc \
-# topology/FieldOps.cc \
-# topology/MeshOps.cc \
-# topology/MeshRefiner.cc \
-# topology/SubMesh.cc
+# topology/MeshRefiner.cc
# topology/RefineUniform.cc \
# bc/AbsorbingDampers.cc
Modified: short/3D/PyLith/branches/pylith-swig/libsrc/bc/BoundaryCondition.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/bc/BoundaryCondition.cc 2009-02-06 01:27:43 UTC (rev 14024)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/bc/BoundaryCondition.cc 2009-02-06 05:23:10 UTC (rev 14025)
@@ -38,7 +38,7 @@
void
pylith::bc::BoundaryCondition::verifyConfiguration(const topology::Mesh& mesh) const
{ // verifyConfiguration
- const ALE::Obj<SieveMesh>& sieveMesh = mesh.sieveMesh();
+ const ALE::Obj<topology::Mesh::SieveMesh>& sieveMesh = mesh.sieveMesh();
assert(!sieveMesh.isNull());
if (!sieveMesh->hasIntSection(_label)) {
Modified: short/3D/PyLith/branches/pylith-swig/libsrc/bc/DirichletBC.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/bc/DirichletBC.cc 2009-02-06 01:27:43 UTC (rev 14024)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/bc/DirichletBC.cc 2009-02-06 05:23:10 UTC (rev 14025)
@@ -26,6 +26,10 @@
#include <sstream> // USES std::ostringstream
// ----------------------------------------------------------------------
+typedef pylith::topology::Mesh::SieveMesh SieveMesh;
+typedef pylith::topology::Mesh::RealSection RealSection;
+
+// ----------------------------------------------------------------------
// Default constructor.
pylith::bc::DirichletBC::DirichletBC(void) :
_tRef(0.0),
@@ -72,13 +76,13 @@
// ----------------------------------------------------------------------
// Set number of degrees of freedom that are constrained at points in field.
void
-pylith::bc::DirichletBC::setConstraintSizes(const topology::Field& field)
+pylith::bc::DirichletBC::setConstraintSizes(const topology::Field<topology::Mesh>& field)
{ // setConstraintSizes
const int numFixedDOF = _fixedDOF.size();
if (0 == numFixedDOF)
return;
- const ALE::Obj<MeshRealSection>& section = field.section();
+ const ALE::Obj<RealSection>& section = field.section();
assert(!section.isNull());
const int numPoints = _points.size();
@@ -105,13 +109,13 @@
// ----------------------------------------------------------------------
// Set which degrees of freedom are constrained at points in field.
void
-pylith::bc::DirichletBC::setConstraints(const topology::Field& field)
+pylith::bc::DirichletBC::setConstraints(const topology::Field<topology::Mesh>& field)
{ // setConstraints
const int numFixedDOF = _fixedDOF.size();
if (0 == numFixedDOF)
return;
- const ALE::Obj<MeshRealSection>& section = field.section();
+ const ALE::Obj<RealSection>& section = field.section();
assert(!section.isNull());
const int numPoints = _points.size();
@@ -167,13 +171,13 @@
// Set values in field.
void
pylith::bc::DirichletBC::setField(const double t,
- const topology::Field& field)
+ const topology::Field<topology::Mesh>& field)
{ // setField
const int numFixedDOF = _fixedDOF.size();
if (0 == numFixedDOF)
return;
- const ALE::Obj<MeshRealSection>& section = field.section();
+ const ALE::Obj<RealSection>& section = field.section();
assert(!section.isNull());
const ALE::Obj<SieveMesh>& sieveMesh = field.mesh().sieveMesh();
assert(!sieveMesh.isNull());
@@ -201,7 +205,7 @@
void
pylith::bc::DirichletBC::_getPoints(const topology::Mesh& mesh)
{ // _getPoints
- typedef SieveMesh::int_section_type::chart_type chart_type;
+ typedef topology::Mesh::IntSection::chart_type chart_type;
const ALE::Obj<SieveMesh>& sieveMesh = mesh.sieveMesh();
assert(!sieveMesh.isNull());
@@ -268,7 +272,7 @@
const ALE::Obj<SieveMesh>& sieveMesh = mesh.sieveMesh();
assert(!sieveMesh.isNull());
- const ALE::Obj<MeshRealSection>& coordinates =
+ const ALE::Obj<RealSection>& coordinates =
sieveMesh->getRealSection("coordinates");
assert(!coordinates.isNull());
Modified: short/3D/PyLith/branches/pylith-swig/libsrc/bc/DirichletBC.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/bc/DirichletBC.hh 2009-02-06 01:27:43 UTC (rev 14024)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/bc/DirichletBC.hh 2009-02-06 05:23:10 UTC (rev 14025)
@@ -24,8 +24,6 @@
#include "pylith/feassemble/Constraint.hh" // ISA Constraint
#include "pylith/utils/array.hh" // HASA std::vector, double_array, int_array
-#define NEWPYLITHMESH 1
-#include "pylith/utils/sievetypes.hh" // HASA SieveMesh::point_type
// DirichletBC ------------------------------------------------------
class pylith::bc::DirichletBC : public BoundaryCondition,
@@ -79,13 +77,13 @@
*
* @param field Solution field
*/
- void setConstraintSizes(const topology::Field& field);
+ void setConstraintSizes(const topology::Field<topology::Mesh>& field);
/** Set which degrees of freedom are constrained at points in field.
*
* @param field Solution field
*/
- void setConstraints(const topology::Field& field);
+ void setConstraints(const topology::Field<topology::Mesh>& field);
/** Set values in field.
*
@@ -93,7 +91,7 @@
* @param field Solution field
*/
void setField(const double t,
- const topology::Field& field);
+ const topology::Field<topology::Mesh>& field);
// PROTECTED METHODS //////////////////////////////////////////////////
protected :
@@ -129,7 +127,7 @@
double_array _valuesInitial; ///< Initial values at points.
double_array _valuesRate; ///< Rate of change of values at points.
- std::vector<SieveMesh::point_type> _points; ///< Points for BC
+ int_array _points; ///< Points for BC
int_array _fixedDOF; ///< Indices of fixed degrees of freedom
/// Offset in list of fixed DOF at point to get to fixed DOF
Modified: short/3D/PyLith/branches/pylith-swig/libsrc/bc/DirichletBoundary.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/bc/DirichletBoundary.cc 2009-02-06 01:27:43 UTC (rev 14024)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/bc/DirichletBoundary.cc 2009-02-06 05:23:10 UTC (rev 14025)
@@ -17,7 +17,6 @@
#include "pylith/topology/Mesh.hh" // USES Mesh
#include "pylith/topology/SubMesh.hh" // USES SubMesh
#include "pylith/topology/Field.hh" // USES Field
-#include "pylith/topology/FieldSubMesh.hh" // USES FieldSubMesh
#include "spatialdata/geocoords/CoordSys.hh" // USES CoordSys
#include "spatialdata/units/Nondimensional.hh" // USES Nondimensional
@@ -62,15 +61,18 @@
// ----------------------------------------------------------------------
// Get vertex field of BC initial or rate of change of values.
-const pylith::topology::FieldSubMesh&
+const pylith::topology::Field<pylith::topology::SubMesh>&
pylith::bc::DirichletBoundary::vertexField(const char* name,
const topology::SolutionFields& fields)
{ // getVertexField
+ typedef topology::SubMesh::SieveMesh SieveMesh;
+ typedef topology::SubMesh::RealSection RealSection;
+
assert(0 != name);
assert(0 != _boundaryMesh);
assert(0 != _normalizer);
- const ALE::Obj<SieveSubMesh>& sieveMesh = _boundaryMesh->sieveMesh();
+ const ALE::Obj<SieveMesh>& sieveMesh = _boundaryMesh->sieveMesh();
assert(!sieveMesh.isNull());
const ALE::Obj<SieveMesh::label_sequence>& vertices =
@@ -87,7 +89,7 @@
const int numFixedDOF = _fixedDOF.size();
if (0 == _tmpField) {
- _tmpField = new topology::FieldSubMesh(*_boundaryMesh);
+ _tmpField = new topology::Field<topology::SubMesh>(*_boundaryMesh);
assert(0 != _tmpField);
_tmpField->newSection(vertices, fiberDim);
_tmpField->allocate();
@@ -99,14 +101,14 @@
if (0 == strcasecmp(name, "initial")) {
_tmpField->name("displacement");
- _tmpField->vectorFieldType(topology::Field::VECTOR);
+ _tmpField->vectorFieldType(topology::Field<topology::SubMesh>::VECTOR);
_tmpField->scale(_normalizer->lengthScale());
_tmpField->addDimensionOkay(true);
_tmpField->zero();
- const ALE::Obj<SubMeshRealSection>& section = _tmpField->section();
+ const ALE::Obj<RealSection>& section = _tmpField->section();
for (int iPoint=0; iPoint < numPoints; ++iPoint) {
- const SieveSubMesh::point_type point = _points[iPoint];
+ const SieveMesh::point_type point = _points[iPoint];
assert(fiberDim == section->getFiberDimension(point));
for (int iDOF=0; iDOF < numFixedDOF; ++iDOF)
values[_fixedDOF[iDOF]] = _valuesInitial[iPoint*numFixedDOF+iDOF];
@@ -114,11 +116,11 @@
} // for
} else if (0 == strcasecmp(name, "rate-of-change")) {
_tmpField->name("velocity");
- _tmpField->vectorFieldType(topology::Field::VECTOR);
+ _tmpField->vectorFieldType(topology::Field<topology::SubMesh>::VECTOR);
_tmpField->scale(_normalizer->lengthScale());
_tmpField->addDimensionOkay(true);
_tmpField->zero();
- const ALE::Obj<SubMeshRealSection>& section = _tmpField->section();
+ const ALE::Obj<RealSection>& section = _tmpField->section();
for (int iPoint=0; iPoint < numPoints; ++iPoint) {
const SieveMesh::point_type point = _points[iPoint];
Modified: short/3D/PyLith/branches/pylith-swig/libsrc/bc/DirichletBoundary.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/bc/DirichletBoundary.hh 2009-02-06 01:27:43 UTC (rev 14024)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/bc/DirichletBoundary.hh 2009-02-06 05:23:10 UTC (rev 14025)
@@ -57,7 +57,7 @@
*
* @returns Field over vertices.
*/
- const topology::FieldSubMesh&
+ const topology::Field<topology::SubMesh>&
vertexField(const char* name,
const topology::SolutionFields& fields);
@@ -74,7 +74,7 @@
private :
topology::SubMesh* _boundaryMesh; ///< Boundary mesh.
- topology::FieldSubMesh* _tmpField; ///< Temporary field for output.
+ topology::Field<topology::SubMesh>* _tmpField; ///< Temporary field for output.
}; // class DirichletBoundary
Modified: short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/Constraint.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/Constraint.hh 2009-02-06 01:27:43 UTC (rev 14024)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/Constraint.hh 2009-02-06 05:23:10 UTC (rev 14025)
@@ -51,14 +51,14 @@
* @param field Solution field
*/
virtual
- void setConstraintSizes(const topology::Field& field) = 0;
+ void setConstraintSizes(const topology::Field<topology::Mesh>& field) = 0;
/** Set which degrees of freedom are constrained at points in field.
*
* @param field Solution field
*/
virtual
- void setConstraints(const topology::Field& field) = 0;
+ void setConstraints(const topology::Field<topology::Mesh>& field) = 0;
/** Set flag for setting constraints for total field solution or
* incremental field solution.
@@ -75,7 +75,7 @@
*/
virtual
void setField(const double t,
- const topology::Field& field) = 0;
+ const topology::Field<topology::Mesh>& field) = 0;
// PROTECTED MEMBERS //////////////////////////////////////////////////
protected :
Modified: short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/Integrator.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/Integrator.hh 2009-02-06 01:27:43 UTC (rev 14024)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/feassemble/Integrator.hh 2009-02-06 05:23:10 UTC (rev 14025)
@@ -106,7 +106,7 @@
* @param fields Solution fields
*/
virtual
- void integrateResidual(const topology::Field& residual,
+ void integrateResidual(const topology::Field<topology::Mesh>& residual,
const double t,
topology::SolutionFields* const fields);
@@ -130,7 +130,7 @@
* @param fields Solution fields
*/
virtual
- void integrateResidualAssembled(const topology::Field& residual,
+ void integrateResidualAssembled(const topology::Field<topology::Mesh>& residual,
const double t,
topology::SolutionFields* const fields);
Modified: short/3D/PyLith/branches/pylith-swig/libsrc/topology/Field.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/topology/Field.hh 2009-02-06 01:27:43 UTC (rev 14024)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/topology/Field.hh 2009-02-06 05:23:10 UTC (rev 14025)
@@ -25,6 +25,8 @@
// Include directives ---------------------------------------------------
#include "topologyfwd.hh" // forward declarations
+#include <petscmesh.hh>
+
// Field ----------------------------------------------------------------
template<typename mesh_type>
class pylith::topology::Field
@@ -49,8 +51,14 @@
enum DomainEnum {
VERTICES_FIELD=0, ///< FieldBase over vertices.
CELLS_FIELD=1, ///< FieldBase over cells.
- }; // omainEnum
+ }; // DomainEnum
+// PUBLIC TYPEDEFS //////////////////////////////////////////////////////
+public:
+
+ // Convenience typedefs
+ typedef mesh_type Mesh;
+
// PRIVATE TYPEDEFS /////////////////////////////////////////////////////
private:
Deleted: short/3D/PyLith/branches/pylith-swig/libsrc/topology/FieldOps.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/topology/FieldOps.cc 2009-02-06 01:27:43 UTC (rev 14024)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/topology/FieldOps.cc 2009-02-06 05:23:10 UTC (rev 14025)
@@ -1,45 +0,0 @@
-// -*- C++ -*-
-//
-// ======================================================================
-//
-// Brad T. Aagaard
-// U.S. Geological Survey
-//
-// {LicenseText}
-//
-// ======================================================================
-//
-
-#include <portinfo>
-
-#include "FieldOps.hh" // implementation of class methods
-
-#include <stdexcept> // USES std::runtime_error
-#include <sstream> // USES std::ostringstream
-#include <cassert> // USES assert()
-
-// ----------------------------------------------------------------------
-// Copy values from one section to another.
-void
-pylith::topology::FieldOps::copyValues(const ALE::Obj<real_section_type>& dest,
- const ALE::Obj<real_section_type>& src)
-{ // copyValues
- typedef real_section_type::chart_type chart_type;
-
- assert(!dest.isNull());
- assert(!src.isNull());
-
- const chart_type& chartSrc = src->getChart();
- const chart_type& chartDest = dest->getChart();
- const chart_type::const_iterator chartEnd = chartSrc.end();
- for (chart_type::const_iterator c_iter = chartSrc.begin();
- c_iter != chartEnd;
- ++c_iter) {
- assert(dest->getFiberDimension(*c_iter) ==
- src->getFiberDimension(*c_iter));
- dest->updatePoint(*c_iter, src->restrictPoint(*c_iter));
- } // for
-} // copyValues
-
-
-// End of file
Deleted: short/3D/PyLith/branches/pylith-swig/libsrc/topology/FieldOps.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/topology/FieldOps.hh 2009-02-06 01:27:43 UTC (rev 14024)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/topology/FieldOps.hh 2009-02-06 05:23:10 UTC (rev 14025)
@@ -1,66 +0,0 @@
-// -*- C++ -*-
-//
-// ======================================================================
-//
-// Brad T. Aagaard
-// U.S. Geological Survey
-//
-// {LicenseText}
-//
-// ======================================================================
-//
-
-/**
- * @file pylith/topology/FieldOps.hh
- *
- * @brief Temporary object for doing operations on a PETSc
- * field. Object will be replaced by a PyLith Field object that inherits
- * or templates over the PETSc Field object.
- */
-
-#if !defined(pylith_topology_fieldops_hh)
-#define pylith_topology_fieldops_hh
-
-#include "pylith/utils/sievetypes.hh" // USES PETSc real_section_type
-
-namespace pylith {
- namespace topology {
- class FieldOps;
- class TestFieldOps;
- } // topology
-} // pylith
-
-class pylith::topology::FieldOps
-{ // MeshOps
- friend class TestFieldOps; // unit testing
-
-// PUBLIC MEMBERS ///////////////////////////////////////////////////////
-public :
-
- /** Copy values from one section to another. Sections must be
- * compatible in size and shape.
- *
- * @param dest Section to copy values into.
- * @param src Section to copy values from.
- */
- static
- void copyValues(const ALE::Obj<real_section_type>& dest,
- const ALE::Obj<real_section_type>& src);
-
-
-// NOT IMPLEMENTED //////////////////////////////////////////////////////
-private :
-
- /// Not implemented
- FieldOps(const FieldOps&);
-
- /// Not implemented
- const FieldOps& operator=(const FieldOps&);
-
-
-}; // FieldOps
-
-#endif // pylith_topology_fieldops_hh
-
-
-// End of file
Modified: short/3D/PyLith/branches/pylith-swig/libsrc/topology/Fields.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/topology/Fields.hh 2009-02-06 01:27:43 UTC (rev 14024)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/topology/Fields.hh 2009-02-06 05:23:10 UTC (rev 14025)
@@ -25,7 +25,7 @@
#include "FieldBase.hh" // USES FieldBase::DomainEnum
// Fields ---------------------------------------------------------------
-template<typename field_type, typename mesh_type>
+template<typename field_type>
class pylith::topology::Fields
{ // Fields
friend class TestFieldsMesh; // unit testing
@@ -38,7 +38,7 @@
*
* @param mesh Finite-element mesh.
*/
- Fields(const mesh_type& mesh);
+ Fields(const typename field_type::Mesh& mesh);
/// Destructor.
~Fields(void);
@@ -92,7 +92,7 @@
private :
map_type _fields;
- const mesh_type& _mesh;
+ const typename field_type::Mesh& _mesh;
// NOT IMPLEMENTED //////////////////////////////////////////////////////
private :
Modified: short/3D/PyLith/branches/pylith-swig/libsrc/topology/Fields.icc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/topology/Fields.icc 2009-02-06 01:27:43 UTC (rev 14024)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/topology/Fields.icc 2009-02-06 05:23:10 UTC (rev 14025)
@@ -17,24 +17,24 @@
// ----------------------------------------------------------------------
// Default constructor.
-template<typename field_type, typename mesh_type>
-pylith::topology::Fields<field_type, mesh_type>::Fields(const mesh_type& mesh) :
+template<typename field_type>
+pylith::topology::Fields<field_type>::Fields(const field_type::Mesh& mesh) :
_mesh(mesh)
{ // constructor
} // constructor
// ----------------------------------------------------------------------
// Destructor.
-template<typename field_type, typename mesh_type>
-pylith::topology::Fields<field_type, mesh_type>::~Fields(void)
+template<typename field_type>
+pylith::topology::Fields<field_type>::~Fields(void)
{ // destructor
} // destructor
// ----------------------------------------------------------------------
// Add field.
-template<typename field_type, typename mesh_type>
+template<typename field_type>
void
-pylith::topology::Fields<field_type, mesh_type>::add(const char* name)
+pylith::topology::Fields<field_type>::add(const char* name)
{ // add
typename map_type::iterator iter = _fields.find(name);
if (iter != _fields.end()) {
@@ -49,9 +49,9 @@
// ----------------------------------------------------------------------
// Add field.
-template<typename field_type, typename mesh_type>
+template<typename field_type>
void
-pylith::topology::Fields<field_type, mesh_type>::add(const char* name,
+pylith::topology::Fields<field_type>::add(const char* name,
const FieldBase::DomainEnum domain,
const int fiberDim)
{ // add
@@ -69,9 +69,9 @@
// ----------------------------------------------------------------------
// Delete field.
-template<typename field_type, typename mesh_type>
+template<typename field_type>
void
-pylith::topology::Fields<field_type, mesh_type>::del(const char* name)
+pylith::topology::Fields<field_type>::del(const char* name)
{ // del
typename map_type::iterator iter = _fields.find(name);
if (iter == _fields.end()) {
@@ -86,9 +86,9 @@
// ----------------------------------------------------------------------
// Get field.
-template<typename field_type, typename mesh_type>
+template<typename field_type>
const field_type&
-pylith::topology::Fields<field_type, mesh_type>::get(const char* name) const
+pylith::topology::Fields<field_type>::get(const char* name) const
{ // get
typename map_type::const_iterator iter = _fields.find(name);
if (iter == _fields.end()) {
@@ -102,9 +102,9 @@
// ----------------------------------------------------------------------
// Get field.
-template<typename field_type, typename mesh_type>
+template<typename field_type>
field_type&
-pylith::topology::Fields<field_type, mesh_type>::get(const char* name)
+pylith::topology::Fields<field_type>::get(const char* name)
{ // get
typename map_type::iterator iter = _fields.find(name);
if (iter == _fields.end()) {
@@ -118,9 +118,9 @@
// ----------------------------------------------------------------------
// Copy layout to other fields.
-template<typename field_type, typename mesh_type>
+template<typename field_type>
void
-pylith::topology::Fields<field_type, mesh_type>::copyLayout(const char* name)
+pylith::topology::Fields<field_type>::copyLayout(const char* name)
{ // copyLayout
typename map_type::const_iterator src = _fields.find(name);
if (src == _fields.end()) {
Modified: short/3D/PyLith/branches/pylith-swig/libsrc/topology/MeshOps.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/topology/MeshOps.cc 2009-02-06 01:27:43 UTC (rev 14024)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/topology/MeshOps.cc 2009-02-06 05:23:10 UTC (rev 14025)
@@ -31,6 +31,8 @@
int* const materialIds,
const int numMaterials)
{ // checkMaterialIds
+ typedef Mesh::SieveMesh SieveMesh;
+
assert( (0 == numMaterials && 0 == materialIds) ||
(0 < numMaterials && 0 != materialIds) );
Modified: short/3D/PyLith/branches/pylith-swig/libsrc/topology/MeshOps.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/topology/MeshOps.hh 2009-02-06 01:27:43 UTC (rev 14024)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/topology/MeshOps.hh 2009-02-06 05:23:10 UTC (rev 14025)
@@ -33,7 +33,7 @@
/** Check to make sure material id of every cell matches the id of
* one of the materials.
*
- * @param mesh PETSc mesh.
+ * @param mesh Finite-element mesh.
* @param materialIds Array of ids for all materials and cohesive
* cell interfaces.
* @param numMaterials Size of array.
@@ -47,13 +47,11 @@
// NOT IMPLEMENTED //////////////////////////////////////////////////////
private :
- /// Not implemented
- MeshOps(const MeshOps&);
+ MeshOps(void); ///< Not Implemented
+ MeshOps(const MeshOps&); ///< Not implemented
+ const MeshOps& operator=(const MeshOps&); ///< Not implemented
- /// Not implemented
- const MeshOps& operator=(const MeshOps&);
-
}; // MeshOps
#endif // pylith_topology_meshops_hh
Modified: short/3D/PyLith/branches/pylith-swig/libsrc/topology/topologyfwd.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/topology/topologyfwd.hh 2009-02-06 01:27:43 UTC (rev 14024)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/topology/topologyfwd.hh 2009-02-06 05:23:10 UTC (rev 14025)
@@ -27,20 +27,17 @@
class Mesh;
class SubMesh;
template<typename mesh_type> class Field;
-
-#if 0
- class MeshOps;
-
template<typename field_type> class Fields;
typedef Fields<Field<Mesh> > FieldsMesh;
typedef Fields<Field<SubMesh> > FieldsSubMesh;
class SolutionFields;
+ class MeshOps;
+
class Distributor;
class MeshRefiner;
class RefineUniform;
-#endif
} // topology
} // pylith
Modified: short/3D/PyLith/branches/pylith-swig/libsrc/utils/sievefwd.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/utils/sievefwd.hh 2009-02-06 01:27:43 UTC (rev 14024)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/utils/sievefwd.hh 2009-02-06 05:23:10 UTC (rev 14025)
@@ -19,7 +19,6 @@
#if !defined(pylith_utils_sievefwd_hh)
#define pylith_utils_sievefwd_hh
-#include <ALE.hh>
/// Namespace for Sieve package.
namespace ALE {
Modified: short/3D/PyLith/branches/pylith-swig/modulesrc/topology/SubMesh.i
===================================================================
--- short/3D/PyLith/branches/pylith-swig/modulesrc/topology/SubMesh.i 2009-02-06 01:27:43 UTC (rev 14024)
+++ short/3D/PyLith/branches/pylith-swig/modulesrc/topology/SubMesh.i 2009-02-06 05:23:10 UTC (rev 14025)
@@ -19,7 +19,6 @@
namespace pylith {
namespace topology {
- template<typename mesh_type>
class SubMesh
{ // SubMesh
@@ -34,7 +33,7 @@
* @param mesh Finite-element mesh over domain.
* @param label Label for vertices marking boundary.
*/
- SubMesh(const mesh_type& mesh,
+ SubMesh(const Mesh& mesh,
const char* label);
/// Default destructor
@@ -45,7 +44,7 @@
* @param mesh Finite-element mesh over domain.
* @param label Label for vertices marking boundary.
*/
- void createSubMesh(const mesh_type& mesh,
+ void createSubMesh(const Mesh& mesh,
const char* label);
/** Get coordinate system.
Modified: short/3D/PyLith/branches/pylith-swig/modulesrc/topology/topology.i
===================================================================
--- short/3D/PyLith/branches/pylith-swig/modulesrc/topology/topology.i 2009-02-06 01:27:43 UTC (rev 14024)
+++ short/3D/PyLith/branches/pylith-swig/modulesrc/topology/topology.i 2009-02-06 05:23:10 UTC (rev 14025)
@@ -54,7 +54,7 @@
// Template instatiation
%template(MeshField) pylith::topology::Field<pylith::topology::Mesh>;
-%template(SubMeshField) pylith::topology::Field<pylith::topology::SubMesh<pylith::topology::Mesh> >;
+%template(SubMeshField) pylith::topology::Field<pylith::topology::SubMesh>;
// End of file
Modified: short/3D/PyLith/branches/pylith-swig/pylith/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/Makefile.am 2009-02-06 01:27:43 UTC (rev 14024)
+++ short/3D/PyLith/branches/pylith-swig/pylith/Makefile.am 2009-02-06 05:23:10 UTC (rev 14025)
@@ -114,8 +114,7 @@
topology/FieldsManager.py \
topology/Mesh.py \
topology/SubMesh.py \
- topology/MeshField.py \
- topology/SubMeshField.py \
+ topology/Field.py \
topology/MeshGenerator.py \
topology/MeshImporter.py \
topology/MeshRefiner.py \
Modified: short/3D/PyLith/branches/pylith-swig/pylith/topology/__init__.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/pylith/topology/__init__.py 2009-02-06 01:27:43 UTC (rev 14024)
+++ short/3D/PyLith/branches/pylith-swig/pylith/topology/__init__.py 2009-02-06 05:23:10 UTC (rev 14025)
@@ -15,8 +15,9 @@
## @brief Python PyLith finite-element topology module initialization
__all__ = ['Distributor',
- 'FieldsManager',
'Mesh',
+ 'SubMesh',
+ 'Field',
'MeshGenSimple',
'MeshGenerator',
'MeshImporter',
Modified: short/3D/PyLith/branches/pylith-swig/unittests/pytests/topology/TestMeshField.py
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/pytests/topology/TestMeshField.py 2009-02-06 01:27:43 UTC (rev 14024)
+++ short/3D/PyLith/branches/pylith-swig/unittests/pytests/topology/TestMeshField.py 2009-02-06 05:23:10 UTC (rev 14025)
@@ -16,7 +16,7 @@
import unittest
-from pylith.topology.MeshField import MeshField
+from pylith.topology.Field import MeshField
# ----------------------------------------------------------------------
class TestMeshField(unittest.TestCase):
More information about the CIG-COMMITS
mailing list