Intrepid
http://trilinos.sandia.gov/packages/docs/r10.12/packages/intrepid/test/Discretization/Basis/HGRAD_TET_Cn_FEM_ORTH/test_01.cpp
Go to the documentation of this file.
00001 // @HEADER
00002 // ************************************************************************
00003 //
00004 //                           Intrepid Package
00005 //                 Copyright (2007) Sandia Corporation
00006 //
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 //
00010 // Redistribution and use in source and binary forms, with or without
00011 // modification, are permitted provided that the following conditions are
00012 // met:
00013 //
00014 // 1. Redistributions of source code must retain the above copyright
00015 // notice, this list of conditions and the following disclaimer.
00016 //
00017 // 2. Redistributions in binary form must reproduce the above copyright
00018 // notice, this list of conditions and the following disclaimer in the
00019 // documentation and/or other materials provided with the distribution.
00020 //
00021 // 3. Neither the name of the Corporation nor the names of the
00022 // contributors may be used to endorse or promote products derived from
00023 // this software without specific prior written permission.
00024 //
00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00036 //
00037 // Questions? Contact Pavel Bochev  (pbboche@sandia.gov)
00038 //                    Denis Ridzal  (dridzal@sandia.gov), or
00039 //                    Kara Peterson (kjpeter@sandia.gov)
00040 //
00041 // ************************************************************************
00042 // @HEADER
00043 
00044 
00050 #include "Intrepid_FieldContainer.hpp"
00051 #include "Teuchos_oblackholestream.hpp"
00052 #include "Teuchos_RCP.hpp"
00053 #include "Teuchos_GlobalMPISession.hpp"
00054 #include "Intrepid_HGRAD_TET_Cn_FEM_ORTH.hpp"
00055 #include "Intrepid_CubatureDirectTetDefault.hpp"
00056 #include "Shards_CellTopology.hpp"
00057 #include "Intrepid_PointTools.hpp"
00058 
00059 #include <iostream>
00060 
00061 using namespace Intrepid;
00062 
00068 int main(int argc, char *argv[]) {
00069 
00070   Teuchos::GlobalMPISession mpiSession(&argc, &argv);
00071   
00072   // This little trick lets us print to std::cout only if a (dummy) command-line argument is provided.
00073   int iprint     = argc - 1;
00074   
00075   Teuchos::RCP<std::ostream> outStream;
00076   Teuchos::oblackholestream bhs; // outputs nothing
00077   
00078   if (iprint > 0)
00079     outStream = Teuchos::rcp(&std::cout, false);
00080   else
00081     outStream = Teuchos::rcp(&bhs, false);
00082   
00083   // Save the format state of the original std::cout.
00084   Teuchos::oblackholestream oldFormatState;
00085   oldFormatState.copyfmt(std::cout);
00086   
00087   *outStream \
00088     << "===============================================================================\n" \
00089     << "|                                                                             |\n" \
00090     << "|                           Unit Test OrthogonalBases                         |\n" \
00091     << "|                                                                             |\n" \
00092     << "|     1) Tests orthogonality of tetrahedral orthogonal basis                  |\n" \
00093     << "|                                                                             |\n" \
00094     << "|  Questions? Contact  Pavel Bochev (pbboche@sandia.gov) or                   |\n" \
00095     << "|                      Denis Ridzal (dridzal@sandia.gov) or                   |\n" \
00096     << "|                      Robert Kirby (robert.c.kirby@ttu.edu)                  |\n" \
00097     << "|                                                                             |\n" \
00098     << "|  Intrepid's website: http://trilinos.sandia.gov/packages/intrepid           |\n" \
00099     << "|  Trilinos website:   http://trilinos.sandia.gov                             |\n" \
00100     << "|                                                                             |\n" \
00101     << "===============================================================================\n";
00102   
00103   int errorFlag  = 0;
00104 
00105   const int deg = 3;
00106 
00107   Basis_HGRAD_TET_Cn_FEM_ORTH<double,FieldContainer<double> > myBasis( deg );
00108   const int polydim = myBasis.getCardinality();
00109   
00110   // First, get a reference quadrature rule
00111 
00112   CubatureDirectTetDefault<double,FieldContainer<double> > myCub(2*deg);
00113   FieldContainer<double> cubPts( myCub.getNumPoints() , 3 );
00114   FieldContainer<double> cubWts( myCub.getNumPoints() );
00115 
00116   myCub.getCubature( cubPts , cubWts );
00117 
00118 
00119   // Tabulate the basis functions at the cubature points
00120   FieldContainer<double> basisAtCubPts( polydim , myCub.getNumPoints() );
00121 
00122   myBasis.getValues( basisAtCubPts , cubPts , OPERATOR_VALUE );
00123 
00124 
00125   // Now let's compute the mass matrix
00126   for (int i=0;i<polydim;i++) {
00127     for (int j=i;j<polydim;j++) {
00128       double cur = 0.0;
00129       for (int k=0;k<myCub.getNumPoints();k++) {
00130         cur += cubWts(k) * basisAtCubPts( i , k ) * basisAtCubPts( j , k );
00131       }
00132       if (i != j && fabs( cur ) > 100. * INTREPID_TOL) {
00133         std::cout << "not diagonal" << i << " " << j << " " << fabs( cur ) << std::endl;
00134         errorFlag++;
00135       }
00136       if (i == j && fabs( cur ) <= 100. * INTREPID_TOL) {
00137         std::cout << "zero on diagonal" << i << " " << j << std::endl;
00138       }
00139     }
00140   }
00141   
00142   shards::CellTopology myTet_4( shards::getCellTopologyData< shards::Tetrahedron<4> >() );  
00143   const int np_lattice = PointTools::getLatticeSize( myTet_4 , deg , 0 );
00144   FieldContainer<double> lattice( np_lattice , 3 );
00145   PointTools::getLattice<double,FieldContainer<double> >( lattice , 
00146                                                           myTet_4 , 
00147                                                           deg , 
00148                                                           0 , 
00149                                                           POINTTYPE_EQUISPACED );        
00150                                 
00151   FieldContainer<double> dBasisAtLattice( polydim , np_lattice , 3 );
00152   myBasis.getValues( dBasisAtLattice , lattice , OPERATOR_D1 );
00153 
00154   const double fiat_vals[] = {
00155     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00156     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00157     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00158     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00159     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00160     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00161     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00162     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00163     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00164     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00165     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00166     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00167     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00168     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00169     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00170     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00171     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00172     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00173     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00174     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00175     5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
00176     5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
00177     5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
00178     5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
00179     5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
00180     5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
00181     5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
00182     5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
00183     5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
00184     5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
00185     5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
00186     5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
00187     5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
00188     5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
00189     5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
00190     5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
00191     5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
00192     5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
00193     5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
00194     5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
00195     0.000000000000000e+00, 4.743416490252569e+00, 1.581138830084190e+00,
00196     0.000000000000000e+00, 4.743416490252569e+00, 1.581138830084190e+00,
00197     0.000000000000000e+00, 4.743416490252568e+00, 1.581138830084190e+00,
00198     0.000000000000000e+00, 4.743416490252569e+00, 1.581138830084190e+00,
00199     0.000000000000000e+00, 4.743416490252569e+00, 1.581138830084190e+00,
00200     0.000000000000000e+00, 4.743416490252569e+00, 1.581138830084190e+00,
00201     0.000000000000000e+00, 4.743416490252569e+00, 1.581138830084190e+00,
00202     0.000000000000000e+00, 4.743416490252568e+00, 1.581138830084190e+00,
00203     0.000000000000000e+00, 4.743416490252568e+00, 1.581138830084190e+00,
00204     0.000000000000000e+00, 4.743416490252569e+00, 1.581138830084190e+00,
00205     0.000000000000000e+00, 4.743416490252569e+00, 1.581138830084190e+00,
00206     0.000000000000000e+00, 4.743416490252569e+00, 1.581138830084190e+00,
00207     0.000000000000000e+00, 4.743416490252569e+00, 1.581138830084190e+00,
00208     0.000000000000000e+00, 4.743416490252569e+00, 1.581138830084190e+00,
00209     0.000000000000000e+00, 4.743416490252569e+00, 1.581138830084190e+00,
00210     0.000000000000000e+00, 4.743416490252569e+00, 1.581138830084190e+00,
00211     0.000000000000000e+00, 4.743416490252568e+00, 1.581138830084190e+00,
00212     0.000000000000000e+00, 4.743416490252568e+00, 1.581138830084190e+00,
00213     0.000000000000000e+00, 4.743416490252568e+00, 1.581138830084190e+00,
00214     0.000000000000000e+00, 4.743416490252569e+00, 1.581138830084190e+00,
00215     0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999580e+00,
00216     0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999580e+00,
00217     0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999579e+00,
00218     0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999580e+00,
00219     0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999580e+00,
00220     0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999580e+00,
00221     0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999580e+00,
00222     0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999579e+00,
00223     0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999579e+00,
00224     0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999580e+00,
00225     0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999580e+00,
00226     0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999580e+00,
00227     0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999580e+00,
00228     0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999580e+00,
00229     0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999580e+00,
00230     0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999580e+00,
00231     0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999579e+00,
00232     0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999579e+00,
00233     0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999579e+00,
00234     0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999580e+00,
00235     -3.074085229787880e+01, -1.024695076595960e+01, -1.024695076595960e+01,
00236     -1.024695076595960e+01, 0.000000000000000e+00, 0.000000000000000e+00,
00237     1.024695076595960e+01, 1.024695076595960e+01, 1.024695076595960e+01,
00238     3.074085229787880e+01, 2.049390153191920e+01, 2.049390153191920e+01,
00239     -2.049390153191920e+01, -6.831300510639732e+00, -6.831300510639732e+00,
00240     -1.706460100885310e-15, 3.415650255319865e+00, 3.415650255319865e+00,
00241     2.049390153191919e+01, 1.366260102127946e+01, 1.366260102127946e+01,
00242     -1.024695076595960e+01, -3.415650255319866e+00, -3.415650255319866e+00,
00243     1.024695076595960e+01, 6.831300510639730e+00, 6.831300510639730e+00,
00244     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00245     -2.049390153191920e+01, -6.831300510639732e+00, -6.831300510639732e+00,
00246     -1.706460100885310e-15, 3.415650255319865e+00, 3.415650255319865e+00,
00247     2.049390153191919e+01, 1.366260102127946e+01, 1.366260102127946e+01,
00248     -1.024695076595960e+01, -3.415650255319866e+00, -3.415650255319866e+00,
00249     1.024695076595960e+01, 6.831300510639730e+00, 6.831300510639730e+00,
00250     -1.706460100885310e-15, -5.688200336284365e-16, -5.688200336284365e-16,
00251     -1.024695076595960e+01, -3.415650255319866e+00, -3.415650255319866e+00,
00252     1.024695076595960e+01, 6.831300510639730e+00, 6.831300510639730e+00,
00253     -1.706460100885310e-15, -5.688200336284365e-16, -5.688200336284365e-16,
00254     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00255     -7.937253933193772e+00, -2.381176179958132e+01, -7.937253933193772e+00,
00256     -7.937253933193772e+00, -1.058300524425836e+01, -5.291502622129182e+00,
00257     -7.937253933193772e+00, 2.645751311064589e+00, -2.645751311064591e+00,
00258     -7.937253933193772e+00, 1.587450786638754e+01, 0.000000000000000e+00,
00259     5.291502622129181e+00, -1.058300524425837e+01, -4.406061034464155e-16,
00260     5.291502622129181e+00, 2.645751311064589e+00, 2.645751311064590e+00,
00261     5.291502622129181e+00, 1.587450786638754e+01, 5.291502622129181e+00,
00262     1.852025917745213e+01, 2.645751311064588e+00, 7.937253933193770e+00,
00263     1.852025917745213e+01, 1.587450786638754e+01, 1.058300524425836e+01,
00264     3.174901573277509e+01, 1.587450786638754e+01, 1.587450786638754e+01,
00265     -5.291502622129182e+00, -1.587450786638755e+01, -5.291502622129182e+00,
00266     -5.291502622129182e+00, -2.645751311064592e+00, -2.645751311064591e+00,
00267     -5.291502622129182e+00, 1.058300524425836e+01, -8.812122068928310e-16,
00268     7.937253933193772e+00, -2.645751311064592e+00, 2.645751311064591e+00,
00269     7.937253933193772e+00, 1.058300524425836e+01, 5.291502622129181e+00,
00270     2.116601048851673e+01, 1.058300524425836e+01, 1.058300524425836e+01,
00271     -2.645751311064591e+00, -7.937253933193774e+00, -2.645751311064591e+00,
00272     -2.645751311064591e+00, 5.291502622129181e+00, -4.406061034464155e-16,
00273     1.058300524425836e+01, 5.291502622129181e+00, 5.291502622129181e+00,
00274     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00275     -6.480740698407860e+00, -3.240370349203930e+00, -2.268259244442751e+01,
00276     -6.480740698407860e+00, -3.240370349203930e+00, -9.721111047611791e+00,
00277     -6.480740698407860e+00, -3.240370349203930e+00, 3.240370349203929e+00,
00278     -6.480740698407860e+00, -3.240370349203930e+00, 1.620185174601965e+01,
00279     -6.480740698407860e+00, -3.240370349203930e+00, -1.620185174601965e+01,
00280     -6.480740698407860e+00, -3.240370349203930e+00, -3.240370349203932e+00,
00281     -6.480740698407860e+00, -3.240370349203930e+00, 9.721111047611787e+00,
00282     -6.480740698407860e+00, -3.240370349203930e+00, -9.721111047611791e+00,
00283     -6.480740698407860e+00, -3.240370349203930e+00, 3.240370349203929e+00,
00284     -6.480740698407860e+00, -3.240370349203930e+00, -3.240370349203930e+00,
00285     6.480740698407860e+00, 3.240370349203930e+00, -9.721111047611791e+00,
00286     6.480740698407860e+00, 3.240370349203930e+00, 3.240370349203929e+00,
00287     6.480740698407860e+00, 3.240370349203930e+00, 1.620185174601965e+01,
00288     6.480740698407860e+00, 3.240370349203930e+00, -3.240370349203930e+00,
00289     6.480740698407860e+00, 3.240370349203930e+00, 9.721111047611789e+00,
00290     6.480740698407860e+00, 3.240370349203930e+00, 3.240370349203929e+00,
00291     1.944222209522358e+01, 9.721111047611791e+00, 3.240370349203930e+00,
00292     1.944222209522358e+01, 9.721111047611791e+00, 1.620185174601965e+01,
00293     1.944222209522358e+01, 9.721111047611791e+00, 9.721111047611789e+00,
00294     3.240370349203930e+01, 1.620185174601965e+01, 1.620185174601965e+01,
00295     0.000000000000000e+00, -1.833030277982336e+01, -4.582575694955840e+00,
00296     0.000000000000000e+00, -1.833030277982336e+01, -4.582575694955840e+00,
00297     0.000000000000000e+00, -1.833030277982336e+01, -4.582575694955839e+00,
00298     0.000000000000000e+00, -1.833030277982336e+01, -4.582575694955840e+00,
00299     0.000000000000000e+00, -3.055050463303894e+00, 1.527525231651946e+00,
00300     0.000000000000000e+00, -3.055050463303894e+00, 1.527525231651946e+00,
00301     0.000000000000000e+00, -3.055050463303894e+00, 1.527525231651946e+00,
00302     0.000000000000000e+00, 1.222020185321557e+01, 7.637626158259732e+00,
00303     0.000000000000000e+00, 1.222020185321557e+01, 7.637626158259732e+00,
00304     0.000000000000000e+00, 2.749545416973504e+01, 1.374772708486752e+01,
00305     0.000000000000000e+00, -1.222020185321557e+01, -3.055050463303894e+00,
00306     0.000000000000000e+00, -1.222020185321557e+01, -3.055050463303894e+00,
00307     0.000000000000000e+00, -1.222020185321557e+01, -3.055050463303894e+00,
00308     0.000000000000000e+00, 3.055050463303893e+00, 3.055050463303893e+00,
00309     0.000000000000000e+00, 3.055050463303893e+00, 3.055050463303893e+00,
00310     0.000000000000000e+00, 1.833030277982336e+01, 9.165151389911680e+00,
00311     0.000000000000000e+00, -6.110100926607787e+00, -1.527525231651947e+00,
00312     0.000000000000000e+00, -6.110100926607787e+00, -1.527525231651947e+00,
00313     0.000000000000000e+00, 9.165151389911678e+00, 4.582575694955839e+00,
00314     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00315     0.000000000000000e+00, -5.612486080160912e+00, -1.309580085370879e+01,
00316     0.000000000000000e+00, -5.612486080160912e+00, -1.309580085370879e+01,
00317     0.000000000000000e+00, -5.612486080160911e+00, -1.309580085370879e+01,
00318     0.000000000000000e+00, -5.612486080160912e+00, -1.309580085370879e+01,
00319     0.000000000000000e+00, -5.612486080160912e+00, -1.870828693386971e+00,
00320     0.000000000000000e+00, -5.612486080160912e+00, -1.870828693386971e+00,
00321     0.000000000000000e+00, -5.612486080160912e+00, -1.870828693386971e+00,
00322     0.000000000000000e+00, -5.612486080160911e+00, 9.354143466934852e+00,
00323     0.000000000000000e+00, -5.612486080160911e+00, 9.354143466934852e+00,
00324     0.000000000000000e+00, -5.612486080160912e+00, 2.057911562725668e+01,
00325     0.000000000000000e+00, 5.612486080160912e+00, -5.612486080160912e+00,
00326     0.000000000000000e+00, 5.612486080160912e+00, -5.612486080160912e+00,
00327     0.000000000000000e+00, 5.612486080160912e+00, -5.612486080160912e+00,
00328     0.000000000000000e+00, 5.612486080160912e+00, 5.612486080160912e+00,
00329     0.000000000000000e+00, 5.612486080160912e+00, 5.612486080160912e+00,
00330     0.000000000000000e+00, 5.612486080160912e+00, 1.683745824048274e+01,
00331     0.000000000000000e+00, 1.683745824048273e+01, 1.870828693386970e+00,
00332     0.000000000000000e+00, 1.683745824048273e+01, 1.870828693386970e+00,
00333     0.000000000000000e+00, 1.683745824048273e+01, 1.309580085370879e+01,
00334     0.000000000000000e+00, 2.806243040080456e+01, 9.354143466934854e+00,
00335     0.000000000000000e+00, 0.000000000000000e+00, -1.322875655532295e+01,
00336     0.000000000000000e+00, 0.000000000000000e+00, -1.322875655532295e+01,
00337     0.000000000000000e+00, 0.000000000000000e+00, -1.322875655532295e+01,
00338     0.000000000000000e+00, 0.000000000000000e+00, -1.322875655532295e+01,
00339     0.000000000000000e+00, 0.000000000000000e+00, -1.322875655532295e+01,
00340     0.000000000000000e+00, 0.000000000000000e+00, -1.322875655532295e+01,
00341     0.000000000000000e+00, 0.000000000000000e+00, -1.322875655532295e+01,
00342     0.000000000000000e+00, 0.000000000000000e+00, -1.322875655532295e+01,
00343     0.000000000000000e+00, 0.000000000000000e+00, -1.322875655532295e+01,
00344     0.000000000000000e+00, 0.000000000000000e+00, -1.322875655532295e+01,
00345     0.000000000000000e+00, 0.000000000000000e+00, -8.812122068928310e-16,
00346     0.000000000000000e+00, 0.000000000000000e+00, -8.812122068928310e-16,
00347     0.000000000000000e+00, 0.000000000000000e+00, -8.812122068928310e-16,
00348     0.000000000000000e+00, 0.000000000000000e+00, -8.812122068928310e-16,
00349     0.000000000000000e+00, 0.000000000000000e+00, -8.812122068928310e-16,
00350     0.000000000000000e+00, 0.000000000000000e+00, -8.812122068928310e-16,
00351     0.000000000000000e+00, 0.000000000000000e+00, 1.322875655532295e+01,
00352     0.000000000000000e+00, 0.000000000000000e+00, 1.322875655532295e+01,
00353     0.000000000000000e+00, 0.000000000000000e+00, 1.322875655532295e+01,
00354     0.000000000000000e+00, 0.000000000000000e+00, 2.645751311064591e+01,
00355     9.524704719832526e+01, 2.381176179958132e+01, 2.381176179958132e+01,
00356     -1.058300524425836e+01, -1.322875655532295e+01, -1.322875655532295e+01,
00357     -1.058300524425837e+01, 2.645751311064586e+00, 2.645751311064586e+00,
00358     9.524704719832526e+01, 7.143528539874394e+01, 7.143528539874394e+01,
00359     4.233202097703347e+01, 1.058300524425837e+01, 1.058300524425837e+01,
00360     -1.058300524425836e+01, -5.291502622129184e+00, -5.291502622129184e+00,
00361     4.233202097703344e+01, 3.174901573277508e+01, 3.174901573277508e+01,
00362     1.058300524425837e+01, 2.645751311064592e+00, 2.645751311064592e+00,
00363     1.058300524425836e+01, 7.937253933193769e+00, 7.937253933193769e+00,
00364     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00365     4.233202097703347e+01, 1.058300524425837e+01, 1.058300524425837e+01,
00366     -1.058300524425836e+01, -5.291502622129184e+00, -5.291502622129184e+00,
00367     4.233202097703344e+01, 3.174901573277508e+01, 3.174901573277508e+01,
00368     1.058300524425837e+01, 2.645751311064592e+00, 2.645751311064592e+00,
00369     1.058300524425836e+01, 7.937253933193769e+00, 7.937253933193769e+00,
00370     2.935026245019504e-31, 7.337565612548760e-32, 7.337565612548760e-32,
00371     1.058300524425837e+01, 2.645751311064592e+00, 2.645751311064592e+00,
00372     1.058300524425836e+01, 7.937253933193769e+00, 7.937253933193769e+00,
00373     2.935026245019504e-31, 7.337565612548760e-32, 7.337565612548760e-32,
00374     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00375     4.024922359499622e+01, 6.037383539249433e+01, 2.012461179749811e+01,
00376     1.341640786499874e+01, -1.565247584249853e+01, -2.236067977499790e+00,
00377     -1.341640786499874e+01, -2.906888370749726e+01, -1.565247584249853e+01,
00378     -4.024922359499622e+01, 2.012461179749811e+01, -2.012461179749811e+01,
00379     -3.577708763999664e+01, 8.944271909999161e+00, -8.944271909999159e+00,
00380     -2.979040983896728e-15, -4.472135954999583e+00, 4.472135954999577e+00,
00381     3.577708763999663e+01, 4.472135954999577e+01, 2.683281572999747e+01,
00382     -4.919349550499538e+01, -1.118033988749895e+01, -1.565247584249853e+01,
00383     4.919349550499536e+01, 3.801315561749642e+01, 3.354101966249684e+01,
00384     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00385     1.788854381999832e+01, 2.683281572999748e+01, 8.944271909999161e+00,
00386     1.489520491948364e-15, -1.341640786499874e+01, -4.472135954999580e+00,
00387     -1.788854381999832e+01, 8.944271909999145e+00, -8.944271909999161e+00,
00388     -2.236067977499789e+01, -2.236067977499788e+00, -6.708203932499368e+00,
00389     2.236067977499789e+01, 2.012461179749810e+01, 1.565247584249852e+01,
00390     -8.937122951690183e-15, -2.979040983896728e-15, -2.979040983896728e-15,
00391     4.472135954999580e+00, 6.708203932499371e+00, 2.236067977499790e+00,
00392     -4.472135954999580e+00, 2.236067977499787e+00, -2.236067977499790e+00,
00393     -4.468561475845092e-15, -1.489520491948364e-15, -1.489520491948364e-15,
00394     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00395     3.485685011586675e+01, 1.161895003862225e+01, 5.809475019311125e+01,
00396     1.161895003862225e+01, 0.000000000000000e+00, -1.549193338482967e+01,
00397     -1.161895003862225e+01, -1.161895003862225e+01, -2.711088342345191e+01,
00398     -3.485685011586675e+01, -2.323790007724450e+01, 2.323790007724450e+01,
00399     2.323790007724450e+01, 7.745966692414833e+00, 2.840187787218773e+01,
00400     1.934943878227166e-15, -3.872983346207416e+00, -1.420093893609386e+01,
00401     -2.323790007724450e+01, -1.549193338482966e+01, 5.163977794943212e+00,
00402     1.161895003862225e+01, 3.872983346207417e+00, 9.036961141150641e+00,
00403     -1.161895003862225e+01, -7.745966692414831e+00, -2.581988897471612e+00,
00404     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00405     -3.872983346207416e+01, -1.290994448735805e+01, 7.745966692414837e+00,
00406     -3.224906463711944e-15, 6.454972243679026e+00, -3.872983346207421e+00,
00407     3.872983346207415e+01, 2.581988897471610e+01, 4.647580015448898e+01,
00408     -1.936491673103708e+01, -6.454972243679027e+00, -1.290994448735804e+00,
00409     1.936491673103708e+01, 1.290994448735805e+01, 1.807392228230127e+01,
00410     -3.224906463711944e-15, -1.074968821237314e-15, -1.074968821237314e-15,
00411     -5.034878350069641e+01, -1.678292783356547e+01, -1.161895003862225e+01,
00412     5.034878350069641e+01, 3.356585566713093e+01, 3.872983346207415e+01,
00413     -8.384756805651052e-15, -2.794918935217017e-15, -2.794918935217017e-15,
00414     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00415     1.039230484541326e+01, 6.754998149518620e+01, 1.558845726811989e+01,
00416     1.039230484541326e+01, 2.598076211353317e+01, 8.660254037844389e+00,
00417     1.039230484541326e+01, -1.558845726811989e+01, 1.732050807568879e+00,
00418     1.039230484541326e+01, -5.715767664977296e+01, -5.196152422706632e+00,
00419     -6.928203230275511e+00, -1.039230484541326e+01, -1.039230484541326e+01,
00420     -6.928203230275511e+00, -3.464101615137756e+00, -3.464101615137756e+00,
00421     -6.928203230275511e+00, 3.464101615137752e+00, 3.464101615137753e+00,
00422     2.424871130596427e+01, -1.558845726811990e+01, 1.732050807568872e+00,
00423     2.424871130596427e+01, 3.983716857408416e+01, 2.251666049839540e+01,
00424     1.039230484541326e+02, 5.196152422706632e+01, 5.196152422706632e+01,
00425     4.618802153517007e+00, 3.002221399786055e+01, 6.928203230275511e+00,
00426     4.618802153517007e+00, 2.309401076758505e+00, 2.309401076758504e+00,
00427     4.618802153517007e+00, -2.540341184434353e+01, -2.309401076758502e+00,
00428     1.154700538379250e+00, -9.814954576223640e+00, -4.041451884327382e+00,
00429     1.154700538379250e+00, 1.096965511460288e+01, 5.196152422706630e+00,
00430     4.618802153517006e+01, 2.309401076758502e+01, 2.309401076758503e+01,
00431     1.154700538379252e+00, 7.505553499465138e+00, 1.732050807568878e+00,
00432     1.154700538379252e+00, -6.350852961085883e+00, -5.773502691896256e-01,
00433     1.154700538379251e+01, 5.773502691896255e+00, 5.773502691896256e+00,
00434     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00435     9.000000000000000e+00, 2.700000000000000e+01, 4.500000000000000e+01,
00436     9.000000000000000e+00, 1.200000000000000e+01, 1.800000000000000e+01,
00437     9.000000000000000e+00, -2.999999999999998e+00, -8.999999999999996e+00,
00438     9.000000000000000e+00, -1.800000000000000e+01, -3.600000000000000e+01,
00439     -6.000000000000000e+00, 1.200000000000000e+01, -1.600000000000000e+01,
00440     -6.000000000000000e+00, -2.999999999999998e+00, -3.000000000000001e+00,
00441     -6.000000000000000e+00, -1.800000000000000e+01, 9.999999999999996e+00,
00442     -2.100000000000000e+01, -2.999999999999997e+00, -3.700000000000000e+01,
00443     -2.100000000000000e+01, -1.800000000000000e+01, 1.599999999999999e+01,
00444     -3.600000000000000e+01, -1.800000000000000e+01, -1.800000000000000e+01,
00445     -1.000000000000000e+01, -3.000000000000001e+01, 6.000000000000003e+00,
00446     -1.000000000000000e+01, -5.000000000000002e+00, -4.999999999999999e+00,
00447     -1.000000000000000e+01, 1.999999999999999e+01, -1.600000000000000e+01,
00448     1.500000000000000e+01, -5.000000000000002e+00, -7.000000000000002e+00,
00449     1.500000000000000e+01, 1.999999999999999e+01, 2.199999999999999e+01,
00450     3.999999999999999e+01, 1.999999999999999e+01, 1.999999999999999e+01,
00451     -1.300000000000000e+01, -3.900000000000001e+01, -8.999999999999998e+00,
00452     -1.300000000000000e+01, 2.599999999999999e+01, -4.000000000000002e+00,
00453     5.199999999999999e+01, 2.599999999999999e+01, 2.599999999999999e+01,
00454     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00455     7.348469228349536e+00, 3.674234614174768e+00, 5.511351921262152e+01,
00456     7.348469228349536e+00, 3.674234614174768e+00, 2.082066281365702e+01,
00457     7.348469228349536e+00, 3.674234614174768e+00, -1.347219358530748e+01,
00458     7.348469228349536e+00, 3.674234614174768e+00, -4.776504998427198e+01,
00459     7.348469228349536e+00, 3.674234614174768e+00, 3.796709101313927e+01,
00460     7.348469228349536e+00, 3.674234614174768e+00, 3.674234614174771e+00,
00461     7.348469228349536e+00, 3.674234614174768e+00, -3.061862178478972e+01,
00462     7.348469228349536e+00, 3.674234614174768e+00, 2.082066281365702e+01,
00463     7.348469228349536e+00, 3.674234614174768e+00, -1.347219358530748e+01,
00464     7.348469228349536e+00, 3.674234614174768e+00, 3.674234614174768e+00,
00465     -4.082482904638631e+00, -2.041241452319316e+00, -1.347219358530748e+01,
00466     -4.082482904638631e+00, -2.041241452319316e+00, -2.041241452319317e+00,
00467     -4.082482904638631e+00, -2.041241452319316e+00, 9.389710680668845e+00,
00468     -4.082482904638631e+00, -2.041241452319316e+00, -7.756717518813399e+00,
00469     -4.082482904638631e+00, -2.041241452319316e+00, 3.674234614174765e+00,
00470     -4.082482904638631e+00, -2.041241452319316e+00, -2.041241452319317e+00,
00471     3.021037349432586e+01, 1.510518674716293e+01, -1.347219358530748e+01,
00472     3.021037349432586e+01, 1.510518674716293e+01, 4.368256707963334e+01,
00473     3.021037349432586e+01, 1.510518674716293e+01, 1.510518674716292e+01,
00474     1.102270384252430e+02, 5.511351921262151e+01, 5.511351921262151e+01,
00475     0.000000000000000e+00, 4.500000000000001e+01, 9.000000000000000e+00,
00476     0.000000000000000e+00, 4.500000000000001e+01, 9.000000000000000e+00,
00477     0.000000000000000e+00, 4.499999999999999e+01, 9.000000000000000e+00,
00478     0.000000000000000e+00, 4.500000000000001e+01, 9.000000000000000e+00,
00479     0.000000000000000e+00, -1.000000000000000e+01, -5.999999999999999e+00,
00480     0.000000000000000e+00, -1.000000000000000e+01, -5.999999999999999e+00,
00481     0.000000000000000e+00, -1.000000000000000e+01, -5.999999999999999e+00,
00482     0.000000000000000e+00, 4.999999999999996e+00, 8.999999999999996e+00,
00483     0.000000000000000e+00, 4.999999999999996e+00, 8.999999999999996e+00,
00484     0.000000000000000e+00, 9.000000000000000e+01, 5.400000000000000e+01,
00485     0.000000000000000e+00, 2.000000000000000e+01, 4.000000000000000e+00,
00486     0.000000000000000e+00, 2.000000000000000e+01, 4.000000000000000e+00,
00487     0.000000000000000e+00, 2.000000000000000e+01, 4.000000000000000e+00,
00488     0.000000000000000e+00, -5.000000000000002e+00, -1.000000000000001e+00,
00489     0.000000000000000e+00, -5.000000000000002e+00, -1.000000000000001e+00,
00490     0.000000000000000e+00, 4.000000000000000e+01, 2.400000000000000e+01,
00491     0.000000000000000e+00, 5.000000000000000e+00, 1.000000000000000e+00,
00492     0.000000000000000e+00, 5.000000000000000e+00, 1.000000000000000e+00,
00493     0.000000000000000e+00, 9.999999999999996e+00, 5.999999999999998e+00,
00494     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00495     0.000000000000000e+00, 2.078460969082653e+01, 2.598076211353316e+01,
00496     0.000000000000000e+00, 2.078460969082653e+01, 2.598076211353316e+01,
00497     0.000000000000000e+00, 2.078460969082652e+01, 2.598076211353316e+01,
00498     0.000000000000000e+00, 2.078460969082653e+01, 2.598076211353316e+01,
00499     0.000000000000000e+00, 3.464101615137756e+00, -1.327905619136139e+01,
00500     0.000000000000000e+00, 3.464101615137756e+00, -1.327905619136139e+01,
00501     0.000000000000000e+00, 3.464101615137756e+00, -1.327905619136139e+01,
00502     0.000000000000000e+00, -1.385640646055102e+01, -6.350852961085886e+00,
00503     0.000000000000000e+00, -1.385640646055102e+01, -6.350852961085886e+00,
00504     0.000000000000000e+00, -3.117691453623979e+01, 4.676537180435969e+01,
00505     0.000000000000000e+00, -2.309401076758503e+01, 3.464101615137756e+00,
00506     0.000000000000000e+00, -2.309401076758503e+01, 3.464101615137756e+00,
00507     0.000000000000000e+00, -2.309401076758503e+01, 3.464101615137756e+00,
00508     0.000000000000000e+00, 5.773502691896256e+00, 1.154700538379249e+00,
00509     0.000000000000000e+00, 5.773502691896256e+00, 1.154700538379249e+00,
00510     0.000000000000000e+00, 3.464101615137754e+01, 4.503332099679081e+01,
00511     0.000000000000000e+00, -3.002221399786054e+01, -5.196152422706631e+00,
00512     0.000000000000000e+00, -3.002221399786054e+01, -5.196152422706631e+00,
00513     0.000000000000000e+00, 4.503332099679080e+01, 2.944486372867091e+01,
00514     0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00515     0.000000000000000e+00, 6.363961030678929e+00, 3.181980515339464e+01,
00516     0.000000000000000e+00, 6.363961030678929e+00, 3.181980515339464e+01,
00517     0.000000000000000e+00, 6.363961030678928e+00, 3.181980515339464e+01,
00518     0.000000000000000e+00, 6.363961030678929e+00, 3.181980515339464e+01,
00519     0.000000000000000e+00, 6.363961030678929e+00, 2.121320343559643e+00,
00520     0.000000000000000e+00, 6.363961030678929e+00, 2.121320343559643e+00,
00521     0.000000000000000e+00, 6.363961030678929e+00, 2.121320343559643e+00,
00522     0.000000000000000e+00, 6.363961030678928e+00, -2.757716446627535e+01,
00523     0.000000000000000e+00, 6.363961030678928e+00, -2.757716446627535e+01,
00524     0.000000000000000e+00, 6.363961030678929e+00, -5.727564927611036e+01,
00525     0.000000000000000e+00, -3.535533905932738e+00, -7.778174593052023e+00,
00526     0.000000000000000e+00, -3.535533905932738e+00, -7.778174593052023e+00,
00527     0.000000000000000e+00, -3.535533905932738e+00, -7.778174593052023e+00,
00528     0.000000000000000e+00, -3.535533905932738e+00, 2.121320343559642e+00,
00529     0.000000000000000e+00, -3.535533905932738e+00, 2.121320343559642e+00,
00530     0.000000000000000e+00, -3.535533905932738e+00, 1.202081528017131e+01,
00531     0.000000000000000e+00, 2.616295090390225e+01, -7.778174593052024e+00,
00532     0.000000000000000e+00, 2.616295090390225e+01, -7.778174593052024e+00,
00533     0.000000000000000e+00, 2.616295090390225e+01, 4.171930009000628e+01,
00534     0.000000000000000e+00, 9.545941546018391e+01, 3.181980515339464e+01,
00535     0.000000000000000e+00, 0.000000000000000e+00, 2.700000000000001e+01,
00536     0.000000000000000e+00, 0.000000000000000e+00, 2.700000000000001e+01,
00537     0.000000000000000e+00, 0.000000000000000e+00, 2.700000000000000e+01,
00538     0.000000000000000e+00, 0.000000000000000e+00, 2.700000000000001e+01,
00539     0.000000000000000e+00, 0.000000000000000e+00, 2.700000000000001e+01,
00540     0.000000000000000e+00, 0.000000000000000e+00, 2.700000000000001e+01,
00541     0.000000000000000e+00, 0.000000000000000e+00, 2.700000000000001e+01,
00542     0.000000000000000e+00, 0.000000000000000e+00, 2.700000000000000e+01,
00543     0.000000000000000e+00, 0.000000000000000e+00, 2.700000000000000e+01,
00544     0.000000000000000e+00, 0.000000000000000e+00, 2.700000000000001e+01,
00545     0.000000000000000e+00, 0.000000000000000e+00, -8.000000000000000e+00,
00546     0.000000000000000e+00, 0.000000000000000e+00, -8.000000000000000e+00,
00547     0.000000000000000e+00, 0.000000000000000e+00, -8.000000000000000e+00,
00548     0.000000000000000e+00, 0.000000000000000e+00, -8.000000000000000e+00,
00549     0.000000000000000e+00, 0.000000000000000e+00, -8.000000000000000e+00,
00550     0.000000000000000e+00, 0.000000000000000e+00, -8.000000000000000e+00,
00551     0.000000000000000e+00, 0.000000000000000e+00, 1.299999999999999e+01,
00552     0.000000000000000e+00, 0.000000000000000e+00, 1.299999999999999e+01,
00553     0.000000000000000e+00, 0.000000000000000e+00, 1.299999999999999e+01,
00554     0.000000000000000e+00, 0.000000000000000e+00, 9.000000000000000e+01
00555   };
00556 
00557   int fiat_index_cur = 0;
00558   for (int i=0;i<polydim;i++) {
00559     for (int j=0;j<np_lattice;j++) {
00560       for (int k=0;k<3;k++) {
00561         if (std::abs( dBasisAtLattice(i,j,k) - fiat_vals[fiat_index_cur] ) > 10.0*INTREPID_TOL ) {
00562           errorFlag++;
00563           *outStream << std::setw(70) << "^^^^----FAILURE!" << "\n";
00564           
00565           // Output the multi-index of the value where the error is:
00566           *outStream << " At multi-index { ";
00567           *outStream << i << " " << j << " " << k;
00568           *outStream << "}  computed value: " << dBasisAtLattice(i,j,k)
00569                      << " but correct value: " << fiat_vals[fiat_index_cur] << "\n";
00570           *outStream << "Difference: " << std::abs( dBasisAtLattice(i,j,k) - fiat_vals[fiat_index_cur] ) << "\n";
00571         }
00572         fiat_index_cur++;
00573       }
00574     }
00575   }
00576 
00577 
00578   if (errorFlag != 0)
00579     std::cout << "End Result: TEST FAILED\n";
00580   else
00581     std::cout << "End Result: TEST PASSED\n";
00582   
00583   // reset format state of std::cout
00584   std::cout.copyfmt(oldFormatState);
00585   
00586   return errorFlag;
00587 }