[cig-commits] r14283 - short/3D/PyLith/branches/pylith-swig/modulesrc/feassemble
brad at geodynamics.org
brad at geodynamics.org
Mon Mar 9 20:06:07 PDT 2009
Author: brad
Date: 2009-03-09 20:06:07 -0700 (Mon, 09 Mar 2009)
New Revision: 14283
Modified:
short/3D/PyLith/branches/pylith-swig/modulesrc/feassemble/Quadrature.i
short/3D/PyLith/branches/pylith-swig/modulesrc/feassemble/QuadratureRefCell.i
short/3D/PyLith/branches/pylith-swig/modulesrc/feassemble/feassemble.i
Log:
More work on feassemble SWIG stuff.
Modified: short/3D/PyLith/branches/pylith-swig/modulesrc/feassemble/Quadrature.i
===================================================================
--- short/3D/PyLith/branches/pylith-swig/modulesrc/feassemble/Quadrature.i 2009-03-10 03:03:07 UTC (rev 14282)
+++ short/3D/PyLith/branches/pylith-swig/modulesrc/feassemble/Quadrature.i 2009-03-10 03:06:07 UTC (rev 14283)
@@ -10,142 +10,52 @@
// ======================================================================
//
-/**
- * @file pylith/feassemble/Quadrature.hh
+/** @file modulesrc/feassemble/Quadrature.i
*
- * @brief Abstract base class for integrating over finite-elements
- * using quadrature.
- *
- * This object contains the informatio needed to perform numerical
- * quadrature over a finite-element cell. It inherits quadrature
- * information over the reference cell from the QuadratureRefCell object.
-
- * Given a cell this object will compute the cell's Jacobian, the
- * determinant of the Jacobian, the inverse of the Jacobian, and the
- * coordinates in the domain of the cell's quadrature points. The
- * Jacobian and its inverse are computed at the quadrature points.
+ * @brief Python interface to C++ Quadrature object.
*/
-#if !defined(pylith_feassemble_quadrature_hh)
-#define pylith_feassemble_quadrature_hh
+namespace pylith {
+ namespace feassemble {
-// Include directives ---------------------------------------------------
-#include "QuadratureRefCell.hh" // ISA QuadratureRefCell
+ template<typename mesh_type>
+ class Quadrature : public QuadratureRefCell
+ { // Quadrature
-#include "pylith/topology/topologyfwd.hh" // forward declarations
+ // PUBLIC METHODS /////////////////////////////////////////////////
+ public :
-#include "pylith/utils/array.hh" // HASA double_array
+ /// Constructor
+ Quadrature(void);
+
+ /// Destructor
+ ~Quadrature(void);
+
+ /** Copy constructor.
+ *
+ * @param q Quadrature to copy
+ */
+ Quadrature(const Quadrature& q);
+
+ /** Set flag for checking ill-conditioning.
+ *
+ * @param flag True to check for ill-conditioning, false otherwise.
+ */
+ void checkConditioning(const bool flag);
+
+ /** Get flag for checking ill-conditioning.
+ *
+ * @returns True if checking for ill-conditioning, false otherwise.
+ */
+ bool checkConditioning(void) const;
+
+ /// Deallocate temporary storage.
+ void clear(void);
+
+ }; // Quadrature
-// Quadrature -----------------------------------------------------------
-template<typename mesh_type>
-class pylith::feassemble::Quadrature : public QuadratureRefCell
-{ // Quadrature
- friend class TestQuadrature; // unit testing
+ } // feassemble
+} // pylith
-// PUBLIC METHODS ///////////////////////////////////////////////////////
-public :
- /// Constructor
- Quadrature(void);
-
- /// Destructor
- ~Quadrature(void);
-
- /** Copy constructor.
- *
- * @param q Quadrature to copy
- */
- Quadrature(const Quadrature& q);
-
- /** Set flag for checking ill-conditioning.
- *
- * @param flag True to check for ill-conditioning, false otherwise.
- */
- void checkConditioning(const bool flag);
-
- /** Get flag for checking ill-conditioning.
- *
- * @returns True if checking for ill-conditioning, false otherwise.
- */
- bool checkConditioning(void) const;
-
- /** Get coordinates of quadrature points in cell (NOT reference cell).
- *
- * @returns Array of coordinates of quadrature points in cell
- */
- const double_array& quadPts(void) const;
-
- /** Get derivatives of basis fns evaluated at quadrature points.
- *
- * @returns Array of derivatives of basis fns evaluated at
- * quadrature points
- */
- const double_array& basisDeriv(void) const;
-
- /** Get Jacobians evaluated at quadrature points.
- *
- * @returns Array of Jacobian inverses evaluated at quadrature points.
- */
- const double_array& jacobian(void) const;
-
- /** Get determinants of Jacobian evaluated at quadrature points.
- *
- * @returns Array of determinants of Jacobian evaluated at quadrature pts
- */
- const double_array& jacobianDet(void) const;
-
- /** Precompute geometric quantities for each cell.
- *
- * @param mesh Finite-element mesh
- * @param cells Finite-element cells for geometry.
- */
- void computeGeometry(const mesh_type& mesh,
- const ALE::Obj<typename mesh_type::SieveMesh::label_sequence>& cells);
-
- /** Retrieve precomputed geometric quantities for a cell.
- *
- * @param mesh Finite-element mesh
- * @param cell Finite-element cell
- */
- void retrieveGeometry(const typename mesh_type::SieveMesh::point_type& cell);
-
- /// Deallocate temporary storage.
- void clear(void);
-
-// PRIVATE METHODS //////////////////////////////////////////////////////
-private :
-
- /// Setup quadrature engine.
- void _setupEngine(void);
-
-// PRIVATE MEMBERS //////////////////////////////////////////////////////
-private :
-
- QuadratureEngine* _engine; ///< Quadrature geometry engine.
-
- /** Fields and visitors for precomputing geometry information for
- * cells associated with this quadrature.
- */
- topology::Field<mesh_type>* _quadPtsField; ///< Coordinates of quad pts.
- topology::Field<mesh_type>* _jacobianField; ///< Jacobian at quad pts.
- topology::Field<mesh_type>* _jacobianDetField; ///< |J| at quad pts.
-
- /// Derivatives of basis fns at quad pts.
- topology::Field<mesh_type>* _basisDerivField;
-
- bool _checkConditioning; ///< True if checking for ill-conditioning.
-
-// NOT IMPLEMENTED //////////////////////////////////////////////////////
-private :
-
- const Quadrature& operator=(const Quadrature&); ///< Not implemented
-
-}; // Quadrature
-
-#include "Quadrature.icc" // inline methods
-#include "Quadrature.cc" // template methods
-
-#endif // pylith_feassemble_quadrature_hh
-
-
// End of file
Modified: short/3D/PyLith/branches/pylith-swig/modulesrc/feassemble/QuadratureRefCell.i
===================================================================
--- short/3D/PyLith/branches/pylith-swig/modulesrc/feassemble/QuadratureRefCell.i 2009-03-10 03:03:07 UTC (rev 14282)
+++ short/3D/PyLith/branches/pylith-swig/modulesrc/feassemble/QuadratureRefCell.i 2009-03-10 03:06:07 UTC (rev 14283)
@@ -102,26 +102,26 @@
*
* @returns Array of coordinates of quadrature points in reference cell.
*/
- const double_array& quadPtsRef(void) const;
+ const pylith::double_array& quadPtsRef(void) const;
/** Get weights of quadrature points.
*
* @returns Weights of quadrature points
*/
- const double_array& quadWts(void) const;
+ const pylith::double_array& quadWts(void) const;
/** Get basis fns evaluated at quadrature points.
*
* @returns Array of basis fns evaluated at quadrature points
*/
- const double_array& basis(void) const;
+ const pylith::double_array& basis(void) const;
/** Get derivates of basis fns evaluated at quadrature points.
*
* @returns Array of derivates of basis fns evaluated at
* quadrature points
*/
- const double_array& basisDerivRef(void) const;
+ const pylith::double_array& basisDerivRef(void) const;
/** Get number of dimensions in reference cell.
*
Modified: short/3D/PyLith/branches/pylith-swig/modulesrc/feassemble/feassemble.i
===================================================================
--- short/3D/PyLith/branches/pylith-swig/modulesrc/feassemble/feassemble.i 2009-03-10 03:03:07 UTC (rev 14282)
+++ short/3D/PyLith/branches/pylith-swig/modulesrc/feassemble/feassemble.i 2009-03-10 03:06:07 UTC (rev 14283)
@@ -28,8 +28,12 @@
#include "pylith/feassemble/GeometryQuad3D.hh"
#include "pylith/feassemble/GeometryTet3D.hh"
#include "pylith/feassemble/GeometryHex3D.hh"
+#include "pylith/feassemble/QuadratureRefCell.hh"
-#include "pylith/utils/arrayfwd.hh"
+#include "pylith/topology/Mesh.hh"
+#include "pylith/topology/SubMesh.hh"
+#include "pylith/feassemble/Quadrature.hh"
+
%}
%include "exception.i"
@@ -66,7 +70,14 @@
%include "GeometryQuad3D.i"
%include "GeometryTet3D.i"
%include "GeometryHex3D.i"
+%include "QuadratureRefCell.i"
+%include "Quadrature.i"
+// Template instatiation
+%template(MeshQuadrature) pylith::feassemble::Quadrature<pylith::topology::Mesh>;
+%template(SubMeshQuadrature) pylith::feassemble::Quadrature<pylith::topology::SubMesh>;
+
+
// End of file
More information about the CIG-COMMITS
mailing list