51 #include "Teuchos_oblackholestream.hpp"
52 #include "Teuchos_RCP.hpp"
53 #include "Teuchos_GlobalMPISession.hpp"
56 #include "Shards_CellTopology.hpp"
59 using namespace Intrepid;
66 int main(
int argc,
char *argv[]) {
67 Teuchos::GlobalMPISession mpiSession(&argc, &argv);
70 int iprint = argc - 1;
72 Teuchos::RCP<std::ostream> outStream;
73 Teuchos::oblackholestream bhs;
76 outStream = Teuchos::rcp(&std::cout,
false);
78 outStream = Teuchos::rcp(&bhs,
false);
81 Teuchos::oblackholestream oldFormatState;
82 oldFormatState.copyfmt(std::cout);
85 <<
"===============================================================================\n" \
87 <<
"| Unit Test HGRAD_TRI_Cn_FEM |\n" \
89 <<
"| 1) Tests triangular Lagrange basis |\n" \
91 <<
"| Questions? Contact Pavel Bochev (pbboche@sandia.gov) or |\n" \
92 <<
"| Denis Ridzal (dridzal@sandia.gov) or |\n" \
93 <<
"| Robert Kirby (robert.c.kirby@ttu.edu) |\n" \
95 <<
"| Intrepid's website: http://trilinos.sandia.gov/packages/intrepid |\n" \
96 <<
"| Trilinos website: http://trilinos.sandia.gov |\n" \
98 <<
"===============================================================================\n";
115 PointTools::getLattice<double,FieldContainer<double> >( lattice ,
119 POINTTYPE_WARPBLEND );
122 myBasis.
getValues( vals , lattice , OPERATOR_VALUE );
125 for (
int i=0;i<nbf;i++) {
126 for (
int j=0;j<np_lattice;j++) {
127 if ( i==j && std::abs( vals(i,j) - 1.0 ) > INTREPID_TOL ) {
129 *outStream << std::setw(70) <<
"^^^^----FAILURE!" <<
"\n";
130 *outStream <<
" Basis function " << i <<
" does not have unit value at its node\n";
132 if ( i!=j && std::abs( vals(i,j) ) > INTREPID_TOL ) {
134 *outStream << std::setw(70) <<
"^^^^----FAILURE!" <<
"\n";
135 *outStream <<
" Basis function " << i <<
" does not vanish at node " << j <<
"\n";
140 catch (
const std::exception & err) {
141 *outStream << err.what() <<
"\n\n";
149 const std::vector<std::vector<std::vector<int> > >& dofdata = myBasis.
getDofOrdinalData();
150 for (
unsigned d=0;d<dofdata.size();d++) {
151 std::cout <<
"Dimension " << d <<
"\n";
152 for (
unsigned f=0;f<dofdata[d].size();f++) {
153 std::cout <<
"\tFacet number " << f <<
"\n";
154 std::cout <<
"\t\tDOFS:\n";
155 for (
unsigned n=0;n<dofdata[d][f].size();n++) {
156 std::cout <<
"\t\t\t" << dofdata[d][f][n] <<
"\n";
161 catch (
const std::exception & err) {
162 *outStream << err.what() <<
"\n\n";
178 PointTools::getLattice<double,FieldContainer<double> >( lattice ,
182 POINTTYPE_WARPBLEND );
186 myBasis.
getValues( vals , lattice , OPERATOR_CURL );
188 std::cout << vals << std::endl;
190 catch (
const std::exception & err) {
191 *outStream << err.what() <<
"\n\n";
197 std::cout <<
"End Result: TEST FAILED\n";
199 std::cout <<
"End Result: TEST PASSED\n";
202 std::cout.copyfmt(oldFormatState);
Header file for the Intrepid::HGRAD_TRI_Cn_FEM class.
virtual int getCardinality() const
Returns cardinality of the basis.
Header file for utility class to provide multidimensional containers.
void getValues(ArrayScalar &outputValues, const ArrayScalar &inputPoints, const EOperator operatorType) const
Evaluation of a FEM basis on a reference Triangle cell.
Implementation of the default H(grad)-compatible Lagrange basis of arbitrary degree on Triangle cell...
virtual const shards::CellTopology getBaseCellTopology() const
Returns the base cell topology for which the basis is defined. See Shards documentation http://trilin...
virtual const std::vector< std::vector< std::vector< int > > > & getDofOrdinalData()
DoF tag to ordinal data structure.