[cig-commits] r5093 - in short/3D/PyLith/trunk: libsrc/feassemble
unittests/libtests/feassemble
brad at geodynamics.org
brad at geodynamics.org
Wed Oct 25 17:28:07 PDT 2006
Author: brad
Date: 2006-10-25 17:28:07 -0700 (Wed, 25 Oct 2006)
New Revision: 5093
Added:
short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity3D.cc
short/3D/PyLith/trunk/libsrc/feassemble/IntegratorInertia3D.cc
short/3D/PyLith/trunk/libsrc/feassemble/IntegratorInertia3D.hh
short/3D/PyLith/trunk/libsrc/feassemble/IntegratorInertia3D.icc
Modified:
short/3D/PyLith/trunk/libsrc/feassemble/Integrator.cc
short/3D/PyLith/trunk/libsrc/feassemble/Integrator.hh
short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity3D.hh
short/3D/PyLith/trunk/libsrc/feassemble/Makefile.am
short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.hh
short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.icc
short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1D.cc
short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1D.hh
short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din2D.cc
short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din2D.hh
short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din3D.cc
short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din3D.hh
short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2D.cc
short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2D.hh
short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2Din3D.cc
short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2Din3D.hh
short/3D/PyLith/trunk/libsrc/feassemble/Quadrature3D.cc
short/3D/PyLith/trunk/libsrc/feassemble/Quadrature3D.hh
short/3D/PyLith/trunk/unittests/libtests/feassemble/TestQuadrature.cc
Log:
Continued setting up Integrator object. Switched Quadrature::_computeGeometry from protected to public (dropped leading underscore), because it seems to make more sense for an integrator to hold a quadrature object rather than inherit from it. Added accessors to Quadrature and updated unit tests to check accessors.
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Integrator.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Integrator.cc 2006-10-25 14:19:37 UTC (rev 5092)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Integrator.cc 2006-10-26 00:28:07 UTC (rev 5093)
@@ -12,14 +12,10 @@
#include <portinfo>
+#include "Quadrature.hh"
+
#include "Integrator.hh" // implementation of class methods
-#include "Quadrature.hh" // USES Quadrature
-
-#include <assert.h> // USES assert()
-#include <stdexcept> // USES std::runtime_error
-#include <sstream> // USES std::ostringstream
-
// ----------------------------------------------------------------------
// Constructor
pylith::feassemble::Integrator::Integrator(void) :
@@ -36,19 +32,18 @@
// ----------------------------------------------------------------------
// Copy constructor
-pylith::feassemble::Integrator::Integrator(const Integrator& i) :
- _quadrature(0)
+pylith::feassemble::Integrator::Integrator(const Integrator& i)
{ // copy constructor
if (0 != i._quadrature)
_quadrature = i._quadrature->clone();
} // copy constructor
// ----------------------------------------------------------------------
-// Set quadrature for integration.
+// Set quadrature for integrating finite-element quantities.
void
pylith::feassemble::Integrator::quadrature(const Quadrature* q)
{ // quadrature
- delete _quadrature;
+ delete _quadrature;
_quadrature = (0 != q) ? q->clone() : 0;
} // quadrature
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Integrator.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Integrator.hh 2006-10-25 14:19:37 UTC (rev 5092)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Integrator.hh 2006-10-26 00:28:07 UTC (rev 5093)
@@ -19,7 +19,7 @@
#if !defined(pylith_feassemble_integrator_hh)
#define pylith_feassemble_integrator_hh
-#include <Mesh.hh>
+#include <Mesh.hh> // USES Mesh
#include "pylith/utils/petscfwd.h" // USES PetscMat
namespace pylith {
@@ -49,12 +49,6 @@
virtual
Integrator* clone(void) const = 0;
- /** Set quadrature for integration.
- *
- * @param q Quadrature object
- */
- void quadrature(const Quadrature* q);
-
/** Integrate elasticity term for 3-D finite elements.
*
* @param fieldOut Output field
@@ -66,19 +60,21 @@
const ALE::Obj<ALE::Mesh::real_section_type>& fieldIn,
const ALE::Obj<ALE::Mesh::real_section_type>& coordinates) = 0;
- /** Compute tangent stiffness matrix.
+ /** Compute matrix associated with operator.
*
* @param mat Sparse matrix
- * @param fieldOut Output field
- * @param fieldIn Input field
* @param coordinates Field of cell vertex coordinates
*/
virtual
void integrate(PetscMat* mat,
- const ALE::Obj<ALE::Mesh::real_section_type>& A,
- const ALE::Obj<ALE::Mesh::real_section_type>& F,
const ALE::Obj<ALE::Mesh::real_section_type>& coordinates) = 0;
+ /** Set quadrature for integrating finite-element quantities.
+ *
+ * @param q Quadrature for integrating.
+ */
+ void quadrature(const Quadrature* q);
+
// PROTECTED METHODS ////////////////////////////////////////////////////
protected :
@@ -97,7 +93,7 @@
// PRIVATE MEMBERS //////////////////////////////////////////////////////
private :
- Quadrature* _quadrature; ///< Pointer to quadrature for integration
+ Quadrature* _quadrature; ///< Quadrature for integrating finite-element
}; // Integrator
Added: short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity3D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity3D.cc 2006-10-25 14:19:37 UTC (rev 5092)
+++ short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity3D.cc 2006-10-26 00:28:07 UTC (rev 5093)
@@ -0,0 +1,58 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#include <portinfo>
+
+#include "IntegratorElasticity3D.hh" // implementation of class methods
+
+#include "petscmat.h" // USES PetscMat
+
+#include <assert.h> // USES assert()
+
+// ----------------------------------------------------------------------
+// Constructor
+pylith::feassemble::IntegratorElasticity3D::IntegratorElasticity3D(void)
+{ // constructor
+} // constructor
+
+// ----------------------------------------------------------------------
+// Destructor
+pylith::feassemble::IntegratorElasticity3D::~IntegratorElasticity3D(void)
+{ // destructor
+} // destructor
+
+// ----------------------------------------------------------------------
+// Copy constructor.
+pylith::feassemble::IntegratorElasticity3D::IntegratorElasticity3D(const IntegratorElasticity3D& i) :
+ Integrator(i)
+{ // copy constructor
+} // copy constructor
+
+// ----------------------------------------------------------------------
+// Integrate elasticity term for 3-D finite elements.
+void
+pylith::feassemble::IntegratorElasticity3D::integrateAction(const ALE::Obj<ALE::Mesh::real_section_type>& fieldOut,
+ const ALE::Obj<ALE::Mesh::real_section_type>& fieldIn,
+ const ALE::Obj<ALE::Mesh::real_section_type>& coordinates)
+{ // integrateAction
+} // integrateAction
+
+// ----------------------------------------------------------------------
+// Compute matrix associated with operator.
+void
+pylith::feassemble::IntegratorElasticity3D::integrate(PetscMat* mat,
+ const ALE::Obj<ALE::Mesh::real_section_type>& coordinates)
+{ // integrate
+} // integrate
+
+
+// End of file
Modified: short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity3D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity3D.hh 2006-10-25 14:19:37 UTC (rev 5092)
+++ short/3D/PyLith/trunk/libsrc/feassemble/IntegratorElasticity3D.hh 2006-10-26 00:28:07 UTC (rev 5093)
@@ -46,20 +46,21 @@
/** Integrate elasticity term for 3-D finite elements.
*
- * @param
+ * @param fieldOut Output field
+ * @param fieldIn Input field
+ * @param coordinates Field of cell vertex coordinates
*/
- void integrateAction(const ALE::Mesh::Obj<section_type>& A,
- const ALE::Mesh::Obj<section_type>& F,
- const ALE::Mesh::Obj<section_type>& coordinates);
+ void integrateAction(const ALE::Obj<ALE::Mesh::real_section_type>& fieldOut,
+ const ALE::Obj<ALE::Mesh::real_section_type>& fieldIn,
+ const ALE::Obj<ALE::Mesh::real_section_type>& coordinates);
- /** Compute tangent stiffness matrix.
+ /** Compute matrix associated with operator.
*
- * @param
+ * @param mat Sparse matrix
+ * @param coordinates Field of cell vertex coordinates
*/
- void integrate(PetscMat& mat,
- const ALE::Mesh::Obj<section_type>& A,
- const ALE::Mesh::Obj<section_type>& F,
- const ALE::Mesh::Obj<section_type>& coordinates);
+ void integrate(PetscMat* mat,
+ const ALE::Obj<ALE::Mesh::real_section_type>& coordinates);
// PROTECTED METHODS ////////////////////////////////////////////////////
protected :
@@ -80,6 +81,6 @@
#include "IntegratorElasticity3D.icc" // inline methods
-#endif // pylith_feassemble_quadrature3d_hh
+#endif // pylith_feassemble_integratorelasticity3d_hh
// End of file
Added: short/3D/PyLith/trunk/libsrc/feassemble/IntegratorInertia3D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/IntegratorInertia3D.cc 2006-10-25 14:19:37 UTC (rev 5092)
+++ short/3D/PyLith/trunk/libsrc/feassemble/IntegratorInertia3D.cc 2006-10-26 00:28:07 UTC (rev 5093)
@@ -0,0 +1,58 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#include <portinfo>
+
+#include "IntegratorInertia3D.hh" // implementation of class methods
+
+#include "petscmat.h" // USES PetscMat
+
+#include <assert.h> // USES assert()
+
+// ----------------------------------------------------------------------
+// Constructor
+pylith::feassemble::IntegratorInertia3D::IntegratorInertia3D(void)
+{ // constructor
+} // constructor
+
+// ----------------------------------------------------------------------
+// Destructor
+pylith::feassemble::IntegratorInertia3D::~IntegratorInertia3D(void)
+{ // destructor
+} // destructor
+
+// ----------------------------------------------------------------------
+// Copy constructor.
+pylith::feassemble::IntegratorInertia3D::IntegratorInertia3D(const IntegratorInertia3D& i) :
+ Integrator(i)
+{ // copy constructor
+} // copy constructor
+
+// ----------------------------------------------------------------------
+// Integrate inertial term for 3-D finite elements.
+void
+pylith::feassemble::IntegratorInertia3D::integrateAction(const ALE::Obj<ALE::Mesh::real_section_type>& fieldOut,
+ const ALE::Obj<ALE::Mesh::real_section_type>& fieldIn,
+ const ALE::Obj<ALE::Mesh::real_section_type>& coordinates)
+{ // integrateAction
+} // integrateAction
+
+// ----------------------------------------------------------------------
+// Compute matrix associated with operator.
+void
+pylith::feassemble::IntegratorInertia3D::integrate(PetscMat* mat,
+ const ALE::Obj<ALE::Mesh::real_section_type>& coordinates)
+{ // integrate
+} // integrate
+
+
+// End of file
Added: short/3D/PyLith/trunk/libsrc/feassemble/IntegratorInertia3D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/IntegratorInertia3D.hh 2006-10-25 14:19:37 UTC (rev 5092)
+++ short/3D/PyLith/trunk/libsrc/feassemble/IntegratorInertia3D.hh 2006-10-26 00:28:07 UTC (rev 5093)
@@ -0,0 +1,86 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+/**
+ * @file pylith/feassemble/IntegratorInertia3D.hh
+ *
+ * @brief Integrate inertial term for 3-D finite elements.
+ */
+
+#if !defined(pylith_feassemble_integratorinertia3d_hh)
+#define pylith_feassemble_integratorinertia3d_hh
+
+#include "Integrator.hh"
+
+namespace pylith {
+ namespace feassemble {
+ class IntegratorInertia3D;
+ class TestIntegratorInertia3D;
+ } // feassemble
+} // pylith
+
+class pylith::feassemble::IntegratorInertia3D : public Integrator
+{ // Integrator1D
+ friend class TestIntegratorInertia3D; // unit testing
+
+// PUBLIC MEMBERS ///////////////////////////////////////////////////////
+public :
+
+ /// Constructor
+ IntegratorInertia3D(void);
+
+ /// Destructor
+ ~IntegratorInertia3D(void);
+
+ /// Create a copy of this object.
+ Integrator* clone(void) const;
+
+ /** Integrate inertial term for 3-D finite elements.
+ *
+ * @param fieldOut Output field
+ * @param fieldIn Input field
+ * @param coordinates Field of cell vertex coordinates
+ */
+ void integrateAction(const ALE::Obj<ALE::Mesh::real_section_type>& fieldOut,
+ const ALE::Obj<ALE::Mesh::real_section_type>& fieldIn,
+ const ALE::Obj<ALE::Mesh::real_section_type>& coordinates);
+
+ /** Compute matrix associated with operator.
+ *
+ * @param mat Sparse matrix
+ * @param coordinates Field of cell vertex coordinates
+ */
+ void integrate(PetscMat* mat,
+ const ALE::Obj<ALE::Mesh::real_section_type>& coordinates);
+
+// PROTECTED METHODS ////////////////////////////////////////////////////
+protected :
+
+ /** Copy constructor.
+ *
+ * @param i Integrator to copy
+ */
+ IntegratorInertia3D(const IntegratorInertia3D& i);
+
+// PRIVATE METHODS //////////////////////////////////////////////////////
+private :
+
+ /// Not implemented
+ const IntegratorInertia3D& operator=(const IntegratorInertia3D&);
+
+}; // IntegratorInertia3D
+
+#include "IntegratorInertia3D.icc" // inline methods
+
+#endif // pylith_feassemble_integratorineria3d_hh
+
+// End of file
Added: short/3D/PyLith/trunk/libsrc/feassemble/IntegratorInertia3D.icc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/IntegratorInertia3D.icc 2006-10-25 14:19:37 UTC (rev 5092)
+++ short/3D/PyLith/trunk/libsrc/feassemble/IntegratorInertia3D.icc 2006-10-26 00:28:07 UTC (rev 5093)
@@ -0,0 +1,26 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#if !defined(pylith_feassemble_integratorinertia3d_hh)
+#error "IntegratorInertia3D.icc must be included only from IntegratorInertia3D.hh"
+#else
+
+// Create a copy of this object.
+inline
+pylith::feassemble::Integrator*
+pylith::feassemble::IntegratorInertia3D::clone(void) const {
+ return new IntegratorInertia3D(*this);
+} // clone
+
+#endif
+
+// End of file
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Makefile.am 2006-10-25 14:19:37 UTC (rev 5092)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Makefile.am 2006-10-26 00:28:07 UTC (rev 5093)
@@ -17,6 +17,8 @@
libpylithfeassemble_la_SOURCES = \
Integrator.cc \
+ IntegratorElasticity3D.cc \
+ IntegratorInertia3D.cc \
Quadrature.cc \
Quadrature1D.cc \
Quadrature1Din2D.cc \
@@ -27,6 +29,10 @@
subpkginclude_HEADERS = \
Integrator.hh \
+ IntegratorElasticity3D.hh \
+ IntegratorElasticity3D.icc \
+ IntegratorInertia3D.hh \
+ IntegratorInertia3D.icc \
Quadrature.hh \
Quadrature.icc \
Quadrature1D.hh \
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.hh 2006-10-25 14:19:37 UTC (rev 5092)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.hh 2006-10-26 00:28:07 UTC (rev 5093)
@@ -112,30 +112,91 @@
*/
double minJacobian(void);
-// PROTECTED METHODS ////////////////////////////////////////////////////
-protected :
+ /** Get basis fns evaluated at quadrature points.
+ *
+ * @returns Array of basis fns evaluated at quadrature points
+ */
+ const double* basis(void) const;
- /** Copy constructor.
+ /** Get derivatives of basis fns evaluated at quadrature points.
*
- * @param q Quadrature to copy
+ * @returns Array of derivatives of basis fns evaluated at
+ * quadrature points
*/
- Quadrature(const Quadrature& q);
+ const double* basisDeriv(void) const;
+ /** Get coordinates of quadrature points in cell (NOT reference cell).
+ *
+ * @returns Array of coordinates of quadrature points in cell
+ */
+ const double* quadPts(void) const;
+
+ /** Get weights of quadrature points.
+ *
+ * @returns Weights of quadrature points
+ */
+ const double* quadWts(void) const;
+
+ /** Get Jacobian inverses evaluated at quadrature points.
+ *
+ * @returns Array of Jacobian inverses evaluated at quadrature points.
+ */
+ const double* jacobianInv(void) const;
+
+ /** Get determinants of Jacobian evaluated at quadrature points.
+ *
+ * @returns Array of determinants of Jacobian evaluated at quadrature pts
+ */
+ const double* jacobianDet(void) const;
+
+ /** Get number of dimensions in reference cell.
+ *
+ * @returns Number of dimensions in reference cell
+ */
+ int cellDim(void) const;
+
+ /** Get number of vertices in cell.
+ *
+ * @returns Number of vertices in cell
+ */
+ int numCorners(void) const;
+
+ /** Get number of quadrature points.
+ *
+ * @returns Number of quadrature points
+ */
+ int numQuadPts(void) const;
+
+ /** Get number of dimensions in coordinates of cell vertices.
+ *
+ * @returns Number of dimensions in coordinates of cell vertices
+ */
+ int spaceDim(void) const;
+
/** Compute geometric quantities for a cell.
*
* @param coordinates Section containing vertex coordinates
* @param cell Finite-element cell
*/
virtual
- void _computeGeometry(const ALE::Obj<ALE::Mesh::real_section_type>& coordinates,
- const ALE::Mesh::point_type& cell) = 0;
+ void computeGeometry(const ALE::Obj<ALE::Mesh::real_section_type>& coordinates,
+ const ALE::Mesh::point_type& cell) = 0;
- /// Set entries in geometry arrays to zero.
- void _resetGeometry(void);
+// PROTECTED METHODS ////////////////////////////////////////////////////
+protected :
+ /** Copy constructor.
+ *
+ * @param q Quadrature to copy
+ */
+ Quadrature(const Quadrature& q);
+
/// Check determinant of Jacobian against minimum allowable value
void _checkJacobianDet(const double det) const;
+ /// Set entries in geometry arrays to zero.
+ void _resetGeometry(void);
+
// PRIVATE METHODS //////////////////////////////////////////////////////
private :
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.icc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.icc 2006-10-25 14:19:37 UTC (rev 5092)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.icc 2006-10-26 00:28:07 UTC (rev 5093)
@@ -28,6 +28,76 @@
_minJacobian = min;
}
+// Get basis fns evaluated at quadrature points.
+inline
+const double*
+pylith::feassemble::Quadrature::basis(void) const {
+ return _basis;
+}
+
+// Get derivatives of basis fns evaluated at quadrature points.
+inline
+const double*
+pylith::feassemble::Quadrature::basisDeriv(void) const {
+ return _basisDeriv;
+}
+
+// Get coordinates of quadrature points in cell (NOT reference cell).
+inline
+const double*
+pylith::feassemble::Quadrature::quadPts(void) const {
+ return _quadPts;
+}
+
+// Get weights of quadrature points.
+inline
+const double*
+pylith::feassemble::Quadrature::quadWts(void) const {
+ return _quadWts;
+}
+
+// Get Jacobian inverses evaluated at quadrature points.
+inline
+const double*
+pylith::feassemble::Quadrature::jacobianInv(void) const {
+ return _jacobianInv;
+}
+
+// Get determinants of Jacobian evaluated at quadrature points.
+inline
+const double*
+pylith::feassemble::Quadrature::jacobianDet(void) const {
+ return _jacobianDet;
+}
+
+// Get number of dimensions in reference cell.
+inline
+int
+pylith::feassemble::Quadrature::cellDim(void) const {
+ return _cellDim;
+}
+
+// Get number of vertices in cell.
+inline
+int
+pylith::feassemble::Quadrature::numCorners(void) const {
+ return _numCorners;
+}
+
+// Get number of quadrature points.
+inline
+int
+pylith::feassemble::Quadrature::numQuadPts(void) const {
+ return _numQuadPts;
+}
+
+// Get number of dimensions in coordinates of cell vertices.
+inline
+int
+pylith::feassemble::Quadrature::spaceDim(void) const {
+ return _spaceDim;
+}
+
#endif
// End of file
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1D.cc 2006-10-25 14:19:37 UTC (rev 5092)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1D.cc 2006-10-26 00:28:07 UTC (rev 5093)
@@ -38,10 +38,10 @@
// ----------------------------------------------------------------------
// Compute geometric quantities for a cell.
void
-pylith::feassemble::Quadrature1D::_computeGeometry(
+pylith::feassemble::Quadrature1D::computeGeometry(
const ALE::Obj<ALE::Mesh::real_section_type>& coordinates,
const ALE::Mesh::point_type& cell)
-{ // _computeGeometry
+{ // computeGeometry
assert(1 == _cellDim);
assert(1 == _spaceDim);
assert(0 != _basisDeriv);
@@ -85,6 +85,6 @@
// Jinv = 1/j00
_jacobianInv[iQuadPt] = 1.0/_jacobianDet[iQuadPt];
} // for
-} // _computeGeometry
+} // computeGeometry
// End of file
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1D.hh 2006-10-25 14:19:37 UTC (rev 5092)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1D.hh 2006-10-26 00:28:07 UTC (rev 5093)
@@ -39,12 +39,14 @@
Quadrature1D(void);
/// Destructor
- virtual ~Quadrature1D(void);
+ ~Quadrature1D(void);
/// Create a copy of this object.
- virtual
Quadrature* clone(void) const;
+ void computeGeometry(const ALE::Obj<ALE::Mesh::real_section_type>& coordinates,
+ const ALE::Mesh::point_type& cell);
+
// PROTECTED METHODS ////////////////////////////////////////////////////
protected :
@@ -54,14 +56,6 @@
*/
Quadrature1D(const Quadrature1D& q);
- /** Compute geometric quantities for a cell.
- *
- * @param coordinates Section containing vertex coordinates
- * @param cell Finite-element cell
- */
- void _computeGeometry(const ALE::Obj<ALE::Mesh::real_section_type>& coordinates,
- const ALE::Mesh::point_type& cell);
-
// PRIVATE METHODS //////////////////////////////////////////////////////
private :
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din2D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din2D.cc 2006-10-25 14:19:37 UTC (rev 5092)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din2D.cc 2006-10-26 00:28:07 UTC (rev 5093)
@@ -38,10 +38,10 @@
// ----------------------------------------------------------------------
// Compute geometric quantities for a cell.
void
-pylith::feassemble::Quadrature1Din2D::_computeGeometry(
+pylith::feassemble::Quadrature1Din2D::computeGeometry(
const ALE::Obj<ALE::Mesh::real_section_type>& coordinates,
const ALE::Mesh::point_type& cell)
-{ // _computeGeometry
+{ // computeGeometry
assert(1 == _cellDim);
assert(2 == _spaceDim);
assert(0 != _basisDeriv);
@@ -104,6 +104,6 @@
for (int iDim=0, iJ=iQuadPt*_spaceDim; iDim < _spaceDim; ++iDim)
_jacobianInv[iJ+iDim] = 1.0/_jacobian[iJ+iDim];
} // for
-} // _computeGeometry
+} // computeGeometry
// End of file
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din2D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din2D.hh 2006-10-25 14:19:37 UTC (rev 5092)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din2D.hh 2006-10-26 00:28:07 UTC (rev 5093)
@@ -39,12 +39,19 @@
Quadrature1Din2D(void);
/// Destructor
- virtual ~Quadrature1Din2D(void);
+ ~Quadrature1Din2D(void);
/// Create a copy of this object.
- virtual
Quadrature* clone(void) const;
+ /** Compute geometric quantities for a cell.
+ *
+ * @param coordinates Section containing vertex coordinates
+ * @param cell Finite-element cell
+ */
+ void computeGeometry(const ALE::Obj<ALE::Mesh::real_section_type>& coordinates,
+ const ALE::Mesh::point_type& cell);
+
// PROTECTED METHODS ////////////////////////////////////////////////////
protected :
@@ -54,14 +61,6 @@
*/
Quadrature1Din2D(const Quadrature1Din2D& q);
- /** Compute geometric quantities for a cell.
- *
- * @param coordinates Section containing vertex coordinates
- * @param cell Finite-element cell
- */
- void _computeGeometry(const ALE::Obj<ALE::Mesh::real_section_type>& coordinates,
- const ALE::Mesh::point_type& cell);
-
// PRIVATE METHODS //////////////////////////////////////////////////////
private :
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din3D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din3D.cc 2006-10-25 14:19:37 UTC (rev 5092)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din3D.cc 2006-10-26 00:28:07 UTC (rev 5093)
@@ -38,10 +38,10 @@
// ----------------------------------------------------------------------
// Compute geometric quantities for a cell.
void
-pylith::feassemble::Quadrature1Din3D::_computeGeometry(
+pylith::feassemble::Quadrature1Din3D::computeGeometry(
const ALE::Obj<ALE::Mesh::real_section_type>& coordinates,
const ALE::Mesh::point_type& cell)
-{ // _computeGeometry
+{ // computeGeometry
assert(1 == _cellDim);
assert(3 == _spaceDim);
assert(0 != _basisDeriv);
@@ -106,6 +106,6 @@
for (int iDim=0, iJ=iQuadPt*_spaceDim; iDim < _spaceDim; ++iDim)
_jacobianInv[iJ+iDim] = 1.0/_jacobian[iJ+iDim];
} // for
-} // _computeGeometry
+} // computeGeometry
// End of file
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din3D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din3D.hh 2006-10-25 14:19:37 UTC (rev 5092)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature1Din3D.hh 2006-10-26 00:28:07 UTC (rev 5093)
@@ -39,12 +39,19 @@
Quadrature1Din3D(void);
/// Destructor
- virtual ~Quadrature1Din3D(void);
+ ~Quadrature1Din3D(void);
/// Create a copy of this object.
- virtual
Quadrature* clone(void) const;
+ /** Compute geometric quantities for a cell.
+ *
+ * @param coordinates Section containing vertex coordinates
+ * @param cell Finite-element cell
+ */
+ void computeGeometry(const ALE::Obj<ALE::Mesh::real_section_type>& coordinates,
+ const ALE::Mesh::point_type& cell);
+
// PROTECTED METHODS ////////////////////////////////////////////////////
protected :
@@ -54,14 +61,6 @@
*/
Quadrature1Din3D(const Quadrature1Din3D& q);
- /** Compute geometric quantities for a cell.
- *
- * @param coordinates Section containing vertex coordinates
- * @param cell Finite-element cell
- */
- void _computeGeometry(const ALE::Obj<ALE::Mesh::real_section_type>& coordinates,
- const ALE::Mesh::point_type& cell);
-
// PRIVATE METHODS //////////////////////////////////////////////////////
private :
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2D.cc 2006-10-25 14:19:37 UTC (rev 5092)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2D.cc 2006-10-26 00:28:07 UTC (rev 5093)
@@ -38,10 +38,10 @@
// ----------------------------------------------------------------------
// Compute geometric quantities for a cell.
void
-pylith::feassemble::Quadrature2D::_computeGeometry(
+pylith::feassemble::Quadrature2D::computeGeometry(
const ALE::Obj<ALE::Mesh::real_section_type>& coordinates,
const ALE::Mesh::point_type& cell)
-{ // _computeGeometry
+{ // computeGeometry
assert(2 == _cellDim);
assert(2 == _spaceDim);
assert(0 != _basisDeriv);
@@ -115,6 +115,6 @@
_jacobianInv[i10] = -_jacobian[i10] / det;
_jacobianInv[i11] = _jacobian[i00] / det;
} // for
-} // _computeGeometry
+} // computeGeometry
// End of file
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2D.hh 2006-10-25 14:19:37 UTC (rev 5092)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2D.hh 2006-10-26 00:28:07 UTC (rev 5093)
@@ -39,12 +39,19 @@
Quadrature2D(void);
/// Destructor
- virtual ~Quadrature2D(void);
+ ~Quadrature2D(void);
/// Create a copy of this object.
- virtual
Quadrature* clone(void) const;
+ /** Compute geometric quantities for a cell.
+ *
+ * @param coordinates Section containing vertex coordinates
+ * @param cell Finite-element cell
+ */
+ void computeGeometry(const ALE::Obj<ALE::Mesh::real_section_type>& coordinates,
+ const ALE::Mesh::point_type& cell);
+
// PROTECTED METHODS ////////////////////////////////////////////////////
protected :
@@ -54,14 +61,6 @@
*/
Quadrature2D(const Quadrature2D& q);
- /** Compute geometric quantities for a cell.
- *
- * @param coordinates Section containing vertex coordinates
- * @param cell Finite-element cell
- */
- void _computeGeometry(const ALE::Obj<ALE::Mesh::real_section_type>& coordinates,
- const ALE::Mesh::point_type& cell);
-
// PRIVATE METHODS //////////////////////////////////////////////////////
private :
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2Din3D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2Din3D.cc 2006-10-25 14:19:37 UTC (rev 5092)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2Din3D.cc 2006-10-26 00:28:07 UTC (rev 5093)
@@ -41,10 +41,10 @@
// ----------------------------------------------------------------------
// Compute geometric quantities for a cell.
void
-pylith::feassemble::Quadrature2Din3D::_computeGeometry(
+pylith::feassemble::Quadrature2Din3D::computeGeometry(
const ALE::Obj<ALE::Mesh::real_section_type>& coordinates,
const ALE::Mesh::point_type& cell)
-{ // _computeGeometry
+{ // computeGeometry
assert(2 == _cellDim);
assert(3 == _spaceDim);
assert(0 != _basisDeriv);
@@ -191,6 +191,6 @@
} else
throw std::runtime_error("Could not invert Jacobian.");
} // for
-} // _computeGeometry
+} // computeGeometry
// End of file
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2Din3D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2Din3D.hh 2006-10-25 14:19:37 UTC (rev 5092)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature2Din3D.hh 2006-10-26 00:28:07 UTC (rev 5093)
@@ -39,12 +39,19 @@
Quadrature2Din3D(void);
/// Destructor
- virtual ~Quadrature2Din3D(void);
+ ~Quadrature2Din3D(void);
/// Create a copy of this object.
- virtual
Quadrature* clone(void) const;
+ /** Compute geometric quantities for a cell.
+ *
+ * @param coordinates Section containing vertex coordinates
+ * @param cell Finite-element cell
+ */
+ void computeGeometry(const ALE::Obj<ALE::Mesh::real_section_type>& coordinates,
+ const ALE::Mesh::point_type& cell);
+
// PROTECTED METHODS ////////////////////////////////////////////////////
protected :
@@ -54,14 +61,6 @@
*/
Quadrature2Din3D(const Quadrature2Din3D& q);
- /** Compute geometric quantities for a cell.
- *
- * @param coordinates Section containing vertex coordinates
- * @param cell Finite-element cell
- */
- void _computeGeometry(const ALE::Obj<ALE::Mesh::real_section_type>& coordinates,
- const ALE::Mesh::point_type& cell);
-
// PRIVATE METHODS //////////////////////////////////////////////////////
private :
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature3D.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature3D.cc 2006-10-25 14:19:37 UTC (rev 5092)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature3D.cc 2006-10-26 00:28:07 UTC (rev 5093)
@@ -38,10 +38,10 @@
// ----------------------------------------------------------------------
// Compute geometric quantities for a cell.
void
-pylith::feassemble::Quadrature3D::_computeGeometry(
+pylith::feassemble::Quadrature3D::computeGeometry(
const ALE::Obj<ALE::Mesh::real_section_type>& coordinates,
const ALE::Mesh::point_type& cell)
-{ // _computeGeometry
+{ // computeGeometry
assert(3 == _cellDim);
assert(3 == _spaceDim);
assert(0 != _basisDeriv);
@@ -146,6 +146,6 @@
_jacobianInv[i22] = (_jacobian[i00]*_jacobian[i11] -
_jacobian[i01]*_jacobian[i10]) / det;
} // for
-} // _computeGeometry
+} // computeGeometry
// End of file
Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature3D.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature3D.hh 2006-10-25 14:19:37 UTC (rev 5092)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature3D.hh 2006-10-26 00:28:07 UTC (rev 5093)
@@ -39,12 +39,19 @@
Quadrature3D(void);
/// Destructor
- virtual ~Quadrature3D(void);
+ ~Quadrature3D(void);
/// Create a copy of this object.
- virtual
Quadrature* clone(void) const;
+ /** Compute geometric quantities for a cell.
+ *
+ * @param coordinates Section containing vertex coordinates
+ * @param cell Finite-element cell
+ */
+ void computeGeometry(const ALE::Obj<ALE::Mesh::real_section_type>& coordinates,
+ const ALE::Mesh::point_type& cell);
+
// PROTECTED METHODS ////////////////////////////////////////////////////
protected :
@@ -54,14 +61,6 @@
*/
Quadrature3D(const Quadrature3D& q);
- /** Compute geometric quantities for a cell.
- *
- * @param coordinates Section containing vertex coordinates
- * @param cell Finite-element cell
- */
- void _computeGeometry(const ALE::Obj<ALE::Mesh::real_section_type>& coordinates,
- const ALE::Mesh::point_type& cell);
-
// PRIVATE METHODS //////////////////////////////////////////////////////
private :
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/TestQuadrature.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/TestQuadrature.cc 2006-10-25 14:19:37 UTC (rev 5092)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/TestQuadrature.cc 2006-10-26 00:28:07 UTC (rev 5093)
@@ -89,45 +89,45 @@
CPPUNIT_ASSERT(0 != qCopy);
CPPUNIT_ASSERT_EQUAL(minJacobian, qCopy->_minJacobian);
- CPPUNIT_ASSERT_EQUAL(cellDim, qCopy->_cellDim);
- CPPUNIT_ASSERT_EQUAL(numCorners, qCopy->_numCorners);
- CPPUNIT_ASSERT_EQUAL(numQuadPts, qCopy->_numQuadPts);
- CPPUNIT_ASSERT_EQUAL(spaceDim, qCopy->_spaceDim);
+ CPPUNIT_ASSERT_EQUAL(cellDim, qCopy->cellDim());
+ CPPUNIT_ASSERT_EQUAL(numCorners, qCopy->numCorners());
+ CPPUNIT_ASSERT_EQUAL(numQuadPts, qCopy->numQuadPts());
+ CPPUNIT_ASSERT_EQUAL(spaceDim, qCopy->spaceDim());
- CPPUNIT_ASSERT(0 != qCopy->_basis);
+ CPPUNIT_ASSERT(0 != qCopy->basis());
size = numCorners * numQuadPts;
for (int i=0; i < size; ++i)
- CPPUNIT_ASSERT_EQUAL(basis[i], qCopy->_basis[i]);
+ CPPUNIT_ASSERT_EQUAL(basis[i], qCopy->basis()[i]);
- CPPUNIT_ASSERT(0 != qCopy->_basisDeriv);
+ CPPUNIT_ASSERT(0 != qCopy->basisDeriv());
size = numCorners * numQuadPts * spaceDim;
for (int i=0; i < size; ++i)
- CPPUNIT_ASSERT_EQUAL(basisDeriv[i], qCopy->_basisDeriv[i]);
+ CPPUNIT_ASSERT_EQUAL(basisDeriv[i], qCopy->basisDeriv()[i]);
CPPUNIT_ASSERT(0 != qCopy->_quadPtsRef);
size = numQuadPts * cellDim;
for (int i=0; i < size; ++i)
CPPUNIT_ASSERT_EQUAL(quadPtsRef[i], qCopy->_quadPtsRef[i]);
- CPPUNIT_ASSERT(0 != qCopy->_quadWts);
+ CPPUNIT_ASSERT(0 != qCopy->quadWts());
size = numQuadPts;
for (int i=0; i < size; ++i)
- CPPUNIT_ASSERT_EQUAL(quadWts[i], qCopy->_quadWts[i]);
+ CPPUNIT_ASSERT_EQUAL(quadWts[i], qCopy->quadWts()[i]);
size = 1;
- CPPUNIT_ASSERT(0 != qCopy->_quadPts);
+ CPPUNIT_ASSERT(0 != qCopy->quadPts());
for (int i=0; i < size; ++i)
- CPPUNIT_ASSERT_EQUAL(quadPts[i], qCopy->_quadPts[i]);
+ CPPUNIT_ASSERT_EQUAL(quadPts[i], qCopy->quadPts()[i]);
CPPUNIT_ASSERT(0 != qCopy->_jacobian);
for (int i=0; i < size; ++i)
CPPUNIT_ASSERT_EQUAL(jacobian[i], qCopy->_jacobian[i]);
- CPPUNIT_ASSERT(0 != qCopy->_jacobianInv);
+ CPPUNIT_ASSERT(0 != qCopy->jacobianInv());
for (int i=0; i < size; ++i)
- CPPUNIT_ASSERT_EQUAL(jacobianInv[i], qCopy->_jacobianInv[i]);
- CPPUNIT_ASSERT(0 != qCopy->_jacobianDet);
+ CPPUNIT_ASSERT_EQUAL(jacobianInv[i], qCopy->jacobianInv()[i]);
+ CPPUNIT_ASSERT(0 != qCopy->jacobianDet());
for (int i=0; i < size; ++i)
- CPPUNIT_ASSERT_EQUAL(jacobianDet[i], qCopy->_jacobianDet[i]);
+ CPPUNIT_ASSERT_EQUAL(jacobianDet[i], qCopy->jacobianDet()[i]);
} // testCopy
// ----------------------------------------------------------------------
@@ -248,14 +248,14 @@
ALE::New::SieveBuilder<sieve_type>::buildCoordinates(
mesh->getRealSection("coordinates"), spaceDim, vertCoords);
- // Check values from _computeGeometry()
+ // Check values from computeGeometry()
const ALE::Mesh::topology_type::patch_type patch = 0;
const ALE::Obj<topology_type::label_sequence>& elements =
topology->heightStratum(patch, 0);
const topology_type::label_sequence::iterator e_iter = elements->begin();
const ALE::Obj<ALE::Mesh::real_section_type>& coordinates =
mesh->getRealSection("coordinates");
- pQuad->_computeGeometry(coordinates, *e_iter);
+ pQuad->computeGeometry(coordinates, *e_iter);
CPPUNIT_ASSERT(1 == numCells);
More information about the cig-commits
mailing list