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