55 #include "Teuchos_oblackholestream.hpp"
56 #include "Teuchos_RCP.hpp"
57 #include "Teuchos_GlobalMPISession.hpp"
60 using namespace Intrepid;
62 #define INTREPID_TEST_COMMAND( S ) \
67 catch (const std::logic_error & err) { \
68 *outStream << "Expected Error ----------------------------------------------------------------\n"; \
69 *outStream << err.what() << '\n'; \
70 *outStream << "-------------------------------------------------------------------------------" << "\n\n"; \
75 int main(
int argc,
char *argv[]) {
77 Teuchos::GlobalMPISession mpiSession(&argc, &argv);
81 int iprint = argc - 1;
82 Teuchos::RCP<std::ostream> outStream;
83 Teuchos::oblackholestream bhs;
85 outStream = Teuchos::rcp(&std::cout,
false);
87 outStream = Teuchos::rcp(&bhs,
false);
90 Teuchos::oblackholestream oldFormatState;
91 oldFormatState.copyfmt(std::cout);
94 <<
"===============================================================================\n" \
96 <<
"| Unit Test (TensorProductSpaceTools) |\n" \
98 <<
"| 1) exception testing |\n" \
100 <<
"| Questions? Contact Pavel Bochev (pbboche@sandia.gov) or |\n" \
101 <<
"| Denis Ridzal (dridzal@sandia.gov). |\n" \
103 <<
"| Intrepid's website: http://trilinos.sandia.gov/packages/intrepid |\n" \
104 <<
"| Trilinos website: http://trilinos.sandia.gov |\n" \
106 <<
"===============================================================================\n";
109 #ifdef HAVE_INTREPID_DEBUG
110 const int numTotalExceptions = 7;
111 int beginThrowNumber = Teuchos::TestForException_getThrowNumber();
112 int endThrowNumber = beginThrowNumber + numTotalExceptions;
117 <<
"===============================================================================\n"\
118 <<
"| TEST 1: exceptions |\n"\
119 <<
"===============================================================================\n";
122 #ifdef HAVE_INTREPID_DEBUG
131 Array<RCP<FieldContainer<double> > > bases_2(2);
132 Array<RCP<FieldContainer<double> > > bases_1(1);
133 bases_2[0] = Teuchos::rcp( &a_2_2 ,
false );
134 bases_2[1] = Teuchos::rcp( &a_2_2 ,
false );
135 bases_1[0] = Teuchos::rcp( &a_2_2 ,
false );
140 INTREPID_TEST_COMMAND( tpst::evaluate<double>( a_4 , a_4_1_4 , bases_2 ) );
142 INTREPID_TEST_COMMAND( tpst::evaluate<double>( a_4_4 , a_4_4 , bases_2 ) );
144 INTREPID_TEST_COMMAND( tpst::evaluate<double>( a_4_4 , a_4_4, bases_1 ) );
146 bases_2[1] = Teuchos::rcp( & a_2 ,
false );
147 INTREPID_TEST_COMMAND( tpst::evaluate<double>( a_4_4 , a_4_4, bases_2 ) );
149 bases_2[1] = Teuchos::rcp( &a_2_2 ,
false );
150 INTREPID_TEST_COMMAND( tpst::evaluate<double>( a_2_2 , a_4_4, bases_2 ) );
152 INTREPID_TEST_COMMAND( tpst::evaluate<double>( a_4_2 , a_4_4 , bases_2 ) );
154 INTREPID_TEST_COMMAND( tpst::evaluate<double>( a_4_4 , a_4_2 , bases_2 ) );
161 catch (
const std::logic_error & err) {
162 *outStream <<
"UNEXPECTED ERROR !!! ----------------------------------------------------------\n";
163 *outStream << err.what() <<
'\n';
164 *outStream <<
"-------------------------------------------------------------------------------" <<
"\n\n";
168 #ifdef HAVE_INTREPID_DEBUG
169 if (Teuchos::TestForException_getThrowNumber() != endThrowNumber)
174 std::cout <<
"End Result: TEST FAILED\n";
176 std::cout <<
"End Result: TEST PASSED\n";
179 std::cout.copyfmt(oldFormatState);
Header file for utility class to provide multidimensional containers.
Header file for the abstract base class Intrepid::DefaultCubatureFactory.
Header file for the Intrepid::HGRAD_QUAD_Cn_FEM class.