[cig-commits] r13901 - cs/cigma/trunk/src

luis at geodynamics.org luis at geodynamics.org
Wed Jan 21 11:37:52 PST 2009


Author: luis
Date: 2009-01-21 11:37:51 -0800 (Wed, 21 Jan 2009)
New Revision: 13901

Modified:
   cs/cigma/trunk/src/fe_hex8.cpp
   cs/cigma/trunk/src/fe_quad4.cpp
   cs/cigma/trunk/src/fe_tet4.cpp
   cs/cigma/trunk/src/fe_tri3.cpp
Log:
Clean out old Cell methods that got moved to Quadrature::default_rule()

Modified: cs/cigma/trunk/src/fe_hex8.cpp
===================================================================
--- cs/cigma/trunk/src/fe_hex8.cpp	2009-01-21 19:37:50 UTC (rev 13900)
+++ cs/cigma/trunk/src/fe_hex8.cpp	2009-01-21 19:37:51 UTC (rev 13901)
@@ -4,8 +4,6 @@
 
 using namespace cigma;
 
-// ---------------------------------------------------------------------------
-
 static void hex_shape(double u, double v, double w, double s[8])
 {
     s[0] = (1.0 - u) * (1.0 - v) * (1.0 - w) * 0.125;
@@ -68,9 +66,6 @@
     -1.0, +1.0, +1.0
 };
 
-
-// ---------------------------------------------------------------------------
-
 hex8::hex8()
 {
     Cell::init();
@@ -87,67 +82,6 @@
 
 
 /*
-boost::shared_ptr<Quadrature> hex8::default_quadrature()
-{
-    // hex8_qr(3)
-    const int nno = 8;
-    const int celldim = 3;
-    double qpts[nno * celldim] = {
-        -0.57735027, -0.57735027, -0.57735027,
-         0.57735027, -0.57735027, -0.57735027,
-         0.57735027,  0.57735027, -0.57735027,
-        -0.57735027,  0.57735027, -0.57735027,
-        -0.57735027, -0.57735027,  0.57735027,
-         0.57735027, -0.57735027,  0.57735027,
-         0.57735027,  0.57735027,  0.57735027,
-        -0.57735027,  0.57735027,  0.57735027
-    };
-    double qwts[nno] = { 1.,  1.,  1.,  1.,  1.,  1.,  1.,  1. };
-
-    boost::shared_ptr<Quadrature> Q(new Quadrature(nno, celldim));
-    Q->setData(qpts, qwts);
-    return Q;
-} */
-
-/*
-void hex8::qr_default(double **wts, double **pts, int *npts, int *ndim)
-{
-    // hex_qr(3)
-    const int hex_nno = 8;
-    const int hex_celldim = 3;
-    double hex_qpts[hex_nno * hex_celldim] = {
-        -0.57735027, -0.57735027, -0.57735027,
-         0.57735027, -0.57735027, -0.57735027,
-         0.57735027,  0.57735027, -0.57735027,
-        -0.57735027,  0.57735027, -0.57735027,
-        -0.57735027, -0.57735027,  0.57735027,
-         0.57735027, -0.57735027,  0.57735027,
-         0.57735027,  0.57735027,  0.57735027,
-        -0.57735027,  0.57735027,  0.57735027
-    };
-    double hex_qwts[hex_nno] = { 1.,  1.,  1.,  1.,  1.,  1.,  1.,  1. };
-
-    int i,j,n;
-    *npts = hex_nno;
-    *ndim = hex_celldim;
-    *wts = new double[(*npts)];
-    *pts = new double[(*npts) * (*ndim)];
-    for (i = 0; i < hex_nno; i++)
-    {
-        (*wts)[i] = hex_qwts[i];
-        for (j = 0; j < (*ndim); j++)
-        {
-            n = (*ndim) * i + j;
-            (*pts)[n] = hex_qpts[n];
-        }
-    }
-}
-*/
-
-
-// ---------------------------------------------------------------------------
-
-/*
  * @param points points is an [num x celldim] array (in)
  * @param values values is an [num x ndofs] array (out)
  *

Modified: cs/cigma/trunk/src/fe_quad4.cpp
===================================================================
--- cs/cigma/trunk/src/fe_quad4.cpp	2009-01-21 19:37:50 UTC (rev 13900)
+++ cs/cigma/trunk/src/fe_quad4.cpp	2009-01-21 19:37:51 UTC (rev 13901)
@@ -38,8 +38,6 @@
     -1.0, +1.0
 };
 
-// ---------------------------------------------------------------------------
-
 quad4::quad4()
 {
     Cell::init();
@@ -55,85 +53,6 @@
 }
 
 /*
-boost::shared_ptr<Quadrature> quad4::default_quadrature()
-{
-    if (false)
-    {
-        // quad4_qr(7)
-        const int nno = 16;
-        const int celldim = 2;
-        double qpts[nno*celldim] = {
-            -0.86113631, -0.86113631,
-            -0.33998104, -0.86113631,
-             0.33998104, -0.86113631,
-             0.86113631, -0.86113631,
-             0.86113631, -0.33998104,
-             0.86113631,  0.33998104,
-             0.86113631,  0.86113631,
-             0.33998104,  0.86113631,
-            -0.33998104,  0.86113631,
-            -0.86113631,  0.86113631,
-            -0.86113631,  0.33998104,
-            -0.86113631, -0.33998104,
-            -0.33998104, -0.33998104,
-             0.33998104, -0.33998104,
-            -0.33998104,  0.33998104,
-             0.33998104,  0.33998104
-        };
-        double qwts[nno] = {
-            0.12100299,  0.22685185,  0.22685185,  0.12100299,  0.22685185,
-            0.22685185,  0.12100299,  0.22685185,  0.22685185,  0.12100299,
-            0.22685185,  0.22685185,  0.4252933 ,  0.4252933 ,  0.4252933 ,
-            0.4252933
-        };
-    }
-
-    if (false)
-    {
-        // quad4_qr(5)
-        const int nno = 9;
-        const int celldim = 2;
-        double qpts[nno*celldim] = {
-            -7.74596669e-01,  -7.74596669e-01,
-            -2.46519033e-31,  -7.74596669e-01,
-             7.74596669e-01,  -7.74596669e-01,
-             7.74596669e-01,  -2.46519033e-31,
-             7.74596669e-01,   7.74596669e-01,
-            -2.46519033e-31,   7.74596669e-01,
-            -7.74596669e-01,   7.74596669e-01,
-            -7.74596669e-01,  -2.46519033e-31,
-            -2.46519033e-31,  -2.46519033e-31
-        };
-        double qwts[nno] = {
-            0.30864198,  0.49382716,  0.30864198,  0.49382716,  0.30864198,
-            0.49382716,  0.30864198,  0.49382716,  0.79012346
-        };
-    }
- 
-
-    // quad4_qr(3)
-    const int nno = 4;
-    const int celldim = 2;
-    double qpts[nno*celldim] = {
-        -0.57735027, -0.57735027,
-         0.57735027, -0.57735027,
-         0.57735027,  0.57735027,
-        -0.57735027,  0.57735027
-    };
-    double qwts[nno] = {
-        1.,  1.,  1.,  1.
-    };
-    
-    boost::shared_ptr<Quadrature> Q(new Quadrature(nno, celldim));
-    Q->setData(qpts, qwts);
-    return Q;
-} */
-
-
-// ---------------------------------------------------------------------------
-
-/*
- *
  * @param points points is an [num x celldim] array (in)
  * @param values values is an [num x ndofs] array (out)
  */
@@ -149,7 +68,6 @@
 }
 
 /*
- *
  * @param points points is an [num x celldim] array (in)
  * @param values values is an [num x ndofs x celldim] array (out)
  */
