51 #include "Teuchos_oblackholestream.hpp" 52 #include "Teuchos_RCP.hpp" 53 #include "Teuchos_GlobalMPISession.hpp" 56 #include "Shards_CellTopology.hpp" 66 int main(
int argc,
char *argv[]) {
68 Teuchos::GlobalMPISession mpiSession(&argc, &argv);
71 int iprint = argc - 1;
73 Teuchos::RCP<std::ostream> outStream;
74 Teuchos::oblackholestream bhs;
77 outStream = Teuchos::rcp(&std::cout,
false);
79 outStream = Teuchos::rcp(&bhs,
false);
82 Teuchos::oblackholestream oldFormatState;
83 oldFormatState.copyfmt(std::cout);
86 <<
"===============================================================================\n" \
88 <<
"| Unit Test HGRAD_TRI_Cn_FEM |\n" \
90 <<
"| 1) Tests triangular Lagrange basis |\n" \
92 <<
"| Questions? Contact Pavel Bochev (pbboche@sandia.gov) or |\n" \
93 <<
"| Denis Ridzal (dridzal@sandia.gov) or |\n" \
94 <<
"| Robert Kirby (robert.c.kirby@ttu.edu) |\n" \
96 <<
"| Intrepid's website: http://trilinos.sandia.gov/packages/intrepid |\n" \
97 <<
"| Trilinos website: http://trilinos.sandia.gov |\n" \
99 <<
"===============================================================================\n";
112 PointTools::getLattice<double,FieldContainer<double> >( lattice ,
116 POINTTYPE_WARPBLEND );
119 myBasis.
getValues( vals , lattice , OPERATOR_VALUE );
122 for (
int i=0;i<nbf;i++) {
123 for (
int j=0;j<np_lattice;j++) {
124 if ( i==j && std::abs( vals(i,j) - 1.0 ) > INTREPID_TOL ) {
126 *outStream << std::setw(70) <<
"^^^^----FAILURE!" <<
"\n";
127 *outStream <<
" Basis function " << i <<
" does not have unit value at its node\n";
129 if ( i!=j && std::abs( vals(i,j) ) > INTREPID_TOL ) {
131 *outStream << std::setw(70) <<
"^^^^----FAILURE!" <<
"\n";
132 *outStream <<
" Basis function " << i <<
" does not vanish at node " << j <<
"\n";
137 catch (std::exception err) {
138 *outStream << err.what() <<
"\n\n";
145 const std::vector<std::vector<std::vector<int> > >& dofdata = myBasis.
getDofOrdinalData();
146 for (
unsigned d=0;d<dofdata.size();d++) {
147 std::cout <<
"Dimension " << d <<
"\n";
148 for (
unsigned f=0;f<dofdata[d].size();f++) {
149 std::cout <<
"\tFacet number " << f <<
"\n";
150 std::cout <<
"\t\tDOFS:\n";
151 for (
unsigned n=0;n<dofdata[d][f].size();n++) {
152 std::cout <<
"\t\t\t" << dofdata[d][f][n] <<
"\n";
157 catch (std::exception err) {
158 *outStream << err.what() <<
"\n\n";
170 PointTools::getLattice<double,FieldContainer<double> >( lattice ,
174 POINTTYPE_WARPBLEND );
177 myBasis.
getValues( vals , lattice , OPERATOR_CURL );
179 std::cout << vals << std::endl;
181 catch (std::exception err) {
182 *outStream << err.what() <<
"\n\n";
188 std::cout <<
"End Result: TEST FAILED\n";
190 std::cout <<
"End Result: TEST PASSED\n";
193 std::cout.copyfmt(oldFormatState);
Header file for the Intrepid::HGRAD_TRI_Cn_FEM class.
int main(int argc, char *argv[])
Performs a code-code comparison to FIAT for Nedelec bases on tets (values and curls) ...
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.