Intrepid
test_01.cpp
Go to the documentation of this file.
1 // @HEADER
2 // ************************************************************************
3 //
4 // Intrepid Package
5 // Copyright (2007) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Pavel Bochev (pbboche@sandia.gov)
38 // Denis Ridzal (dridzal@sandia.gov), or
39 // Kara Peterson (kjpeter@sandia.gov)
40 //
41 // ************************************************************************
42 // @HEADER
43 
44 
51 #include "Teuchos_oblackholestream.hpp"
52 #include "Teuchos_RCP.hpp"
53 #include "Teuchos_GlobalMPISession.hpp"
54 #include "Intrepid_HGRAD_TET_Cn_FEM_ORTH.hpp"
56 #include "Shards_CellTopology.hpp"
57 #include "Intrepid_PointTools.hpp"
58 
59 #include <iostream>
60 
61 using namespace Intrepid;
62 
68 int main(int argc, char *argv[]) {
69 
70  Teuchos::GlobalMPISession mpiSession(&argc, &argv);
71 
72  // This little trick lets us print to std::cout only if a (dummy) command-line argument is provided.
73  int iprint = argc - 1;
74 
75  Teuchos::RCP<std::ostream> outStream;
76  Teuchos::oblackholestream bhs; // outputs nothing
77 
78  if (iprint > 0)
79  outStream = Teuchos::rcp(&std::cout, false);
80  else
81  outStream = Teuchos::rcp(&bhs, false);
82 
83  // Save the format state of the original std::cout.
84  Teuchos::oblackholestream oldFormatState;
85  oldFormatState.copyfmt(std::cout);
86 
87  *outStream \
88  << "===============================================================================\n" \
89  << "| |\n" \
90  << "| Unit Test OrthogonalBases |\n" \
91  << "| |\n" \
92  << "| 1) Tests orthogonality of tetrahedral orthogonal basis |\n" \
93  << "| |\n" \
94  << "| Questions? Contact Pavel Bochev (pbboche@sandia.gov) or |\n" \
95  << "| Denis Ridzal (dridzal@sandia.gov) or |\n" \
96  << "| Robert Kirby (robert.c.kirby@ttu.edu) |\n" \
97  << "| |\n" \
98  << "| Intrepid's website: http://trilinos.sandia.gov/packages/intrepid |\n" \
99  << "| Trilinos website: http://trilinos.sandia.gov |\n" \
100  << "| |\n" \
101  << "===============================================================================\n";
102 
103  int errorFlag = 0;
104 
105  const int deg = 3;
106 
108  const int polydim = myBasis.getCardinality();
109 
110  // First, get a reference quadrature rule
111 
113  FieldContainer<double> cubPts( myCub.getNumPoints() , 3 );
114  FieldContainer<double> cubWts( myCub.getNumPoints() );
115 
116  myCub.getCubature( cubPts , cubWts );
117 
118 
119  // Tabulate the basis functions at the cubature points
120  FieldContainer<double> basisAtCubPts( polydim , myCub.getNumPoints() );
121 
122  myBasis.getValues( basisAtCubPts , cubPts , OPERATOR_VALUE );
123 
124 
125  // Now let's compute the mass matrix
126  for (int i=0;i<polydim;i++) {
127  for (int j=i;j<polydim;j++) {
128  double cur = 0.0;
129  for (int k=0;k<myCub.getNumPoints();k++) {
130  cur += cubWts(k) * basisAtCubPts( i , k ) * basisAtCubPts( j , k );
131  }
132  if (i != j && fabs( cur ) > 100. * INTREPID_TOL) {
133  std::cout << "not diagonal" << i << " " << j << " " << fabs( cur ) << std::endl;
134  errorFlag++;
135  }
136  if (i == j && fabs( cur ) <= 100. * INTREPID_TOL) {
137  std::cout << "zero on diagonal" << i << " " << j << std::endl;
138  }
139  }
140  }
141 
142  shards::CellTopology myTet_4( shards::getCellTopologyData< shards::Tetrahedron<4> >() );
143  const int np_lattice = PointTools::getLatticeSize( myTet_4 , deg , 0 );
144  FieldContainer<double> lattice( np_lattice , 3 );
145  PointTools::getLattice<double,FieldContainer<double> >( lattice ,
146  myTet_4 ,
147  deg ,
148  0 ,
149  POINTTYPE_EQUISPACED );
150 
151  FieldContainer<double> dBasisAtLattice( polydim , np_lattice , 3 );
152  myBasis.getValues( dBasisAtLattice , lattice , OPERATOR_D1 );
153 
154  const double fiat_vals[] = {
155  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
156  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
157  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
158  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
159  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
160  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
161  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
162  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
163  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
164  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
165  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
166  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
167  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
168  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
169  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
170  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
171  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
172  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
173  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
174  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
175  5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
176  5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
177  5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
178  5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
179  5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
180  5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
181  5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
182  5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
183  5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
184  5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
185  5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
186  5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
187  5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
188  5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
189  5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
190  5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
191  5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
192  5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
193  5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
194  5.477225575051661e+00, 2.738612787525831e+00, 2.738612787525831e+00,
195  0.000000000000000e+00, 4.743416490252569e+00, 1.581138830084190e+00,
196  0.000000000000000e+00, 4.743416490252569e+00, 1.581138830084190e+00,
197  0.000000000000000e+00, 4.743416490252568e+00, 1.581138830084190e+00,
198  0.000000000000000e+00, 4.743416490252569e+00, 1.581138830084190e+00,
199  0.000000000000000e+00, 4.743416490252569e+00, 1.581138830084190e+00,
200  0.000000000000000e+00, 4.743416490252569e+00, 1.581138830084190e+00,
201  0.000000000000000e+00, 4.743416490252569e+00, 1.581138830084190e+00,
202  0.000000000000000e+00, 4.743416490252568e+00, 1.581138830084190e+00,
203  0.000000000000000e+00, 4.743416490252568e+00, 1.581138830084190e+00,
204  0.000000000000000e+00, 4.743416490252569e+00, 1.581138830084190e+00,
205  0.000000000000000e+00, 4.743416490252569e+00, 1.581138830084190e+00,
206  0.000000000000000e+00, 4.743416490252569e+00, 1.581138830084190e+00,
207  0.000000000000000e+00, 4.743416490252569e+00, 1.581138830084190e+00,
208  0.000000000000000e+00, 4.743416490252569e+00, 1.581138830084190e+00,
209  0.000000000000000e+00, 4.743416490252569e+00, 1.581138830084190e+00,
210  0.000000000000000e+00, 4.743416490252569e+00, 1.581138830084190e+00,
211  0.000000000000000e+00, 4.743416490252568e+00, 1.581138830084190e+00,
212  0.000000000000000e+00, 4.743416490252568e+00, 1.581138830084190e+00,
213  0.000000000000000e+00, 4.743416490252568e+00, 1.581138830084190e+00,
214  0.000000000000000e+00, 4.743416490252569e+00, 1.581138830084190e+00,
215  0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999580e+00,
216  0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999580e+00,
217  0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999579e+00,
218  0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999580e+00,
219  0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999580e+00,
220  0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999580e+00,
221  0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999580e+00,
222  0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999579e+00,
223  0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999579e+00,
224  0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999580e+00,
225  0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999580e+00,
226  0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999580e+00,
227  0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999580e+00,
228  0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999580e+00,
229  0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999580e+00,
230  0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999580e+00,
231  0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999579e+00,
232  0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999579e+00,
233  0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999579e+00,
234  0.000000000000000e+00, 0.000000000000000e+00, 4.472135954999580e+00,
235  -3.074085229787880e+01, -1.024695076595960e+01, -1.024695076595960e+01,
236  -1.024695076595960e+01, 0.000000000000000e+00, 0.000000000000000e+00,
237  1.024695076595960e+01, 1.024695076595960e+01, 1.024695076595960e+01,
238  3.074085229787880e+01, 2.049390153191920e+01, 2.049390153191920e+01,
239  -2.049390153191920e+01, -6.831300510639732e+00, -6.831300510639732e+00,
240  -1.706460100885310e-15, 3.415650255319865e+00, 3.415650255319865e+00,
241  2.049390153191919e+01, 1.366260102127946e+01, 1.366260102127946e+01,
242  -1.024695076595960e+01, -3.415650255319866e+00, -3.415650255319866e+00,
243  1.024695076595960e+01, 6.831300510639730e+00, 6.831300510639730e+00,
244  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
245  -2.049390153191920e+01, -6.831300510639732e+00, -6.831300510639732e+00,
246  -1.706460100885310e-15, 3.415650255319865e+00, 3.415650255319865e+00,
247  2.049390153191919e+01, 1.366260102127946e+01, 1.366260102127946e+01,
248  -1.024695076595960e+01, -3.415650255319866e+00, -3.415650255319866e+00,
249  1.024695076595960e+01, 6.831300510639730e+00, 6.831300510639730e+00,
250  -1.706460100885310e-15, -5.688200336284365e-16, -5.688200336284365e-16,
251  -1.024695076595960e+01, -3.415650255319866e+00, -3.415650255319866e+00,
252  1.024695076595960e+01, 6.831300510639730e+00, 6.831300510639730e+00,
253  -1.706460100885310e-15, -5.688200336284365e-16, -5.688200336284365e-16,
254  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
255  -7.937253933193772e+00, -2.381176179958132e+01, -7.937253933193772e+00,
256  -7.937253933193772e+00, -1.058300524425836e+01, -5.291502622129182e+00,
257  -7.937253933193772e+00, 2.645751311064589e+00, -2.645751311064591e+00,
258  -7.937253933193772e+00, 1.587450786638754e+01, 0.000000000000000e+00,
259  5.291502622129181e+00, -1.058300524425837e+01, -4.406061034464155e-16,
260  5.291502622129181e+00, 2.645751311064589e+00, 2.645751311064590e+00,
261  5.291502622129181e+00, 1.587450786638754e+01, 5.291502622129181e+00,
262  1.852025917745213e+01, 2.645751311064588e+00, 7.937253933193770e+00,
263  1.852025917745213e+01, 1.587450786638754e+01, 1.058300524425836e+01,
264  3.174901573277509e+01, 1.587450786638754e+01, 1.587450786638754e+01,
265  -5.291502622129182e+00, -1.587450786638755e+01, -5.291502622129182e+00,
266  -5.291502622129182e+00, -2.645751311064592e+00, -2.645751311064591e+00,
267  -5.291502622129182e+00, 1.058300524425836e+01, -8.812122068928310e-16,
268  7.937253933193772e+00, -2.645751311064592e+00, 2.645751311064591e+00,
269  7.937253933193772e+00, 1.058300524425836e+01, 5.291502622129181e+00,
270  2.116601048851673e+01, 1.058300524425836e+01, 1.058300524425836e+01,
271  -2.645751311064591e+00, -7.937253933193774e+00, -2.645751311064591e+00,
272  -2.645751311064591e+00, 5.291502622129181e+00, -4.406061034464155e-16,
273  1.058300524425836e+01, 5.291502622129181e+00, 5.291502622129181e+00,
274  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
275  -6.480740698407860e+00, -3.240370349203930e+00, -2.268259244442751e+01,
276  -6.480740698407860e+00, -3.240370349203930e+00, -9.721111047611791e+00,
277  -6.480740698407860e+00, -3.240370349203930e+00, 3.240370349203929e+00,
278  -6.480740698407860e+00, -3.240370349203930e+00, 1.620185174601965e+01,
279  -6.480740698407860e+00, -3.240370349203930e+00, -1.620185174601965e+01,
280  -6.480740698407860e+00, -3.240370349203930e+00, -3.240370349203932e+00,
281  -6.480740698407860e+00, -3.240370349203930e+00, 9.721111047611787e+00,
282  -6.480740698407860e+00, -3.240370349203930e+00, -9.721111047611791e+00,
283  -6.480740698407860e+00, -3.240370349203930e+00, 3.240370349203929e+00,
284  -6.480740698407860e+00, -3.240370349203930e+00, -3.240370349203930e+00,
285  6.480740698407860e+00, 3.240370349203930e+00, -9.721111047611791e+00,
286  6.480740698407860e+00, 3.240370349203930e+00, 3.240370349203929e+00,
287  6.480740698407860e+00, 3.240370349203930e+00, 1.620185174601965e+01,
288  6.480740698407860e+00, 3.240370349203930e+00, -3.240370349203930e+00,
289  6.480740698407860e+00, 3.240370349203930e+00, 9.721111047611789e+00,
290  6.480740698407860e+00, 3.240370349203930e+00, 3.240370349203929e+00,
291  1.944222209522358e+01, 9.721111047611791e+00, 3.240370349203930e+00,
292  1.944222209522358e+01, 9.721111047611791e+00, 1.620185174601965e+01,
293  1.944222209522358e+01, 9.721111047611791e+00, 9.721111047611789e+00,
294  3.240370349203930e+01, 1.620185174601965e+01, 1.620185174601965e+01,
295  0.000000000000000e+00, -1.833030277982336e+01, -4.582575694955840e+00,
296  0.000000000000000e+00, -1.833030277982336e+01, -4.582575694955840e+00,
297  0.000000000000000e+00, -1.833030277982336e+01, -4.582575694955839e+00,
298  0.000000000000000e+00, -1.833030277982336e+01, -4.582575694955840e+00,
299  0.000000000000000e+00, -3.055050463303894e+00, 1.527525231651946e+00,
300  0.000000000000000e+00, -3.055050463303894e+00, 1.527525231651946e+00,
301  0.000000000000000e+00, -3.055050463303894e+00, 1.527525231651946e+00,
302  0.000000000000000e+00, 1.222020185321557e+01, 7.637626158259732e+00,
303  0.000000000000000e+00, 1.222020185321557e+01, 7.637626158259732e+00,
304  0.000000000000000e+00, 2.749545416973504e+01, 1.374772708486752e+01,
305  0.000000000000000e+00, -1.222020185321557e+01, -3.055050463303894e+00,
306  0.000000000000000e+00, -1.222020185321557e+01, -3.055050463303894e+00,
307  0.000000000000000e+00, -1.222020185321557e+01, -3.055050463303894e+00,
308  0.000000000000000e+00, 3.055050463303893e+00, 3.055050463303893e+00,
309  0.000000000000000e+00, 3.055050463303893e+00, 3.055050463303893e+00,
310  0.000000000000000e+00, 1.833030277982336e+01, 9.165151389911680e+00,
311  0.000000000000000e+00, -6.110100926607787e+00, -1.527525231651947e+00,
312  0.000000000000000e+00, -6.110100926607787e+00, -1.527525231651947e+00,
313  0.000000000000000e+00, 9.165151389911678e+00, 4.582575694955839e+00,
314  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
315  0.000000000000000e+00, -5.612486080160912e+00, -1.309580085370879e+01,
316  0.000000000000000e+00, -5.612486080160912e+00, -1.309580085370879e+01,
317  0.000000000000000e+00, -5.612486080160911e+00, -1.309580085370879e+01,
318  0.000000000000000e+00, -5.612486080160912e+00, -1.309580085370879e+01,
319  0.000000000000000e+00, -5.612486080160912e+00, -1.870828693386971e+00,
320  0.000000000000000e+00, -5.612486080160912e+00, -1.870828693386971e+00,
321  0.000000000000000e+00, -5.612486080160912e+00, -1.870828693386971e+00,
322  0.000000000000000e+00, -5.612486080160911e+00, 9.354143466934852e+00,
323  0.000000000000000e+00, -5.612486080160911e+00, 9.354143466934852e+00,
324  0.000000000000000e+00, -5.612486080160912e+00, 2.057911562725668e+01,
325  0.000000000000000e+00, 5.612486080160912e+00, -5.612486080160912e+00,
326  0.000000000000000e+00, 5.612486080160912e+00, -5.612486080160912e+00,
327  0.000000000000000e+00, 5.612486080160912e+00, -5.612486080160912e+00,
328  0.000000000000000e+00, 5.612486080160912e+00, 5.612486080160912e+00,
329  0.000000000000000e+00, 5.612486080160912e+00, 5.612486080160912e+00,
330  0.000000000000000e+00, 5.612486080160912e+00, 1.683745824048274e+01,
331  0.000000000000000e+00, 1.683745824048273e+01, 1.870828693386970e+00,
332  0.000000000000000e+00, 1.683745824048273e+01, 1.870828693386970e+00,
333  0.000000000000000e+00, 1.683745824048273e+01, 1.309580085370879e+01,
334  0.000000000000000e+00, 2.806243040080456e+01, 9.354143466934854e+00,
335  0.000000000000000e+00, 0.000000000000000e+00, -1.322875655532295e+01,
336  0.000000000000000e+00, 0.000000000000000e+00, -1.322875655532295e+01,
337  0.000000000000000e+00, 0.000000000000000e+00, -1.322875655532295e+01,
338  0.000000000000000e+00, 0.000000000000000e+00, -1.322875655532295e+01,
339  0.000000000000000e+00, 0.000000000000000e+00, -1.322875655532295e+01,
340  0.000000000000000e+00, 0.000000000000000e+00, -1.322875655532295e+01,
341  0.000000000000000e+00, 0.000000000000000e+00, -1.322875655532295e+01,
342  0.000000000000000e+00, 0.000000000000000e+00, -1.322875655532295e+01,
343  0.000000000000000e+00, 0.000000000000000e+00, -1.322875655532295e+01,
344  0.000000000000000e+00, 0.000000000000000e+00, -1.322875655532295e+01,
345  0.000000000000000e+00, 0.000000000000000e+00, -8.812122068928310e-16,
346  0.000000000000000e+00, 0.000000000000000e+00, -8.812122068928310e-16,
347  0.000000000000000e+00, 0.000000000000000e+00, -8.812122068928310e-16,
348  0.000000000000000e+00, 0.000000000000000e+00, -8.812122068928310e-16,
349  0.000000000000000e+00, 0.000000000000000e+00, -8.812122068928310e-16,
350  0.000000000000000e+00, 0.000000000000000e+00, -8.812122068928310e-16,
351  0.000000000000000e+00, 0.000000000000000e+00, 1.322875655532295e+01,
352  0.000000000000000e+00, 0.000000000000000e+00, 1.322875655532295e+01,
353  0.000000000000000e+00, 0.000000000000000e+00, 1.322875655532295e+01,
354  0.000000000000000e+00, 0.000000000000000e+00, 2.645751311064591e+01,
355  9.524704719832526e+01, 2.381176179958132e+01, 2.381176179958132e+01,
356  -1.058300524425836e+01, -1.322875655532295e+01, -1.322875655532295e+01,
357  -1.058300524425837e+01, 2.645751311064586e+00, 2.645751311064586e+00,
358  9.524704719832526e+01, 7.143528539874394e+01, 7.143528539874394e+01,
359  4.233202097703347e+01, 1.058300524425837e+01, 1.058300524425837e+01,
360  -1.058300524425836e+01, -5.291502622129184e+00, -5.291502622129184e+00,
361  4.233202097703344e+01, 3.174901573277508e+01, 3.174901573277508e+01,
362  1.058300524425837e+01, 2.645751311064592e+00, 2.645751311064592e+00,
363  1.058300524425836e+01, 7.937253933193769e+00, 7.937253933193769e+00,
364  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
365  4.233202097703347e+01, 1.058300524425837e+01, 1.058300524425837e+01,
366  -1.058300524425836e+01, -5.291502622129184e+00, -5.291502622129184e+00,
367  4.233202097703344e+01, 3.174901573277508e+01, 3.174901573277508e+01,
368  1.058300524425837e+01, 2.645751311064592e+00, 2.645751311064592e+00,
369  1.058300524425836e+01, 7.937253933193769e+00, 7.937253933193769e+00,
370  2.935026245019504e-31, 7.337565612548760e-32, 7.337565612548760e-32,
371  1.058300524425837e+01, 2.645751311064592e+00, 2.645751311064592e+00,
372  1.058300524425836e+01, 7.937253933193769e+00, 7.937253933193769e+00,
373  2.935026245019504e-31, 7.337565612548760e-32, 7.337565612548760e-32,
374  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
375  4.024922359499622e+01, 6.037383539249433e+01, 2.012461179749811e+01,
376  1.341640786499874e+01, -1.565247584249853e+01, -2.236067977499790e+00,
377  -1.341640786499874e+01, -2.906888370749726e+01, -1.565247584249853e+01,
378  -4.024922359499622e+01, 2.012461179749811e+01, -2.012461179749811e+01,
379  -3.577708763999664e+01, 8.944271909999161e+00, -8.944271909999159e+00,
380  -2.979040983896728e-15, -4.472135954999583e+00, 4.472135954999577e+00,
381  3.577708763999663e+01, 4.472135954999577e+01, 2.683281572999747e+01,
382  -4.919349550499538e+01, -1.118033988749895e+01, -1.565247584249853e+01,
383  4.919349550499536e+01, 3.801315561749642e+01, 3.354101966249684e+01,
384  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
385  1.788854381999832e+01, 2.683281572999748e+01, 8.944271909999161e+00,
386  1.489520491948364e-15, -1.341640786499874e+01, -4.472135954999580e+00,
387  -1.788854381999832e+01, 8.944271909999145e+00, -8.944271909999161e+00,
388  -2.236067977499789e+01, -2.236067977499788e+00, -6.708203932499368e+00,
389  2.236067977499789e+01, 2.012461179749810e+01, 1.565247584249852e+01,
390  -8.937122951690183e-15, -2.979040983896728e-15, -2.979040983896728e-15,
391  4.472135954999580e+00, 6.708203932499371e+00, 2.236067977499790e+00,
392  -4.472135954999580e+00, 2.236067977499787e+00, -2.236067977499790e+00,
393  -4.468561475845092e-15, -1.489520491948364e-15, -1.489520491948364e-15,
394  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
395  3.485685011586675e+01, 1.161895003862225e+01, 5.809475019311125e+01,
396  1.161895003862225e+01, 0.000000000000000e+00, -1.549193338482967e+01,
397  -1.161895003862225e+01, -1.161895003862225e+01, -2.711088342345191e+01,
398  -3.485685011586675e+01, -2.323790007724450e+01, 2.323790007724450e+01,
399  2.323790007724450e+01, 7.745966692414833e+00, 2.840187787218773e+01,
400  1.934943878227166e-15, -3.872983346207416e+00, -1.420093893609386e+01,
401  -2.323790007724450e+01, -1.549193338482966e+01, 5.163977794943212e+00,
402  1.161895003862225e+01, 3.872983346207417e+00, 9.036961141150641e+00,
403  -1.161895003862225e+01, -7.745966692414831e+00, -2.581988897471612e+00,
404  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
405  -3.872983346207416e+01, -1.290994448735805e+01, 7.745966692414837e+00,
406  -3.224906463711944e-15, 6.454972243679026e+00, -3.872983346207421e+00,
407  3.872983346207415e+01, 2.581988897471610e+01, 4.647580015448898e+01,
408  -1.936491673103708e+01, -6.454972243679027e+00, -1.290994448735804e+00,
409  1.936491673103708e+01, 1.290994448735805e+01, 1.807392228230127e+01,
410  -3.224906463711944e-15, -1.074968821237314e-15, -1.074968821237314e-15,
411  -5.034878350069641e+01, -1.678292783356547e+01, -1.161895003862225e+01,
412  5.034878350069641e+01, 3.356585566713093e+01, 3.872983346207415e+01,
413  -8.384756805651052e-15, -2.794918935217017e-15, -2.794918935217017e-15,
414  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
415  1.039230484541326e+01, 6.754998149518620e+01, 1.558845726811989e+01,
416  1.039230484541326e+01, 2.598076211353317e+01, 8.660254037844389e+00,
417  1.039230484541326e+01, -1.558845726811989e+01, 1.732050807568879e+00,
418  1.039230484541326e+01, -5.715767664977296e+01, -5.196152422706632e+00,
419  -6.928203230275511e+00, -1.039230484541326e+01, -1.039230484541326e+01,
420  -6.928203230275511e+00, -3.464101615137756e+00, -3.464101615137756e+00,
421  -6.928203230275511e+00, 3.464101615137752e+00, 3.464101615137753e+00,
422  2.424871130596427e+01, -1.558845726811990e+01, 1.732050807568872e+00,
423  2.424871130596427e+01, 3.983716857408416e+01, 2.251666049839540e+01,
424  1.039230484541326e+02, 5.196152422706632e+01, 5.196152422706632e+01,
425  4.618802153517007e+00, 3.002221399786055e+01, 6.928203230275511e+00,
426  4.618802153517007e+00, 2.309401076758505e+00, 2.309401076758504e+00,
427  4.618802153517007e+00, -2.540341184434353e+01, -2.309401076758502e+00,
428  1.154700538379250e+00, -9.814954576223640e+00, -4.041451884327382e+00,
429  1.154700538379250e+00, 1.096965511460288e+01, 5.196152422706630e+00,
430  4.618802153517006e+01, 2.309401076758502e+01, 2.309401076758503e+01,
431  1.154700538379252e+00, 7.505553499465138e+00, 1.732050807568878e+00,
432  1.154700538379252e+00, -6.350852961085883e+00, -5.773502691896256e-01,
433  1.154700538379251e+01, 5.773502691896255e+00, 5.773502691896256e+00,
434  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
435  9.000000000000000e+00, 2.700000000000000e+01, 4.500000000000000e+01,
436  9.000000000000000e+00, 1.200000000000000e+01, 1.800000000000000e+01,
437  9.000000000000000e+00, -2.999999999999998e+00, -8.999999999999996e+00,
438  9.000000000000000e+00, -1.800000000000000e+01, -3.600000000000000e+01,
439  -6.000000000000000e+00, 1.200000000000000e+01, -1.600000000000000e+01,
440  -6.000000000000000e+00, -2.999999999999998e+00, -3.000000000000001e+00,
441  -6.000000000000000e+00, -1.800000000000000e+01, 9.999999999999996e+00,
442  -2.100000000000000e+01, -2.999999999999997e+00, -3.700000000000000e+01,
443  -2.100000000000000e+01, -1.800000000000000e+01, 1.599999999999999e+01,
444  -3.600000000000000e+01, -1.800000000000000e+01, -1.800000000000000e+01,
445  -1.000000000000000e+01, -3.000000000000001e+01, 6.000000000000003e+00,
446  -1.000000000000000e+01, -5.000000000000002e+00, -4.999999999999999e+00,
447  -1.000000000000000e+01, 1.999999999999999e+01, -1.600000000000000e+01,
448  1.500000000000000e+01, -5.000000000000002e+00, -7.000000000000002e+00,
449  1.500000000000000e+01, 1.999999999999999e+01, 2.199999999999999e+01,
450  3.999999999999999e+01, 1.999999999999999e+01, 1.999999999999999e+01,
451  -1.300000000000000e+01, -3.900000000000001e+01, -8.999999999999998e+00,
452  -1.300000000000000e+01, 2.599999999999999e+01, -4.000000000000002e+00,
453  5.199999999999999e+01, 2.599999999999999e+01, 2.599999999999999e+01,
454  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
455  7.348469228349536e+00, 3.674234614174768e+00, 5.511351921262152e+01,
456  7.348469228349536e+00, 3.674234614174768e+00, 2.082066281365702e+01,
457  7.348469228349536e+00, 3.674234614174768e+00, -1.347219358530748e+01,
458  7.348469228349536e+00, 3.674234614174768e+00, -4.776504998427198e+01,
459  7.348469228349536e+00, 3.674234614174768e+00, 3.796709101313927e+01,
460  7.348469228349536e+00, 3.674234614174768e+00, 3.674234614174771e+00,
461  7.348469228349536e+00, 3.674234614174768e+00, -3.061862178478972e+01,
462  7.348469228349536e+00, 3.674234614174768e+00, 2.082066281365702e+01,
463  7.348469228349536e+00, 3.674234614174768e+00, -1.347219358530748e+01,
464  7.348469228349536e+00, 3.674234614174768e+00, 3.674234614174768e+00,
465  -4.082482904638631e+00, -2.041241452319316e+00, -1.347219358530748e+01,
466  -4.082482904638631e+00, -2.041241452319316e+00, -2.041241452319317e+00,
467  -4.082482904638631e+00, -2.041241452319316e+00, 9.389710680668845e+00,
468  -4.082482904638631e+00, -2.041241452319316e+00, -7.756717518813399e+00,
469  -4.082482904638631e+00, -2.041241452319316e+00, 3.674234614174765e+00,
470  -4.082482904638631e+00, -2.041241452319316e+00, -2.041241452319317e+00,
471  3.021037349432586e+01, 1.510518674716293e+01, -1.347219358530748e+01,
472  3.021037349432586e+01, 1.510518674716293e+01, 4.368256707963334e+01,
473  3.021037349432586e+01, 1.510518674716293e+01, 1.510518674716292e+01,
474  1.102270384252430e+02, 5.511351921262151e+01, 5.511351921262151e+01,
475  0.000000000000000e+00, 4.500000000000001e+01, 9.000000000000000e+00,
476  0.000000000000000e+00, 4.500000000000001e+01, 9.000000000000000e+00,
477  0.000000000000000e+00, 4.499999999999999e+01, 9.000000000000000e+00,
478  0.000000000000000e+00, 4.500000000000001e+01, 9.000000000000000e+00,
479  0.000000000000000e+00, -1.000000000000000e+01, -5.999999999999999e+00,
480  0.000000000000000e+00, -1.000000000000000e+01, -5.999999999999999e+00,
481  0.000000000000000e+00, -1.000000000000000e+01, -5.999999999999999e+00,
482  0.000000000000000e+00, 4.999999999999996e+00, 8.999999999999996e+00,
483  0.000000000000000e+00, 4.999999999999996e+00, 8.999999999999996e+00,
484  0.000000000000000e+00, 9.000000000000000e+01, 5.400000000000000e+01,
485  0.000000000000000e+00, 2.000000000000000e+01, 4.000000000000000e+00,
486  0.000000000000000e+00, 2.000000000000000e+01, 4.000000000000000e+00,
487  0.000000000000000e+00, 2.000000000000000e+01, 4.000000000000000e+00,
488  0.000000000000000e+00, -5.000000000000002e+00, -1.000000000000001e+00,
489  0.000000000000000e+00, -5.000000000000002e+00, -1.000000000000001e+00,
490  0.000000000000000e+00, 4.000000000000000e+01, 2.400000000000000e+01,
491  0.000000000000000e+00, 5.000000000000000e+00, 1.000000000000000e+00,
492  0.000000000000000e+00, 5.000000000000000e+00, 1.000000000000000e+00,
493  0.000000000000000e+00, 9.999999999999996e+00, 5.999999999999998e+00,
494  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
495  0.000000000000000e+00, 2.078460969082653e+01, 2.598076211353316e+01,
496  0.000000000000000e+00, 2.078460969082653e+01, 2.598076211353316e+01,
497  0.000000000000000e+00, 2.078460969082652e+01, 2.598076211353316e+01,
498  0.000000000000000e+00, 2.078460969082653e+01, 2.598076211353316e+01,
499  0.000000000000000e+00, 3.464101615137756e+00, -1.327905619136139e+01,
500  0.000000000000000e+00, 3.464101615137756e+00, -1.327905619136139e+01,
501  0.000000000000000e+00, 3.464101615137756e+00, -1.327905619136139e+01,
502  0.000000000000000e+00, -1.385640646055102e+01, -6.350852961085886e+00,
503  0.000000000000000e+00, -1.385640646055102e+01, -6.350852961085886e+00,
504  0.000000000000000e+00, -3.117691453623979e+01, 4.676537180435969e+01,
505  0.000000000000000e+00, -2.309401076758503e+01, 3.464101615137756e+00,
506  0.000000000000000e+00, -2.309401076758503e+01, 3.464101615137756e+00,
507  0.000000000000000e+00, -2.309401076758503e+01, 3.464101615137756e+00,
508  0.000000000000000e+00, 5.773502691896256e+00, 1.154700538379249e+00,
509  0.000000000000000e+00, 5.773502691896256e+00, 1.154700538379249e+00,
510  0.000000000000000e+00, 3.464101615137754e+01, 4.503332099679081e+01,
511  0.000000000000000e+00, -3.002221399786054e+01, -5.196152422706631e+00,
512  0.000000000000000e+00, -3.002221399786054e+01, -5.196152422706631e+00,
513  0.000000000000000e+00, 4.503332099679080e+01, 2.944486372867091e+01,
514  0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
515  0.000000000000000e+00, 6.363961030678929e+00, 3.181980515339464e+01,
516  0.000000000000000e+00, 6.363961030678929e+00, 3.181980515339464e+01,
517  0.000000000000000e+00, 6.363961030678928e+00, 3.181980515339464e+01,
518  0.000000000000000e+00, 6.363961030678929e+00, 3.181980515339464e+01,
519  0.000000000000000e+00, 6.363961030678929e+00, 2.121320343559643e+00,
520  0.000000000000000e+00, 6.363961030678929e+00, 2.121320343559643e+00,
521  0.000000000000000e+00, 6.363961030678929e+00, 2.121320343559643e+00,
522  0.000000000000000e+00, 6.363961030678928e+00, -2.757716446627535e+01,
523  0.000000000000000e+00, 6.363961030678928e+00, -2.757716446627535e+01,
524  0.000000000000000e+00, 6.363961030678929e+00, -5.727564927611036e+01,
525  0.000000000000000e+00, -3.535533905932738e+00, -7.778174593052023e+00,
526  0.000000000000000e+00, -3.535533905932738e+00, -7.778174593052023e+00,
527  0.000000000000000e+00, -3.535533905932738e+00, -7.778174593052023e+00,
528  0.000000000000000e+00, -3.535533905932738e+00, 2.121320343559642e+00,
529  0.000000000000000e+00, -3.535533905932738e+00, 2.121320343559642e+00,
530  0.000000000000000e+00, -3.535533905932738e+00, 1.202081528017131e+01,
531  0.000000000000000e+00, 2.616295090390225e+01, -7.778174593052024e+00,
532  0.000000000000000e+00, 2.616295090390225e+01, -7.778174593052024e+00,
533  0.000000000000000e+00, 2.616295090390225e+01, 4.171930009000628e+01,
534  0.000000000000000e+00, 9.545941546018391e+01, 3.181980515339464e+01,
535  0.000000000000000e+00, 0.000000000000000e+00, 2.700000000000001e+01,
536  0.000000000000000e+00, 0.000000000000000e+00, 2.700000000000001e+01,
537  0.000000000000000e+00, 0.000000000000000e+00, 2.700000000000000e+01,
538  0.000000000000000e+00, 0.000000000000000e+00, 2.700000000000001e+01,
539  0.000000000000000e+00, 0.000000000000000e+00, 2.700000000000001e+01,
540  0.000000000000000e+00, 0.000000000000000e+00, 2.700000000000001e+01,
541  0.000000000000000e+00, 0.000000000000000e+00, 2.700000000000001e+01,
542  0.000000000000000e+00, 0.000000000000000e+00, 2.700000000000000e+01,
543  0.000000000000000e+00, 0.000000000000000e+00, 2.700000000000000e+01,
544  0.000000000000000e+00, 0.000000000000000e+00, 2.700000000000001e+01,
545  0.000000000000000e+00, 0.000000000000000e+00, -8.000000000000000e+00,
546  0.000000000000000e+00, 0.000000000000000e+00, -8.000000000000000e+00,
547  0.000000000000000e+00, 0.000000000000000e+00, -8.000000000000000e+00,
548  0.000000000000000e+00, 0.000000000000000e+00, -8.000000000000000e+00,
549  0.000000000000000e+00, 0.000000000000000e+00, -8.000000000000000e+00,
550  0.000000000000000e+00, 0.000000000000000e+00, -8.000000000000000e+00,
551  0.000000000000000e+00, 0.000000000000000e+00, 1.299999999999999e+01,
552  0.000000000000000e+00, 0.000000000000000e+00, 1.299999999999999e+01,
553  0.000000000000000e+00, 0.000000000000000e+00, 1.299999999999999e+01,
554  0.000000000000000e+00, 0.000000000000000e+00, 9.000000000000000e+01
555  };
556 
557  int fiat_index_cur = 0;
558  for (int i=0;i<polydim;i++) {
559  for (int j=0;j<np_lattice;j++) {
560  for (int k=0;k<3;k++) {
561  if (std::abs( dBasisAtLattice(i,j,k) - fiat_vals[fiat_index_cur] ) > 10.0*INTREPID_TOL ) {
562  errorFlag++;
563  *outStream << std::setw(70) << "^^^^----FAILURE!" << "\n";
564 
565  // Output the multi-index of the value where the error is:
566  *outStream << " At multi-index { ";
567  *outStream << i << " " << j << " " << k;
568  *outStream << "} computed value: " << dBasisAtLattice(i,j,k)
569  << " but correct value: " << fiat_vals[fiat_index_cur] << "\n";
570  *outStream << "Difference: " << std::abs( dBasisAtLattice(i,j,k) - fiat_vals[fiat_index_cur] ) << "\n";
571  }
572  fiat_index_cur++;
573  }
574  }
575  }
576 
577 
578  if (errorFlag != 0)
579  std::cout << "End Result: TEST FAILED\n";
580  else
581  std::cout << "End Result: TEST PASSED\n";
582 
583  // reset format state of std::cout
584  std::cout.copyfmt(oldFormatState);
585 
586  return errorFlag;
587 }
virtual int getCardinality() const
Returns cardinality of the basis.
virtual void getCubature(ArrayPoint &cubPoints, ArrayWeight &cubWeights) const
Returns cubature points and weights (return arrays must be pre-sized/pre-allocated).
Header file for utility class to provide point tools, such as barycentric coordinates, equispaced lattices, and warp-blend point distrubtions.
void getValues(ArrayScalar &outputValues, const ArrayScalar &inputPoints, const EOperator operatorType) const
Evaluation of a FEM basis on a reference Tetrahedron cell.
Defines direct integration rules on a tetrahedron.
Header file for utility class to provide multidimensional containers.
virtual int getNumPoints() const
Returns the number of cubature points.
Header file for the Intrepid::CubatureDirectTetDefault class.
Implementation of the default H(grad)-compatible orthogonal basis of arbitrary degree on tetrahedron...
static int getLatticeSize(const shards::CellTopology &cellType, const int order, const int offset=0)
Computes the number of points in a lattice of a given order on a simplex (currently disabled for othe...