@@ -196,4 +114,3 @@
     #undef Y
 }
 
-// ---------------------------------------------------------------------------

Modified: cs/cigma/trunk/src/fe_tet4.cpp
===================================================================
--- cs/cigma/trunk/src/fe_tet4.cpp	2009-01-21 19:37:50 UTC (rev 13900)
+++ cs/cigma/trunk/src/fe_tet4.cpp	2009-01-21 19:37:51 UTC (rev 13901)
@@ -4,8 +4,6 @@
 
 using namespace cigma;
 
-// ---------------------------------------------------------------------------
-
 static void tet_shape(double u, double v, double w, double s[4])
 {
     s[0] = 1.0 - u - v - w;
@@ -44,9 +42,6 @@
     0.0, 0.0, 1.0
 };
 
-
-// ---------------------------------------------------------------------------
-
 tet4::tet4()
 {
     Cell::init();
@@ -61,97 +56,6 @@
 {
 }
 
-/*
-boost::shared_ptr<Quadrature> tet4::default_quadrature()
-{
-    // tet4_qr(3)
-    const int nno = 8;
-    const int celldim = 3;
-    double qpts[nno * celldim] = {
-        -0.68663473, -0.72789005, -0.75497035,
-        -0.83720867, -0.85864055,  0.08830369,
-        -0.86832263,  0.13186633, -0.75497035,
-        -0.93159441, -0.4120024 ,  0.08830369,
-         0.16949513, -0.72789005, -0.75497035,
-        -0.39245447, -0.85864055,  0.08830369,
-        -0.50857335,  0.13186633, -0.75497035,
-        -0.74470688, -0.4120024 ,  0.08830369
-    };
-    double qwts[nno] = {
-        0.29583885,  0.12821632,  0.16925605,  0.07335544,  0.29583885,
-        0.12821632,  0.16925605,  0.07335544
-    };
-
-    for (int i = 0; i < nno; i++)
-    {
-        for (int j = 0; j < celldim; j++)
-        {
-            int n = celldim * i + j;
-            qpts[n] += 1;
-            qpts[n] *= 0.5;
-        }
-        // don't forget to adjust the integration weights
-        // to account for the reference domain transformation!
-        qwts[i] *= 0.125;
-    }
-
-    boost::shared_ptr<Quadrature> Q(new Quadrature(nno, celldim));
-    Q->setData(qpts, qwts);
-    return Q;
-} */
-
-/*
-void tet4::qr_default(double **wts, double **pts, int *npts, int *ndim)
-{
-    // tet_qr(3)
-    const int tet_nno = 8;
-    const int tet_celldim = 3;
-    double tet_qpts[tet_nno * tet_celldim] = {
-        -0.68663473, -0.72789005, -0.75497035,
-        -0.83720867, -0.85864055,  0.08830369,
-        -0.86832263,  0.13186633, -0.75497035,
-        -0.93159441, -0.4120024 ,  0.08830369,
-         0.16949513, -0.72789005, -0.75497035,
-        -0.39245447, -0.85864055,  0.08830369,
-        -0.50857335,  0.13186633, -0.75497035,
-        -0.74470688, -0.4120024 ,  0.08830369
-    };
-    double tet_qwts[tet_nno] = {
-        0.29583885,  0.12821632,  0.16925605,  0.07335544,  0.29583885,
-        0.12821632,  0.16925605,  0.07335544
-    };
-
-    int i,j,n;
-
-    for (i = 0; i < tet_nno; i++)
-    {
-        for (j = 0; j < tet_celldim; j++)
-        {
-            n = tet_celldim * i + j;
-            tet_qpts[n] += 1;
-            tet_qpts[n] *= 0.5;
-        }
-        // don't forget to adjust the integration weights
-        // to account for the reference domain transformation!
-        tet_qwts[i] *= 0.125;
-    }
-
-    *npts = tet_nno;
-    *ndim = tet_celldim;
-    *wts = new double[(*npts)];
-    *pts = new double[(*npts) * (*ndim)];
-    for (i = 0; i < tet_nno; i++)
-    {
-        (*wts)[i] = tet_qwts[i];
-        for (j = 0; j < (*ndim); j++)
-        {
-            n = (*ndim) * i + j;
-            (*pts)[n] = tet_qpts[n];
-        }
-    }
-}
-*/
-
 void tet4::shape(int num, double *points, double *values)
 {
     const int nno = n_nodes();
@@ -249,28 +153,29 @@
     //      | x3 y3 z3 1 |
     //
     double *a = globverts;
-    return fabs(a[0] * a[4] * a[8]
-        - a[0] * a[4] * a[11] 
-        + a[0] * a[7] * a[11]
-        - a[0] * a[7] * a[5] 
-        + a[0] * a[10] * a[5] 
-        - a[0] * a[10] * a[8] 
-        - a[3] * a[1] * a[8] 
-        + a[3] * a[1] * a[11] 
-        - a[3] * a[7] * a[11] 
-        + a[3] * a[7] * a[2] 
-        - a[3] * a[10] * a[2] 
-        + a[3] * a[10] * a[8] 
-        + a[6] * a[1] * a[5] 
-        - a[6] * a[1] * a[11] 
-        + a[6] * a[4] * a[11] 
-        - a[6] * a[4] * a[2] 
-        + a[6] * a[10] * a[2] 
-        - a[6] * a[10] * a[5] 
-        - a[9] * a[1] * a[5] 
-        + a[9] * a[1] * a[8] 
-        - a[9] * a[4] * a[8] 
-        + a[9] * a[4] * a[2] 
-        - a[9] * a[7] * a[2] 
-        + a[9] * a[7] * a[5]) / 6.0;
+    return fabs(+ a[0] * a[4] * a[8]
+                - a[0] * a[4] * a[11] 
+                + a[0] * a[7] * a[11]
+                - a[0] * a[7] * a[5] 
+                + a[0] * a[10] * a[5] 
+                - a[0] * a[10] * a[8] 
+                - a[3] * a[1] * a[8] 
+                + a[3] * a[1] * a[11] 
+                - a[3] * a[7] * a[11] 
+                + a[3] * a[7] * a[2] 
+                - a[3] * a[10] * a[2] 
+                + a[3] * a[10] * a[8] 
+                + a[6] * a[1] * a[5] 
+                - a[6] * a[1] * a[11] 
+                + a[6] * a[4] * a[11] 
+                - a[6] * a[4] * a[2] 
+                + a[6] * a[10] * a[2] 
+                - a[6] * a[10] * a[5] 
+                - a[9] * a[1] * a[5] 
+                + a[9] * a[1] * a[8] 
+                - a[9] * a[4] * a[8] 
+                + a[9] * a[4] * a[2] 
+                - a[9] * a[7] * a[2] 
+                + a[9] * a[7] * a[5]) / 6.0;
 }
+

Modified: cs/cigma/trunk/src/fe_tri3.cpp
===================================================================
--- cs/cigma/trunk/src/fe_tri3.cpp	2009-01-21 19:37:50 UTC (rev 13900)
+++ cs/cigma/trunk/src/fe_tri3.cpp	2009-01-21 19:37:51 UTC (rev 13901)
@@ -2,8 +2,6 @@
 
 using namespace cigma;
 
-// ---------------------------------------------------------------------------
-
 static void tri_shape(double u, double v, double s[3])
 {
     s[0] = 1.0 - u - v ;
@@ -33,7 +31,6 @@
     0.0, 1.0
 };
 
-// ---------------------------------------------------------------------------
 
 tri3::tri3()
 {
@@ -49,86 +46,6 @@
 {
 }
 
-/*
-boost::shared_ptr<Quadrature> tri3::default_quadrature()
-{
-    // tri3_qr(5)
-    const int nno = 9;
-    const int celldim = 2;
-    double qpts[nno*celldim] = {
-        -0.79456469, -0.82282408,
-        -0.86689186, -0.18106627,
-        -0.95213774,  0.57531892,
-        -0.08858796, -0.82282408,
-        -0.40946686, -0.18106627,
-        -0.78765946,  0.57531892,
-         0.61738877, -0.82282408,
-         0.04795814, -0.18106627,
-        -0.62318119,  0.57531892
-    };
-    double qwts[nno] = {
-        0.22325768,  0.25471234,  0.07758553,  0.35721229,  0.40753974,
-        0.12413685,  0.22325768,  0.25471234,  0.07758553
-    };
-
-    boost::shared_ptr<Quadrature> Q(new Quadrature(nno, celldim));
-    Q->setData(qpts, qwts);
-    return Q;
-} */
-
-/*
-void tri3::qr_default(double **wts, double **pts, int *npts, int *ndim)
-{
-    // tri_qr(5)
-    const int tri_nno = 9;
-    const int tri_celldim = 2;
-    double tri_qpts[tri_nno * tri_celldim] = {
-        -0.79456469, -0.82282408,
-        -0.86689186, -0.18106627,
-        -0.95213774,  0.57531892,
-        -0.08858796, -0.82282408,
-        -0.40946686, -0.18106627,
-        -0.78765946,  0.57531892,
-         0.61738877, -0.82282408,
-         0.04795814, -0.18106627,
-        -0.62318119,  0.57531892
-    };
-    double tri_qwts[tri_nno] = {
-        0.22325768,  0.25471234,  0.07758553,  0.35721229,  0.40753974,
-        0.12413685,  0.22325768,  0.25471234,  0.07758553
-    };
-
-    int i,j,n;
-
-    for (i = 0; i < tri_nno; i++)
-    {
-        for (j = 0; j < tri_celldim; j++)
-        {
-            n = tri_celldim * i + j;
-            tri_qpts[n] += 1;
-            tri_qpts[n] *= 0.5;
-        }
-    }
-
-    *npts = tri_nno;
-    *ndim = tri_celldim;
-    *wts = new double[(*npts)];
-    *pts = new double[(*npts) * (*ndim)];
-    for (i = 0; i < tri_nno; i++)
-    {
-        (*wts)[i] = tri_qwts[i];
-        for (j = 0; j < (*ndim); j++)
-        {
-            n = (*ndim) * i + j;
-            (*pts)[n] = tri_qpts[n];
-        }
-    }
-}
-*/
-
-
-// ---------------------------------------------------------------------------
-
 void tri3::shape(int num, double *points, double *values)
 {
     const int nno = n_nodes();
@@ -183,4 +100,3 @@
     #undef Y
 }
 
-// ---------------------------------------------------------------------------



More information about the CIG-COMMITS mailing list