[cig-commits] r4559 - short/3D/PyLith/trunk/libsrc/feassemble

baagaard at geodynamics.org baagaard at geodynamics.org
Fri Sep 15 21:41:32 PDT 2006


Author: baagaard
Date: 2006-09-15 21:41:32 -0700 (Fri, 15 Sep 2006)
New Revision: 4559

Modified:
   short/3D/PyLith/trunk/libsrc/feassemble/Makefile.am
   short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.cc
   short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.hh
Log:
Fixed compilation bugs.

Modified: short/3D/PyLith/trunk/libsrc/feassemble/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Makefile.am	2006-09-15 22:50:47 UTC (rev 4558)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Makefile.am	2006-09-16 04:41:32 UTC (rev 4559)
@@ -15,7 +15,7 @@
 
 lib_LTLIBRARIES = libpylithfeassemble.la
 
-libpylithmeshio_la_SOURCES = \
+libpylithfeassemble_la_SOURCES = \
 	Quadrature.cc
 
 subpkginclude_HEADERS = \

Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.cc	2006-09-15 22:50:47 UTC (rev 4558)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.cc	2006-09-16 04:41:32 UTC (rev 4559)
@@ -12,6 +12,8 @@
 
 #include "Quadrature.hh" // implementation of class methods
 
+#include <stdexcept> // USES std::runtime_error
+
 // ----------------------------------------------------------------------
 // Constructor
 pylith::feassemble::Quadrature::Quadrature(void) :
@@ -28,6 +30,10 @@
 // Destructor
 pylith::feassemble::Quadrature::~Quadrature(void)
 { // destructor
+  delete[] _pBasisFns; _pBasisFns = 0;
+  delete[] _pBasisFnsDeriv; _pBasisFnsDeriv = 0;
+  delete[] _pQuadPts; _pQuadPts = 0;
+  delete[] _pQuadWts; _pQuadWts = 0;
 } // destructor
   
 // ----------------------------------------------------------------------
@@ -53,18 +59,26 @@
   int size = numCorners * numQuadPts;
   delete[] _pBasisFns;
   _pBasisFns = (size > 0) ? new double[size] : 0;
+  for (int i=0; i < size; ++i)
+    _pBasisFns[i] = pBasisFns[i];
 
   size = numCorners * numQuadPts * numDims;
   delete[] _pBasisFnsDeriv;
   _pBasisFnsDeriv = (size > 0) ? new double[size] : 0;
+  for (int i=0; i < size; ++i)
+    _pBasisFnsDeriv[i] = pBasisFnsDeriv[i];
 
   size = numQuadPts * numDims;
   delete[] _pQuadPts;
   _pQuadPts = (size > 0) ? new double[size] : 0;
+  for (int i=0; i < size; ++i)
+    _pQuadPts[i] = pQuadPts[i];
 
   size = numQuadPts;
   delete[] _pQuadWts;
   _pQuadWts = (size > 0) ? new double[size] : 0;
+  for (int i=0; i < size; ++i)
+    _pQuadWts[i] = pQuadWts[i];
 
   _numDims = numDims;
   _numCorners = numCorners;

Modified: short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.hh	2006-09-15 22:50:47 UTC (rev 4558)
+++ short/3D/PyLith/trunk/libsrc/feassemble/Quadrature.hh	2006-09-16 04:41:32 UTC (rev 4559)
@@ -22,6 +22,8 @@
 #if !defined(pylith_feassemble_quadrature_hh)
 #define pylith_feassemble_quadrature_hh
 
+#include <Mesh.hh>
+
 namespace pylith {
   namespace feassemble {
     class Quadrature;
@@ -42,13 +44,24 @@
 
   /** Compute geometric quantities for a cell.
    *
+   * @param coordinates Section containing vertex coordinates
+   * @param cell Finite-element cell
+   * @param pV Array of ???
+   * @param pJacobian Jacobian evaluated at quadrature points
+   *   size = numDims*numDims*numQuadPts
+   *   index = iQuadPt*numDims*numDims + iJacobian
+   * @param pJacobianInv Inverse Jacobian evaluated at quadrature points
+   *   quadrature pts
+   *   size = numDims*numDims*numQuadPts
+   *   index = iQuadPt*numDims*numDims + iJacobian
+   * @param jacobianDet Determinant of Jacobian
    */
-  virtual void compute(const Obj<section_type>& coordinates,
-		       const point_type& cell,
+  virtual void compute(const ALE::Obj<ALE::Mesh::section_type>& coordinates,
+		       const ALE::Mesh::point_type& cell,
 		       double* pV,
 		       double* pJacobian,
 		       double* pJacobianInv,
-		       double* pJacobianDet) = 0;
+		       double& jacobianDet) = 0;
 
   /** Set basis functions and their derivatives and coordinates and
    *  weights of the quadrature points.
@@ -79,6 +92,57 @@
 		  const int numCorners,
 		  const int numQuadPts);
 
+  /** Set tolerance for minimum allowable Jacobian.
+   *
+   * @param tolerance Minimum allowable value for Jacobian
+   */
+  void jacobianTolerance(const double tolerance);
+
+  /** Set tolerance for minimum allowable Jacobian.
+   *
+   * @param tolerance Minimum allowable value for Jacobian
+   */
+  double jacobianTolerance(void);
+
+  /** Get number of dimensions.
+   *
+   * @returns Number of dimensions
+   */
+  int numDims(void) const;
+
+  /** Get number of vertices in a cell.
+   *
+   * @returns Number of vertices in a cell
+   */
+  int numCorners(void) const;
+
+  /** Get number of quadrature points.
+   *
+   * @param returns Number of quadrature points
+   */
+  int numQuadPts(void) const;
+
+// PROTECTED MEMBERS ////////////////////////////////////////////////////
+protected :
+
+  /** Get basis functions evaluated at quadrature points.
+   *
+   * @returns Array of basis functions evaluated at quadrature points.
+   */
+  const double* basisFns(void) const;
+
+  /** Get derivatives of basis functions evaluated at quadrature points.
+   *
+   * @returns Array of basis functions evaluated at quadrature points.
+   */
+  const double* basisFnsDeric(void) const;
+
+  /** Get basis functions evaluated at quadrature points.
+   *
+   * @returns Array of basis functions evaluated at quadrature points.
+   */
+  const double* basisFns(void) const;
+
 // PRIVATE MEMBERS //////////////////////////////////////////////////////
 private :
 



More information about the cig-commits mailing list