63int main(
int argc,
char *argv[]) {
65 Teuchos::GlobalMPISession mpiSession(&argc, &argv);
68 int iprint = argc - 1;
70 Teuchos::RCP<std::ostream> outStream;
71 Teuchos::oblackholestream bhs;
74 outStream = Teuchos::rcp(&std::cout,
false);
76 outStream = Teuchos::rcp(&bhs,
false);
79 Teuchos::oblackholestream oldFormatState;
80 oldFormatState.copyfmt(std::cout);
83 <<
"===============================================================================\n" \
85 <<
"| Unit Test OrthogonalBases |\n" \
87 <<
"| 1) Tests orthogonality of tetrahedral orthogonal basis |\n" \
89 <<
"| Questions? Contact Pavel Bochev (pbboche@sandia.gov) or |\n" \
90 <<
"| Denis Ridzal (dridzal@sandia.gov) or |\n" \
91 <<
"| Robert Kirby (robert.c.kirby@ttu.edu) |\n" \
93 <<
"| Intrepid's website: http://trilinos.sandia.gov/packages/intrepid |\n" \
94 <<
"| Trilinos website: http://trilinos.sandia.gov |\n" \
96 <<
"===============================================================================\n";
102 CubatureDirectTetDefault<double,FieldContainer<double> > myCub(20);
103 FieldContainer<double> cubPts( myCub.getNumPoints() , 3 );
104 FieldContainer<double> cubWts( myCub.getNumPoints() );
106 myCub.getCubature( cubPts , cubWts );
110 const int polydim = (deg+1)*(deg+2)*(deg+3)/6;
111 FieldContainer<double> basisAtCubPts( polydim , myCub.getNumPoints() );
112 OrthogonalBases::tabulateTetrahedron<double,FieldContainer<double>,FieldContainer<double> >( cubPts , deg , basisAtCubPts );
115 for (
int i=0;i<polydim;i++) {
116 for (
int j=0;j<polydim;j++) {
118 for (
int k=0;k<myCub.getNumPoints();k++) {
119 cur += cubWts(k) * basisAtCubPts( i , k ) * basisAtCubPts( j , k );
121 if (i != j && fabs( cur ) > 20.0 * INTREPID_TOL) {
122 std::cout << INTREPID_TOL << std::endl;
123 std::cout << i <<
" " << j <<
" " << cur << std::endl;
126 else if (i == j && fabs( cur ) < 20.0 * INTREPID_TOL ) {
127 std::cout << i <<
" " << j <<
" " << cur << std::endl;
136 std::cout <<
"End Result: TEST FAILED\n";
138 std::cout <<
"End Result: TEST PASSED\n";
141 std::cout.copyfmt(oldFormatState);