[cig-commits] r19095 - short/3D/PyLith/trunk/pylith/feassemble

brad at geodynamics.org brad at geodynamics.org
Tue Oct 18 20:16:12 PDT 2011


Author: brad
Date: 2011-10-18 20:16:12 -0700 (Tue, 18 Oct 2011)
New Revision: 19095

Added:
   short/3D/PyLith/trunk/pylith/feassemble/FIATQuadrature.py
Log:
Added missing file.

Added: short/3D/PyLith/trunk/pylith/feassemble/FIATQuadrature.py
===================================================================
--- short/3D/PyLith/trunk/pylith/feassemble/FIATQuadrature.py	                        (rev 0)
+++ short/3D/PyLith/trunk/pylith/feassemble/FIATQuadrature.py	2011-10-19 03:16:12 UTC (rev 19095)
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+#
+# ----------------------------------------------------------------------
+#
+# Brad T. Aagaard, U.S. Geological Survey
+# Charles A. Williams, GNS Science
+# Matthew G. Knepley, University of Chicago
+#
+# This code was developed as part of the Computational Infrastructure
+# for Geodynamics (http://geodynamics.org).
+#
+# Copyright (c) 2010-2011 University of California, Davis
+#
+# See COPYING for license information.
+#
+# ----------------------------------------------------------------------
+#
+
+## @file pylith/feassemble/FIATQuadrature.py
+##
+## @brief Python object for special FIAT quadrature schemes.
+
+from FIAT.quadrature import QuadratureRule
+class CollocatedQuadratureRule(QuadratureRule):
+  """
+  Quadrature points colocated with vertices.
+  """
+  def __init__(self, ref_el, m):
+    from FIAT.lagrange import Lagrange
+    vertices = Lagrange(ref_el, m).dual.get_nodes()
+    pts = [v.get_point_dict().keys()[0] for v in vertices]
+    npts = len(pts)
+    wts = (ref_el.volume()/npts,)*npts
+    
+    QuadratureRule.__init__(self, ref_el, pts, wts)
+    return
+
+
+# End of file 



More information about the CIG-COMMITS mailing list