[cig-commits] [commit] knepley/upgrade-petsc-interface: Fixed C++ tet4 feassemble stuff for outward order. (8f854fa)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Thu Nov 14 17:26:08 PST 2013


Repository : ssh://geoshell/pylith

On branch  : knepley/upgrade-petsc-interface
Link       : https://github.com/geodynamics/pylith/compare/469a38928082279d92e8dca12193bf4292e5c05c...b685ee097b0c3233e5a4fcbff97d364d41bb0e99

>---------------------------------------------------------------

commit 8f854fa6244c68b45faf443e0f0f01d31f9246a0
Author: Brad Aagaard <baagaard at usgs.gov>
Date:   Thu Nov 14 17:14:41 2013 -0800

    Fixed C++ tet4 feassemble stuff for outward order.
    
    Matt flipped the internal PyLith ordering of vertices for tet4 cells to
    outward pointing. In the feassemble tests, we build the mesh, so the
    automatic inverting in meshio didn't happen. The tests previously passed
    because the feassemble geometry stuff hadn't been updated to reflect the
    new ordering.


>---------------------------------------------------------------

8f854fa6244c68b45faf443e0f0f01d31f9246a0
 libsrc/pylith/feassemble/ElasticityExplicitTet4.cc | 13 +++----
 libsrc/pylith/feassemble/GeometryTet3D.cc          | 25 +++++++-------
 libsrc/pylith/materials/ElasticMaterial.cc         |  5 +++
 unittests/libtests/feassemble/TestCellGeometry.cc  |  4 ++-
 .../data/ElasticityExplicitData3DLinear.cc         | 14 ++++----
 .../data/ElasticityExplicitData3DQuadratic.cc      | 40 +++++++++++-----------
 .../data/ElasticityExplicitGravData3DLinear.cc     | 14 ++++----
 .../data/ElasticityExplicitGravData3DQuadratic.cc  | 40 +++++++++++-----------
 .../libtests/feassemble/data/GeomDataTet3D.cc      |  2 +-
 unittests/libtests/feassemble/data/Mesh3DLinear.py |  6 ++--
 .../libtests/feassemble/data/Mesh3DQuadratic.py    |  6 ++--
 .../libtests/feassemble/data/Quadrature3DLinear.py | 16 ++++-----
 .../feassemble/data/Quadrature3DQuadratic.py       | 16 ++++-----
 13 files changed, 105 insertions(+), 96 deletions(-)

