[cig-commits] r4620 - in short/3D/PyLith/trunk/pylith: . feassemble

baagaard at geodynamics.org baagaard at geodynamics.org
Mon Sep 25 17:23:40 PDT 2006


Author: baagaard
Date: 2006-09-25 17:23:40 -0700 (Mon, 25 Sep 2006)
New Revision: 4620

Added:
   short/3D/PyLith/trunk/pylith/feassemble/Quadrature.py
Modified:
   short/3D/PyLith/trunk/pylith/Makefile.am
Log:
Added feassemble/Quadrature object.

Modified: short/3D/PyLith/trunk/pylith/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/pylith/Makefile.am	2006-09-26 00:20:07 UTC (rev 4619)
+++ short/3D/PyLith/trunk/pylith/Makefile.am	2006-09-26 00:23:40 UTC (rev 4620)
@@ -18,6 +18,7 @@
 	feassemble/Field.py \
 	feassemble/Integrator.py \
 	feassemble/IntegratorElasticity.py \
+	feassemble/Quadrature.py \
 	materials/__init__.py \
 	materials/ElasticIsotropic3D.py \
 	materials/Homogeneous.py \

Added: short/3D/PyLith/trunk/pylith/feassemble/Quadrature.py
===================================================================
--- short/3D/PyLith/trunk/pylith/feassemble/Quadrature.py	2006-09-26 00:20:07 UTC (rev 4619)
+++ short/3D/PyLith/trunk/pylith/feassemble/Quadrature.py	2006-09-26 00:23:40 UTC (rev 4620)
@@ -0,0 +1,102 @@
+#!/usr/bin/env python
+#
+# ----------------------------------------------------------------------
+#
+#                           Brad T. Aagaard
+#                        U.S. Geological Survey
+#
+# <LicenseText>
+#
+# ----------------------------------------------------------------------
+#
+
+## @file pyre/feassemble/Qudrature.py
+
+## @brief Python abstract base class for integrating over
+## finite-elements using quadrature.
+
+# TODO
+#
+# Use FIAT to create numpy arrays containing basis functions and their
+# derivatives evaludated at the quadrature points and the coordinates
+# and weights of the quadrature points in the reference cell.
+
+# DESIGN QUESTION
+#
+# The dimension of the space associated with the coordinates of
+# the vertices is specific to the quadrature object. However, the
+# quadrature points/weights and basis functions are associated with
+# the reference cell not the actual cell.
+#
+# Where should the dimension of the space associated with the
+# coordinates of the vertices be specified? I don't think the user
+# will specify it, so that means it won't be in the inventory.
+
+from pyre.components.Component import Component
+
+# Quadrature class
+class Quadrature(Component):
+  """
+  Python abstract base class for integrating over finite-elements
+  using quadrature.
+  """
+
+  # INVENTORY //////////////////////////////////////////////////////////
+
+  class Inventory(Component.Inventory):
+    """Python object for managing Quadrature facilities and properties."""
+
+    ## @class Inventory
+    ## Python object for managing Quadrature facilities and properties.
+    ##
+    ## \b Properties
+    ## @li \b jacobian_tolerance Minimum allowable determinant of Jacobian.
+    ##
+    ## \b Facilities
+    ## @li None
+
+    import pyre.inventory
+
+    jacobianTol = pyre.inventory.float("jacobian_tolerance", default=1.0e-06)
+    jacobianTol.meta['tip'] = "Minimum allowable determinant of Jacobian."
+
+
+  # PUBLIC METHODS /////////////////////////////////////////////////////
+
+  def __init__(self, name="quadrature"):
+    """
+    Constructor.
+    """
+    Component.__init__(self, name, facility="quadrature")
+    #import pylith.feassemble.feassemble as bindings
+    #self.cppHandle = bindings.Quadrature()
+    self.spaceDim = 3
+    return
+
+  def initialize(self):
+    """
+    Initialize C++ quadrature object.
+    """
+    # Set minimum allowable determinant of Jacobian
+    #self.cppHandle.jacobianTol = self.jacobianTol
+
+    # Get basis functions, quadrature points
+    #self.cppHandle.initialize(LOTS OF ARGS)
+    return
+
+
+  # PRIVATE METHODS ////////////////////////////////////////////////////
+
+  def _configure(self):
+    """
+    Set members based using inventory.
+    """
+    Component._configure(self)
+    self.jacobianTol = self.inventory.jacobianTol
+    return
+
+
+# version
+__id__ = "$Id$"
+
+# End of file 



More information about the cig-commits mailing list