Intrepid
/usr/src/RPM/BUILD/trilinos10-10.6.4/packages/intrepid/test/Discretization/Basis/HDIV_TET_In_FEM/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 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Pavel Bochev (pbboche@sandia.gov) or
00025 //                    Denis Ridzal (dridzal@sandia.gov) or
00026 //                    Robert Kirby (robert.c.kirby@ttu.edu)
00027 //
00028 // ************************************************************************
00029 // @HEADER
00030 
00031 
00037 #include "Intrepid_FieldContainer.hpp"
00038 #include "Teuchos_oblackholestream.hpp"
00039 #include "Teuchos_RCP.hpp"
00040 #include "Teuchos_GlobalMPISession.hpp"
00041 #include "Intrepid_PointTools.hpp"
00042 #include "Intrepid_HDIV_TET_In_FEM.hpp"
00043 #include "Shards_CellTopology.hpp"
00044 
00045 #include <iostream>
00046 using namespace Intrepid;
00047 
00052 int main(int argc, char *argv[]) {
00053 
00054   Teuchos::GlobalMPISession mpiSession(&argc, &argv);
00055   
00056   // This little trick lets us print to std::cout only if a (dummy) command-line argument is provided.
00057   int iprint     = argc - 1;
00058   
00059   Teuchos::RCP<std::ostream> outStream;
00060   Teuchos::oblackholestream bhs; // outputs nothing
00061   
00062   if (iprint > 0)
00063     outStream = Teuchos::rcp(&std::cout, false);
00064   else
00065     outStream = Teuchos::rcp(&bhs, false);
00066   
00067   // Save the format state of the original std::cout.
00068   Teuchos::oblackholestream oldFormatState;
00069   oldFormatState.copyfmt(std::cout);
00070   
00071   *outStream \
00072     << "===============================================================================\n" \
00073     << "|                                                                             |\n" \
00074     << "|                           Unit Test HDIV_TET_In_FEM                         |\n" \
00075     << "|                                                                             |\n" \
00076     << "|     1) Tests tetrahedral Raviart-Thomas basis                               |\n" \
00077     << "|                                                                             |\n" \
00078     << "|  Questions? Contact  Pavel Bochev (pbboche@sandia.gov) or                   |\n" \
00079     << "|                      Denis Ridzal (dridzal@sandia.gov) or                   |\n" \
00080     << "|                      Robert Kirby (robert.c.kirby@ttu.edu)                  |\n" \
00081     << "|                                                                             |\n" \
00082     << "|  Intrepid's website: http://trilinos.sandia.gov/packages/intrepid           |\n" \
00083     << "|  Trilinos website:   http://trilinos.sandia.gov                             |\n" \
00084     << "|                                                                             |\n" \
00085     << "===============================================================================\n";
00086   
00087   int errorFlag  = 0;
00088 
00089   // test for basis values, compare against fiat
00090   try {
00091     const int deg = 2;
00092     Basis_HDIV_TET_In_FEM<double,FieldContainer<double> >  myBasis( deg , POINTTYPE_EQUISPACED );
00093 
00094     // Get a lattice
00095     const int np_lattice = PointTools::getLatticeSize( myBasis.getBaseCellTopology() , deg , 0 );
00096     FieldContainer<double> lattice( np_lattice , 3 );
00097     FieldContainer<double> myBasisValues( myBasis.getCardinality() , np_lattice , 3 );
00098     PointTools::getLattice<double,FieldContainer<double> >( lattice , 
00099                                                             myBasis.getBaseCellTopology() , 
00100                                                             deg , 
00101                                                             0 , 
00102                                                             POINTTYPE_EQUISPACED );    
00103 
00104     myBasis.getValues( myBasisValues , lattice , OPERATOR_VALUE );
00105 
00106 
00107     const double fiat_vals[] = {
00108       0.000000000000000e+00, -6.000000000000000e+00, 0.000000000000000e+00,
00109       1.000000000000000e+00, -2.000000000000000e+00, 0.000000000000000e+00,
00110       -2.000000000000000e+00, 2.000000000000000e+00, 0.000000000000000e+00,
00111       0.000000000000000e+00, -1.000000000000000e+00, 0.000000000000000e+00,
00112       -1.000000000000000e+00, 1.000000000000000e+00, 0.000000000000000e+00,
00113       0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00114       0.000000000000000e+00, -2.000000000000000e+00, 1.000000000000000e+00,
00115       -1.000000000000000e+00, 2.000000000000000e+00, -1.000000000000000e+00,
00116       0.000000000000000e+00, 1.000000000000000e+00, -1.000000000000000e+00,
00117       0.000000000000000e+00, 2.000000000000000e+00, -2.000000000000000e+00,
00118       0.000000000000000e+00, 2.000000000000000e+00, 0.000000000000000e+00,
00119       1.000000000000000e+00, -2.000000000000000e+00, 0.000000000000000e+00,
00120       6.000000000000000e+00, -6.000000000000000e+00, 0.000000000000000e+00,
00121       0.000000000000000e+00, 1.000000000000000e+00, 0.000000000000000e+00,
00122       1.000000000000000e+00, -1.000000000000000e+00, 0.000000000000000e+00,
00123       0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00124       0.000000000000000e+00, 2.000000000000000e+00, -1.000000000000000e+00,
00125       1.000000000000000e+00, -2.000000000000000e+00, 1.000000000000000e+00,
00126       0.000000000000000e+00, 1.000000000000000e+00, -1.000000000000000e+00,
00127       0.000000000000000e+00, 2.000000000000000e+00, -2.000000000000000e+00,
00128       0.000000000000000e+00, 2.000000000000000e+00, 0.000000000000000e+00,
00129       -1.000000000000000e+00, 2.000000000000000e+00, 0.000000000000000e+00,
00130       -2.000000000000000e+00, 2.000000000000000e+00, 0.000000000000000e+00,
00131       0.000000000000000e+00, 1.000000000000000e+00, 0.000000000000000e+00,
00132       -1.000000000000000e+00, 1.000000000000000e+00, 0.000000000000000e+00,
00133       0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00134       0.000000000000000e+00, -2.000000000000000e+00, 1.000000000000000e+00,
00135       1.000000000000000e+00, -2.000000000000000e+00, 1.000000000000000e+00,
00136       0.000000000000000e+00, -1.000000000000000e+00, 1.000000000000000e+00,
00137       0.000000000000000e+00, -6.000000000000000e+00, 6.000000000000000e+00,
00138       0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00139       1.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00140       6.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00141       0.000000000000000e+00, -1.000000000000000e+00, 0.000000000000000e+00,
00142       1.000000000000000e+00, 1.000000000000000e+00, 0.000000000000000e+00,
00143       0.000000000000000e+00, -2.000000000000000e+00, 0.000000000000000e+00,
00144       0.000000000000000e+00, 0.000000000000000e+00, -1.000000000000000e+00,
00145       1.000000000000000e+00, 0.000000000000000e+00, 1.000000000000000e+00,
00146       0.000000000000000e+00, -1.000000000000000e+00, -1.000000000000000e+00,
00147       0.000000000000000e+00, 0.000000000000000e+00, -2.000000000000000e+00,
00148       0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00149       -1.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00150       -2.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00151       0.000000000000000e+00, 1.000000000000000e+00, 0.000000000000000e+00,
00152       1.000000000000000e+00, 1.000000000000000e+00, 0.000000000000000e+00,
00153       0.000000000000000e+00, 6.000000000000000e+00, 0.000000000000000e+00,
00154       0.000000000000000e+00, 0.000000000000000e+00, -1.000000000000000e+00,
00155       -1.000000000000000e+00, 0.000000000000000e+00, -1.000000000000000e+00,
00156       0.000000000000000e+00, 1.000000000000000e+00, 1.000000000000000e+00,
00157       0.000000000000000e+00, 0.000000000000000e+00, -2.000000000000000e+00,
00158       0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00159       -1.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00160       -2.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00161       0.000000000000000e+00, -1.000000000000000e+00, 0.000000000000000e+00,
00162       -1.000000000000000e+00, -1.000000000000000e+00, 0.000000000000000e+00,
00163       0.000000000000000e+00, -2.000000000000000e+00, 0.000000000000000e+00,
00164       0.000000000000000e+00, 0.000000000000000e+00, 1.000000000000000e+00,
00165       1.000000000000000e+00, 0.000000000000000e+00, 1.000000000000000e+00,
00166       0.000000000000000e+00, 1.000000000000000e+00, 1.000000000000000e+00,
00167       0.000000000000000e+00, 0.000000000000000e+00, 6.000000000000000e+00,
00168       -6.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00169       -1.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00170       0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00171       -2.000000000000000e+00, 1.000000000000000e+00, 0.000000000000000e+00,
00172       1.000000000000000e+00, -1.000000000000000e+00, 0.000000000000000e+00,
00173       2.000000000000000e+00, -2.000000000000000e+00, 0.000000000000000e+00,
00174       -2.000000000000000e+00, 0.000000000000000e+00, 1.000000000000000e+00,
00175       1.000000000000000e+00, 0.000000000000000e+00, -1.000000000000000e+00,
00176       2.000000000000000e+00, -1.000000000000000e+00, -1.000000000000000e+00,
00177       2.000000000000000e+00, 0.000000000000000e+00, -2.000000000000000e+00,
00178       2.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00179       1.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00180       0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00181       2.000000000000000e+00, -1.000000000000000e+00, 0.000000000000000e+00,
00182       1.000000000000000e+00, -1.000000000000000e+00, 0.000000000000000e+00,
00183       2.000000000000000e+00, -2.000000000000000e+00, 0.000000000000000e+00,
00184       -2.000000000000000e+00, 0.000000000000000e+00, 1.000000000000000e+00,
00185       -1.000000000000000e+00, 0.000000000000000e+00, 1.000000000000000e+00,
00186       -2.000000000000000e+00, 1.000000000000000e+00, 1.000000000000000e+00,
00187       -6.000000000000000e+00, 0.000000000000000e+00, 6.000000000000000e+00,
00188       2.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00189       1.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00190       0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00191       -2.000000000000000e+00, 1.000000000000000e+00, 0.000000000000000e+00,
00192       -1.000000000000000e+00, 1.000000000000000e+00, 0.000000000000000e+00,
00193       -6.000000000000000e+00, 6.000000000000000e+00, 0.000000000000000e+00,
00194       2.000000000000000e+00, 0.000000000000000e+00, -1.000000000000000e+00,
00195       1.000000000000000e+00, 0.000000000000000e+00, -1.000000000000000e+00,
00196       -2.000000000000000e+00, 1.000000000000000e+00, 1.000000000000000e+00,
00197       2.000000000000000e+00, 0.000000000000000e+00, -2.000000000000000e+00,
00198       0.000000000000000e+00, 0.000000000000000e+00, -6.000000000000000e+00,
00199       1.000000000000000e+00, 0.000000000000000e+00, -2.000000000000000e+00,
00200       -2.000000000000000e+00, 0.000000000000000e+00, 2.000000000000000e+00,
00201       0.000000000000000e+00, 1.000000000000000e+00, -2.000000000000000e+00,
00202       -1.000000000000000e+00, -1.000000000000000e+00, 2.000000000000000e+00,
00203       0.000000000000000e+00, -2.000000000000000e+00, 2.000000000000000e+00,
00204       0.000000000000000e+00, 0.000000000000000e+00, -1.000000000000000e+00,
00205       -1.000000000000000e+00, 0.000000000000000e+00, 1.000000000000000e+00,
00206       0.000000000000000e+00, -1.000000000000000e+00, 1.000000000000000e+00,
00207       0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00208       0.000000000000000e+00, 0.000000000000000e+00, 2.000000000000000e+00,
00209       -1.000000000000000e+00, 0.000000000000000e+00, 2.000000000000000e+00,
00210       -2.000000000000000e+00, 0.000000000000000e+00, 2.000000000000000e+00,
00211       0.000000000000000e+00, 1.000000000000000e+00, -2.000000000000000e+00,
00212       1.000000000000000e+00, 1.000000000000000e+00, -2.000000000000000e+00,
00213       0.000000000000000e+00, 6.000000000000000e+00, -6.000000000000000e+00,
00214       0.000000000000000e+00, 0.000000000000000e+00, 1.000000000000000e+00,
00215       -1.000000000000000e+00, 0.000000000000000e+00, 1.000000000000000e+00,
00216       0.000000000000000e+00, 1.000000000000000e+00, -1.000000000000000e+00,
00217       0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00218       0.000000000000000e+00, 0.000000000000000e+00, 2.000000000000000e+00,
00219       1.000000000000000e+00, 0.000000000000000e+00, -2.000000000000000e+00,
00220       6.000000000000000e+00, 0.000000000000000e+00, -6.000000000000000e+00,
00221       0.000000000000000e+00, -1.000000000000000e+00, 2.000000000000000e+00,
00222       1.000000000000000e+00, 1.000000000000000e+00, -2.000000000000000e+00,
00223       0.000000000000000e+00, -2.000000000000000e+00, 2.000000000000000e+00,
00224       0.000000000000000e+00, 0.000000000000000e+00, 1.000000000000000e+00,
00225       1.000000000000000e+00, 0.000000000000000e+00, -1.000000000000000e+00,
00226       0.000000000000000e+00, -1.000000000000000e+00, 1.000000000000000e+00,
00227       0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00228       0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00229       2.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00230       0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00231       0.000000000000000e+00, 1.000000000000000e+00, 0.000000000000000e+00,
00232       1.000000000000000e+00, -1.000000000000000e+00, 0.000000000000000e+00,
00233       0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00234       0.000000000000000e+00, 0.000000000000000e+00, 1.000000000000000e+00,
00235       1.000000000000000e+00, 0.000000000000000e+00, -1.000000000000000e+00,
00236       0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00237       0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00238       0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00239       1.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00240       0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00241       0.000000000000000e+00, 2.000000000000000e+00, 0.000000000000000e+00,
00242       -1.000000000000000e+00, 1.000000000000000e+00, 0.000000000000000e+00,
00243       0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00244       0.000000000000000e+00, 0.000000000000000e+00, 1.000000000000000e+00,
00245       0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00246       0.000000000000000e+00, 1.000000000000000e+00, -1.000000000000000e+00,
00247       0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00248       0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00249       1.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00250       0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00251       0.000000000000000e+00, 1.000000000000000e+00, 0.000000000000000e+00,
00252       0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00253       0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
00254       0.000000000000000e+00, 0.000000000000000e+00, 2.000000000000000e+00,
00255       -1.000000000000000e+00, 0.000000000000000e+00, 1.000000000000000e+00,
00256       0.000000000000000e+00, -1.000000000000000e+00, 1.000000000000000e+00,
00257       0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00
00258 
00259     };
00260 
00261     int cur=0;
00262     for (int i=0;i<myBasisValues.dimension(0);i++) {
00263       for (int j=0;j<myBasisValues.dimension(1);j++) {
00264         for (int k=0;k<myBasisValues.dimension(2);k++) {
00265           if (std::abs( myBasisValues(i,j,k) - fiat_vals[cur] ) > 10.0*INTREPID_TOL ) {
00266             errorFlag++;
00267             *outStream << std::setw(70) << "^^^^----FAILURE!" << "\n";
00268             
00269             // Output the multi-index of the value where the error is:
00270             *outStream << " At multi-index { ";
00271             *outStream << i << " " << j << " " << k;
00272             *outStream << "}  computed value: " << myBasisValues(i,j,k)
00273                        << " but correct value: " << fiat_vals[cur] << "\n";
00274             *outStream << "Difference: " << std::abs( myBasisValues(i,j,k) - fiat_vals[cur] ) << "\n";
00275           }
00276           cur++;
00277         }
00278       }
00279     }
00280   }
00281   catch (std::exception err) {
00282     *outStream << err.what() << "\n\n";
00283     errorFlag = -1000;
00284   }
00285   try {
00286     const int deg = 2;
00287     Basis_HDIV_TET_In_FEM<double,FieldContainer<double> >  myBasis( deg , POINTTYPE_EQUISPACED );
00288 
00289     // Get a lattice
00290     const int np_lattice = PointTools::getLatticeSize( myBasis.getBaseCellTopology() , deg , 0 );
00291     FieldContainer<double> lattice( np_lattice , 3 );
00292     FieldContainer<double> myBasisDivs( myBasis.getCardinality() , np_lattice );
00293     PointTools::getLattice<double,FieldContainer<double> >( lattice , 
00294                                                             myBasis.getBaseCellTopology() , 
00295                                                             deg , 
00296                                                             0 , 
00297                                                             POINTTYPE_EQUISPACED );    
00298 
00299     myBasis.getValues( myBasisDivs , lattice , OPERATOR_DIV );
00300 
00301     const double fiat_divs[] = {
00302       2.600000000000000e+01,
00303       1.000000000000000e+01,
00304       -6.000000000000000e+00,
00305       1.000000000000000e+01,
00306       -6.000000000000000e+00,
00307       -6.000000000000000e+00,
00308       1.000000000000000e+01,
00309       -6.000000000000000e+00,
00310       -6.000000000000000e+00,
00311       -6.000000000000000e+00,
00312       -6.000000000000000e+00,
00313       1.000000000000000e+01,
00314       2.600000000000000e+01,
00315       -6.000000000000000e+00,
00316       1.000000000000000e+01,
00317       -6.000000000000000e+00,
00318       -6.000000000000000e+00,
00319       1.000000000000000e+01,
00320       -6.000000000000000e+00,
00321       -6.000000000000000e+00,
00322       -6.000000000000000e+00,
00323       -6.000000000000000e+00,
00324       -6.000000000000000e+00,
00325       -6.000000000000000e+00,
00326       -6.000000000000000e+00,
00327       -6.000000000000000e+00,
00328       1.000000000000000e+01,
00329       1.000000000000000e+01,
00330       1.000000000000000e+01,
00331       2.600000000000000e+01,
00332       -6.000000000000000e+00,
00333       1.000000000000000e+01,
00334       2.600000000000000e+01,
00335       -6.000000000000000e+00,
00336       1.000000000000000e+01,
00337       -6.000000000000000e+00,
00338       -6.000000000000000e+00,
00339       1.000000000000000e+01,
00340       -6.000000000000000e+00,
00341       -6.000000000000000e+00,
00342       -6.000000000000000e+00,
00343       -6.000000000000000e+00,
00344       -6.000000000000000e+00,
00345       1.000000000000000e+01,
00346       1.000000000000000e+01,
00347       2.600000000000000e+01,
00348       -6.000000000000000e+00,
00349       -6.000000000000000e+00,
00350       1.000000000000000e+01,
00351       -6.000000000000000e+00,
00352       -6.000000000000000e+00,
00353       -6.000000000000000e+00,
00354       -6.000000000000000e+00,
00355       -6.000000000000000e+00,
00356       -6.000000000000000e+00,
00357       -6.000000000000000e+00,
00358       1.000000000000000e+01,
00359       1.000000000000000e+01,
00360       1.000000000000000e+01,
00361       2.600000000000000e+01,
00362       2.600000000000000e+01,
00363       1.000000000000000e+01,
00364       -6.000000000000000e+00,
00365       1.000000000000000e+01,
00366       -6.000000000000000e+00,
00367       -6.000000000000000e+00,
00368       1.000000000000000e+01,
00369       -6.000000000000000e+00,
00370       -6.000000000000000e+00,
00371       -6.000000000000000e+00,
00372       -6.000000000000000e+00,
00373       -6.000000000000000e+00,
00374       -6.000000000000000e+00,
00375       -6.000000000000000e+00,
00376       -6.000000000000000e+00,
00377       -6.000000000000000e+00,
00378       1.000000000000000e+01,
00379       1.000000000000000e+01,
00380       1.000000000000000e+01,
00381       2.600000000000000e+01,
00382       -6.000000000000000e+00,
00383       -6.000000000000000e+00,
00384       -6.000000000000000e+00,
00385       1.000000000000000e+01,
00386       1.000000000000000e+01,
00387       2.600000000000000e+01,
00388       -6.000000000000000e+00,
00389       -6.000000000000000e+00,
00390       1.000000000000000e+01,
00391       -6.000000000000000e+00,
00392       2.600000000000000e+01,
00393       1.000000000000000e+01,
00394       -6.000000000000000e+00,
00395       1.000000000000000e+01,
00396       -6.000000000000000e+00,
00397       -6.000000000000000e+00,
00398       1.000000000000000e+01,
00399       -6.000000000000000e+00,
00400       -6.000000000000000e+00,
00401       -6.000000000000000e+00,
00402       -6.000000000000000e+00,
00403       -6.000000000000000e+00,
00404       -6.000000000000000e+00,
00405       1.000000000000000e+01,
00406       1.000000000000000e+01,
00407       2.600000000000000e+01,
00408       -6.000000000000000e+00,
00409       -6.000000000000000e+00,
00410       1.000000000000000e+01,
00411       -6.000000000000000e+00,
00412       -6.000000000000000e+00,
00413       1.000000000000000e+01,
00414       2.600000000000000e+01,
00415       -6.000000000000000e+00,
00416       1.000000000000000e+01,
00417       -6.000000000000000e+00,
00418       -6.000000000000000e+00,
00419       1.000000000000000e+01,
00420       -6.000000000000000e+00,
00421       -6.000000000000000e+00,
00422       1.600000000000000e+01,
00423       0.000000000000000e+00,
00424       -1.600000000000000e+01,
00425       8.000000000000000e+00,
00426       -8.000000000000000e+00,
00427       0.000000000000000e+00,
00428       8.000000000000000e+00,
00429       -8.000000000000000e+00,
00430       0.000000000000000e+00,
00431       0.000000000000000e+00,
00432       1.600000000000000e+01,
00433       8.000000000000000e+00,
00434       0.000000000000000e+00,
00435       0.000000000000000e+00,
00436       -8.000000000000000e+00,
00437       -1.600000000000000e+01,
00438       8.000000000000000e+00,
00439       0.000000000000000e+00,
00440       -8.000000000000000e+00,
00441       0.000000000000000e+00,
00442       1.600000000000000e+01,
00443       8.000000000000000e+00,
00444       0.000000000000000e+00,
00445       8.000000000000000e+00,
00446       0.000000000000000e+00,
00447       0.000000000000000e+00,
00448       0.000000000000000e+00,
00449       -8.000000000000000e+00,
00450       -8.000000000000000e+00,
00451       -1.600000000000000e+01
00452 
00453     };
00454 
00455     int cur=0;
00456     for (int i=0;i<myBasisDivs.dimension(0);i++) {
00457       for (int j=0;j<myBasisDivs.dimension(1);j++) {
00458         if (std::abs( myBasisDivs(i,j) - fiat_divs[cur] ) > 10.0 * INTREPID_TOL ) {
00459           errorFlag++;
00460           *outStream << std::setw(70) << "^^^^----FAILURE!" << "\n";
00461           
00462           // Output the multi-index of the value where the error is:
00463           *outStream << " At multi-index { ";
00464           *outStream << i << " " << j;
00465           *outStream << "}  computed value: " << myBasisDivs(i,j)
00466                     << " but correct value: " << fiat_divs[cur] << "\n";
00467           *outStream << "Difference: " << std::abs( myBasisDivs(i,j) - fiat_divs[cur] ) << "\n";
00468         }
00469         cur++;
00470       }
00471     }
00472   }
00473   catch (std::exception err) {
00474     *outStream << err.what() << "\n\n";
00475     errorFlag = -1000;
00476   }
00477 
00478 
00479   if (errorFlag != 0)
00480     std::cout << "End Result: TEST FAILED\n";
00481   else
00482     std::cout << "End Result: TEST PASSED\n";
00483   
00484   // reset format state of std::cout
00485   std::cout.copyfmt(oldFormatState);
00486   
00487   return errorFlag;
00488 }