[cig-commits] r8161 - short/3D/PyLith/trunk/unittests/libtests/bc/data

brad at geodynamics.org brad at geodynamics.org
Fri Oct 19 16:39:53 PDT 2007


Author: brad
Date: 2007-10-19 16:39:53 -0700 (Fri, 19 Oct 2007)
New Revision: 8161

Added:
   short/3D/PyLith/trunk/unittests/libtests/bc/data/absorbingdampers.py
Modified:
   short/3D/PyLith/trunk/unittests/libtests/bc/data/AbsorbingDampersDataTri3.cc
Log:
More work on tri3 test for absorbing dampers BC.

Modified: short/3D/PyLith/trunk/unittests/libtests/bc/data/AbsorbingDampersDataTri3.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/data/AbsorbingDampersDataTri3.cc	2007-10-19 22:02:45 UTC (rev 8160)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/data/AbsorbingDampersDataTri3.cc	2007-10-19 23:39:53 UTC (rev 8161)
@@ -70,10 +70,10 @@
   12.5e+6, 7.5e+6,
 };
 const double pylith::bc::AbsorbingDampersDataTri3::_valsResidual[] = {
-  0.0, 0.0, // FIX THESE
   0.0, 0.0,
+  2.4e+07, 6.0e+06,
   0.0, 0.0,
-  0.0, 0.0,
+  2.4e+07, 6.0e+06
 };
 const double pylith::bc::AbsorbingDampersDataTri3::_valsJacobian[] = {
   0.0, 0.0, // 0   // FIX THESE

Added: short/3D/PyLith/trunk/unittests/libtests/bc/data/absorbingdampers.py
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/data/absorbingdampers.py	2007-10-19 22:02:45 UTC (rev 8160)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/data/absorbingdampers.py	2007-10-19 23:39:53 UTC (rev 8161)
@@ -0,0 +1,58 @@
+#!/usr/bin/env python
+#
+# ----------------------------------------------------------------------
+#
+#                           Brad T. Aagaard
+#                        U.S. Geological Survey
+#
+# <LicenseText>
+#
+# ----------------------------------------------------------------------
+#
+
+## @file unittests/libtests/bc/data/absorbingdampers.py
+
+## @brief Python routines for calculating values for test of absorbing
+## dampers.
+
+import math
+
+# ----------------------------------------------------------------------
+def calcTri3():
+  """
+  Calculate damping constants, residual, and Jacobian values for
+  absorbing dampers on mesh with tri3 cells.
+  """
+
+  density = 2500.0
+  vp = 5000.0
+  vs = 3000.0
+  velocity = 1.2
+  edgeLen = 0.5**0.5
+  dt = 0.25
+  normal = [0.5**0.5, -0.5**0.5]
+
+  dampingConsts = [density*vp, density*vs]
+  residualNormal = dampingConsts[0]*velocity*edgeLen/(2.0*dt)
+  residualTangential = dampingConsts[1]*velocity*edgeLen/(2.0*dt)
+  residual = [residualNormal*normal[0] - residualTangential*normal[1],
+              residualNormal*normal[1] + residualTangential*normal[0],
+              residualNormal*normal[0] - residualTangential*normal[1],
+              residualNormal*normal[1] + residualTangential*normal[0]]
+
+  jacobian = []
+
+  print "Absorbing boundary for tri3 mesh"
+  print "damping constants:"
+  for v in dampingConsts:
+      print "  %16.8e" % v
+  print "residual:"
+  for v in residual:
+      print "  %16.8e" % v
+
+  
+# ----------------------------------------------------------------------
+calcTri3()
+
+  
+# End of file 



More information about the cig-commits mailing list