diff --git a/libsrc/pylith/feassemble/ElasticityExplicitTet4.cc b/libsrc/pylith/feassemble/ElasticityExplicitTet4.cc
index bc83cc8..d706be5 100644
--- a/libsrc/pylith/feassemble/ElasticityExplicitTet4.cc
+++ b/libsrc/pylith/feassemble/ElasticityExplicitTet4.cc
@@ -582,13 +582,13 @@ pylith::feassemble::ElasticityExplicitTet4::_volume(const scalar_array& coordina
   const PylithScalar y0 = coordinatesCell[1];
   const PylithScalar z0 = coordinatesCell[2];
 
-  const PylithScalar x1 = coordinatesCell[3];
-  const PylithScalar y1 = coordinatesCell[4];
-  const PylithScalar z1 = coordinatesCell[5];
+  const PylithScalar x2 = coordinatesCell[3];
+  const PylithScalar y2 = coordinatesCell[4];
+  const PylithScalar z2 = coordinatesCell[5];
 
-  const PylithScalar x2 = coordinatesCell[6];
-  const PylithScalar y2 = coordinatesCell[7];
-  const PylithScalar z2 = coordinatesCell[8];
+  const PylithScalar x1 = coordinatesCell[6];
+  const PylithScalar y1 = coordinatesCell[7];
+  const PylithScalar z1 = coordinatesCell[8];
 
   const PylithScalar x3 = coordinatesCell[9];
   const PylithScalar y3 = coordinatesCell[10];
@@ -599,6 +599,7 @@ pylith::feassemble::ElasticityExplicitTet4::_volume(const scalar_array& coordina
     x0*((y2*z3-y3*z2)-y1*(z3-z2)+(y3-y2)*z1) +
     y0*((x2*z3-x3*z2)-x1*(z3-z2)+(x3-x2)*z1) -
     z0*((x2*y3-x3*y2)-x1*(y3-y2)+(x3-x2)*y1);
+  assert(det > 0.0);
 
   const PylithScalar volume = det / 6.0;
   PetscLogFlops(48);
diff --git a/libsrc/pylith/feassemble/GeometryTet3D.cc b/libsrc/pylith/feassemble/GeometryTet3D.cc
index ec5e64b..da931f5 100644
--- a/libsrc/pylith/feassemble/GeometryTet3D.cc
+++ b/libsrc/pylith/feassemble/GeometryTet3D.cc
@@ -151,13 +151,13 @@ pylith::feassemble::GeometryTet3D::jacobian(scalar_array* jacobian,
   const PylithScalar y0 = vertices[1];
   const PylithScalar z0 = vertices[2];
 
-  const PylithScalar x1 = vertices[3];
-  const PylithScalar y1 = vertices[4];
-  const PylithScalar z1 = vertices[5];
+  const PylithScalar x2 = vertices[3];
+  const PylithScalar y2 = vertices[4];
+  const PylithScalar z2 = vertices[5];
 
-  const PylithScalar x2 = vertices[6];
-  const PylithScalar y2 = vertices[7];
-  const PylithScalar z2 = vertices[8];
+  const PylithScalar x1 = vertices[6];
+  const PylithScalar y1 = vertices[7];
+  const PylithScalar z1 = vertices[8];
 
   const PylithScalar x3 = vertices[9];
   const PylithScalar y3 = vertices[10];
@@ -326,13 +326,13 @@ pylith::feassemble::GeometryTet3D::volume(const PylithScalar* coordinatesCell,
   const PylithScalar y0 = coordinatesCell[1];
   const PylithScalar z0 = coordinatesCell[2];
   
-  const PylithScalar x1 = coordinatesCell[3];
-  const PylithScalar y1 = coordinatesCell[4];
-  const PylithScalar z1 = coordinatesCell[5];
+  const PylithScalar x2 = coordinatesCell[3];
+  const PylithScalar y2 = coordinatesCell[4];
+  const PylithScalar z2 = coordinatesCell[5];
   
-  const PylithScalar x2 = coordinatesCell[6];
-  const PylithScalar y2 = coordinatesCell[7];
-  const PylithScalar z2 = coordinatesCell[8];
+  const PylithScalar x1 = coordinatesCell[6];
+  const PylithScalar y1 = coordinatesCell[7];
+  const PylithScalar z1 = coordinatesCell[8];
   
   const PylithScalar x3 = coordinatesCell[9];
   const PylithScalar y3 = coordinatesCell[10];
@@ -343,6 +343,7 @@ pylith::feassemble::GeometryTet3D::volume(const PylithScalar* coordinatesCell,
     x0*((y2*z3-y3*z2)-y1*(z3-z2)+(y3-y2)*z1) +
     y0*((x2*z3-x3*z2)-x1*(z3-z2)+(x3-x2)*z1) -
     z0*((x2*y3-x3*y2)-x1*(y3-y2)+(x3-x2)*y1);
+  assert(det > 0.0);
 
   const PylithScalar v = det / 6.0;
   PetscLogFlops(48);
diff --git a/libsrc/pylith/materials/ElasticMaterial.cc b/libsrc/pylith/materials/ElasticMaterial.cc
index 353ea3b..bc374c8 100644
--- a/libsrc/pylith/materials/ElasticMaterial.cc
+++ b/libsrc/pylith/materials/ElasticMaterial.cc
@@ -350,6 +350,8 @@ pylith::materials::ElasticMaterial::stableTimeStepImplicit(const topology::Mesh&
   } // for
   delete fieldVisitor; fieldVisitor = 0;
 
+  assert(dtStable > 0.0);
+
   PYLITH_METHOD_RETURN(dtStable);
 } // stableTimeStepImplicit
 
@@ -425,6 +427,7 @@ pylith::materials::ElasticMaterial::stableTimeStepExplicit(const topology::Mesh&
 
     coordsVisitor.getClosure(&coordsCell, cell);
     const PylithScalar minCellWidth = quadrature->minCellWidth(&coordsCell[0], numBasis, spaceDim);
+  assert(minCellWidth > 0.0);
 
     for (int iQuad=0; iQuad < numQuadPts; ++iQuad) {
       const PylithScalar dt = 
@@ -449,6 +452,8 @@ pylith::materials::ElasticMaterial::stableTimeStepExplicit(const topology::Mesh&
   } // for
   delete fieldVisitor; fieldVisitor = 0;
 
+  assert(dtStable > 0.0);
+
   PYLITH_METHOD_RETURN(dtStable);
 } // stableTimeStepExplicit
 
diff --git a/unittests/libtests/feassemble/TestCellGeometry.cc b/unittests/libtests/feassemble/TestCellGeometry.cc
index 128657a..76760d9 100644
--- a/unittests/libtests/feassemble/TestCellGeometry.cc
+++ b/unittests/libtests/feassemble/TestCellGeometry.cc
@@ -265,12 +265,14 @@ pylith::feassemble::TestCellGeometry::testJacobian(void)
     const int size = jacobian.size();
     const int index = iLoc*cellDim*spaceDim;
     const PylithScalar tolerance = 1.0e-06;
-    for (int i=0; i < size; ++i)
+
+    for (int i=0; i < size; ++i) {
       if (_data->jacobian[index+i] < 1.0)
 	CPPUNIT_ASSERT_DOUBLES_EQUAL(_data->jacobian[index+i], jacobian[i], tolerance);
       else
 	CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, jacobian[i]/_data->jacobian[index+i], tolerance);
     CPPUNIT_ASSERT_DOUBLES_EQUAL(_data->jacobianDet[iLoc], det, tolerance);
+    } // for
   } // for
 
   PYLITH_METHOD_END;
diff --git a/unittests/libtests/feassemble/data/ElasticityExplicitData3DLinear.cc b/unittests/libtests/feassemble/data/ElasticityExplicitData3DLinear.cc
index 2ecbc20..4fcf4d3 100644
--- a/unittests/libtests/feassemble/data/ElasticityExplicitData3DLinear.cc
+++ b/unittests/libtests/feassemble/data/ElasticityExplicitData3DLinear.cc
@@ -51,8 +51,8 @@ const PylithScalar pylith::feassemble::ElasticityExplicitData3DLinear::_gravityV
 
 const PylithScalar pylith::feassemble::ElasticityExplicitData3DLinear::_vertices[] = {
  -5.00000000e-01, -1.00000000e+00, -5.00000000e-01,
-  2.00000000e+00, -5.00000000e-01, -4.00000000e-01,
   1.00000000e+00, -1.00000000e-01, -3.00000000e-01,
+  2.00000000e+00, -5.00000000e-01, -4.00000000e-01,
  -2.00000000e-01,  5.00000000e-01,  2.00000000e+00,
 };
 
@@ -62,8 +62,8 @@ const int pylith::feassemble::ElasticityExplicitData3DLinear::_cells[] = {
 
 const PylithScalar pylith::feassemble::ElasticityExplicitData3DLinear::_verticesRef[] = {
  -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
-  1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
  -1.00000000e+00,  1.00000000e+00, -1.00000000e+00,
+  1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
  -1.00000000e+00, -1.00000000e+00,  1.00000000e+00,
 };
 
@@ -81,8 +81,8 @@ const PylithScalar pylith::feassemble::ElasticityExplicitData3DLinear::_basis[]
 
 const PylithScalar pylith::feassemble::ElasticityExplicitData3DLinear::_basisDerivRef[] = {
  -5.00000000e-01, -5.00000000e-01, -5.00000000e-01,
-  5.00000000e-01,  0.00000000e+00,  0.00000000e+00,
   0.00000000e+00,  5.00000000e-01,  0.00000000e+00,
+  5.00000000e-01,  0.00000000e+00,  0.00000000e+00,
   0.00000000e+00,  0.00000000e+00,  5.00000000e-01,
 };
 
@@ -108,10 +108,10 @@ const PylithScalar pylith::feassemble::ElasticityExplicitData3DLinear::_fieldTmd
 };
 
 const PylithScalar pylith::feassemble::ElasticityExplicitData3DLinear::_valsResidual[] = {
- -6.53643381e+09,  3.88073108e+10,  3.46544326e+09,
- -4.31950537e+09,  7.13977327e+10,  2.36607350e+10,
-  7.21485556e+09, -1.13028007e+11, -3.40771285e+10,
-  3.64444612e+09,  2.82296339e+09,  6.95364028e+09,
+ -8.99885327e+09, -4.07464129e+10,  6.21335449e+08,
+  1.27906263e+10,  1.08322387e+11,  1.13912957e+10,
+  1.66969875e+08, -6.20694753e+10, -9.45473384e+09,
+ -3.95538040e+09, -5.50649912e+09, -2.55520730e+09,
 };
 
 const PylithScalar pylith::feassemble::ElasticityExplicitData3DLinear::_valsJacobian[] = {
diff --git a/unittests/libtests/feassemble/data/ElasticityExplicitData3DQuadratic.cc b/unittests/libtests/feassemble/data/ElasticityExplicitData3DQuadratic.cc
index 08ac06c..d92b1fa 100644
--- a/unittests/libtests/feassemble/data/ElasticityExplicitData3DQuadratic.cc
+++ b/unittests/libtests/feassemble/data/ElasticityExplicitData3DQuadratic.cc
@@ -51,8 +51,8 @@ const PylithScalar pylith::feassemble::ElasticityExplicitData3DQuadratic::_gravi
 
 const PylithScalar pylith::feassemble::ElasticityExplicitData3DQuadratic::_vertices[] = {
  -5.00000000e-01, -2.00000000e+00, -1.00000000e+00,
-  2.00000000e+00, -2.00000000e+00, -5.00000000e-01,
   1.00000000e+00,  1.00000000e+00,  0.00000000e+00,
+  2.00000000e+00, -2.00000000e+00, -5.00000000e-01,
   2.00000000e-01,  5.00000000e-01,  2.00000000e+00,
   1.50000000e+00, -5.00000000e-01, -2.50000000e-01,
   2.50000000e-01, -5.00000000e-01, -5.00000000e-01,
@@ -68,8 +68,8 @@ const int pylith::feassemble::ElasticityExplicitData3DQuadratic::_cells[] = {
 
 const PylithScalar pylith::feassemble::ElasticityExplicitData3DQuadratic::_verticesRef[] = {
  -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
-  1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
  -1.00000000e+00,  1.00000000e+00, -1.00000000e+00,
+  1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
  -1.00000000e+00, -1.00000000e+00,  1.00000000e+00,
   0.00000000e+00,  0.00000000e+00, -1.00000000e+00,
  -1.00000000e+00,  0.00000000e+00, -1.00000000e+00,
@@ -94,11 +94,11 @@ const PylithScalar pylith::feassemble::ElasticityExplicitData3DQuadratic::_basis
   2.80000000e-01, -8.00000000e-02, -8.00000000e-02,
  -8.00000000e-02,  4.00000000e-02,  2.80000000e-01,
   2.80000000e-01,  2.80000000e-01,  4.00000000e-02,
-  4.00000000e-02, -4.50000000e-02,  3.75000000e-01,
- -8.00000000e-02, -8.00000000e-02,  3.00000000e-01,
+  4.00000000e-02, -4.50000000e-02, -8.00000000e-02,
+  3.75000000e-01, -8.00000000e-02,  3.00000000e-01,
   2.00000000e-02,  1.50000000e-01,  2.00000000e-02,
   3.00000000e-01,  4.00000000e-02, -4.50000000e-02,
- -8.00000000e-02,  3.75000000e-01, -8.00000000e-02,
+  3.75000000e-01, -8.00000000e-02, -8.00000000e-02,
   3.00000000e-01,  1.50000000e-01,  2.00000000e-02,
   2.00000000e-02,  4.00000000e-02,  3.00000000e-01,
  -4.50000000e-02, -8.00000000e-02, -8.00000000e-02,
@@ -108,8 +108,8 @@ const PylithScalar pylith::feassemble::ElasticityExplicitData3DQuadratic::_basis
 
 const PylithScalar pylith::feassemble::ElasticityExplicitData3DQuadratic::_basisDerivRef[] = {
  -9.00000000e-01, -9.00000000e-01, -9.00000000e-01,
- -3.00000000e-01,  0.00000000e+00,  0.00000000e+00,
   0.00000000e+00, -3.00000000e-01,  0.00000000e+00,
+ -3.00000000e-01,  0.00000000e+00,  0.00000000e+00,
   0.00000000e+00,  0.00000000e+00, -3.00000000e-01,
   2.00000000e-01,  2.00000000e-01,  0.00000000e+00,
  -2.00000000e-01,  1.20000000e+00, -2.00000000e-01,
@@ -118,8 +118,8 @@ const PylithScalar pylith::feassemble::ElasticityExplicitData3DQuadratic::_basis
   2.00000000e-01,  0.00000000e+00,  2.00000000e-01,
   0.00000000e+00,  2.00000000e-01,  2.00000000e-01,
   4.00000000e-01,  4.00000000e-01,  4.00000000e-01,
-  1.00000000e+00,  0.00000000e+00,  0.00000000e+00,
   0.00000000e+00, -3.00000000e-01,  0.00000000e+00,
+  1.00000000e+00,  0.00000000e+00,  0.00000000e+00,
   0.00000000e+00,  0.00000000e+00, -3.00000000e-01,
   2.00000000e-01,  1.50000000e+00,  0.00000000e+00,
  -2.00000000e-01, -1.00000000e-01, -2.00000000e-01,
@@ -128,8 +128,8 @@ const PylithScalar pylith::feassemble::ElasticityExplicitData3DQuadratic::_basis
   2.00000000e-01,  0.00000000e+00,  1.50000000e+00,
   0.00000000e+00,  2.00000000e-01,  2.00000000e-01,
   4.00000000e-01,  4.00000000e-01,  4.00000000e-01,
- -3.00000000e-01,  0.00000000e+00,  0.00000000e+00,
   0.00000000e+00,  1.00000000e+00,  0.00000000e+00,
+ -3.00000000e-01,  0.00000000e+00,  0.00000000e+00,
   0.00000000e+00,  0.00000000e+00, -3.00000000e-01,
   1.50000000e+00,  2.00000000e-01,  0.00000000e+00,
  -1.50000000e+00, -1.40000000e+00, -1.50000000e+00,
@@ -138,8 +138,8 @@ const PylithScalar pylith::feassemble::ElasticityExplicitData3DQuadratic::_basis
   2.00000000e-01,  0.00000000e+00,  2.00000000e-01,
   0.00000000e+00,  2.00000000e-01,  1.50000000e+00,
   4.00000000e-01,  4.00000000e-01,  4.00000000e-01,
- -3.00000000e-01,  0.00000000e+00,  0.00000000e+00,
   0.00000000e+00, -3.00000000e-01,  0.00000000e+00,
+ -3.00000000e-01,  0.00000000e+00,  0.00000000e+00,
   0.00000000e+00,  0.00000000e+00,  1.00000000e+00,
   2.00000000e-01,  2.00000000e-01,  0.00000000e+00,
  -2.00000000e-01, -1.00000000e-01, -2.00000000e-01,
@@ -189,23 +189,23 @@ const PylithScalar pylith::feassemble::ElasticityExplicitData3DQuadratic::_field
 };
 
 const PylithScalar pylith::feassemble::ElasticityExplicitData3DQuadratic::_valsResidual[] = {
-  2.17058857e+10, -1.01733961e+10,  2.19900081e+10,
-  6.44476753e+10, -2.49368998e+10,  6.57917072e+09,
- -4.99716018e+10, -5.58679351e+10, -3.45875383e+10,
- -9.94668247e+09,  4.42023005e+10, -4.09053084e+10,
- -7.05539536e+09,  6.21081750e+10, -1.70783081e+09,
-  7.08342077e+10,  1.17498347e+11, -3.97961197e+10,
- -9.85178213e+10, -5.58312633e+10, -2.54468003e+10,
- -1.35892352e+10, -6.36495517e+10,  1.11511266e+10,
- -3.55928489e+10,  5.53585245e+10,  5.67591930e+09,
-  5.76997342e+10, -6.86862545e+10,  9.70617888e+10,
+  1.48010238e+10, -3.67592300e+09,  1.89160873e+10,
+ -7.24665648e+09, -7.72474528e+09, -7.91227527e+10,
+  1.89039715e+10, -2.08722956e+10,  1.04541544e+10,
+ -4.13458657e+09,  5.51215011e+10, -5.13495646e+10,
+ -6.23418226e+09,  4.68980303e+10,  1.01380632e+10,
+  3.03589617e+10,  8.18609177e+10, -2.11408976e+10,
+ -4.19442396e+10, -5.01699464e+10, -2.51447488e+10,
+ -1.42720650e+10, -4.81794260e+10, -9.43440197e+08,
+ -4.75560933e+09,  5.68743474e+10, -1.41101554e+10,
+  1.45373003e+10, -1.10110414e+11,  1.52317670e+11,
 };
 
 const PylithScalar pylith::feassemble::ElasticityExplicitData3DQuadratic::_valsJacobian[] = {
   2.57903646e+06,  2.57903646e+06,  2.57903646e+06,
   2.40117187e+06,  2.40117187e+06,  2.40117187e+06,
   2.40117187e+06,  2.40117187e+06,  2.40117187e+06,
-  2.40117188e+06,  2.40117188e+06,  2.40117188e+06,
+  2.40117187e+06,  2.40117187e+06,  2.40117187e+06,
   1.20947917e+07,  1.20947917e+07,  1.20947917e+07,
   8.35963542e+06,  8.35963542e+06,  8.35963542e+06,
   8.35963542e+06,  8.35963542e+06,  8.35963542e+06,
diff --git a/unittests/libtests/feassemble/data/ElasticityExplicitGravData3DLinear.cc b/unittests/libtests/feassemble/data/ElasticityExplicitGravData3DLinear.cc
index 9dcd4bc..a5219b0 100644
--- a/unittests/libtests/feassemble/data/ElasticityExplicitGravData3DLinear.cc
+++ b/unittests/libtests/feassemble/data/ElasticityExplicitGravData3DLinear.cc
@@ -51,8 +51,8 @@ const PylithScalar pylith::feassemble::ElasticityExplicitGravData3DLinear::_grav
 
 const PylithScalar pylith::feassemble::ElasticityExplicitGravData3DLinear::_vertices[] = {
  -5.00000000e-01, -1.00000000e+00, -5.00000000e-01,
-  2.00000000e+00, -5.00000000e-01, -4.00000000e-01,
   1.00000000e+00, -1.00000000e-01, -3.00000000e-01,
+  2.00000000e+00, -5.00000000e-01, -4.00000000e-01,
  -2.00000000e-01,  5.00000000e-01,  2.00000000e+00,
 };
 
@@ -62,8 +62,8 @@ const int pylith::feassemble::ElasticityExplicitGravData3DLinear::_cells[] = {
 
 const PylithScalar pylith::feassemble::ElasticityExplicitGravData3DLinear::_verticesRef[] = {
  -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
-  1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
  -1.00000000e+00,  1.00000000e+00, -1.00000000e+00,
+  1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
  -1.00000000e+00, -1.00000000e+00,  1.00000000e+00,
 };
 
@@ -81,8 +81,8 @@ const PylithScalar pylith::feassemble::ElasticityExplicitGravData3DLinear::_basi
 
 const PylithScalar pylith::feassemble::ElasticityExplicitGravData3DLinear::_basisDerivRef[] = {
  -5.00000000e-01, -5.00000000e-01, -5.00000000e-01,
-  5.00000000e-01,  0.00000000e+00,  0.00000000e+00,
   0.00000000e+00,  5.00000000e-01,  0.00000000e+00,
+  5.00000000e-01,  0.00000000e+00,  0.00000000e+00,
   0.00000000e+00,  0.00000000e+00,  5.00000000e-01,
 };
 
@@ -108,10 +108,10 @@ const PylithScalar pylith::feassemble::ElasticityExplicitGravData3DLinear::_fiel
 };
 
 const PylithScalar pylith::feassemble::ElasticityExplicitGravData3DLinear::_valsResidual[] = {
- -6.53643381e+09,  3.88073108e+10, -3.01595567e+10,
- -4.31950537e+09,  7.13977327e+10, -9.96426503e+09,
-  7.21485556e+09, -1.13028007e+11, -6.77021285e+10,
-  3.64444612e+09,  2.82296339e+09, -2.66713597e+10,
+ -8.99885327e+09, -4.07464129e+10, -3.30036646e+10,
+  1.27906263e+10,  1.08322387e+11, -2.22337043e+10,
+  1.66969875e+08, -6.20694753e+10, -4.30797338e+10,
+ -3.95538040e+09, -5.50649912e+09, -3.61802073e+10,
 };
 
 const PylithScalar pylith::feassemble::ElasticityExplicitGravData3DLinear::_valsJacobian[] = {
diff --git a/unittests/libtests/feassemble/data/ElasticityExplicitGravData3DQuadratic.cc b/unittests/libtests/feassemble/data/ElasticityExplicitGravData3DQuadratic.cc
index 4c7f8fe..e857865 100644
--- a/unittests/libtests/feassemble/data/ElasticityExplicitGravData3DQuadratic.cc
+++ b/unittests/libtests/feassemble/data/ElasticityExplicitGravData3DQuadratic.cc
@@ -51,8 +51,8 @@ const PylithScalar pylith::feassemble::ElasticityExplicitGravData3DQuadratic::_g
 
 const PylithScalar pylith::feassemble::ElasticityExplicitGravData3DQuadratic::_vertices[] = {
  -5.00000000e-01, -2.00000000e+00, -1.00000000e+00,
-  2.00000000e+00, -2.00000000e+00, -5.00000000e-01,
   1.00000000e+00,  1.00000000e+00,  0.00000000e+00,
+  2.00000000e+00, -2.00000000e+00, -5.00000000e-01,
   2.00000000e-01,  5.00000000e-01,  2.00000000e+00,
   1.50000000e+00, -5.00000000e-01, -2.50000000e-01,
   2.50000000e-01, -5.00000000e-01, -5.00000000e-01,
@@ -68,8 +68,8 @@ const int pylith::feassemble::ElasticityExplicitGravData3DQuadratic::_cells[] =
 
 const PylithScalar pylith::feassemble::ElasticityExplicitGravData3DQuadratic::_verticesRef[] = {
  -1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
-  1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
  -1.00000000e+00,  1.00000000e+00, -1.00000000e+00,
+  1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
  -1.00000000e+00, -1.00000000e+00,  1.00000000e+00,
   0.00000000e+00,  0.00000000e+00, -1.00000000e+00,
  -1.00000000e+00,  0.00000000e+00, -1.00000000e+00,
@@ -94,11 +94,11 @@ const PylithScalar pylith::feassemble::ElasticityExplicitGravData3DQuadratic::_b
   2.80000000e-01, -8.00000000e-02, -8.00000000e-02,
  -8.00000000e-02,  4.00000000e-02,  2.80000000e-01,
   2.80000000e-01,  2.80000000e-01,  4.00000000e-02,
-  4.00000000e-02, -4.50000000e-02,  3.75000000e-01,
- -8.00000000e-02, -8.00000000e-02,  3.00000000e-01,
+  4.00000000e-02, -4.50000000e-02, -8.00000000e-02,
+  3.75000000e-01, -8.00000000e-02,  3.00000000e-01,
   2.00000000e-02,  1.50000000e-01,  2.00000000e-02,
   3.00000000e-01,  4.00000000e-02, -4.50000000e-02,
- -8.00000000e-02,  3.75000000e-01, -8.00000000e-02,
+  3.75000000e-01, -8.00000000e-02, -8.00000000e-02,
   3.00000000e-01,  1.50000000e-01,  2.00000000e-02,
   2.00000000e-02,  4.00000000e-02,  3.00000000e-01,
  -4.50000000e-02, -8.00000000e-02, -8.00000000e-02,
@@ -108,8 +108,8 @@ const PylithScalar pylith::feassemble::ElasticityExplicitGravData3DQuadratic::_b
 
 const PylithScalar pylith::feassemble::ElasticityExplicitGravData3DQuadratic::_basisDerivRef[] = {
  -9.00000000e-01, -9.00000000e-01, -9.00000000e-01,
- -3.00000000e-01,  0.00000000e+00,  0.00000000e+00,
   0.00000000e+00, -3.00000000e-01,  0.00000000e+00,
+ -3.00000000e-01,  0.00000000e+00,  0.00000000e+00,
   0.00000000e+00,  0.00000000e+00, -3.00000000e-01,
   2.00000000e-01,  2.00000000e-01,  0.00000000e+00,
  -2.00000000e-01,  1.20000000e+00, -2.00000000e-01,
@@ -118,8 +118,8 @@ const PylithScalar pylith::feassemble::ElasticityExplicitGravData3DQuadratic::_b
   2.00000000e-01,  0.00000000e+00,  2.00000000e-01,
   0.00000000e+00,  2.00000000e-01,  2.00000000e-01,
   4.00000000e-01,  4.00000000e-01,  4.00000000e-01,
-  1.00000000e+00,  0.00000000e+00,  0.00000000e+00,
   0.00000000e+00, -3.00000000e-01,  0.00000000e+00,
+  1.00000000e+00,  0.00000000e+00,  0.00000000e+00,
   0.00000000e+00,  0.00000000e+00, -3.00000000e-01,
   2.00000000e-01,  1.50000000e+00,  0.00000000e+00,
  -2.00000000e-01, -1.00000000e-01, -2.00000000e-01,
@@ -128,8 +128,8 @@ const PylithScalar pylith::feassemble::ElasticityExplicitGravData3DQuadratic::_b
   2.00000000e-01,  0.00000000e+00,  1.50000000e+00,
   0.00000000e+00,  2.00000000e-01,  2.00000000e-01,
   4.00000000e-01,  4.00000000e-01,  4.00000000e-01,
- -3.00000000e-01,  0.00000000e+00,  0.00000000e+00,
   0.00000000e+00,  1.00000000e+00,  0.00000000e+00,
+ -3.00000000e-01,  0.00000000e+00,  0.00000000e+00,
   0.00000000e+00,  0.00000000e+00, -3.00000000e-01,
   1.50000000e+00,  2.00000000e-01,  0.00000000e+00,
  -1.50000000e+00, -1.40000000e+00, -1.50000000e+00,
@@ -138,8 +138,8 @@ const PylithScalar pylith::feassemble::ElasticityExplicitGravData3DQuadratic::_b
   2.00000000e-01,  0.00000000e+00,  2.00000000e-01,
   0.00000000e+00,  2.00000000e-01,  1.50000000e+00,
   4.00000000e-01,  4.00000000e-01,  4.00000000e-01,
- -3.00000000e-01,  0.00000000e+00,  0.00000000e+00,
   0.00000000e+00, -3.00000000e-01,  0.00000000e+00,
+ -3.00000000e-01,  0.00000000e+00,  0.00000000e+00,
   0.00000000e+00,  0.00000000e+00,  1.00000000e+00,
   2.00000000e-01,  2.00000000e-01,  0.00000000e+00,
  -2.00000000e-01, -1.00000000e-01, -2.00000000e-01,
@@ -189,23 +189,23 @@ const PylithScalar pylith::feassemble::ElasticityExplicitGravData3DQuadratic::_f
 };
 
 const PylithScalar pylith::feassemble::ElasticityExplicitGravData3DQuadratic::_valsResidual[] = {
-  2.17058857e+10, -1.01733961e+10, -3.80035653e+09,
-  6.44476753e+10, -2.49368998e+10, -1.74325480e+10,
- -4.99716018e+10, -5.58679351e+10, -5.85992570e+10,
- -9.94668247e+09,  4.42023005e+10, -6.49170271e+10,
- -7.05539536e+09,  6.21081750e+10, -1.22655747e+11,
-  7.08342077e+10,  1.17498347e+11, -1.23392474e+11,
- -9.85178213e+10, -5.58312633e+10, -1.09043154e+11,
- -1.35892352e+10, -6.36495517e+10, -7.24452276e+10,
- -3.55928489e+10,  5.53585245e+10, -1.15271997e+11,
-  5.76997342e+10, -6.86862545e+10, -2.38861279e+10,
+  1.48010238e+10, -3.67592300e+09, -6.87427732e+09,
+ -7.24665648e+09, -7.72474528e+09, -1.03134471e+11,
+  1.89039715e+10, -2.08722956e+10, -1.35575644e+10,
+ -4.13458657e+09,  5.51215011e+10, -7.53612834e+10,
+ -6.23418226e+09,  4.68980303e+10, -1.10809853e+11,
+  3.03589617e+10,  8.18609177e+10, -1.04737252e+11,
+ -4.19442396e+10, -5.01699464e+10, -1.08741103e+11,
+ -1.42720650e+10, -4.81794260e+10, -8.45397944e+10,
+ -4.75560933e+09,  5.68743474e+10, -1.35058072e+11,
+  1.45373003e+10, -1.10110414e+11,  3.13697537e+10,
 };
 
 const PylithScalar pylith::feassemble::ElasticityExplicitGravData3DQuadratic::_valsJacobian[] = {
   2.57903646e+06,  2.57903646e+06,  2.57903646e+06,
   2.40117187e+06,  2.40117187e+06,  2.40117187e+06,
   2.40117187e+06,  2.40117187e+06,  2.40117187e+06,
-  2.40117188e+06,  2.40117188e+06,  2.40117188e+06,
+  2.40117187e+06,  2.40117187e+06,  2.40117187e+06,
   1.20947917e+07,  1.20947917e+07,  1.20947917e+07,
   8.35963542e+06,  8.35963542e+06,  8.35963542e+06,
   8.35963542e+06,  8.35963542e+06,  8.35963542e+06,
diff --git a/unittests/libtests/feassemble/data/GeomDataTet3D.cc b/unittests/libtests/feassemble/data/GeomDataTet3D.cc
index 153f9eb..e6024cc 100644
--- a/unittests/libtests/feassemble/data/GeomDataTet3D.cc
+++ b/unittests/libtests/feassemble/data/GeomDataTet3D.cc
@@ -31,8 +31,8 @@ const int pylith::feassemble::GeomDataTet3D::_numLocs = 2;
 
 const PylithScalar pylith::feassemble::GeomDataTet3D::_vertices[] = {
   -1.3, -0.8, 0.2,
-  2.1, -0.7, 0.1,
   -1.0, 2.4, -0.3,
+  2.1, -0.7, 0.1,
   -0.1, 0.2, 3.0
 };
 
diff --git a/unittests/libtests/feassemble/data/Mesh3DLinear.py b/unittests/libtests/feassemble/data/Mesh3DLinear.py
index 81cb4ec..12a1a36 100644
--- a/unittests/libtests/feassemble/data/Mesh3DLinear.py
+++ b/unittests/libtests/feassemble/data/Mesh3DLinear.py
@@ -50,13 +50,13 @@ class Mesh3DLinear(Component):
     self.gravityVec = numpy.array( [0.0, 0.0, -1.0e8],
                                    dtype=numpy.float64)
     self.vertices = numpy.array( [[-0.5, -1.0, -0.5],
-                                  [ 2.0, -0.5, -0.4],
                                   [ 1.0, -0.1, -0.3],
+                                  [ 2.0, -0.5, -0.4],
                                   [-0.2,  0.5,  2.0]], dtype=numpy.float64)
     self.cells = numpy.array( [[0, 1, 2, 3]], dtype=numpy.int32)
     self.verticesRef = numpy.array( [[-1.0, -1.0, -1.0],
-                                     [+1.0, -1.0, -1.0],
                                      [-1.0, +1.0, -1.0],
+                                     [+1.0, -1.0, -1.0],
                                      [-1.0, -1.0, +1.0]],
                                     dtype=numpy.float64)
 
@@ -73,8 +73,8 @@ class Mesh3DLinear(Component):
     e23 = ((v2[0]-v3[0])**2 + (v2[1]-v3[1])**2 + (v2[2]-v3[2])**2)**0.5
 
     vol = 1.0/6.0*numpy.linalg.det(numpy.array([[1.0, v0[0], v0[1], v0[2]],
-                                                [1.0, v1[0], v1[1], v1[2]],
                                                 [1.0, v2[0], v2[1], v2[2]],
+                                                [1.0, v1[0], v1[1], v1[2]],
                                                 [1.0, v3[0], v3[1], v3[2]]],
                                                dtype=numpy.float64))
     cross012 = numpy.cross(v1-v0, v2-v0)
diff --git a/unittests/libtests/feassemble/data/Mesh3DQuadratic.py b/unittests/libtests/feassemble/data/Mesh3DQuadratic.py
index 8871ee7..31f25fa 100644
--- a/unittests/libtests/feassemble/data/Mesh3DQuadratic.py
+++ b/unittests/libtests/feassemble/data/Mesh3DQuadratic.py
@@ -50,8 +50,8 @@ class Mesh3DQuadratic(Component):
     self.gravityVec = numpy.array( [0.0, 0.0, -1.0e8],
                                    dtype=numpy.float64)
     self.vertices = numpy.array( [[-0.5, -2.0, -1.0],
-                                  [ 2.0, -2.0, -0.5],
                                   [ 1.0,  1.0,  0.0],
+                                  [ 2.0, -2.0, -0.5],
                                   [ 0.2,  0.5,  2.0],
                                   [ 1.5, -0.5, -0.25],
                                   [ 0.25, -0.5, -0.5],
@@ -63,8 +63,8 @@ class Mesh3DQuadratic(Component):
     self.cells = numpy.array( [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]],
                               dtype=numpy.int32)
     self.verticesRef = numpy.array( [[-1.0, -1.0, -1.0],
-                                     [+1.0, -1.0, -1.0],
                                      [-1.0, +1.0, -1.0],
+                                     [+1.0, -1.0, -1.0],
                                      [-1.0, -1.0, +1.0],
                                      [ 0.0,  0.0, -1.0],
                                      [-1.0,  0.0, -1.0],
@@ -87,8 +87,8 @@ class Mesh3DQuadratic(Component):
     e23 = ((v2[0]-v3[0])**2 + (v2[1]-v3[1])**2 + (v2[2]-v3[2])**2)**0.5
 
     vol = 1.0/6.0*numpy.linalg.det(numpy.array([[1.0, v0[0], v0[1], v0[2]],
-                                                [1.0, v1[0], v1[1], v1[2]],
                                                 [1.0, v2[0], v2[1], v2[2]],
+                                                [1.0, v1[0], v1[1], v1[2]],
                                                 [1.0, v3[0], v3[1], v3[2]]],
                                                dtype=numpy.float64))
     cross012 = numpy.cross(v1-v0, v2-v0)
diff --git a/unittests/libtests/feassemble/data/Quadrature3DLinear.py b/unittests/libtests/feassemble/data/Quadrature3DLinear.py
index 9af0754..6f87f7c 100644
--- a/unittests/libtests/feassemble/data/Quadrature3DLinear.py
+++ b/unittests/libtests/feassemble/data/Quadrature3DLinear.py
@@ -39,28 +39,28 @@ def N0q(p):
 def N0r(p):
   return -0.5
 
-def N1(p):
+def N2(p):
   return 0.5*(1.0 + p[0])
 
-def N1p(p):
+def N2p(p):
   return 0.5
 
-def N1q(p):
+def N2q(p):
   return 0.0
 
-def N1r(p):
+def N2r(p):
   return 0.0
 
-def N2(p):
+def N1(p):
   return 0.5*(1.0 + p[1])
 
-def N2p(p):
+def N1p(p):
   return 0.0
 
-def N2q(p):
+def N1q(p):
   return 0.5
 
-def N2r(p):
+def N1r(p):
   return 0.0
 
 def N3(p):
diff --git a/unittests/libtests/feassemble/data/Quadrature3DQuadratic.py b/unittests/libtests/feassemble/data/Quadrature3DQuadratic.py
index 88de10c..aea05a4 100644
--- a/unittests/libtests/feassemble/data/Quadrature3DQuadratic.py
+++ b/unittests/libtests/feassemble/data/Quadrature3DQuadratic.py
@@ -39,28 +39,28 @@ def N0q(p):
 def N0r(p):
   return 1.5+p[0]+p[1]+p[2]
 
-def N1(p):
+def N2(p):
   return 0.5*(1.0+p[0])*p[0]
 
-def N1p(p):
+def N2p(p):
   return 0.5+p[0]
 
-def N1q(p):
+def N2q(p):
   return 0.0
 
-def N1r(p):
+def N2r(p):
   return 0.0
 
-def N2(p):
+def N1(p):
   return 0.5*(1.0+p[1])*p[1]
 
-def N2p(p):
+def N1p(p):
   return 0.0
 
-def N2q(p):
+def N1q(p):
   return 0.5+p[1]
 
-def N2r(p):
+def N1r(p):
   return 0.0
 
 def N3(p):



More information about the CIG-COMMITS mailing list