52 #include "Teuchos_oblackholestream.hpp"
53 #include "Teuchos_RCP.hpp"
54 #include "Teuchos_ScalarTraits.hpp"
55 #include <Kokkos_Core.hpp>
58 using namespace Intrepid;
60 #define INTREPID_TEST_COMMAND( S ) \
65 catch (std::logic_error err) { \
66 *outStream << "Expected Error ----------------------------------------------------------------\n"; \
67 *outStream << err.what() << '\n'; \
68 *outStream << "-------------------------------------------------------------------------------" << "\n\n"; \
73 int main(
int argc,
char *argv[]) {
77 int iprint = argc - 1;
78 Teuchos::RCP<std::ostream> outStream;
79 Teuchos::oblackholestream bhs;
81 outStream = Teuchos::rcp(&std::cout,
false);
83 outStream = Teuchos::rcp(&bhs,
false);
86 Teuchos::oblackholestream oldFormatState;
87 oldFormatState.copyfmt(std::cout);
90 <<
"===============================================================================\n" \
92 <<
"| Unit Test (ArrayTools) |\n" \
94 <<
"| 1) Array operations: multiplication, contractions |\n" \
96 <<
"| Questions? Contact Pavel Bochev (pbboche@sandia.gov) or |\n" \
97 <<
"| Denis Ridzal (dridzal@sandia.gov). |\n" \
99 <<
"| Intrepid's website: http://trilinos.sandia.gov/packages/intrepid |\n" \
100 <<
"| Trilinos website: http://trilinos.sandia.gov |\n" \
102 <<
"===============================================================================\n";
106 #ifdef HAVE_INTREPID_DEBUG
107 int beginThrowNumber = Teuchos::TestForException_getThrowNumber();
108 int endThrowNumber = beginThrowNumber + 39 + 18 + 28 + 26 + 34 + 37 + 46 + 45;
112 #ifdef HAVE_INTREPID_DEBUG
122 int D1 = 1, D2 = 2, D3 = 3, D4 = 4;
124 Kokkos::View<double*> fc_P (
"fc_P",P);
125 Kokkos::View<double**> fc_P_D1 (
"fc_P_D1",P, D1);
126 Kokkos::View<double**> fc_P_D2 (
"fc_P_D2",P, D2);
127 Kokkos::View<double**> fc_P_D3 (
"fc_P_D3",P, D3);
128 Kokkos::View<double***> fc_P_D2_D2 (
"fc_P_D2_D2",P, D2, D2);
129 Kokkos::View<double**> fc_P1_D3 (
"fc_P1_D3",P1, D3);
130 Kokkos::View<double***> fc_P1_D2_D2 (
"fc_P1_D2_D2",P1, D2, D2);
131 Kokkos::View<double***> fc_P1_D3_D3 (
"fc_P1_D3_D3",P1, D3, D3);
133 Kokkos::View<double*> fc_C (
"fc_C",C);
134 Kokkos::View<double**> fc_C1_P (
"fc_C1_P",C1,P);
135 Kokkos::View<double**> fc_C_P1 (
"fc_C_P1",C, P1);
136 Kokkos::View<double**> fc_C_P (
"fc_C_P",C, P);
137 Kokkos::View<double***> fc_C_P_D1 (
"fc_C_P_D1",C, P, D1);
138 Kokkos::View<double***> fc_C_P_D2 (
"fc_C_P_D2",C, P, D2);
139 Kokkos::View<double***> fc_C_P_D3 (
"fc_C_P_D3",C, P, D3);
140 Kokkos::View<double***> fc_C_P_D4 (
"fc_C_P_D4",C, P, D4);
141 Kokkos::View<double***> fc_C1_P_D2 (
"fc_C1_P_D2",C1,P, D2);
142 Kokkos::View<double***> fc_C1_P_D3 (
"fc_C1_P_D3",C1,P, D3);
143 Kokkos::View<double***> fc_C_P1_D1 (
"fc_C_P1_D1",C, P1,D1);
144 Kokkos::View<double***> fc_C_P1_D2 (
"fc_C_P1_D2",C, P1,D2);
145 Kokkos::View<double***> fc_C_P1_D3 (
"fc_C_P1_D3",C, P1,D3);
146 Kokkos::View<double****> fc_C_P_D1_D1 (
"fc_C_P_D1_D1",C, P, D1, D1);
147 Kokkos::View<double****> fc_C_P_D1_D2 (
"fc_C_P_D1_D2",C, P, D1, D2);
148 Kokkos::View<double****> fc_C_P_D1_D3 (
"fc_C_P_D1_D3",C, P, D1, D3);
149 Kokkos::View<double****> fc_C_P_D2_D2 (
"fc_C_P_D2_D2",C, P, D2, D2);
150 Kokkos::View<double****> fc_C_P_D3_D1 (
"fc_C_P_D3_D1",C, P, D3, D1);
151 Kokkos::View<double****> fc_C_P_D3_D2 (
"fc_C_P_D3_D2",C, P, D3, D2);
152 Kokkos::View<double****> fc_C_P_D2_D3 (
"fc_C_P_D2_D3",C, P, D2, D3);
153 Kokkos::View<double****> fc_C_P_D3_D3 (
"fc_C_P_D3_D3",C, P, D3, D3);
154 Kokkos::View<double****> fc_C1_P_D3_D3 (
"fc_C1_P_D3_D3",C1,P, D3, D3);
155 Kokkos::View<double****> fc_C1_P_D2_D2 (
"fc_C1_P_D2_D2",C1,P, D2, D2);
156 Kokkos::View<double****> fc_C_P1_D2_D2 (
"fc_C_P1_D2_D2",C, P1,D2, D2);
157 Kokkos::View<double****> fc_C_P1_D3_D3 (
"fc_C_P1_D3_D3",C, P1,D3, D3);
158 Kokkos::View<double*****> fc_C_P_D3_D3_D3 (
"fc_C_P_D3_D3_D3",C, P, D3, D3, D3);
160 Kokkos::View<double**> fc_F_P (
"fc_F_P",F, P);
161 Kokkos::View<double***> fc_F_P_D1 (
"fc_F_P_D1",F, P, D1);
162 Kokkos::View<double***> fc_F_P_D2 (
"fc_F_P_D2",F, P, D2);
163 Kokkos::View<double***> fc_F_P1_D2 (
"fc_F_P1_D2",F, P1, D2);
164 Kokkos::View<double***> fc_F_P_D3 (
"fc_F_P_D3",F, P, D3);
165 Kokkos::View<double****> fc_F_P_D3_D3 (
"fc_F_P_D3_D3",F, P, D3, D3);
166 Kokkos::View<double***> fc_F1_P_D2 (
"fc_F1_P_D2",F1,P, D2);
167 Kokkos::View<double***> fc_F1_P_D3 (
"fc_F1_P_D3",F1,P, D3);
168 Kokkos::View<double****> fc_F1_P_D3_D3 (
"fc_F1_P_D3_D3",F1,P, D3, D3);
169 Kokkos::View<double***> fc_F_P1_D3 (
"fc_F_P1_D3",F, P1,D3);
170 Kokkos::View<double****> fc_F_P1_D3_D3 (
"fc_F_P1_D3_D3",F, P1,D3, D3);
171 Kokkos::View<double****> fc_F_P_D2_D2 (
"fc_F_P_D2_D2",F, P, D2, D2);
172 Kokkos::View<double****> fc_F_P1_D2_D2 (
"fc_F_P1_D2_D2",F, P1,D2, D2);
173 Kokkos::View<double***> fc_C_F_P (
"fc_C_F_P",C, F, P);
174 Kokkos::View<double***> fc_C1_F_P (
"fc_C1_F_P",C1, F, P);
175 Kokkos::View<double***> fc_C_F1_P (
"fc_C_F1_P",C, F1,P);
176 Kokkos::View<double***> fc_C_F_P1 (
"fc_C_F_P1",C, F, P1);
177 Kokkos::View<double****> fc_C_F_P_D1 (
"fc_C_F_P_D1",C, F, P, D1);
178 Kokkos::View<double****> fc_C_F_P_D2 (
"fc_C_F_P_D2",C, F, P, D2);
179 Kokkos::View<double****> fc_C_F_P_D3 (
"fc_C_F_P_D3",C, F, P, D3);
180 Kokkos::View<double****> fc_C1_F_P_D2 (
"fc_C1_F_P_D2",C1, F, P,D2);
181 Kokkos::View<double****> fc_C1_F_P_D3 (
"fc_C1_F_P_D3",C1, F, P,D3);
182 Kokkos::View<double****> fc_C_F1_P_D2 (
"fc_C_F1_P_D2",C, F1,P, D2);
183 Kokkos::View<double****> fc_C_F1_P_D3 (
"fc_C_F1_P_D3",C, F1,P, D3);
184 Kokkos::View<double*****> fc_C_F1_P_D3_D3 (
"fc_C_F1_P_D3_D3",C, F1,P, D3, D3);
185 Kokkos::View<double****> fc_C_F_P1_D2 (
"fc_C_F_P1_D2",C, F, P1,D2);
186 Kokkos::View<double****> fc_C_F_P1_D3 (
"fc_C_F_P1_D3",C, F, P1,D3);
187 Kokkos::View<double*****> fc_C_F_P_D1_D1 (
"fc_C_F_P_D1_D1",C, F, P, D1, D1);
188 Kokkos::View<double*****> fc_C_F_P_D2_D2 (
"fc_C_F_P_D2_D2",C, F, P, D2, D2);
189 Kokkos::View<double*****> fc_C_F_P_D1_D3 (
"fc_C_F_P_D1_D3",C, F, P, D1, D3);
190 Kokkos::View<double*****> fc_C_F_P_D2_D3 (
"fc_C_F_P_D2_D3",C, F, P, D2, D3);
191 Kokkos::View<double*****> fc_C_F_P_D3_D1 (
"fc_C_F_P_D3_D1",C, F, P, D3, D1);
192 Kokkos::View<double*****> fc_C_F_P_D3_D2 (
"fc_C_F_P_D3_D2",C, F, P, D3, D2);
193 Kokkos::View<double*****> fc_C_F_P_D3_D3 (
"fc_C_F_P_D3_D3",C, F, P, D3, D3);
194 Kokkos::View<double*****> fc_C_F_P1_D2_D2 (
"fc_C_F_P1_D2_D2",C, F, P1,D2, D2);
195 Kokkos::View<double*****> fc_C_F_P1_D3_D3 (
"fc_C_F_P1_D3_D3",C, F, P1,D3, D3);
196 Kokkos::View<double*****> fc_C1_F_P_D2_D2 (
"fc_C1_F_P_D2_D2",C1,F, P, D2, D2);
197 Kokkos::View<double*****> fc_C1_F_P1_D2_D2 (
"fc_C1_F_P1_D2_D2",C1,F, P1,D2, D2);
198 Kokkos::View<double*****> fc_C1_F_P_D3_D3 (
"fc_C1_F_P_D3_D3",C1,F, P, D3, D3);
200 Teuchos::Array<int> dimensions(6);
212 <<
"===============================================================================\n"\
213 <<
"| TEST 1: crossProductDataField exceptions |\n"\
214 <<
"===============================================================================\n";
220 INTREPID_TEST_COMMAND(atools.
crossProductDataField<
double>(fc_C_F_P_D3, fc_C_P_D2_D2, fc_C_F_P_D3) );
225 INTREPID_TEST_COMMAND(atools.
crossProductDataField<
double>(fc_C_F_P_D3, fc_C_P_D3, fc_C_F_P_D3_D3) );
271 <<
"===============================================================================\n"\
272 <<
"| TEST 2: crossProductDataData exceptions |\n"\
273 <<
"===============================================================================\n";
278 INTREPID_TEST_COMMAND(atools.
crossProductDataData<
double>(fc_C_P_D3, fc_C_P_D2_D2, fc_C_P_D3) );
283 INTREPID_TEST_COMMAND(atools.
crossProductDataData<
double>(fc_C_P_D3, fc_C_P_D3, fc_C_P_D2_D2) );
310 <<
"===============================================================================\n"\
311 <<
"| TEST 3: outerProductDataField exceptions |\n"\
312 <<
"===============================================================================\n";
316 INTREPID_TEST_COMMAND(atools.
outerProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D2_D2, fc_C_F_P_D3) );
317 INTREPID_TEST_COMMAND(atools.
outerProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D1, fc_C_F_P_D3) );
321 INTREPID_TEST_COMMAND(atools.
outerProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D3, fc_C_F_P_D3_D3) );
322 INTREPID_TEST_COMMAND(atools.
outerProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D3, fc_C_F_P_D1) );
327 INTREPID_TEST_COMMAND(atools.
outerProductDataField<
double>(fc_C_F_P_D3_D3_D3,fc_C_P_D3, fc_C_F_P_D3) );
328 INTREPID_TEST_COMMAND(atools.
outerProductDataField<
double>(fc_C_F_P_D1_D3, fc_C_P_D3, fc_C_F_P_D3) );
329 INTREPID_TEST_COMMAND(atools.
outerProductDataField<
double>(fc_C_F_P_D3_D1, fc_C_P_D3, fc_C_F_P_D3) );
330 INTREPID_TEST_COMMAND(atools.
outerProductDataField<
double>(fc_C_F_P_D1_D1, fc_C_P_D3, fc_C_F_P_D3) );
333 INTREPID_TEST_COMMAND(atools.
outerProductDataField<
double>(fc_C_F_P_D3_D3, fc_C1_P_D3, fc_C_F_P_D3) );
334 INTREPID_TEST_COMMAND(atools.
outerProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P1_D3, fc_C_F_P_D3) );
335 INTREPID_TEST_COMMAND(atools.
outerProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D2, fc_C_F_P_D2) );
338 INTREPID_TEST_COMMAND(atools.
outerProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D3, fc_C1_F_P_D3) );
339 INTREPID_TEST_COMMAND(atools.
outerProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D3, fc_C_F_P1_D3) );
340 INTREPID_TEST_COMMAND(atools.
outerProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D3, fc_C_F_P_D2) );
346 INTREPID_TEST_COMMAND(atools.
outerProductDataField<
double>(fc_C_F_P_D3_D3, fc_C1_P_D3, fc_C1_F_P_D3) );
347 INTREPID_TEST_COMMAND(atools.
outerProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D3, fc_C_F1_P_D3) );
348 INTREPID_TEST_COMMAND(atools.
outerProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P1_D3, fc_C_F_P1_D3) );
349 INTREPID_TEST_COMMAND(atools.
outerProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D2, fc_C_F_P_D2) );
350 INTREPID_TEST_COMMAND(atools.
outerProductDataField<
double>(fc_C_F_P_D2_D3, fc_C_P_D2, fc_C_F_P_D2) );
353 INTREPID_TEST_COMMAND(atools.
outerProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P1_D3, fc_F_P1_D3) );
357 <<
"===============================================================================\n"\
358 <<
"| TEST 4: outerProductDataData exceptions |\n"\
359 <<
"===============================================================================\n";
363 INTREPID_TEST_COMMAND(atools.
outerProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D3_D3, fc_C_P_D3) );
364 INTREPID_TEST_COMMAND(atools.
outerProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D1, fc_C_P_D3) );
368 INTREPID_TEST_COMMAND(atools.
outerProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D3, fc_C_P_D3_D3) );
369 INTREPID_TEST_COMMAND(atools.
outerProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D3, fc_C_P_D1) );
374 INTREPID_TEST_COMMAND(atools.
outerProductDataData<
double>(fc_C_P_D3_D3_D3,fc_C_P_D3, fc_C_P_D3) );
375 INTREPID_TEST_COMMAND(atools.
outerProductDataData<
double>(fc_C_P_D3_D1, fc_C_P_D3, fc_C_P_D3) );
376 INTREPID_TEST_COMMAND(atools.
outerProductDataData<
double>(fc_C_P_D1_D2, fc_C_P_D3, fc_C_P_D3) );
386 INTREPID_TEST_COMMAND(atools.
outerProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D3, fc_C1_P_D3) );
387 INTREPID_TEST_COMMAND(atools.
outerProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D3, fc_C_P1_D3) );
388 INTREPID_TEST_COMMAND(atools.
outerProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D3, fc_C_P_D2) );
394 INTREPID_TEST_COMMAND(atools.
outerProductDataData<
double>(fc_C_P_D3_D3, fc_C1_P_D3, fc_C1_P_D3) );
395 INTREPID_TEST_COMMAND(atools.
outerProductDataData<
double>(fc_C_P_D3_D3, fc_C_P1_D3, fc_C_P1_D3) );
396 INTREPID_TEST_COMMAND(atools.
outerProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D2, fc_C_P_D2) );
398 INTREPID_TEST_COMMAND(atools.
outerProductDataData<
double>(fc_C_P_D3_D3, fc_C_P1_D3, fc_P1_D3) );
403 <<
"===============================================================================\n"\
404 <<
"| TEST 5: matvecProductDataField exceptions |\n"\
405 <<
"===============================================================================\n";
458 <<
"===============================================================================\n"\
459 <<
"| TEST 6: matvecProductDataData exceptions |\n"\
460 <<
"===============================================================================\n";
517 <<
"===============================================================================\n"\
518 <<
"| TEST 7: matmatProductDataField exceptions |\n"\
519 <<
"===============================================================================\n";
523 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D3_D3_D3, fc_C_F_P_D3_D3) );
524 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D1_D3, fc_C_F_P_D3_D3) );
525 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D3_D1, fc_C_F_P_D3_D3) );
529 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D3_D3, fc_C_F_P_D3_D3_D3) );
530 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D3_D3, fc_C_F_P_D1_D3) );
531 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D3_D3, fc_C_F_P_D3_D1) );
535 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3_D3, fc_C_P_D3_D3, fc_C_F_P_D3_D3) );
536 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D1_D3, fc_C_P_D3_D3, fc_C_F_P_D3_D3) );
537 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D1, fc_C_P_D3_D3, fc_C_F_P_D3_D3) );
540 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C1_P_D3_D3, fc_C_F_P_D3_D3) );
541 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P1_D3_D3, fc_C_F_P_D3_D3) );
542 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D2_D2, fc_C_F_P_D3_D3) );
543 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P1_D2_D2, fc_C_F_P_D3_D3) );
544 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D2_D2, fc_C_P_D3_D3, fc_C_F_P_D3_D3) );
547 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C1_P_D3, fc_C_F_P_D3_D3) );
548 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P1_D3, fc_C_F_P_D3_D3) );
552 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D3_D3, fc_C1_F_P_D3_D3) );
553 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D3_D3, fc_C_F_P1_D3_D3) );
554 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D3_D3, fc_C_F_P_D2_D2) );
555 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D3_D3, fc_C_F_P1_D2_D2) );
556 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D3_D3, fc_C1_F_P_D2_D2) );
557 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D3_D3, fc_C1_F_P1_D2_D2) );
560 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D3, fc_C1_F_P_D3_D3) );
561 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D3, fc_C_F_P1_D3_D3) );
565 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D3_D3, fc_F_P1_D3_D3) );
566 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D3_D3, fc_F_P_D2_D2) );
567 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D3_D3, fc_F_P1_D2_D2) );
573 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D3_D3, fc_C1_F_P_D3_D3) );
574 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D3_D3, fc_C_F1_P_D3_D3) );
575 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D3_D3, fc_C_F_P1_D3_D3) );
576 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D3_D3, fc_C_F_P_D2_D2) );
579 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D3_D3, fc_F1_P_D3_D3) );
580 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D3_D3, fc_F_P1_D3_D3) );
581 INTREPID_TEST_COMMAND(atools.
matmatProductDataField<
double>(fc_C_F_P_D3_D3, fc_C_P_D3_D3, fc_F_P_D2_D2) );
584 <<
"===============================================================================\n"\
585 <<
"| TEST 8: matmatProductDataData exceptions |\n"\
586 <<
"===============================================================================\n";
590 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D3_D3_D3, fc_C_P_D3_D3) );
591 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D1_D3, fc_C_P_D3_D3) );
592 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D3_D1, fc_C_P_D3_D3) );
596 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D3, fc_C_P_D3_D3_D3) );
597 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D3_D3, fc_C_P_D1_D3) );
598 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D3_D3, fc_C_P_D3_D1) );
602 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3_D3, fc_C_P_D3, fc_C_P_D3_D3) );
603 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D1_D3, fc_C_P_D3_D3, fc_C_P_D3_D3) );
604 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D1, fc_C_P_D3_D3, fc_C_P_D3_D3) );
607 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3, fc_C1_P_D3_D3, fc_C_P_D3_D3) );
608 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3, fc_C_P1_D3_D3, fc_C_P_D3_D3) );
609 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D2_D2, fc_C_P_D3_D3) );
610 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3, fc_C_P1_D2_D2, fc_C_P_D3_D3) );
611 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D2_D2, fc_C_P_D3_D3, fc_C_P_D3_D3) );
614 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3, fc_C1_P_D3, fc_C_P_D3_D3) );
615 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3, fc_C_P1_D3, fc_C_P_D3_D3) );
619 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D3_D3, fc_C1_P_D3_D3) );
620 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D3_D3, fc_C_P1_D3_D3) );
621 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D3_D3, fc_C_P_D2_D2) );
622 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D3_D3, fc_C_P1_D2_D2) );
623 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D3_D3, fc_C1_P_D2_D2) );
624 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D3_D3, fc_C_P1_D2_D2) );
627 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D3, fc_C1_P_D3_D3) );
628 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D3, fc_C_P1_D3_D3) );
632 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D3_D3, fc_P1_D3_D3) );
633 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D3_D3, fc_P_D2_D2) );
634 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D3_D3, fc_P1_D2_D2) );
640 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D3_D3, fc_C1_P_D3_D3) );
641 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D3_D3, fc_C1_P_D3_D3) );
642 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D3_D3, fc_C_P1_D3_D3) );
643 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D3_D3, fc_C_P_D2_D2) );
646 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D3_D3, fc_P_D2_D2) );
647 INTREPID_TEST_COMMAND(atools.
matmatProductDataData<
double>(fc_C_P_D3_D3, fc_C_P_D3_D3, fc_P1_D3_D3) );
650 catch (std::logic_error err) {
651 *outStream <<
"UNEXPECTED ERROR !!! ----------------------------------------------------------\n";
652 *outStream << err.what() <<
'\n';
653 *outStream <<
"-------------------------------------------------------------------------------" <<
"\n\n";
657 if (Teuchos::TestForException_getThrowNumber() != endThrowNumber)
671 <<
"===============================================================================\n"\
672 <<
"| TEST 1.a: 3D crossProductDataField operations: (C,P,D) and (C,F,P,D) |\n"\
673 <<
"===============================================================================\n";
682 Kokkos::View<double***> ijkData_1a(
"ijkData_1a", 3, 2, 3);
684 ijkData_1a(0, 0, 0) = 1.0; ijkData_1a(0, 0, 1) = 0.0; ijkData_1a(0, 0, 2) = 0.0;
685 ijkData_1a(0, 1, 0) = 1.0; ijkData_1a(0, 1, 1) = 0.0; ijkData_1a(0, 1, 2) = 0.0;
687 ijkData_1a(1, 0, 0) = 0.0; ijkData_1a(1, 0, 1) = 1.0; ijkData_1a(1, 0, 2) = 0.0;
688 ijkData_1a(1, 1, 0) = 0.0; ijkData_1a(1, 1, 1) = 1.0; ijkData_1a(1, 1, 2) = 0.0;
690 ijkData_1a(2, 0, 0) = 0.0; ijkData_1a(2, 0, 1) = 0.0; ijkData_1a(2, 0, 2) = 1.0;
691 ijkData_1a(2, 1, 0) = 0.0; ijkData_1a(2, 1, 1) = 0.0; ijkData_1a(2, 1, 2) = 1.0;
694 Kokkos::View<double****> ijkFields_1a(
"ijkFields_1a", 3, 3, 2, 3);
696 ijkFields_1a(0, 0, 0, 0) = 1.0; ijkFields_1a(0, 0, 0, 1) = 0.0; ijkFields_1a(0, 0, 0, 2) = 0.0;
697 ijkFields_1a(0, 0, 1, 0) = 1.0; ijkFields_1a(0, 0, 1, 1) = 0.0; ijkFields_1a(0, 0, 1, 2) = 0.0;
699 ijkFields_1a(0, 1, 0, 0) = 0.0; ijkFields_1a(0, 1, 0, 1) = 1.0; ijkFields_1a(0, 1, 0, 2) = 0.0;
700 ijkFields_1a(0, 1, 1, 0) = 0.0; ijkFields_1a(0, 1, 1, 1) = 1.0; ijkFields_1a(0, 1, 1, 2) = 0.0;
702 ijkFields_1a(0, 2, 0, 0) = 0.0; ijkFields_1a(0, 2, 0, 1) = 0.0; ijkFields_1a(0, 2, 0, 2) = 1.0;
703 ijkFields_1a(0, 2, 1, 0) = 0.0; ijkFields_1a(0, 2, 1, 1) = 0.0; ijkFields_1a(0, 2, 1, 2) = 1.0;
706 ijkFields_1a(1, 0, 0, 0) = 1.0; ijkFields_1a(1, 0, 0, 1) = 0.0; ijkFields_1a(1, 0, 0, 2) = 0.0;
707 ijkFields_1a(1, 0, 1, 0) = 1.0; ijkFields_1a(1, 0, 1, 1) = 0.0; ijkFields_1a(1, 0, 1, 2) = 0.0;
709 ijkFields_1a(1, 1, 0, 0) = 0.0; ijkFields_1a(1, 1, 0, 1) = 1.0; ijkFields_1a(1, 1, 0, 2) = 0.0;
710 ijkFields_1a(1, 1, 1, 0) = 0.0; ijkFields_1a(1, 1, 1, 1) = 1.0; ijkFields_1a(1, 1, 1, 2) = 0.0;
712 ijkFields_1a(1, 2, 0, 0) = 0.0; ijkFields_1a(1, 2, 0, 1) = 0.0; ijkFields_1a(1, 2, 0, 2) = 1.0;
713 ijkFields_1a(1, 2, 1, 0) = 0.0; ijkFields_1a(1, 2, 1, 1) = 0.0; ijkFields_1a(1, 2, 1, 2) = 1.0;
716 ijkFields_1a(2, 0, 0, 0) = 1.0; ijkFields_1a(2, 0, 0, 1) = 0.0; ijkFields_1a(2, 0, 0, 2) = 0.0;
717 ijkFields_1a(2, 0, 1, 0) = 1.0; ijkFields_1a(2, 0, 1, 1) = 0.0; ijkFields_1a(2, 0, 1, 2) = 0.0;
719 ijkFields_1a(2, 1, 0, 0) = 0.0; ijkFields_1a(2, 1, 0, 1) = 1.0; ijkFields_1a(2, 1, 0, 2) = 0.0;
720 ijkFields_1a(2, 1, 1, 0) = 0.0; ijkFields_1a(2, 1, 1, 1) = 1.0; ijkFields_1a(2, 1, 1, 2) = 0.0;
722 ijkFields_1a(2, 2, 0, 0) = 0.0; ijkFields_1a(2, 2, 0, 1) = 0.0; ijkFields_1a(2, 2, 0, 2) = 1.0;
723 ijkFields_1a(2, 2, 1, 0) = 0.0; ijkFields_1a(2, 2, 1, 1) = 0.0; ijkFields_1a(2, 2, 1, 2) = 1.0;
726 Kokkos::View<double****> outFields4(
"outFields4", 3, 3, 2, 3);
727 art::crossProductDataField<double>(outFields4, ijkData_1a, ijkFields_1a);
730 if( !(outFields4(0,0,0,0)==0.0 && outFields4(0,0,0,1)==0.0 && outFields4(0,0,0,2)==0.0 &&
731 outFields4(0,0,1,0)==0.0 && outFields4(0,0,1,1)==0.0 && outFields4(0,0,1,2)==0.0 ) ) {
732 *outStream <<
"\n\nINCORRECT crossProductDataField (1): i x i != 0; ";
735 if( !(outFields4(0,1,0,0)==0.0 && outFields4(0,1,0,1)==0.0 && outFields4(0,1,0,2)==1.0 &&
736 outFields4(0,1,1,0)==0.0 && outFields4(0,1,1,1)==0.0 && outFields4(0,1,1,2)==1.0 ) ) {
737 *outStream <<
"\n\nINCORRECT crossProductDataField (2): i x j != k; ";
740 if( !(outFields4(0,2,0,0)==0.0 && outFields4(0,2,0,1)==-1.0 && outFields4(0,2,0,2)==0.0 &&
741 outFields4(0,2,1,0)==0.0 && outFields4(0,2,1,1)==-1.0 && outFields4(0,2,1,2)==0.0 ) ) {
742 *outStream <<
"\n\nINCORRECT crossProductDataField (3): i x k != -j; ";
747 if( !(outFields4(1,0,0,0)==0.0 && outFields4(1,0,0,1)==0.0 && outFields4(1,0,0,2)==-1.0 &&
748 outFields4(1,0,1,0)==0.0 && outFields4(1,0,1,1)==0.0 && outFields4(1,0,1,2)==-1.0 ) ) {
749 *outStream <<
"\n\nINCORRECT crossProductDataField (4): j x i != -k; ";
752 if( !(outFields4(1,1,0,0)==0.0 && outFields4(1,1,0,1)==0.0 && outFields4(1,1,0,2)==0.0 &&
753 outFields4(1,1,1,0)==0.0 && outFields4(1,1,1,1)==0.0 && outFields4(1,1,1,2)==0.0 ) ) {
754 *outStream <<
"\n\nINCORRECT crossProductDataField (5): j x j != 0; ";
757 if( !(outFields4(1,2,0,0)==1.0 && outFields4(1,2,0,1)==0.0 && outFields4(1,2,0,2)==0.0 &&
758 outFields4(1,2,1,0)==1.0 && outFields4(1,2,1,1)==0.0 && outFields4(1,2,1,2)==0.0 ) ) {
759 *outStream <<
"\n\nINCORRECT crossProductDataField (6): j x k != i; ";
764 if( !(outFields4(2,0,0,0)==0.0 && outFields4(2,0,0,1)==1.0 && outFields4(2,0,0,2)==0.0 &&
765 outFields4(2,0,1,0)==0.0 && outFields4(2,0,1,1)==1.0 && outFields4(2,0,1,2)==0.0 ) ) {
766 *outStream <<
"\n\nINCORRECT crossProductDataField (7): k x i != j; ";
769 if( !(outFields4(2,1,0,0)==-1.0 && outFields4(2,1,0,1)==0.0 && outFields4(2,1,0,2)==0.0 &&
770 outFields4(2,1,1,0)==-1.0 && outFields4(2,1,1,1)==0.0 && outFields4(2,1,1,2)==0.0 ) ) {
771 *outStream <<
"\n\nINCORRECT crossProductDataField (8): k x j != -i; ";
774 if( !(outFields4(2,2,0,0)==0.0 && outFields4(2,2,0,1)==0.0 && outFields4(2,2,0,2)==0.0 &&
775 outFields4(2,2,1,0)==0.0 && outFields4(2,2,1,1)==0.0 && outFields4(2,2,1,2)==0.0 ) ) {
776 *outStream <<
"\n\nINCORRECT crossProductDataField (9): k x k != 0; ";
782 <<
"===============================================================================\n"\
783 <<
"| TEST 1.b: 3D crossProductDataField operations: (C,P,D) and (F,P,D) |\n"\
784 <<
"===============================================================================\n";
793 Kokkos::View<double***> ijkData_1b(
"ijkData_1b", 3, 3, 3);
795 ijkData_1b(0, 0, 0) = 1.0; ijkData_1b(0, 0, 1) = 0.0; ijkData_1b(0, 0, 2) = 0.0;
796 ijkData_1b(0, 1, 0) = 1.0; ijkData_1b(0, 1, 1) = 0.0; ijkData_1b(0, 1, 2) = 0.0;
797 ijkData_1b(0, 2, 0) = 1.0; ijkData_1b(0, 2, 1) = 0.0; ijkData_1b(0, 2, 2) = 0.0;
799 ijkData_1b(1, 0, 0) = 0.0; ijkData_1b(1, 0, 1) = 1.0; ijkData_1b(1, 0, 2) = 0.0;
800 ijkData_1b(1, 1, 0) = 0.0; ijkData_1b(1, 1, 1) = 1.0; ijkData_1b(1, 1, 2) = 0.0;
801 ijkData_1b(1, 2, 0) = 0.0; ijkData_1b(1, 2, 1) = 1.0; ijkData_1b(1, 2, 2) = 0.0;
803 ijkData_1b(2, 0, 0) = 0.0; ijkData_1b(2, 0, 1) = 0.0; ijkData_1b(2, 0, 2) = 1.0;
804 ijkData_1b(2, 1, 0) = 0.0; ijkData_1b(2, 1, 1) = 0.0; ijkData_1b(2, 1, 2) = 1.0;
805 ijkData_1b(2, 2, 0) = 0.0; ijkData_1b(2, 2, 1) = 0.0; ijkData_1b(2, 2, 2) = 1.0;
808 Kokkos::View<double***> ijkFields_1b(
"ijkFields_1b", 1, 3, 3);
810 ijkFields_1b(0, 0, 0) = 1.0; ijkFields_1b(0, 0, 1) = 0.0; ijkFields_1b(0, 0, 2) = 0.0;
811 ijkFields_1b(0, 1, 0) = 0.0; ijkFields_1b(0, 1, 1) = 1.0; ijkFields_1b(0, 1, 2) = 0.0;
812 ijkFields_1b(0, 2, 0) = 0.0; ijkFields_1b(0, 2, 1) = 0.0; ijkFields_1b(0, 2, 2) = 1.0;
815 Kokkos::realloc(outFields4, 3, 1, 3, 3);
816 art::crossProductDataField<double>(outFields4, ijkData_1b, ijkFields_1b);
819 if( !(outFields4(0,0,0,0)==0.0 && outFields4(0,0,0,1)==0.0 && outFields4(0,0,0,2)==0.0) ) {
820 *outStream <<
"\n\nINCORRECT crossProductDataField (10): i x i != 0; ";
823 if( !(outFields4(0,0,1,0)==0.0 && outFields4(0,0,1,1)==0.0 && outFields4(0,0,1,2)==1.0) ) {
824 *outStream <<
"\n\nINCORRECT crossProductDataField (11): i x j != k; ";
827 if( !(outFields4(0,0,2,0)==0.0 && outFields4(0,0,2,1)==-1.0 && outFields4(0,0,2,2)==0.0) ) {
828 *outStream <<
"\n\nINCORRECT crossProductDataField (12): i x k != -j; ";
833 if( !(outFields4(1,0,0,0)==0.0 && outFields4(1,0,0,1)==0.0 && outFields4(1,0,0,2)==-1.0) ) {
834 *outStream <<
"\n\nINCORRECT crossProductDataField (13): j x i != -k; ";
837 if( !(outFields4(1,0,1,0)==0.0 && outFields4(1,0,1,1)==0.0 && outFields4(1,0,1,2)==0.0) ) {
838 *outStream <<
"\n\nINCORRECT crossProductDataField (14): j x j != 0; ";
841 if( !(outFields4(1,0,2,0)==1.0 && outFields4(1,0,2,1)==0.0 && outFields4(1,0,2,2)==0.0) ) {
842 *outStream <<
"\n\nINCORRECT crossProductDataField (15): j x k != i; ";
847 if( !(outFields4(2,0,0,0)==0.0 && outFields4(2,0,0,1)==1.0 && outFields4(2,0,0,2)==0.0) ) {
848 *outStream <<
"\n\nINCORRECT crossProductDataField (16): k x i != j; ";
851 if( !(outFields4(2,0,1,0)==-1.0 && outFields4(2,0,1,1)==0.0 && outFields4(2,0,1,2)==0.0) ) {
852 *outStream <<
"\n\nINCORRECT crossProductDataField (17): k x j != -i; ";
855 if( !(outFields4(2,0,2,0)==0.0 && outFields4(2,0,2,1)==0.0 && outFields4(2,0,2,2)==0.0) ) {
856 *outStream <<
"\n\nINCORRECT crossProductDataField (18): k x k != 0; ";
862 <<
"===============================================================================\n"\
863 <<
"| TEST 1.c: 2D crossProductDataField operations: (C,P,D) and (C,F,P,D) |\n"\
864 <<
"===============================================================================\n";
872 Kokkos::View<double***> ijData_1c(
"ijData_1c", 2, 2, 2);
874 ijData_1c(0, 0, 0) = 1.0; ijData_1c(0, 0, 1) = 0.0;
875 ijData_1c(0, 1, 0) = 1.0; ijData_1c(0, 1, 1) = 0.0;
877 ijData_1c(1, 0, 0) = 0.0; ijData_1c(1, 0, 1) = 1.0;
878 ijData_1c(1, 1, 0) = 0.0; ijData_1c(1, 1, 1) = 1.0;
881 Kokkos::View<double****> ijFields_1c(
"ijFields_1c", 2, 2, 2, 2);
883 ijFields_1c(0, 0, 0, 0) = 1.0; ijFields_1c(0, 0, 0, 1) = 0.0;
884 ijFields_1c(0, 0, 1, 0) = 1.0; ijFields_1c(0, 0, 1, 1) = 0.0;
886 ijFields_1c(0, 1, 0, 0) = 0.0; ijFields_1c(0, 1, 0, 1) = 1.0;
887 ijFields_1c(0, 1, 1, 0) = 0.0; ijFields_1c(0, 1, 1, 1) = 1.0;
890 ijFields_1c(1, 0, 0, 0) = 1.0; ijFields_1c(1, 0, 0, 1) = 0.0;
891 ijFields_1c(1, 0, 1, 0) = 1.0; ijFields_1c(1, 0, 1, 1) = 0.0;
893 ijFields_1c(1, 1, 0, 0) = 0.0; ijFields_1c(1, 1, 0, 1) = 1.0;
894 ijFields_1c(1, 1, 1, 0) = 0.0; ijFields_1c(1, 1, 1, 1) = 1.0;
897 Kokkos::View<double***>outFields3(
"outFields",2,2,2);
899 art::crossProductDataField<double>(outFields3, ijData_1c, ijFields_1c);
901 if( !(outFields3(0,0,0)==0.0 && outFields3(0,0,1)==0.0 ) ) {
902 *outStream <<
"\n\nINCORRECT crossProductDataField (19): i x i != 0; ";
905 if( !(outFields3(0,1,0)==1.0 && outFields3(0,1,1)==1.0 ) ) {
906 *outStream <<
"\n\nINCORRECT crossProductDataField (20): i x j != 1; ";
910 if( !(outFields3(1,0,0)==-1.0 && outFields3(1,0,1)==-1.0 ) ) {
911 *outStream <<
"\n\nINCORRECT crossProductDataField (21): j x i != -1; ";
914 if( !(outFields3(1,1,0)==0.0 && outFields3(1,1,1)==0.0 ) ) {
915 *outStream <<
"\n\nINCORRECT crossProductDataField (22): j x j != 0; ";
921 <<
"===============================================================================\n"\
922 <<
"| TEST 1.d: 2D crossProductDataField operations: (C,P,D) and (F,P,D) |\n"\
923 <<
"===============================================================================\n";
930 Kokkos::View<double***> ijFields_1d(
"ijFields_1d", 1, 2, 2);
932 ijFields_1d(0, 0, 0) = 1.0; ijFields_1d(0, 0, 1) = 0.0;
933 ijFields_1d(0, 1, 0) = 0.0; ijFields_1d(0, 1, 1) = 1.0;
936 Kokkos::realloc(outFields3, 2, 1, 2);
937 art::crossProductDataField<double>(outFields3, ijData_1c, ijFields_1d);
939 if( !(outFields3(0,0,0)==0.0 ) ) {
940 *outStream <<
"\n\nINCORRECT crossProductDataField (23): i x i != 0; ";
943 if( !(outFields3(0,0,1)==1.0 ) ) {
944 *outStream <<
"\n\nINCORRECT crossProductDataField (24): i x j != 1; ";
947 if( !(outFields3(1,0,0)==-1.0 ) ) {
948 *outStream <<
"\n\nINCORRECT crossProductDataField (25): j x i != -1; ";
951 if( !(outFields3(1,0,1)==0.0 ) ) {
952 *outStream <<
"\n\nINCORRECT crossProductDataField (26): j x j != 0; ";
959 <<
"===============================================================================\n"\
960 <<
"| TEST 2.a: 3D crossProductDataData operations: (C,P,D) and (C,P,D) |\n"\
961 <<
"===============================================================================\n";
968 Kokkos::View<double***> jkiData_2a(
"jkiData_2a", 3, 2, 3);
970 jkiData_2a(0, 0, 0) = 0.0; jkiData_2a(0, 0, 1) = 1.0; jkiData_2a(0, 0, 2) = 0.0;
971 jkiData_2a(0, 1, 0) = 0.0; jkiData_2a(0, 1, 1) = 1.0; jkiData_2a(0, 1, 2) = 0.0;
973 jkiData_2a(1, 0, 0) = 0.0; jkiData_2a(1, 0, 1) = 0.0; jkiData_2a(1, 0, 2) = 1.0;
974 jkiData_2a(1, 1, 0) = 0.0; jkiData_2a(1, 1, 1) = 0.0; jkiData_2a(1, 1, 2) = 1.0;
976 jkiData_2a(2, 0, 0) = 1.0; jkiData_2a(2, 0, 1) = 0.0; jkiData_2a(2, 0, 2) = 0.0;
977 jkiData_2a(2, 1, 0) = 1.0; jkiData_2a(2, 1, 1) = 0.0; jkiData_2a(2, 1, 2) = 0.0;
979 Kokkos::View<double***> kijData_2a(
"kijData_2a", 3, 2, 3);
981 kijData_2a(0, 0, 0) = 0.0; kijData_2a(0, 0, 1) = 0.0; kijData_2a(0, 0, 2) = 1.0;
982 kijData_2a(0, 1, 0) = 0.0; kijData_2a(0, 1, 1) = 0.0; kijData_2a(0, 1, 2) = 1.0;
984 kijData_2a(1, 0, 0) = 1.0; kijData_2a(1, 0, 1) = 0.0; kijData_2a(1, 0, 2) = 0.0;
985 kijData_2a(1, 1, 0) = 1.0; kijData_2a(1, 1, 1) = 0.0; kijData_2a(1, 1, 2) = 0.0;
987 kijData_2a(2, 0, 0) = 0.0; kijData_2a(2, 0, 1) = 1.0; kijData_2a(2, 0, 2) = 0.0;
988 kijData_2a(2, 1, 0) = 0.0; kijData_2a(2, 1, 1) = 1.0; kijData_2a(2, 1, 2) = 0.0;
992 Kokkos::View<double***> outData3(
"outData", 3,2,3);
993 art::crossProductDataData<double>(outData3, ijkData_1a, ijkData_1a);
995 for(
unsigned int i = 0; i < outData3.dimension(0); i++)
996 for(
unsigned int j = 0; j < outData3.dimension(1); j++)
997 for(
unsigned int k = 0; k < outData3.dimension(2); k++){
998 if(outData3(i,j,k) != 0) {
999 *outStream <<
"\n\nINCORRECT crossProductDataData (1): i x i, j x j, or k x k != 0; ";
1006 art::crossProductDataData<double>(outData3, ijkData_1a, jkiData_2a);
1009 if( !( outData3(0,0,0)==0.0 && outData3(0,0,1)==0.0 && outData3(0,0,2)==1.0 &&
1010 outData3(0,1,0)==0.0 && outData3(0,1,1)==0.0 && outData3(0,1,2)==1.0) ) {
1011 *outStream <<
"\n\nINCORRECT crossProductDataData (2): i x j != k; ";
1016 if( !( outData3(1,0,0)==1.0 && outData3(1,0,1)==0.0 && outData3(1,0,2)==0.0 &&
1017 outData3(1,1,0)==1.0 && outData3(1,1,1)==0.0 && outData3(1,1,2)==0.0) ) {
1018 *outStream <<
"\n\nINCORRECT crossProductDataData (3): j x k != i; ";
1023 if( !( outData3(2,0,0)==0.0 && outData3(2,0,1)==1.0 && outData3(2,0,2)==0.0 &&
1024 outData3(2,1,0)==0.0 && outData3(2,1,1)==1.0 && outData3(2,1,2)==0.0) ) {
1025 *outStream <<
"\n\nINCORRECT crossProductDataData (4): k x i != j; ";
1031 art::crossProductDataData<double>(outData3, ijkData_1a, kijData_2a);
1034 if( !( outData3(0,0,0)==0.0 && outData3(0,0,1)==-1.0 && outData3(0,0,2)==0.0 &&
1035 outData3(0,1,0)==0.0 && outData3(0,1,1)==-1.0 && outData3(0,1,2)==0.0) ) {
1036 *outStream <<
"\n\nINCORRECT crossProductDataData (5): i x k != -j; ";
1041 if( !( outData3(1,0,0)==0.0 && outData3(1,0,1)==0.0 && outData3(1,0,2)==-1.0 &&
1042 outData3(1,1,0)==0.0 && outData3(1,1,1)==0.0 && outData3(1,1,2)==-1.0) ) {
1043 *outStream <<
"\n\nINCORRECT crossProductDataData (6): j x i != -k; ";
1048 if( !( outData3(2,0,0)==-1.0 && outData3(2,0,1)==0.0 && outData3(2,0,2)==0.0 &&
1049 outData3(2,1,0)==-1.0 && outData3(2,1,1)==0.0 && outData3(2,1,2)==0.0) ) {
1050 *outStream <<
"\n\nINCORRECT crossProductDataData (7): k x j != -i; ";
1057 <<
"===============================================================================\n"\
1058 <<
"| TEST 2.b: 3D crossProductDataData operations: (C,P,D) and (P,D) |\n"\
1059 <<
"===============================================================================\n";
1067 Kokkos::View<double**> ijkData_2b(
"ijkData_2b", 3, 3);
1069 ijkData_2b(0, 0) = 1.0; ijkData_2b(0, 1) = 0.0; ijkData_2b(0, 2) = 0.0;
1070 ijkData_2b(1, 0) = 0.0; ijkData_2b(1, 1) = 1.0; ijkData_2b(1, 2) = 0.0;
1071 ijkData_2b(2, 0) = 0.0; ijkData_2b(2, 1) = 0.0; ijkData_2b(2, 2) = 1.0;
1074 Kokkos::realloc(outData3, 3, 3, 3);
1075 art::crossProductDataData<double>(outData3, ijkData_1b, ijkData_2b);
1078 if( !(outData3(0,0,0)==0.0 && outData3(0,0,1)==0.0 && outData3(0,0,2)==0.0) ) {
1079 *outStream <<
"\n\nINCORRECT crossProductDataData (5): i x i != 0; ";
1082 if( !(outData3(0,1,0)==0.0 && outData3(0,1,1)==0.0 && outData3(0,1,2)==1.0) ) {
1083 *outStream <<
"\n\nINCORRECT crossProductDataData (6): i x j != k; ";
1086 if( !(outData3(0,2,0)==0.0 && outData3(0,2,1)==-1.0 && outData3(0,2,2)==0.0) ) {
1087 *outStream <<
"\n\nINCORRECT crossProductDataData (7): i x k != -j; ";
1092 if( !(outData3(1,0,0)==0.0 && outData3(1,0,1)==0.0 && outData3(1,0,2)==-1.0) ) {
1093 *outStream <<
"\n\nINCORRECT crossProductDataData (8): j x i != -k; ";
1096 if( !(outData3(1,1,0)==0.0 && outData3(1,1,1)==0.0 && outData3(1,1,2)==0.0) ) {
1097 *outStream <<
"\n\nINCORRECT crossProductDataData (9): j x j != 0; ";
1100 if( !(outData3(1,2,0)==1.0 && outData3(1,2,1)==0.0 && outData3(1,2,2)==0.0) ) {
1101 *outStream <<
"\n\nINCORRECT crossProductDataData (10): j x k != i; ";
1106 if( !(outData3(2,0,0)==0.0 && outData3(2,0,1)==1.0 && outData3(2,0,2)==0.0) ) {
1107 *outStream <<
"\n\nINCORRECT crossProductDataData (11): k x i != j; ";
1110 if( !(outData3(2,1,0)==-1.0 && outData3(2,1,1)==0.0 && outData3(2,1,2)==0.0) ) {
1111 *outStream <<
"\n\nINCORRECT crossProductDataData (12): k x j != -i; ";
1114 if( !(outData3(2,2,0)==0.0 && outData3(2,2,1)==0.0 && outData3(2,2,2)==0.0) ) {
1115 *outStream <<
"\n\nINCORRECT crossProductDataData (13): k x k != 0; ";
1122 <<
"===============================================================================\n"\
1123 <<
"| TEST 2.c: 2D crossProductDataData operations: (C,P,D) and (C,P,D) |\n"\
1124 <<
"===============================================================================\n";
1130 Kokkos::View<double***> jiData_2c(
"jiData_2c", 2, 2, 2);
1132 jiData_2c(0, 0, 0) = 0.0; jiData_2c(0, 0, 1) = 1.0;
1133 jiData_2c(0, 1, 0) = 0.0; jiData_2c(0, 1, 1) = 1.0;
1135 jiData_2c(1, 0, 0) = 1.0; jiData_2c(1, 0, 1) = 0.0;
1136 jiData_2c(1, 1, 0) = 1.0; jiData_2c(1, 1, 1) = 0.0;
1140 Kokkos::View<double**> outData2(
"outputData2",2,2);
1141 art::crossProductDataData<double>(outData2, ijData_1c, ijData_1c);
1143 for(
unsigned int i = 0; i < outData2.dimension(0); i++){
1144 for(
unsigned int j = 0; j < outData2.dimension(1); j++){
1145 if(outData2(i,j) != 0) {
1146 *outStream <<
"\n\nINCORRECT crossProductDataData (14): i x i or j x j != 0; ";
1152 art::crossProductDataData<double>(outData2, ijData_1c, jiData_2c);
1154 if( !(outData2(0,0)==1.0 && outData2(0,1)==1.0 ) ) {
1155 *outStream <<
"\n\nINCORRECT crossProductDataData (15): i x j != 1; ";
1158 if( !(outData2(1,0)==-1.0 && outData2(1,1)==-1.0 ) ) {
1159 *outStream <<
"\n\nINCORRECT crossProductDataData (16): j x i != -1; ";
1165 <<
"===============================================================================\n"\
1166 <<
"| TEST 2.d: 2D crossProductDataData operations: (C,P,D) and (P,D) |\n"\
1167 <<
"===============================================================================\n";
1173 Kokkos::View<double**> ijData_2d(
"ijData_2d", 2, 2);
1174 ijData_2d(0, 0) = 1.0; ijData_2d(0, 1) = 0.0;
1175 ijData_2d(1, 0) = 0.0; ijData_2d(1, 1) = 1.0;
1177 Kokkos::realloc(outData2,2,2);
1178 art::crossProductDataData<double>(outData2, ijData_1c, ijData_2d);
1180 if( !(outData2(0,0)==0.0 ) ) {
1181 *outStream <<
"\n\nINCORRECT crossProductDataData (17): i x i != 0; ";
1184 if( !(outData2(0,1)==1.0 ) ) {
1185 *outStream <<
"\n\nINCORRECT crossProductDataData (18): i x j != 1; ";
1188 if( !(outData2(1,0)==-1.0 ) ) {
1189 *outStream <<
"\n\nINCORRECT crossProductDataData (19): j x i != -1; ";
1192 if( !(outData2(1,1)==0.0 ) ) {
1193 *outStream <<
"\n\nINCORRECT crossProductDataData (20): j x j != 0; ";
1200 <<
"===============================================================================\n"\
1201 <<
"| TEST 3.a: outerProductDataField operations: (C,P,D) and (C,F,P,D) |\n"\
1202 <<
"===============================================================================\n";
1212 Kokkos::View<double*****> outFields5(
"outFields5",3, 3, 2, 3, 3);
1213 art::outerProductDataField<double>(outFields5, ijkData_1a, ijkFields_1a);
1215 for(
unsigned int cell = 0; cell < ijkData_1a.dimension(0); cell++){
1216 for(
unsigned int field = 0; field < ijkFields_1a.dimension(1); field++){
1217 for(
unsigned int point = 0; point < ijkData_1a.dimension(1); point++){
1218 for(
unsigned int row = 0; row < ijkData_1a.dimension(2); row++){
1219 for(
unsigned int col = 0; col < ijkData_1a.dimension(2); col++){
1222 if( (row == cell && col == field) ){
1223 if(outFields5(cell, field, point, row, col) != 1.0) {
1224 *outStream <<
"\n\nINCORRECT outerProductDataField (1): computed value is "
1225 << outFields5(cell, field, point, row, col) <<
" whereas correct value is 1.0";
1230 if(outFields5(cell, field, point, row, col) != 0.0) {
1231 *outStream <<
"\n\nINCORRECT outerProductDataField (2): computed value is "
1232 << outFields5(cell, field, point, row, col) <<
" whereas correct value is 0.0";
1244 <<
"===============================================================================\n"\
1245 <<
"| TEST 3.b: outerProductDataField operations: (C,P,D) and (F,P,D) |\n"\
1246 <<
"===============================================================================\n";
1256 Kokkos::realloc(outFields5,3, 1, 3, 3, 3);
1257 art::outerProductDataField<double>(outFields5, ijkData_1b, ijkFields_1b);
1259 for(
unsigned int cell = 0; cell < ijkData_1b.dimension(0); cell++){
1260 for(
unsigned int field = 0; field < ijkFields_1b.dimension(0); field++){
1261 for(
unsigned int point = 0; point < ijkData_1b.dimension(1); point++){
1262 for(
unsigned int row = 0; row < ijkData_1b.dimension(2); row++){
1263 for(
unsigned int col = 0; col < ijkData_1b.dimension(2); col++){
1266 if( (row == cell && col == point) ){
1267 if(outFields5(cell, field, point, row, col) != 1.0) {
1268 *outStream <<
"\n\nINCORRECT outerProductDataField (3): computed value is "
1269 << outFields5(cell, field, point, row, col) <<
" whereas correct value is 1.0";
1275 if(outFields5(cell, field, point, row, col) != 0.0) {
1276 *outStream <<
"\n\nINCORRECT outerProductDataField (4): computed value is "
1277 << outFields5(cell, field, point, row, col) <<
" whereas correct value is 0.0";
1288 <<
"===============================================================================\n"\
1289 <<
"| TEST 4.a: outerProductDataData operations: (C,P,D) and (C,P,D) |\n"\
1290 <<
"===============================================================================\n";
1299 Kokkos::View<double****>outData4(
"outData4",3, 2, 3, 3);
1300 art::outerProductDataData<double>(outData4, ijkData_1a, ijkData_1a);
1301 for(
unsigned int cell = 0; cell < ijkData_1a.dimension(0); cell++){
1302 for(
unsigned int point = 0; point < ijkData_1a.dimension(1); point++){
1303 for(
unsigned int row = 0; row < ijkData_1a.dimension(2); row++){
1304 for(
unsigned int col = 0; col < ijkData_1a.dimension(2); col++){
1307 if( (row == cell && col == cell) ){
1308 if(outData4(cell, point, row, col) != 1.0) {
1309 *outStream <<
"\n\nINCORRECT outerProductDataData (1): computed value is "
1310 << outData4(cell, point, row, col) <<
" whereas correct value is 1.0";
1315 if(outData4(cell, point, row, col) != 0.0) {
1316 *outStream <<
"\n\nINCORRECT outerProductDataData (2): computed value is "
1317 << outData4(cell, point, row, col) <<
" whereas correct value is 0.0";
1326 Kokkos::deep_copy(outData4,0.0);
1327 art::outerProductDataData<double>(outData4, ijkData_1a, jkiData_2a);
1328 for(
unsigned int cell = 0; cell < ijkData_1a.dimension(0); cell++){
1329 for(
unsigned int point = 0; point < ijkData_1a.dimension(1); point++){
1330 for(
unsigned int row = 0; row < ijkData_1a.dimension(2); row++){
1331 for(
unsigned int col = 0; col < ijkData_1a.dimension(2); col++){
1334 if( (row == cell && col == (cell + 1) % 3) ){
1335 if(outData4(cell, point, row, col) != 1.0) {
1336 *outStream <<
"\n\nINCORRECT outerProductDataData (3): computed value is "
1337 << outData4(cell, point, row, col) <<
" whereas correct value is 1.0";
1342 if(outData4(cell, point, row, col) != 0.0) {
1343 *outStream <<
"\n\nINCORRECT outerProductDataData (4): computed value is "
1344 << outData4(cell, point, row, col) <<
" whereas correct value is 0.0";
1354 Kokkos::deep_copy(outData4,0.0);
1355 art::outerProductDataData<double>(outData4, ijkData_1a, kijData_2a);
1356 for(
unsigned int cell = 0; cell < ijkData_1a.dimension(0); cell++){
1357 for(
unsigned int point = 0; point < ijkData_1a.dimension(1); point++){
1358 for(
unsigned int row = 0; row < ijkData_1a.dimension(2); row++){
1359 for(
unsigned int col = 0; col < ijkData_1a.dimension(2); col++){
1362 if( (row == cell && col == (cell + 2) % 3) ){
1363 if(outData4(cell, point, row, col) != 1.0) {
1364 *outStream <<
"\n\nINCORRECT outerProductDataData (5): computed value is "
1365 << outData4(cell, point, row, col) <<
" whereas correct value is 1.0";
1370 if(outData4(cell, point, row, col) != 0.0) {
1371 *outStream <<
"\n\nINCORRECT outerProductDataData (6): computed value is "
1372 << outData4(cell, point, row, col) <<
" whereas correct value is 0.0";
1384 <<
"===============================================================================\n"\
1385 <<
"| TEST 4.b: outerProductDataData operations: (C,P,D) and (P,D) |\n"\
1386 <<
"===============================================================================\n";
1395 Kokkos::realloc(outData4,3, 3, 3, 3);
1396 art::outerProductDataData<double>(outData4, ijkData_1b, ijkData_2b);
1397 for(
unsigned int cell = 0; cell < ijkData_1b.dimension(0); cell++){
1398 for(
unsigned int point = 0; point < ijkData_1b.dimension(1); point++){
1399 for(
unsigned int row = 0; row < ijkData_1b.dimension(2); row++){
1400 for(
unsigned int col = 0; col < ijkData_1b.dimension(2); col++){
1403 if( (row == cell && col == point) ){
1404 if(outData4(cell, point, row, col) != 1.0) {
1405 *outStream <<
"\n\nINCORRECT outerProductDataData (7): computed value is "
1406 << outData4(cell, point, row, col) <<
" whereas correct value is 1.0";
1411 if(outData4(cell, point, row, col) != 0.0) {
1412 *outStream <<
"\n\nINCORRECT outerProductDataData (8): computed value is "
1413 << outData4(cell, point, row, col) <<
" whereas correct value is 0.0";
1424 <<
"===============================================================================\n"\
1425 <<
"| TEST 5.a: matvecProductDataField operations: (C,P,D,D) and (C,F,P,D) |\n"\
1426 <<
"===============================================================================\n";
1435 Kokkos::View<double****> inputMat(
"inputMat",2,1,3,3);
1437 inputMat(0,0,0,0) = 1.0; inputMat(0,0,0,1) = 1.0; inputMat(0,0,0,2) = 1.0;
1438 inputMat(0,0,1,0) =-1.0; inputMat(0,0,1,1) = 2.0; inputMat(0,0,1,2) =-1.0;
1439 inputMat(0,0,2,0) = 1.0; inputMat(0,0,2,1) = 2.0; inputMat(0,0,2,2) = 3.0;
1441 inputMat(1,0,0,0) = 0.0; inputMat(1,0,0,1) = 0.0; inputMat(1,0,0,2) = 0.0;
1442 inputMat(1,0,1,0) =-1.0; inputMat(1,0,1,1) =-2.0; inputMat(1,0,1,2) =-3.0;
1443 inputMat(1,0,2,0) =-2.0; inputMat(1,0,2,1) = 6.0; inputMat(1,0,2,2) =-4.0;
1446 Kokkos::View<double****> inputVecFields4(
"inputVecFields4",2,2,1,3);
1448 inputVecFields4(0,0,0,0) = 0.0; inputVecFields4(0,0,0,1) = 0.0; inputVecFields4(0,0,0,2) = 0.0;
1449 inputVecFields4(0,1,0,0) = 1.0; inputVecFields4(0,1,0,1) = 1.0; inputVecFields4(0,1,0,2) = 1.0;
1451 inputVecFields4(1,0,0,0) =-1.0; inputVecFields4(1,0,0,1) =-1.0; inputVecFields4(1,0,0,2) =-1.0;
1452 inputVecFields4(1,1,0,0) =-1.0; inputVecFields4(1,1,0,1) = 1.0; inputVecFields4(1,1,0,2) =-1.0;
1455 Kokkos::View<double****> outFieldsCorrect(
"outFieldsCorrect",2,2,1,3);
1457 outFieldsCorrect(0,0,0,0) = 0.0; outFieldsCorrect(0,0,0,1) = 0.0; outFieldsCorrect(0,0,0,2) = 0.0;
1458 outFieldsCorrect(0,1,0,0) = 3.0; outFieldsCorrect(0,1,0,1) = 0.0; outFieldsCorrect(0,1,0,2) = 6.0;
1460 outFieldsCorrect(1,0,0,0) = 0.0; outFieldsCorrect(1,0,0,1) = 6.0; outFieldsCorrect(1,0,0,2) = 0.0;
1461 outFieldsCorrect(1,1,0,0) = 0.0; outFieldsCorrect(1,1,0,1) = 2.0; outFieldsCorrect(1,1,0,2) = 12.0;
1464 Kokkos::realloc(outFields4,2,2,1,3);
1465 art::matvecProductDataField<double>(outFields4, inputMat, inputVecFields4);
1468 for(
unsigned int cell = 0; cell < outFields4.dimension(0); cell++){
1469 for(
unsigned int field = 0; field < outFields4.dimension(1); field++){
1470 for(
unsigned int point = 0; point < outFields4.dimension(2); point++){
1471 for(
unsigned int row = 0; row < outFields4.dimension(3); row++){
1472 if(outFields4(cell, field, point, row) != outFieldsCorrect(cell, field, point, row)) {
1473 *outStream <<
"\n\nINCORRECT matvecProductDataField (1): \n value at multi-index ("
1474 << cell <<
"," << field <<
"," << point <<
"," << row <<
") = "
1475 << outFields4(cell, field, point, row) <<
" but correct value is "
1476 << outFieldsCorrect(cell, field, point, row) <<
"\n";
1487 <<
"===============================================================================\n"\
1488 <<
"| TEST 5.b: matvecProductDataField operations: (C,P,D,D) and (F,P,D) |\n"\
1489 <<
"===============================================================================\n";
1498 Kokkos::View<double***> inputVecFields3(
"inputVecFields3",4,1,3);
1501 inputVecFields3(0,0,0) = 0.0; inputVecFields3(0,0,1) = 0.0; inputVecFields3(0,0,2) = 0.0;
1502 inputVecFields3(1,0,0) = 1.0; inputVecFields3(1,0,1) = 1.0; inputVecFields3(1,0,2) = 1.0;
1503 inputVecFields3(2,0,0) =-1.0; inputVecFields3(2,0,1) =-1.0; inputVecFields3(2,0,2) =-1.0;
1504 inputVecFields3(3,0,0) =-1.0; inputVecFields3(3,0,1) = 1.0; inputVecFields3(3,0,2) =-1.0;
1507 Kokkos::realloc(outFieldsCorrect,2,4,1,3);
1509 outFieldsCorrect(0,0,0,0) = 0.0; outFieldsCorrect(0,0,0,1) = 0.0; outFieldsCorrect(0,0,0,2) = 0.0;
1510 outFieldsCorrect(0,1,0,0) = 3.0; outFieldsCorrect(0,1,0,1) = 0.0; outFieldsCorrect(0,1,0,2) = 6.0;
1511 outFieldsCorrect(0,2,0,0) =-3.0; outFieldsCorrect(0,2,0,1) = 0.0; outFieldsCorrect(0,2,0,2) =-6.0;
1512 outFieldsCorrect(0,3,0,0) =-1.0; outFieldsCorrect(0,3,0,1) = 4.0; outFieldsCorrect(0,3,0,2) =-2.0;
1514 outFieldsCorrect(1,0,0,0) = 0.0; outFieldsCorrect(1,0,0,1) = 0.0; outFieldsCorrect(1,0,0,2) = 0.0;
1515 outFieldsCorrect(1,1,0,0) = 0.0; outFieldsCorrect(1,1,0,1) =-6.0; outFieldsCorrect(1,1,0,2) = 0.0;
1516 outFieldsCorrect(1,2,0,0) = 0.0; outFieldsCorrect(1,2,0,1) = 6.0; outFieldsCorrect(1,2,0,2) = 0.0;
1517 outFieldsCorrect(1,3,0,0) = 0.0; outFieldsCorrect(1,3,0,1) = 2.0; outFieldsCorrect(1,3,0,2) =12.0;
1521 Kokkos::realloc(outFields4,2,4,1,3);
1522 art::matvecProductDataField<double>(outFields4, inputMat, inputVecFields3);
1525 for(
unsigned int cell = 0; cell < outFields4.dimension(0); cell++){
1526 for(
unsigned int field = 0; field < outFields4.dimension(1); field++){
1527 for(
unsigned int point = 0; point < outFields4.dimension(2); point++){
1528 for(
unsigned int row = 0; row < outFields4.dimension(3); row++){
1529 if(outFields4(cell, field, point, row) != outFieldsCorrect(cell, field, point, row)) {
1530 *outStream <<
"\n\nINCORRECT matvecProductDataField (2): \n value at multi-index ("
1531 << cell <<
"," << field <<
"," << point <<
"," << row <<
") = "
1532 << outFields4(cell, field, point, row) <<
" but correct value is "
1533 << outFieldsCorrect(cell, field, point, row) <<
"\n";
1544 <<
"===============================================================================\n"\
1545 <<
"| TEST 5.c: matvecProductDataField random tests: branch inputFields(C,F,P,D) |\n"\
1546 <<
"===============================================================================\n";
1551 int c=5, p=9, f=7, d1=3;
1552 double zero = INTREPID_TOL*10000.0;
1554 Kokkos::View<double****> in_c_f_p_d(
"in_c_f_p_d",c, f, p, d1);
1555 Kokkos::View<double****> out_c_f_p_d(
"out_c_f_p_d",c, f, p, d1);
1556 Kokkos::View<double****> outi_c_f_p_d(
"outi_c_f_p_d",c, f, p, d1);
1558 Kokkos::View<double**> data_c_p(
"data_c_p",c, p);
1559 Kokkos::View<double**> datainv_c_p(
"datainv_c_p",c, p);
1560 Kokkos::View<double**> data_c_1(
"data_c_1",c, 1);
1561 Kokkos::View<double**> datainv_c_1(
"datainv_c_1",c, 1);
1562 Kokkos::View<double***> data_c_p_d(
"data_c_p_d",c, p, d1);
1563 Kokkos::View<double***> datainv_c_p_d(
"datainv_c_p_d",c, p, d1);
1564 Kokkos::View<double***> data_c_1_d(
"data_c_1_d",c, 1, d1);
1565 Kokkos::View<double***> datainv_c_1_d(
"datainv_c_1_d",c, 1, d1);
1566 Kokkos::View<double****> data_c_p_d_d(
"data_c_p_d_d",c, p, d1, d1);
1567 Kokkos::View<double****> datainv_c_p_d_d(
"datainv_c_p_d_d",c, p, d1, d1);
1568 Kokkos::View<double****> datainvtrn_c_p_d_d(
"datainvtrn_c_p_d_d",c, p, d1, d1);
1569 Kokkos::View<double****> data_c_1_d_d(
"data_c_1_d_d",c, 1, d1, d1);
1570 Kokkos::View<double****> datainv_c_1_d_d(
"datainv_c_1_d_d",c, 1, d1, d1);
1571 Kokkos::View<double****> datainvtrn_c_1_d_d(
"datainvtrn_c_1_d_d",c, 1, d1, d1);
1575 for (
unsigned int i=0; i<in_c_f_p_d.dimension(0); i++)
1576 for (
unsigned int j=0; j<in_c_f_p_d.dimension(1); j++)
1577 for (
unsigned int k=0; k<in_c_f_p_d.dimension(2); k++)
1578 for (
unsigned int l=0; l<in_c_f_p_d.dimension(3); l++)
1579 in_c_f_p_d(i,j,k,l) = Teuchos::ScalarTraits<double>::random();
1581 for (
unsigned int i=0; i<data_c_p.dimension(0); i++)
1582 for (
unsigned int j=0; j<data_c_p.dimension(1); j++){
1583 data_c_p(i,j) = Teuchos::ScalarTraits<double>::random();
1584 datainv_c_p(i,j) = 1.0 / data_c_p(i,j);
1587 for (
unsigned int i=0; i<data_c_1.dimension(0); i++)
1588 for (
unsigned int j=0; j<data_c_1.dimension(1); j++){
1589 data_c_1(i,j) = Teuchos::ScalarTraits<double>::random();
1590 datainv_c_1(i,j) = 1.0 / data_c_1(i,j);
1594 art::matvecProductDataField<double>(out_c_f_p_d, data_c_p, in_c_f_p_d);
1595 art::matvecProductDataField<double>(out_c_f_p_d, datainv_c_p, out_c_f_p_d);
1596 rst::subtract(out_c_f_p_d, in_c_f_p_d);
1597 if (rst::vectorNorm(out_c_f_p_d, NORM_ONE) > zero) {
1598 *outStream <<
"\n\nINCORRECT matvecProductDataField (3): check scalar inverse property\n\n";
1602 art::matvecProductDataField<double>(out_c_f_p_d, data_c_1, in_c_f_p_d);
1603 art::matvecProductDataField<double>(out_c_f_p_d, datainv_c_1, out_c_f_p_d);
1604 rst::subtract(out_c_f_p_d, in_c_f_p_d);
1605 if (rst::vectorNorm(out_c_f_p_d, NORM_ONE) > zero) {
1606 *outStream <<
"\n\nINCORRECT matvecProductDataField (4): check scalar inverse property\n\n";
1612 for (
unsigned int i=0; i<in_c_f_p_d.dimension(0); i++)
1613 for (
unsigned int j=0; j<in_c_f_p_d.dimension(1); j++)
1614 for (
unsigned int k=0; k<in_c_f_p_d.dimension(2); k++)
1615 for (
unsigned int l=0; l<in_c_f_p_d.dimension(3); l++)
1616 in_c_f_p_d(i,j,k,l) = Teuchos::ScalarTraits<double>::random();
1618 for (
unsigned int i=0; i<data_c_p_d.dimension(0); i++)
1619 for (
unsigned int j=0; j<data_c_p_d.dimension(1); j++)
1620 for (
unsigned int k=0; k<data_c_p_d.dimension(2); k++){
1621 data_c_p_d(i,j,k) = Teuchos::ScalarTraits<double>::random();
1622 datainv_c_p_d(i,j,k) = 1.0 / data_c_p_d(i,j,k);
1625 for (
unsigned int i=0; i<data_c_1_d.dimension(0); i++)
1626 for (
unsigned int j=0; j<data_c_1_d.dimension(1); j++)
1627 for (
unsigned int k=0; k<data_c_1_d.dimension(2); k++){
1628 data_c_1_d(i,j,k) = Teuchos::ScalarTraits<double>::random();
1629 datainv_c_1_d(i,j,k) = 1.0 / data_c_1_d(i,j,k);
1634 art::matvecProductDataField<double>(out_c_f_p_d, data_c_p_d, in_c_f_p_d);
1635 art::matvecProductDataField<double>(out_c_f_p_d, datainv_c_p_d, out_c_f_p_d);
1636 rst::subtract(out_c_f_p_d, in_c_f_p_d);
1637 if (rst::vectorNorm(out_c_f_p_d, NORM_ONE) > zero) {
1638 *outStream <<
"\n\nINCORRECT matvecProductDataField (5): check scalar inverse property\n\n";
1642 art::matvecProductDataField<double>(out_c_f_p_d, data_c_1_d, in_c_f_p_d);
1643 art::matvecProductDataField<double>(out_c_f_p_d, datainv_c_1_d, out_c_f_p_d);
1644 rst::subtract(out_c_f_p_d, in_c_f_p_d);
1645 if (rst::vectorNorm(out_c_f_p_d, NORM_ONE) > zero) {
1646 *outStream <<
"\n\nINCORRECT matvecProductDataField (6): check scalar inverse property\n\n";
1653 for (
unsigned int i=0; i<in_c_f_p_d.dimension(0); i++)
1654 for (
unsigned int j=0; j<in_c_f_p_d.dimension(1); j++)
1655 for (
unsigned int k=0; k<in_c_f_p_d.dimension(2); k++)
1656 for (
unsigned int l=0; l<in_c_f_p_d.dimension(3); l++)
1657 in_c_f_p_d(i,j,k,l) = Teuchos::ScalarTraits<double>::random();
1659 for (
unsigned int i=0; i<data_c_p_d_d.dimension(0); i++)
1660 for (
unsigned int j=0; j<data_c_p_d_d.dimension(1); j++)
1661 for (
unsigned int k=0; k<data_c_p_d_d.dimension(2); k++)
1662 for (
unsigned int l=0; l<data_c_p_d_d.dimension(3); l++)
1663 data_c_p_d_d(i, j, k, l) = Teuchos::ScalarTraits<double>::random();
1667 for (
int ic=0; ic < c; ic++) {
1668 for (
int ip=0; ip < p; ip++) {
1669 for (
int i=0; i<d1; i++) {
1670 for (
int j=0; j<d1; j++) {
1671 data_c_p_d_d(ic, ip, i, j) = Teuchos::ScalarTraits<double>::random();
1679 for (
int ic=0; ic < c; ic++) {
1680 for (
int ip=0; ip < 1; ip++) {
1681 for (
int i=0; i<d1; i++) {
1682 for (
int j=0; j<d1; j++) {
1683 data_c_1_d_d(ic, 0, i, j) = Teuchos::ScalarTraits<double>::random();
1692 art::matvecProductDataField<double>(out_c_f_p_d, data_c_p_d_d, in_c_f_p_d);
1693 art::matvecProductDataField<double>(outi_c_f_p_d, datainv_c_p_d_d, out_c_f_p_d);
1694 rst::subtract(outi_c_f_p_d, in_c_f_p_d);
1695 if (rst::vectorNorm(outi_c_f_p_d, NORM_ONE) > zero) {
1696 *outStream <<
"\n\nINCORRECT matvecProductDataField (7): check matrix inverse property\n\n";
1699 art::matvecProductDataField<double>(out_c_f_p_d, data_c_p_d_d, in_c_f_p_d,
't');
1700 art::matvecProductDataField<double>(outi_c_f_p_d, datainv_c_p_d_d, out_c_f_p_d,
't');
1701 rst::subtract(outi_c_f_p_d, in_c_f_p_d);
1702 if (rst::vectorNorm(outi_c_f_p_d,NORM_ONE) > zero) {
1703 *outStream <<
"\n\nINCORRECT matvecProductDataField (8): check matrix inverse property, w/ double transpose\n\n";
1707 art::matvecProductDataField<double>(out_c_f_p_d, data_c_1_d_d, in_c_f_p_d);
1708 art::matvecProductDataField<double>(outi_c_f_p_d, datainv_c_1_d_d, out_c_f_p_d);
1709 rst::subtract(outi_c_f_p_d, in_c_f_p_d);
1710 if (rst::vectorNorm(outi_c_f_p_d, NORM_ONE) > zero) {
1711 *outStream <<
"\n\nINCORRECT matvecProductDataField (9): check matrix inverse property\n\n";
1714 art::matvecProductDataField<double>(out_c_f_p_d, data_c_1_d_d, in_c_f_p_d,
't');
1715 art::matvecProductDataField<double>(outi_c_f_p_d, datainv_c_1_d_d, out_c_f_p_d,
't');
1716 rst::subtract(outi_c_f_p_d,in_c_f_p_d);
1717 if (rst::vectorNorm(outi_c_f_p_d, NORM_ONE) > zero) {
1718 *outStream <<
"\n\nINCORRECT matvecProductDataField (10): check matrix inverse property, w/ double transpose\n\n";
1725 for (
unsigned int i=0; i<in_c_f_p_d.dimension(0); i++)
1726 for (
unsigned int j=0; j<in_c_f_p_d.dimension(1); j++)
1727 for (
unsigned int k=0; k<in_c_f_p_d.dimension(2); k++)
1728 for (
unsigned int l=0; l<in_c_f_p_d.dimension(3); l++)
1729 in_c_f_p_d(i,j,k,l) = Teuchos::ScalarTraits<double>::random();
1732 for (
int ic=0; ic < c; ic++) {
1733 for (
int ip=0; ip < p; ip++) {
1734 for (
int i=0; i<d1; i++) {
1735 for (
int j=0; j<d1; j++) {
1736 data_c_p_d_d(ic, ip, i, j) = Teuchos::ScalarTraits<double>::random();
1744 for (
int ic=0; ic < c; ic++) {
1745 for (
int ip=0; ip < 1; ip++) {
1746 for (
int i=0; i<d1; i++) {
1747 for (
int j=0; j<d1; j++) {
1748 data_c_1_d_d(ic, 0, i, j) = Teuchos::ScalarTraits<double>::random();
1757 art::matvecProductDataField<double>(out_c_f_p_d, data_c_p_d_d, in_c_f_p_d);
1758 art::matvecProductDataField<double>(outi_c_f_p_d, datainvtrn_c_p_d_d, out_c_f_p_d,
't');
1759 rst::subtract(outi_c_f_p_d, in_c_f_p_d);
1760 if (rst::vectorNorm(outi_c_f_p_d, NORM_ONE) > zero) {
1761 *outStream <<
"\n\nINCORRECT matvecProductDataField (11): check matrix inverse transpose property\n\n";
1765 art::matvecProductDataField<double>(out_c_f_p_d, data_c_1_d_d, in_c_f_p_d);
1766 art::matvecProductDataField<double>(outi_c_f_p_d, datainvtrn_c_1_d_d, out_c_f_p_d,
't');
1767 rst::subtract(outi_c_f_p_d, in_c_f_p_d);
1768 if (rst::vectorNorm(outi_c_f_p_d, NORM_ONE) > zero) {
1769 *outStream <<
"\n\nINCORRECT matvecProductDataField (12): check matrix inverse transpose property\n\n";
1777 <<
"===============================================================================\n"\
1778 <<
"| TEST 5.d: matvecProductDataField random tests: branch inputFields(F,P,D) |\n"\
1779 <<
"===============================================================================\n";
1784 int c=5, p=9, f=7, d1=3;
1785 double zero = INTREPID_TOL*10000.0;
1787 Kokkos::View<double***> in_f_p_d(
"in_f_p_d",f, p, d1);
1788 Kokkos::View<double****> in_c_f_p_d(
"in_c_f_p_d",c, f, p, d1);
1789 Kokkos::View<double**> data_c_p(
"data_c_p",c, p);
1790 Kokkos::View<double**> datainv_c_p(
"datainv_c_p",c, p);
1791 Kokkos::View<double**> data_c_1(
"data_c_1",c, 1);
1792 Kokkos::View<double**> datainv_c_1(
"datainv_c_1",c, 1);
1793 Kokkos::View<double***> data_c_p_d(
"data_c_p_d",c, p, d1);
1794 Kokkos::View<double***> datainv_c_p_d(
"datainv_c_p_d",c, p, d1);
1795 Kokkos::View<double***> data_c_1_d(
"data_c_1_d",c, 1, d1);
1796 Kokkos::View<double***> datainv_c_1_d(
"datainv_c_1_d",c, 1, d1);
1797 Kokkos::View<double****> data_c_p_d_d(
"data_c_p_d_d",c, p, d1, d1);
1798 Kokkos::View<double****> datainv_c_p_d_d(
"datainv_c_p_d_d",c, p, d1, d1);
1799 Kokkos::View<double****> datainvtrn_c_p_d_d(
"datainvtrn_c_p_d_d",c, p, d1, d1);
1800 Kokkos::View<double****> data_c_1_d_d(
"data_c_1_d_d",c, 1, d1, d1);
1801 Kokkos::View<double****> datainv_c_1_d_d(
"datainv_c_1_d_d",c, 1, d1, d1);
1802 Kokkos::View<double****> datainvtrn_c_1_d_d(
"datainvtrn_c_1_d_d",c, 1, d1, d1);
1803 Kokkos::View<double**> data_c_p_one(
"data_c_p_one",c, p);
1804 Kokkos::View<double**> data_c_1_one(
"data_c_1_one",c, 1);
1805 Kokkos::View<double****> out_c_f_p_d(
"out_c_f_p_d",c, f, p, d1);
1806 Kokkos::View<double****> outi_c_f_p_d(
"outi_c_f_p_d",c, f, p, d1);
1811 for (
unsigned int i=0; i<in_f_p_d.dimension(0); i++)
1812 for (
unsigned int j=0; j<in_f_p_d.dimension(1); j++)
1813 for (
unsigned int k=0; k<in_f_p_d.dimension(2); k++)
1814 in_f_p_d(i,j,k) = Teuchos::ScalarTraits<double>::random();
1816 for (
unsigned int i=0; i<data_c_p.dimension(0); i++)
1817 for (
unsigned int j=0; j<data_c_p.dimension(1); j++){
1818 data_c_p(i,j) = Teuchos::ScalarTraits<double>::random();
1819 datainv_c_p(i,j) = 1.0 / data_c_p(i,j);
1820 data_c_p_one(i,j) = 1.0;
1823 for (
unsigned int i=0; i<data_c_1.dimension(0); i++)
1824 for (
unsigned int j=0; j<data_c_1.dimension(1); j++){
1825 data_c_1(i,j) = Teuchos::ScalarTraits<double>::random();
1826 datainv_c_1(i,j) = 1.0 / data_c_1(i,j);
1831 art::matvecProductDataField<double>(in_c_f_p_d, data_c_p_one, in_f_p_d);
1832 art::matvecProductDataField<double>(out_c_f_p_d, data_c_p, in_f_p_d);
1833 art::matvecProductDataField<double>(outi_c_f_p_d, datainv_c_p, out_c_f_p_d);
1834 rst::subtract(outi_c_f_p_d, in_c_f_p_d);
1835 if (rst::vectorNorm(outi_c_f_p_d, NORM_ONE) > zero) {
1836 *outStream <<
"\n\nINCORRECT matvecProductDataField (13): check scalar inverse property\n\n";
1840 art::matvecProductDataField<double>(in_c_f_p_d, data_c_p_one, in_f_p_d);
1841 art::matvecProductDataField<double>(out_c_f_p_d, data_c_1, in_f_p_d);
1842 art::matvecProductDataField<double>(outi_c_f_p_d, datainv_c_1, out_c_f_p_d);
1843 rst::subtract(outi_c_f_p_d, in_c_f_p_d);
1844 if (rst::vectorNorm(outi_c_f_p_d, NORM_ONE) > zero) {
1845 *outStream <<
"\n\nINCORRECT matvecProductDataField (14): check scalar inverse property\n\n";
1851 for (
unsigned int i=0; i<in_f_p_d.dimension(0); i++)
1852 for (
unsigned int j=0; j<in_f_p_d.dimension(1); j++)
1853 for (
unsigned int k=0; k<in_f_p_d.dimension(2); k++){
1854 in_f_p_d(i,j,k) = Teuchos::ScalarTraits<double>::random();
1857 for (
unsigned int i=0; i<data_c_p_d.dimension(0); i++)
1858 for (
unsigned int j=0; j<data_c_p_d.dimension(1); j++)
1859 for (
unsigned int k=0; k<data_c_p_d.dimension(2); k++){
1860 data_c_p_d(i,j,k) = Teuchos::ScalarTraits<double>::random();
1861 datainv_c_p_d(i,j,k) = 1.0 / data_c_p_d(i,j,k);
1864 for (
unsigned int i=0; i<data_c_1_d.dimension(0); i++)
1865 for (
unsigned int j=0; j<data_c_1_d.dimension(1); j++)
1866 for (
unsigned int k=0; k<data_c_1_d.dimension(2); k++){
1867 data_c_1_d(i,j,k) = Teuchos::ScalarTraits<double>::random();
1868 datainv_c_1_d(i,j,k) = 1.0 / data_c_1_d(i,j,k);
1872 art::matvecProductDataField<double>(in_c_f_p_d, data_c_p_one, in_f_p_d);
1873 art::matvecProductDataField<double>(out_c_f_p_d, data_c_p_d, in_f_p_d);
1874 art::matvecProductDataField<double>(outi_c_f_p_d, datainv_c_p_d, out_c_f_p_d);
1875 rst::subtract(outi_c_f_p_d, in_c_f_p_d);
1876 if (rst::vectorNorm(outi_c_f_p_d, NORM_ONE) > zero) {
1877 *outStream <<
"\n\nINCORRECT matvecProductDataField (15): check scalar inverse property\n\n";
1881 art::matvecProductDataField<double>(in_c_f_p_d, data_c_p_one, in_f_p_d);
1882 art::matvecProductDataField<double>(out_c_f_p_d, data_c_1_d, in_f_p_d);
1883 art::matvecProductDataField<double>(outi_c_f_p_d, datainv_c_1_d, out_c_f_p_d);
1884 rst::subtract(outi_c_f_p_d, in_c_f_p_d);
1885 if (rst::vectorNorm(outi_c_f_p_d, NORM_ONE) > zero) {
1886 *outStream <<
"\n\nINCORRECT matvecProductDataField (16): check scalar inverse property\n\n";
1892 for (
unsigned int i=0; i<in_f_p_d.dimension(0); i++)
1893 for (
unsigned int j=0; j<in_f_p_d.dimension(1); j++)
1894 for (
unsigned int k=0; k<in_f_p_d.dimension(2); k++){
1895 in_f_p_d(i,j,k) = Teuchos::ScalarTraits<double>::random();
1898 for (
int ic=0; ic < c; ic++) {
1899 for (
int ip=0; ip < p; ip++) {
1900 for (
int i=0; i<d1; i++) {
1901 for (
int j=0; j<d1; j++) {
1902 data_c_p_d_d(ic, ip, i, j) = Teuchos::ScalarTraits<double>::random();
1908 for (
int ic=0; ic < c; ic++) {
1909 for (
int ip=0; ip < 1; ip++) {
1910 for (
int i=0; i<d1; i++) {
1911 for (
int j=0; j<d1; j++) {
1912 data_c_1_d_d(ic, 0, i, j) = Teuchos::ScalarTraits<double>::random();
1919 art::matvecProductDataField<double>(in_c_f_p_d, data_c_p_one, in_f_p_d);
1920 art::matvecProductDataField<double>(out_c_f_p_d, data_c_p_d_d, in_f_p_d);
1921 art::matvecProductDataField<double>(outi_c_f_p_d, datainv_c_p_d_d, out_c_f_p_d);
1922 rst::subtract(outi_c_f_p_d, in_c_f_p_d);
1923 if (rst::vectorNorm(outi_c_f_p_d, NORM_ONE) > zero) {
1924 *outStream <<
"\n\nINCORRECT matvecProductDataField (17): check matrix inverse property\n\n";
1927 art::matvecProductDataField<double>(in_c_f_p_d, data_c_p_one, in_f_p_d);
1928 art::matvecProductDataField<double>(out_c_f_p_d, data_c_p_d_d, in_f_p_d,
't');
1929 art::matvecProductDataField<double>(outi_c_f_p_d, datainv_c_p_d_d, out_c_f_p_d,
't');
1930 rst::subtract(outi_c_f_p_d, in_c_f_p_d);
1931 if (rst::vectorNorm(outi_c_f_p_d, NORM_ONE) > zero) {
1932 *outStream <<
"\n\nINCORRECT matvecProductDataField (18): check matrix inverse property, w/ double transpose\n\n";
1936 art::matvecProductDataField<double>(in_c_f_p_d, data_c_p_one, in_f_p_d);
1937 art::matvecProductDataField<double>(out_c_f_p_d, data_c_1_d_d, in_f_p_d);
1938 art::matvecProductDataField<double>(outi_c_f_p_d, datainv_c_1_d_d, out_c_f_p_d);
1939 rst::subtract(outi_c_f_p_d, in_c_f_p_d);
1940 if (rst::vectorNorm(outi_c_f_p_d, NORM_ONE) > zero) {
1941 *outStream <<
"\n\nINCORRECT matvecProductDataField (19): check matrix inverse property\n\n";
1944 art::matvecProductDataField<double>(in_c_f_p_d, data_c_p_one, in_f_p_d);
1945 art::matvecProductDataField<double>(out_c_f_p_d, data_c_1_d_d, in_f_p_d,
't');
1946 art::matvecProductDataField<double>(outi_c_f_p_d, datainv_c_1_d_d, out_c_f_p_d,
't');
1947 rst::subtract(outi_c_f_p_d, in_c_f_p_d);
1948 if (rst::vectorNorm(outi_c_f_p_d, NORM_ONE) > zero) {
1949 *outStream <<
"\n\nINCORRECT matvecProductDataField (20): check matrix inverse property, w/ double transpose\n\n";
1955 for (
unsigned int i=0; i<in_f_p_d.dimension(0); i++)
1956 for (
unsigned int j=0; j<in_f_p_d.dimension(1); j++)
1957 for (
unsigned int k=0; k<in_f_p_d.dimension(2); k++){
1958 in_f_p_d(i,j,k) = Teuchos::ScalarTraits<double>::random();
1961 for (
int ic=0; ic < c; ic++) {
1962 for (
int ip=0; ip < p; ip++) {
1963 for (
int i=0; i<d1; i++) {
1964 for (
int j=0; j<d1; j++) {
1965 data_c_p_d_d(ic, ip, i, j) = Teuchos::ScalarTraits<double>::random();
1972 for (
int ic=0; ic < c; ic++) {
1973 for (
int ip=0; ip < 1; ip++) {
1974 for (
int i=0; i<d1; i++) {
1975 for (
int j=0; j<d1; j++) {
1976 data_c_1_d_d(ic, 0, i, j) = Teuchos::ScalarTraits<double>::random();
1985 art::matvecProductDataField<double>(in_c_f_p_d, data_c_p_one, in_f_p_d);
1986 art::matvecProductDataField<double>(out_c_f_p_d, data_c_p_d_d, in_f_p_d);
1987 art::matvecProductDataField<double>(outi_c_f_p_d, datainvtrn_c_p_d_d, out_c_f_p_d,
't');
1988 rst::subtract(outi_c_f_p_d, in_c_f_p_d);
1989 if (rst::vectorNorm(outi_c_f_p_d, NORM_ONE) > zero) {
1990 *outStream <<
"\n\nINCORRECT matvecProductDataField (21): check matrix inverse transpose property\n\n";
1994 art::matvecProductDataField<double>(in_c_f_p_d, data_c_p_one, in_f_p_d);
1995 art::matvecProductDataField<double>(out_c_f_p_d, data_c_1_d_d, in_f_p_d);
1996 art::matvecProductDataField<double>(outi_c_f_p_d, datainvtrn_c_1_d_d, out_c_f_p_d,
't');
1997 rst::subtract(outi_c_f_p_d, in_c_f_p_d);
1998 if (rst::vectorNorm(outi_c_f_p_d, NORM_ONE) > zero) {
1999 *outStream <<
"\n\nINCORRECT matvecProductDataField (22): check matrix inverse transpose property\n\n";
2008 <<
"===============================================================================\n"\
2009 <<
"| TEST 6.a: matvecProductDataData operations: (C,P,D,D) and (C,P,D) |\n"\
2010 <<
"===============================================================================\n";
2020 Kokkos::realloc(inputMat,4,1,3,3);
2022 inputMat(0,0,0,0) = 1.0; inputMat(0,0,0,1) = 1.0; inputMat(0,0,0,2) = 1.0;
2023 inputMat(0,0,1,0) =-1.0; inputMat(0,0,1,1) = 2.0; inputMat(0,0,1,2) =-1.0;
2024 inputMat(0,0,2,0) = 1.0; inputMat(0,0,2,1) = 2.0; inputMat(0,0,2,2) = 3.0;
2026 inputMat(1,0,0,0) = 0.0; inputMat(1,0,0,1) = 0.0; inputMat(1,0,0,2) = 0.0;
2027 inputMat(1,0,1,0) =-1.0; inputMat(1,0,1,1) =-2.0; inputMat(1,0,1,2) =-3.0;
2028 inputMat(1,0,2,0) =-2.0; inputMat(1,0,2,1) = 6.0; inputMat(1,0,2,2) =-4.0;
2030 inputMat(2,0,0,0) = 1.0; inputMat(2,0,0,1) = 1.0; inputMat(2,0,0,2) = 1.0;
2031 inputMat(2,0,1,0) =-1.0; inputMat(2,0,1,1) = 2.0; inputMat(2,0,1,2) =-1.0;
2032 inputMat(2,0,2,0) = 1.0; inputMat(2,0,2,1) = 2.0; inputMat(2,0,2,2) = 3.0;
2034 inputMat(3,0,0,0) = 0.0; inputMat(3,0,0,1) = 0.0; inputMat(3,0,0,2) = 0.0;
2035 inputMat(3,0,1,0) =-1.0; inputMat(3,0,1,1) =-2.0; inputMat(3,0,1,2) =-3.0;
2036 inputMat(3,0,2,0) =-2.0; inputMat(3,0,2,1) = 6.0; inputMat(3,0,2,2) =-4.0;
2039 Kokkos::realloc(inputVecFields3,4,1,3);
2040 inputVecFields3(0,0,0) = 0.0; inputVecFields3(0,0,1) = 0.0; inputVecFields3(0,0,2) = 0.0;
2041 inputVecFields3(1,0,0) = 1.0; inputVecFields3(1,0,1) = 1.0; inputVecFields3(1,0,2) = 1.0;
2042 inputVecFields3(2,0,0) =-1.0; inputVecFields3(2,0,1) =-1.0; inputVecFields3(2,0,2) =-1.0;
2043 inputVecFields3(3,0,0) =-1.0; inputVecFields3(3,0,1) = 1.0; inputVecFields3(3,0,2) =-1.0;
2046 Kokkos::View<double***>outFieldsCorrect3(
"outFieldsCorrect3",4,1,3);
2047 outFieldsCorrect3(0,0,0) = 0.0; outFieldsCorrect3(0,0,1) = 0.0; outFieldsCorrect3(0,0,2) = 0.0;
2048 outFieldsCorrect3(1,0,0) = 0.0; outFieldsCorrect3(1,0,1) =-6.0; outFieldsCorrect3(1,0,2) = 0.0;
2049 outFieldsCorrect3(2,0,0) =-3.0; outFieldsCorrect3(2,0,1) = 0.0; outFieldsCorrect3(2,0,2) =-6.0;
2050 outFieldsCorrect3(3,0,0) = 0.0; outFieldsCorrect3(3,0,1) = 2.0; outFieldsCorrect3(3,0,2) = 12.0;
2053 Kokkos::realloc(outFields3,4,1,3);
2054 art::matvecProductDataData<double>(outFields3, inputMat, inputVecFields3);
2056 for(
unsigned int cell = 0; cell < outFields3.dimension(0); cell++){
2057 for(
unsigned int point = 0; point < outFields3.dimension(1); point++){
2058 for(
unsigned int row = 0; row < outFields3.dimension(2); row++){
2059 if(outFields3(cell, point, row) != outFieldsCorrect3(cell, point, row)) {
2060 *outStream <<
"\n\nINCORRECT matvecProductDataData (1): \n value at multi-index ("
2061 << cell <<
"," << point <<
"," << row <<
") = "
2062 << outFields3(cell, point, row) <<
" but correct value is "
2063 << outFieldsCorrect3(cell, point, row) <<
"\n";
2073 <<
"===============================================================================\n"\
2074 <<
"| TEST 6.b: matvecProductDataData operations: (C,P,D,D) and (P,D) |\n"\
2075 <<
"===============================================================================\n";
2083 Kokkos::realloc(inputMat,1,4,3,3);
2085 inputMat(0,0,0,0) = 1.0; inputMat(0,0,0,1) = 1.0; inputMat(0,0,0,2) = 1.0;
2086 inputMat(0,0,1,0) =-1.0; inputMat(0,0,1,1) = 2.0; inputMat(0,0,1,2) =-1.0;
2087 inputMat(0,0,2,0) = 1.0; inputMat(0,0,2,1) = 2.0; inputMat(0,0,2,2) = 3.0;
2089 inputMat(0,1,0,0) = 0.0; inputMat(0,1,0,1) = 0.0; inputMat(0,1,0,2) = 0.0;
2090 inputMat(0,1,1,0) =-1.0; inputMat(0,1,1,1) =-2.0; inputMat(0,1,1,2) =-3.0;
2091 inputMat(0,1,2,0) =-2.0; inputMat(0,1,2,1) = 6.0; inputMat(0,1,2,2) =-4.0;
2093 inputMat(0,2,0,0) = 1.0; inputMat(0,2,0,1) = 1.0; inputMat(0,2,0,2) = 1.0;
2094 inputMat(0,2,1,0) =-1.0; inputMat(0,2,1,1) = 2.0; inputMat(0,2,1,2) =-1.0;
2095 inputMat(0,2,2,0) = 1.0; inputMat(0,2,2,1) = 2.0; inputMat(0,2,2,2) = 3.0;
2097 inputMat(0,3,0,0) = 0.0; inputMat(0,3,0,1) = 0.0; inputMat(0,3,0,2) = 0.0;
2098 inputMat(0,3,1,0) =-1.0; inputMat(0,3,1,1) =-2.0; inputMat(0,3,1,2) =-3.0;
2099 inputMat(0,3,2,0) =-2.0; inputMat(0,3,2,1) = 6.0; inputMat(0,3,2,2) =-4.0;
2102 Kokkos::View<double**>inputVecFields2(
"inputVecFields2",4,3);
2104 inputVecFields2(0,0) = 0.0; inputVecFields2(0,1) = 0.0; inputVecFields2(0,2) = 0.0;
2105 inputVecFields2(1,0) = 1.0; inputVecFields2(1,1) = 1.0; inputVecFields2(1,2) = 1.0;
2106 inputVecFields2(2,0) =-1.0; inputVecFields2(2,1) =-1.0; inputVecFields2(2,2) =-1.0;
2107 inputVecFields2(3,0) =-1.0; inputVecFields2(3,1) = 1.0; inputVecFields2(3,2) =-1.0;
2110 Kokkos::realloc(outFieldsCorrect3,1,4,3);
2111 outFieldsCorrect3(0,0,0) = 0.0; outFieldsCorrect3(0,0,1) = 0.0; outFieldsCorrect3(0,0,2) = 0.0;
2112 outFieldsCorrect3(0,1,0) = 0.0; outFieldsCorrect3(0,1,1) =-6.0; outFieldsCorrect3(0,1,2) = 0.0;
2113 outFieldsCorrect3(0,2,0) =-3.0; outFieldsCorrect3(0,2,1) = 0.0; outFieldsCorrect3(0,2,2) =-6.0;
2114 outFieldsCorrect3(0,3,0) = 0.0; outFieldsCorrect3(0,3,1) = 2.0; outFieldsCorrect3(0,3,2) = 12.0;
2117 Kokkos::realloc(outFields3,1,4,3);
2118 art::matvecProductDataData<double>(outFields3, inputMat, inputVecFields2);
2120 for(
unsigned int cell = 0; cell < outFields3.dimension(0); cell++){
2121 for(
unsigned int point = 0; point < outFields3.dimension(1); point++){
2122 for(
unsigned int row = 0; row < outFields3.dimension(2); row++){
2123 if(outFields3(cell, point, row) != outFieldsCorrect3(cell, point, row)) {
2124 *outStream <<
"\n\nINCORRECT matvecProductDataData (2): \n value at multi-index ("
2125 << cell <<
"," << point <<
"," << row <<
") = "
2126 << outFields3(cell, point, row) <<
" but correct value is "
2127 << outFieldsCorrect3(cell, point, row) <<
"\n";
2137 <<
"===============================================================================\n"\
2138 <<
"| TEST 6.c: matvecProductDataData random tests: branch inputDataRight(C,P,D) |\n"\
2139 <<
"===============================================================================\n";
2145 double zero = INTREPID_TOL*10000.0;
2147 Kokkos::View<double***> in_c_p_d(
"in_c_p_d",c, p, d1);
2148 Kokkos::View<double***> out_c_p_d(
"out_c_p_d",c, p, d1);
2149 Kokkos::View<double***> outi_c_p_d(
"outi_c_p_d",c, p, d1);
2151 Kokkos::View<double**> data_c_p(
"data_c_p",c, p);
2152 Kokkos::View<double**> datainv_c_p(
"datainv_c_p",c, p);
2153 Kokkos::View<double**> data_c_1(
"data_c_1",c, 1);
2154 Kokkos::View<double**> datainv_c_1(
"datainv_c_1",c, 1);
2155 Kokkos::View<double***> data_c_p_d(
"data_c_p_d",c, p, d1);
2156 Kokkos::View<double***> datainv_c_p_d(
"datainv_c_p_d",c, p, d1);
2157 Kokkos::View<double***> data_c_1_d(
"data_c_1_d",c, 1, d1);
2158 Kokkos::View<double***> datainv_c_1_d(
"datainv_c_1_d",c, 1, d1);
2159 Kokkos::View<double****> data_c_p_d_d(
"data_c_p_d_d",c, p, d1, d1);
2160 Kokkos::View<double****> datainv_c_p_d_d(
"datainv_c_p_d_d",c, p, d1, d1);
2161 Kokkos::View<double****> datainvtrn_c_p_d_d(
"datainvtrn_c_p_d_d",c, p, d1, d1);
2162 Kokkos::View<double****> data_c_1_d_d(
"data_c_1_d_d",c, 1, d1, d1);
2163 Kokkos::View<double****> datainv_c_1_d_d(
"datainv_c_1_d_d",c, 1, d1, d1);
2164 Kokkos::View<double****> datainvtrn_c_1_d_d(
"datainvtrn_c_1_d_d",c, 1, d1, d1);
2168 for (
unsigned int i=0; i<in_c_p_d.dimension(0); i++)
2169 for (
unsigned int j=0; j<in_c_p_d.dimension(1); j++)
2170 for (
unsigned int k=0; k<in_c_p_d.dimension(2); k++){
2171 in_c_p_d(i,j,k) = Teuchos::ScalarTraits<double>::random();
2174 for (
unsigned int i=0; i<data_c_p.dimension(0); i++)
2175 for (
unsigned int j=0; j<data_c_p.dimension(1); j++){
2176 data_c_p(i,j) = Teuchos::ScalarTraits<double>::random();
2177 datainv_c_p(i,j) = 1.0 / data_c_p(i,j);
2180 for (
unsigned int i=0; i<data_c_1.dimension(0); i++)
2181 for (
unsigned int j=0; j<data_c_1.dimension(1); j++){
2182 data_c_1(i,j) = Teuchos::ScalarTraits<double>::random();
2183 datainv_c_1(i,j) = 1.0 / data_c_1(i,j);
2186 art::matvecProductDataData<double>(out_c_p_d, data_c_p, in_c_p_d);
2187 art::matvecProductDataData<double>(out_c_p_d, datainv_c_p, out_c_p_d);
2188 rst::subtract(out_c_p_d, in_c_p_d);
2189 if (rst::vectorNorm(out_c_p_d, NORM_ONE) > zero) {
2190 *outStream <<
"\n\nINCORRECT matvecProductDataData (3): check scalar inverse property\n\n";
2194 art::matvecProductDataData<double>(out_c_p_d, data_c_1, in_c_p_d);
2195 art::matvecProductDataData<double>(out_c_p_d, datainv_c_1, out_c_p_d);
2196 rst::subtract(out_c_p_d, in_c_p_d);
2197 if (rst::vectorNorm(out_c_p_d, NORM_ONE) > zero) {
2198 *outStream <<
"\n\nINCORRECT matvecProductDataData (4): check scalar inverse property\n\n";
2204 for (
unsigned int i=0; i<in_c_p_d.dimension(0); i++)
2205 for (
unsigned int j=0; j<in_c_p_d.dimension(1); j++)
2206 for (
unsigned int k=0; k<in_c_p_d.dimension(2); k++){
2207 in_c_p_d(i,j,k) = Teuchos::ScalarTraits<double>::random();
2210 for (
unsigned int i=0; i<data_c_p_d.dimension(0); i++)
2211 for (
unsigned int j=0; j<data_c_p_d.dimension(1); j++)
2212 for (
unsigned int k=0; k<data_c_p_d.dimension(2); k++){
2213 data_c_p_d(i,j,k) = Teuchos::ScalarTraits<double>::random();
2214 datainv_c_p_d(i,j,k) = 1.0 / data_c_p_d(i,j,k);
2217 for (
unsigned int i=0; i<data_c_1_d.dimension(0); i++)
2218 for (
unsigned int j=0; j<data_c_1_d.dimension(1); j++)
2219 for (
unsigned int k=0; k<data_c_1_d.dimension(2); k++){
2220 data_c_1_d(i,j,k) = Teuchos::ScalarTraits<double>::random();
2221 datainv_c_1_d(i,j,k) = 1.0 / data_c_1_d(i,j,k);
2224 art::matvecProductDataData<double>(out_c_p_d, data_c_p_d, in_c_p_d);
2225 art::matvecProductDataData<double>(out_c_p_d, datainv_c_p_d, out_c_p_d);
2226 rst::subtract(out_c_p_d, in_c_p_d);
2227 if (rst::vectorNorm(out_c_p_d, NORM_ONE) > zero) {
2228 *outStream <<
"\n\nINCORRECT matvecProductDataData (5): check scalar inverse property\n\n";
2232 art::matvecProductDataData<double>(out_c_p_d, data_c_1_d, in_c_p_d);
2233 art::matvecProductDataData<double>(out_c_p_d, datainv_c_1_d, out_c_p_d);
2234 rst::subtract(out_c_p_d, in_c_p_d);
2235 if (rst::vectorNorm(out_c_p_d, NORM_ONE) > zero) {
2236 *outStream <<
"\n\nINCORRECT matvecProductDataData (6): check scalar inverse property\n\n";
2242 for (
unsigned int i=0; i<in_c_p_d.dimension(0); i++)
2243 for (
unsigned int j=0; j<in_c_p_d.dimension(1); j++)
2244 for (
unsigned int k=0; k<in_c_p_d.dimension(2); k++){
2245 in_c_p_d(i,j,k) = Teuchos::ScalarTraits<double>::random();
2247 for (
int ic=0; ic < c; ic++) {
2248 for (
int ip=0; ip < p; ip++) {
2249 for (
int i=0; i<d1; i++) {
2250 for (
int j=0; j<d1; j++) {
2251 data_c_p_d_d(ic, ip, i, j) = Teuchos::ScalarTraits<double>::random();
2259 for (
int ic=0; ic < c; ic++) {
2260 for (
int ip=0; ip < 1; ip++) {
2261 for (
int i=0; i<d1; i++) {
2262 for (
int j=0; j<d1; j++) {
2263 data_c_1_d_d(ic, 0, i, j) = Teuchos::ScalarTraits<double>::random();
2271 art::matvecProductDataData<double>(out_c_p_d, data_c_p_d_d, in_c_p_d);
2272 art::matvecProductDataData<double>(outi_c_p_d, datainv_c_p_d_d, out_c_p_d);
2273 rst::subtract(outi_c_p_d, in_c_p_d);
2274 if (rst::vectorNorm(outi_c_p_d, NORM_ONE) > zero) {
2275 *outStream <<
"\n\nINCORRECT matvecProductDataData (7): check matrix inverse property\n\n";
2278 art::matvecProductDataData<double>(out_c_p_d, data_c_p_d_d, in_c_p_d,
't');
2279 art::matvecProductDataData<double>(outi_c_p_d, datainv_c_p_d_d, out_c_p_d,
't');
2280 rst::subtract(outi_c_p_d, in_c_p_d);
2281 if (rst::vectorNorm(outi_c_p_d, NORM_ONE) > zero) {
2282 *outStream <<
"\n\nINCORRECT matvecProductDataData (8): check matrix inverse property, w/ double transpose\n\n";
2286 art::matvecProductDataData<double>(out_c_p_d, data_c_1_d_d, in_c_p_d);
2287 art::matvecProductDataData<double>(outi_c_p_d, datainv_c_1_d_d, out_c_p_d);
2288 rst::subtract(outi_c_p_d, in_c_p_d);
2289 if (rst::vectorNorm(outi_c_p_d, NORM_ONE) > zero) {
2290 *outStream <<
"\n\nINCORRECT matvecProductDataData (9): check matrix inverse property\n\n";
2293 art::matvecProductDataData<double>(out_c_p_d, data_c_1_d_d, in_c_p_d,
't');
2294 art::matvecProductDataData<double>(outi_c_p_d, datainv_c_1_d_d, out_c_p_d,
't');
2295 rst::subtract(outi_c_p_d, in_c_p_d);
2296 if (rst::vectorNorm(outi_c_p_d, NORM_ONE) > zero) {
2297 *outStream <<
"\n\nINCORRECT matvecProductDataData (10): check matrix inverse property, w/ double transpose\n\n";
2304 for (
unsigned int i=0; i<in_c_p_d.dimension(0); i++)
2305 for (
unsigned int j=0; j<in_c_p_d.dimension(1); j++)
2306 for (
unsigned int k=0; k<in_c_p_d.dimension(2); k++){
2307 in_c_p_d(i,j,k) = Teuchos::ScalarTraits<double>::random();
2310 for (
int ic=0; ic < c; ic++) {
2311 for (
int ip=0; ip < p; ip++) {
2312 for (
int i=0; i<d1; i++) {
2313 for (
int j=0; j<d1; j++) {
2314 data_c_p_d_d(ic, ip, i, j) = Teuchos::ScalarTraits<double>::random();
2322 for (
int ic=0; ic < c; ic++) {
2323 for (
int ip=0; ip < 1; ip++) {
2324 for (
int i=0; i<d1; i++) {
2325 for (
int j=0; j<d1; j++) {
2326 data_c_1_d_d(ic, 0, i, j) = Teuchos::ScalarTraits<double>::random();
2334 art::matvecProductDataData<double>(out_c_p_d, data_c_p_d_d, in_c_p_d);
2335 art::matvecProductDataData<double>(outi_c_p_d, datainvtrn_c_p_d_d, out_c_p_d,
't');
2336 rst::subtract(outi_c_p_d, in_c_p_d);
2337 if (rst::vectorNorm(outi_c_p_d, NORM_ONE) > zero) {
2338 *outStream <<
"\n\nINCORRECT matvecProductDataData (11): check matrix inverse transpose property\n\n";
2342 art::matvecProductDataData<double>(out_c_p_d, data_c_1_d_d, in_c_p_d);
2343 art::matvecProductDataData<double>(outi_c_p_d, datainvtrn_c_1_d_d, out_c_p_d,
't');
2344 rst::subtract(outi_c_p_d, in_c_p_d);
2345 if (rst::vectorNorm(outi_c_p_d, NORM_ONE) > zero) {
2346 *outStream <<
"\n\nINCORRECT matvecProductDataData (12): check matrix inverse transpose property\n\n";
2354 <<
"===============================================================================\n"\
2355 <<
"| TEST 6.d: matvecProductDataData random tests: branch inputDataRight(P,D) |\n"\
2356 <<
"===============================================================================\n";
2362 double zero = INTREPID_TOL*10000.0;
2364 Kokkos::View<double**> in_p_d(
"in_p_d",p, d1);
2365 Kokkos::View<double***> in_c_p_d(
"in_c_p_d",c, p, d1);
2366 Kokkos::View<double**> data_c_p(
"data_c_p",c, p);
2367 Kokkos::View<double**> datainv_c_p(
"datainv_c_p",c, p);
2368 Kokkos::View<double**> data_c_1(
"data_c_1",c, 1);
2369 Kokkos::View<double**> datainv_c_1(
"datainv_c_1",c, 1);
2370 Kokkos::View<double***> data_c_p_d(
"data_c_p_d",c, p, d1);
2371 Kokkos::View<double***> datainv_c_p_d(
"datainv_c_p_d",c, p, d1);
2372 Kokkos::View<double***> data_c_1_d(
"data_c_1_d",c, 1, d1);
2373 Kokkos::View<double***> datainv_c_1_d(
"datainv_c_1_d",c, 1, d1);
2374 Kokkos::View<double****> data_c_p_d_d(
"data_c_p_d_d",c, p, d1, d1);
2375 Kokkos::View<double****> datainv_c_p_d_d(
"datainv_c_p_d_d",c, p, d1, d1);
2376 Kokkos::View<double****> datainvtrn_c_p_d_d(
"datainvtrn_c_p_d_d",c, p, d1, d1);
2377 Kokkos::View<double****> data_c_1_d_d(
"data_c_1_d_d",c, 1, d1, d1);
2378 Kokkos::View<double****> datainv_c_1_d_d(
"datainv_c_1_d_d",c, 1, d1, d1);
2379 Kokkos::View<double****> datainvtrn_c_1_d_d(
"datainvtrn_c_1_d_d",c, 1, d1, d1);
2380 Kokkos::View<double**> data_c_p_one(
"data_c_p_one",c, p);
2381 Kokkos::View<double**> data_c_1_one(
"data_c_1_one",c, 1);
2382 Kokkos::View<double***> out_c_p_d(
"out_c_p_d",c, p, d1);
2383 Kokkos::View<double***> outi_c_p_d(
"outi_c_p_d",c, p, d1);
2387 for (
unsigned int i=0; i<in_p_d.dimension(0); i++)
2388 for (
unsigned int j=0; j<in_p_d.dimension(1); j++){
2389 in_p_d(i,j) = Teuchos::ScalarTraits<double>::random();
2392 for (
unsigned int i=0; i<data_c_p.dimension(0); i++)
2393 for (
unsigned int j=0; j<data_c_p.dimension(1); j++){
2394 data_c_p(i,j) = Teuchos::ScalarTraits<double>::random();
2395 datainv_c_p(i,j) = 1.0 / data_c_p(i,j);
2396 data_c_p_one(i,j) = 1.0;
2399 for (
unsigned int i=0; i<data_c_1.dimension(0); i++)
2400 for (
unsigned int j=0; j<data_c_1.dimension(1); j++){
2401 data_c_1(i,j) = Teuchos::ScalarTraits<double>::random();
2402 datainv_c_1(i,j) = 1.0 / data_c_1(i,j);
2405 art::matvecProductDataData<double>(in_c_p_d, data_c_p_one, in_p_d);
2406 art::matvecProductDataData<double>(out_c_p_d, data_c_p, in_p_d);
2407 art::matvecProductDataData<double>(outi_c_p_d, datainv_c_p, out_c_p_d);
2408 rst::subtract(outi_c_p_d, in_c_p_d);
2409 if (rst::vectorNorm(outi_c_p_d, NORM_ONE) > zero) {
2410 *outStream <<
"\n\nINCORRECT matvecProductDataData (13): check scalar inverse property\n\n";
2414 art::matvecProductDataData<double>(in_c_p_d, data_c_p_one, in_p_d);
2415 art::matvecProductDataData<double>(out_c_p_d, data_c_1, in_p_d);
2416 art::matvecProductDataData<double>(outi_c_p_d, datainv_c_1, out_c_p_d);
2417 rst::subtract(outi_c_p_d, in_c_p_d);
2418 if (rst::vectorNorm(outi_c_p_d, NORM_ONE) > zero) {
2419 *outStream <<
"\n\nINCORRECT matvecProductDataData (14): check scalar inverse property\n\n";
2425 for (
unsigned int i=0; i<in_p_d.dimension(0); i++)
2426 for (
unsigned int j=0; j<in_p_d.dimension(1); j++){
2427 in_p_d(i,j) = Teuchos::ScalarTraits<double>::random();
2430 for (
unsigned int i=0; i<data_c_p_d.dimension(0); i++)
2431 for (
unsigned int j=0; j<data_c_p_d.dimension(1); j++)
2432 for (
unsigned int k=0; k<data_c_p_d.dimension(2); k++){
2433 data_c_p_d(i,j,k) = Teuchos::ScalarTraits<double>::random();
2434 datainv_c_p_d(i,j,k) = 1.0 / data_c_p_d(i,j,k);
2437 for (
unsigned int i=0; i<data_c_1_d.dimension(0); i++)
2438 for (
unsigned int j=0; j<data_c_1_d.dimension(1); j++)
2439 for (
unsigned int k=0; k<data_c_1_d.dimension(2); k++){
2440 data_c_1_d(i,j,k) = Teuchos::ScalarTraits<double>::random();
2441 datainv_c_1_d(i,j,k) = 1.0 / data_c_1_d(i,j,k);
2444 art::matvecProductDataData<double>(in_c_p_d, data_c_p_one, in_p_d);
2445 art::matvecProductDataData<double>(out_c_p_d, data_c_p_d, in_p_d);
2446 art::matvecProductDataData<double>(outi_c_p_d, datainv_c_p_d, out_c_p_d);
2447 rst::subtract(outi_c_p_d, in_c_p_d);
2448 if (rst::vectorNorm(outi_c_p_d, NORM_ONE) > zero) {
2449 *outStream <<
"\n\nINCORRECT matvecProductDataData (15): check scalar inverse property\n\n";
2453 art::matvecProductDataData<double>(in_c_p_d, data_c_p_one, in_p_d);
2454 art::matvecProductDataData<double>(out_c_p_d, data_c_1_d, in_p_d);
2455 art::matvecProductDataData<double>(outi_c_p_d, datainv_c_1_d, out_c_p_d);
2456 rst::subtract(outi_c_p_d, in_c_p_d);
2457 if (rst::vectorNorm(outi_c_p_d, NORM_ONE) > zero) {
2458 *outStream <<
"\n\nINCORRECT matvecProductDataData (16): check scalar inverse property\n\n";
2464 for (
unsigned int i=0; i<in_p_d.dimension(0); i++)
2465 for (
unsigned int j=0; j<in_p_d.dimension(1); j++){
2466 in_p_d(i,j) = Teuchos::ScalarTraits<double>::random();
2469 for (
int ic=0; ic < c; ic++) {
2470 for (
int ip=0; ip < p; ip++) {
2471 for (
int i=0; i<d1; i++) {
2472 for (
int j=0; j<d1; j++) {
2473 data_c_p_d_d(ic, ip, i, j) = Teuchos::ScalarTraits<double>::random();
2479 for (
int ic=0; ic < c; ic++) {
2480 for (
int ip=0; ip < 1; ip++) {
2481 for (
int i=0; i<d1; i++) {
2482 for (
int j=0; j<d1; j++) {
2483 data_c_1_d_d(ic, 0, i, j) = Teuchos::ScalarTraits<double>::random();
2491 art::matvecProductDataData<double>(in_c_p_d, data_c_p_one, in_p_d);
2492 art::matvecProductDataData<double>(out_c_p_d, data_c_p_d_d, in_p_d);
2493 art::matvecProductDataData<double>(outi_c_p_d, datainv_c_p_d_d, out_c_p_d);
2494 rst::subtract(outi_c_p_d, in_c_p_d);
2495 if (rst::vectorNorm(outi_c_p_d, NORM_ONE) > zero) {
2496 *outStream <<
"\n\nINCORRECT matvecProductDataData (17): check matrix inverse property\n\n";
2499 art::matvecProductDataData<double>(in_c_p_d, data_c_p_one, in_p_d);
2500 art::matvecProductDataData<double>(out_c_p_d, data_c_p_d_d, in_p_d,
't');
2501 art::matvecProductDataData<double>(outi_c_p_d, datainv_c_p_d_d, out_c_p_d,
't');
2502 rst::subtract(outi_c_p_d, in_c_p_d);
2503 if (rst::vectorNorm(outi_c_p_d, NORM_ONE) > zero) {
2504 *outStream <<
"\n\nINCORRECT matvecProductDataData (18): check matrix inverse property, w/ double transpose\n\n";
2508 art::matvecProductDataData<double>(in_c_p_d, data_c_p_one, in_p_d);
2509 art::matvecProductDataData<double>(out_c_p_d, data_c_1_d_d, in_p_d);
2510 art::matvecProductDataData<double>(outi_c_p_d, datainv_c_1_d_d, out_c_p_d);
2511 rst::subtract(outi_c_p_d, in_c_p_d);
2512 if (rst::vectorNorm(outi_c_p_d, NORM_ONE) > zero) {
2513 *outStream <<
"\n\nINCORRECT matvecProductDataData (19): check matrix inverse property\n\n";
2516 art::matvecProductDataData<double>(in_c_p_d, data_c_p_one, in_p_d);
2517 art::matvecProductDataData<double>(out_c_p_d, data_c_1_d_d, in_p_d,
't');
2518 art::matvecProductDataData<double>(outi_c_p_d, datainv_c_1_d_d, out_c_p_d,
't');
2519 rst::subtract(outi_c_p_d, in_c_p_d);
2520 if (rst::vectorNorm(outi_c_p_d, NORM_ONE) > zero) {
2521 *outStream <<
"\n\nINCORRECT matvecProductDataData (20): check matrix inverse property, w/ double transpose\n\n";
2527 for (
unsigned int i=0; i<in_p_d.dimension(0); i++)
2528 for (
unsigned int j=0; j<in_p_d.dimension(1); j++){
2529 in_p_d(i,j) = Teuchos::ScalarTraits<double>::random();
2532 for (
int ic=0; ic < c; ic++) {
2533 for (
int ip=0; ip < p; ip++) {
2534 for (
int i=0; i<d1; i++) {
2535 for (
int j=0; j<d1; j++) {
2536 data_c_p_d_d(ic, ip, i, j) = Teuchos::ScalarTraits<double>::random();
2544 for (
int ic=0; ic < c; ic++) {
2545 for (
int ip=0; ip < 1; ip++) {
2546 for (
int i=0; i<d1; i++) {
2547 for (
int j=0; j<d1; j++) {
2548 data_c_1_d_d(ic, 0, i, j) = Teuchos::ScalarTraits<double>::random();
2557 art::matvecProductDataData<double>(in_c_p_d, data_c_p_one, in_p_d);
2558 art::matvecProductDataData<double>(out_c_p_d, data_c_p_d_d, in_p_d);
2559 art::matvecProductDataData<double>(outi_c_p_d, datainvtrn_c_p_d_d, out_c_p_d,
't');
2560 rst::subtract(outi_c_p_d, in_c_p_d);
2561 if (rst::vectorNorm(outi_c_p_d, NORM_ONE) > zero) {
2562 *outStream <<
"\n\nINCORRECT matvecProductDataData (21): check matrix inverse transpose property\n\n";
2566 art::matvecProductDataData<double>(in_c_p_d, data_c_p_one, in_p_d);
2567 art::matvecProductDataData<double>(out_c_p_d, data_c_1_d_d, in_p_d);
2568 art::matvecProductDataData<double>(outi_c_p_d, datainvtrn_c_1_d_d, out_c_p_d,
't');
2569 rst::subtract(outi_c_p_d, in_c_p_d);
2570 if (rst::vectorNorm(outi_c_p_d, NORM_ONE) > zero) {
2571 *outStream <<
"\n\nINCORRECT matvecProductDataData (22): check matrix inverse transpose property\n\n";
2579 <<
"===============================================================================\n"\
2580 <<
"| TEST 7.a: matmatProductDataField random tests: branch inputFields(C,F,P,D,D)|\n"\
2581 <<
"===============================================================================\n";
2583 int c=5, p=9, f=7, d1=3;
2584 double zero = INTREPID_TOL*10000.0;
2586 Kokkos::View<double*****> in_c_f_p_d_d(
"in_c_f_p_d_d",c, f, p, d1, d1);
2587 Kokkos::View<double**> data_c_p(
"data_c_p",c, p);
2588 Kokkos::View<double**> datainv_c_p(
"datainv_c_p",c, p);
2589 Kokkos::View<double**> data_c_1(
"data_c_1",c, 1);
2590 Kokkos::View<double**> datainv_c_1(
"datainv_c_1",c, 1);
2591 Kokkos::View<double***> data_c_p_d(
"data_c_p_d",c, p, d1);
2592 Kokkos::View<double***> datainv_c_p_d(
"datainv_c_p_d",c, p, d1);
2593 Kokkos::View<double***> data_c_1_d(
"data_c_1_d",c, 1, d1);
2594 Kokkos::View<double***> datainv_c_1_d(
"datainv_c_1_d",c, 1, d1);
2595 Kokkos::View<double****> data_c_p_d_d(
"data_c_p_d_d",c, p, d1, d1);
2596 Kokkos::View<double****> datainv_c_p_d_d(
"datainv_c_p_d_d",c, p, d1, d1);
2597 Kokkos::View<double****> datainvtrn_c_p_d_d(
"datainvtrn_c_p_d_d",c, p, d1, d1);
2598 Kokkos::View<double****> data_c_1_d_d(
"data_c_1_d_d",c, 1, d1, d1);
2599 Kokkos::View<double****> datainv_c_1_d_d(
"datainv_c_1_d_d",c, 1, d1, d1);
2600 Kokkos::View<double****> datainvtrn_c_1_d_d(
"datainvtrn_c_1_d_d",c, 1, d1, d1);
2601 Kokkos::View<double*****> out_c_f_p_d_d(
"out_c_f_p_d_d",c, f, p, d1, d1);
2602 Kokkos::View<double*****> outi_c_f_p_d_d(
"outi_c_f_p_d_d",c, f, p, d1, d1);
2606 for (
unsigned int i=0; i<in_c_f_p_d_d.dimension(0); i++)
2607 for (
unsigned int j=0; j<in_c_f_p_d_d.dimension(1); j++)
2608 for (
unsigned int k=0; k<in_c_f_p_d_d.dimension(2); k++)
2609 for (
unsigned int l=0; l<in_c_f_p_d_d.dimension(3); l++)
2610 for (
unsigned int m=0; m<in_c_f_p_d_d.dimension(4); m++){
2611 in_c_f_p_d_d(i,j,k,l,m) = Teuchos::ScalarTraits<double>::random();
2614 for (
unsigned int i=0; i<data_c_p.dimension(0); i++)
2615 for (
unsigned int j=0; j<data_c_p.dimension(1); j++){
2616 data_c_p(i,j) = Teuchos::ScalarTraits<double>::random();
2617 datainv_c_p(i,j) = 1.0 / data_c_p(i,j);
2620 for (
unsigned int i=0; i<data_c_1.dimension(0); i++)
2621 for (
unsigned int j=0; j<data_c_1.dimension(1); j++){
2622 data_c_1(i,j) = Teuchos::ScalarTraits<double>::random();
2623 datainv_c_1(i,j) = 1.0 / data_c_1(i,j);
2627 art::matmatProductDataField<double>(out_c_f_p_d_d, data_c_p, in_c_f_p_d_d);
2628 art::matmatProductDataField<double>(out_c_f_p_d_d, datainv_c_p, out_c_f_p_d_d);
2629 rst::subtract(out_c_f_p_d_d, in_c_f_p_d_d);
2630 if (rst::vectorNorm(out_c_f_p_d_d, NORM_ONE) > zero) {
2631 *outStream <<
"\n\nINCORRECT matmatProductDataField (1): check scalar inverse property\n\n";
2635 art::matmatProductDataField<double>(out_c_f_p_d_d, data_c_1, in_c_f_p_d_d);
2636 art::matmatProductDataField<double>(out_c_f_p_d_d, datainv_c_1, out_c_f_p_d_d);
2637 rst::subtract(out_c_f_p_d_d, in_c_f_p_d_d);
2638 if (rst::vectorNorm(out_c_f_p_d_d, NORM_ONE) > zero) {
2639 *outStream <<
"\n\nINCORRECT matmatProductDataField (2): check scalar inverse property\n\n";
2645 for (
unsigned int i=0; i<in_c_f_p_d_d.dimension(0); i++)
2646 for (
unsigned int j=0; j<in_c_f_p_d_d.dimension(1); j++)
2647 for (
unsigned int k=0; k<in_c_f_p_d_d.dimension(2); k++)
2648 for (
unsigned int l=0; l<in_c_f_p_d_d.dimension(3); l++)
2649 for (
unsigned int m=0; m<in_c_f_p_d_d.dimension(4); m++){
2650 in_c_f_p_d_d(i,j,k,l,m) = Teuchos::ScalarTraits<double>::random();
2653 for (
unsigned int i=0; i<data_c_p_d.dimension(0); i++)
2654 for (
unsigned int j=0; j<data_c_p_d.dimension(1); j++)
2655 for (
unsigned int k=0; k<data_c_p_d.dimension(2); k++){
2656 data_c_p_d(i,j,k) = Teuchos::ScalarTraits<double>::random();
2657 datainv_c_p_d(i,j,k) = 1.0 / data_c_p_d(i,j,k);
2660 for (
unsigned int i=0; i<data_c_1_d.dimension(0); i++)
2661 for (
unsigned int j=0; j<data_c_1_d.dimension(1); j++)
2662 for (
unsigned int k=0; k<data_c_1_d.dimension(2); k++){
2663 data_c_1_d(i,j,k) = Teuchos::ScalarTraits<double>::random();
2664 datainv_c_1_d(i,j,k) = 1.0 / data_c_1_d(i,j,k);
2668 art::matmatProductDataField<double>(out_c_f_p_d_d, data_c_p_d, in_c_f_p_d_d);
2669 art::matmatProductDataField<double>(out_c_f_p_d_d, datainv_c_p_d, out_c_f_p_d_d);
2670 rst::subtract(out_c_f_p_d_d, in_c_f_p_d_d);
2671 if (rst::vectorNorm(out_c_f_p_d_d, NORM_ONE) > zero) {
2672 *outStream <<
"\n\nINCORRECT matmatProductDataField (3): check scalar inverse property\n\n";
2676 art::matmatProductDataField<double>(out_c_f_p_d_d, data_c_1_d, in_c_f_p_d_d);
2677 art::matmatProductDataField<double>(out_c_f_p_d_d, datainv_c_1_d, out_c_f_p_d_d);
2678 rst::subtract(out_c_f_p_d_d, in_c_f_p_d_d);
2679 if (rst::vectorNorm(out_c_f_p_d_d, NORM_ONE) > zero) {
2680 *outStream <<
"\n\nINCORRECT matmatProductDataField (4): check scalar inverse property\n\n";
2686 for (
unsigned int i=0; i<in_c_f_p_d_d.dimension(0); i++)
2687 for (
unsigned int j=0; j<in_c_f_p_d_d.dimension(1); j++)
2688 for (
unsigned int k=0; k<in_c_f_p_d_d.dimension(2); k++)
2689 for (
unsigned int l=0; l<in_c_f_p_d_d.dimension(3); l++)
2690 for (
unsigned int m=0; m<in_c_f_p_d_d.dimension(4); m++){
2691 in_c_f_p_d_d(i,j,k,l,m) = Teuchos::ScalarTraits<double>::random();
2694 for (
int ic=0; ic < c; ic++) {
2695 for (
int ip=0; ip < p; ip++) {
2696 for (
int i=0; i<d1; i++) {
2697 for (
int j=0; j<d1; j++) {
2698 data_c_p_d_d(ic, ip, i, j) = Teuchos::ScalarTraits<double>::random();
2705 for (
int ic=0; ic < c; ic++) {
2706 for (
int ip=0; ip < 1; ip++) {
2707 for (
int i=0; i<d1; i++) {
2708 for (
int j=0; j<d1; j++) {
2709 data_c_1_d_d(ic, 0, i, j) = Teuchos::ScalarTraits<double>::random();
2718 art::matmatProductDataField<double>(out_c_f_p_d_d, data_c_p_d_d, in_c_f_p_d_d);
2719 art::matmatProductDataField<double>(outi_c_f_p_d_d, datainv_c_p_d_d, out_c_f_p_d_d);
2720 rst::subtract(outi_c_f_p_d_d, in_c_f_p_d_d);
2721 if (rst::vectorNorm(outi_c_f_p_d_d, NORM_ONE) > zero) {
2722 *outStream <<
"\n\nINCORRECT matmatProductDataField (5): check matrix inverse property\n\n";
2725 art::matmatProductDataField<double>(out_c_f_p_d_d, data_c_p_d_d, in_c_f_p_d_d,
't');
2726 art::matmatProductDataField<double>(outi_c_f_p_d_d, datainv_c_p_d_d, out_c_f_p_d_d,
't');
2727 rst::subtract(outi_c_f_p_d_d, in_c_f_p_d_d);
2728 if (rst::vectorNorm(outi_c_f_p_d_d, NORM_ONE) > zero) {
2729 *outStream <<
"\n\nINCORRECT matmatProductDataField (6): check matrix inverse property, w/ double transpose\n\n";
2733 art::matmatProductDataField<double>(out_c_f_p_d_d, data_c_1_d_d, in_c_f_p_d_d);
2734 art::matmatProductDataField<double>(outi_c_f_p_d_d, datainv_c_1_d_d, out_c_f_p_d_d);
2735 rst::subtract(outi_c_f_p_d_d, in_c_f_p_d_d);
2736 if (rst::vectorNorm(outi_c_f_p_d_d, NORM_ONE) > zero) {
2737 *outStream <<
"\n\nINCORRECT matmatProductDataField (7): check matrix inverse property\n\n";
2740 art::matmatProductDataField<double>(out_c_f_p_d_d, data_c_1_d_d, in_c_f_p_d_d,
't');
2741 art::matmatProductDataField<double>(outi_c_f_p_d_d, datainv_c_1_d_d, out_c_f_p_d_d,
't');
2742 rst::subtract(outi_c_f_p_d_d, in_c_f_p_d_d);
2743 if (rst::vectorNorm(outi_c_f_p_d_d, NORM_ONE) > zero) {
2744 *outStream <<
"\n\nINCORRECT matmatProductDataField (8): check matrix inverse property, w/ double transpose\n\n";
2750 for (
unsigned int i=0; i<in_c_f_p_d_d.dimension(0); i++)
2751 for (
unsigned int j=0; j<in_c_f_p_d_d.dimension(1); j++)
2752 for (
unsigned int k=0; k<in_c_f_p_d_d.dimension(2); k++)
2753 for (
unsigned int l=0; l<in_c_f_p_d_d.dimension(3); l++)
2754 for (
unsigned int m=0; m<in_c_f_p_d_d.dimension(4); m++){
2755 in_c_f_p_d_d(i,j,k,l,m) = Teuchos::ScalarTraits<double>::random();
2757 for (
int ic=0; ic < c; ic++) {
2758 for (
int ip=0; ip < p; ip++) {
2759 for (
int i=0; i<d1; i++) {
2760 for (
int j=0; j<d1; j++) {
2761 data_c_p_d_d(ic, ip, i, j) = Teuchos::ScalarTraits<double>::random();
2769 for (
int ic=0; ic < c; ic++) {
2770 for (
int ip=0; ip < 1; ip++) {
2771 for (
int i=0; i<d1; i++) {
2772 for (
int j=0; j<d1; j++) {
2773 data_c_1_d_d(ic, 0, i, j) = Teuchos::ScalarTraits<double>::random();
2782 art::matmatProductDataField<double>(out_c_f_p_d_d, data_c_p_d_d, in_c_f_p_d_d);
2783 art::matmatProductDataField<double>(outi_c_f_p_d_d, datainvtrn_c_p_d_d, out_c_f_p_d_d,
't');
2784 rst::subtract(outi_c_f_p_d_d, in_c_f_p_d_d);
2785 if (rst::vectorNorm(outi_c_f_p_d_d, NORM_ONE) > zero) {
2786 *outStream <<
"\n\nINCORRECT matmatProductDataField (9): check matrix inverse transpose property\n\n";
2790 art::matmatProductDataField<double>(out_c_f_p_d_d, data_c_1_d_d, in_c_f_p_d_d);
2791 art::matmatProductDataField<double>(outi_c_f_p_d_d, datainvtrn_c_1_d_d, out_c_f_p_d_d,
't');
2792 rst::subtract(outi_c_f_p_d_d, in_c_f_p_d_d);
2793 if (rst::vectorNorm(outi_c_f_p_d_d, NORM_ONE) > zero) {
2794 *outStream <<
"\n\nINCORRECT matmatProductDataField (10): check matrix inverse transpose property\n\n";
2803 <<
"===============================================================================\n"\
2804 <<
"| TEST 7.b: matmatProductDataField random tests: branch inputFields(F,P,D,D) |\n"\
2805 <<
"===============================================================================\n";
2807 int c=5, p=9, f=7, d1=3;
2808 double zero = INTREPID_TOL*10000.0;
2810 Kokkos::View<double****> in_f_p_d_d(
"in_f_p_d_d",f, p, d1, d1);
2811 Kokkos::View<double*****> in_c_f_p_d_d(
"in_c_f_p_d_d",c, f, p, d1, d1);
2812 Kokkos::View<double**> data_c_p(
"data_c_p",c, p);
2813 Kokkos::View<double**> datainv_c_p(
"datainv_c_p",c, p);
2814 Kokkos::View<double**> data_c_1(
"data_c_1",c, 1);
2815 Kokkos::View<double**> datainv_c_1(
"datainv_c_1",c, 1);
2816 Kokkos::View<double***> data_c_p_d(
"data_c_p_d",c, p, d1);
2817 Kokkos::View<double***> datainv_c_p_d(
"datainv_c_p_d",c, p, d1);
2818 Kokkos::View<double***> data_c_1_d(
"data_c_1_d",c, 1, d1);
2819 Kokkos::View<double***> datainv_c_1_d(
"datainv_c_1_d",c, 1, d1);
2820 Kokkos::View<double****> data_c_p_d_d(
"data_c_p_d_d",c, p, d1, d1);
2821 Kokkos::View<double****> datainv_c_p_d_d(
"datainv_c_p_d_d",c, p, d1, d1);
2822 Kokkos::View<double****> datainvtrn_c_p_d_d(
"datainvtrn_c_p_d_d",c, p, d1, d1);
2823 Kokkos::View<double****> data_c_1_d_d(
"data_c_1_d_d",c, 1, d1, d1);
2824 Kokkos::View<double****> datainv_c_1_d_d(
"datainv_c_1_d_d",c, 1, d1, d1);
2825 Kokkos::View<double****> datainvtrn_c_1_d_d(
"datainvtrn_c_1_d_d",c, 1, d1, d1);
2826 Kokkos::View<double**> data_c_p_one(
"data_c_p_one",c, p);
2827 Kokkos::View<double**> data_c_1_one(
"data_c_1_one",c, 1);
2828 Kokkos::View<double*****> out_c_f_p_d_d(
"out_c_f_p_d_d",c, f, p, d1, d1);
2829 Kokkos::View<double*****> outi_c_f_p_d_d(
"outi_c_f_p_d_d",c, f, p, d1, d1);
2833 for (
unsigned int i=0; i<in_f_p_d_d.dimension(0); i++)
2834 for (
unsigned int j=0; j<in_f_p_d_d.dimension(1); j++)
2835 for (
unsigned int k=0; k<in_f_p_d_d.dimension(2); k++)
2836 for (
unsigned int l=0; l<in_f_p_d_d.dimension(3); l++){
2837 in_f_p_d_d(i,j,k,l) = Teuchos::ScalarTraits<double>::random();
2841 for (
unsigned int i=0; i<data_c_p.dimension(0); i++)
2842 for (
unsigned int j=0; j<data_c_p.dimension(1); j++){
2843 data_c_p(i,j) = Teuchos::ScalarTraits<double>::random();
2844 datainv_c_p(i,j) = 1.0 / data_c_p(i,j);
2845 data_c_p_one(i,j) = 1.0;
2848 for (
unsigned int i=0; i<data_c_1.dimension(0); i++)
2849 for (
unsigned int j=0; j<data_c_1.dimension(1); j++){
2850 data_c_1(i,j) = Teuchos::ScalarTraits<double>::random();
2851 datainv_c_1(i,j) = 1.0 / data_c_1(i,j);
2856 art::matmatProductDataField<double>(in_c_f_p_d_d, data_c_p_one, in_f_p_d_d);
2857 art::matmatProductDataField<double>(out_c_f_p_d_d, data_c_p, in_f_p_d_d);
2858 art::matmatProductDataField<double>(outi_c_f_p_d_d, datainv_c_p, out_c_f_p_d_d);
2859 rst::subtract(outi_c_f_p_d_d, in_c_f_p_d_d);
2860 if (rst::vectorNorm(outi_c_f_p_d_d, NORM_ONE) > zero) {
2861 *outStream <<
"\n\nINCORRECT matmatProductDataField (11): check scalar inverse property\n\n";
2865 art::matmatProductDataField<double>(in_c_f_p_d_d, data_c_p_one, in_f_p_d_d);
2866 art::matmatProductDataField<double>(out_c_f_p_d_d, data_c_1, in_f_p_d_d);
2867 art::matmatProductDataField<double>(outi_c_f_p_d_d, datainv_c_1, out_c_f_p_d_d);
2868 rst::subtract(outi_c_f_p_d_d, in_c_f_p_d_d);
2869 if (rst::vectorNorm(outi_c_f_p_d_d, NORM_ONE) > zero) {
2870 *outStream <<
"\n\nINCORRECT matmatProductDataField (12): check scalar inverse property\n\n";
2876 for (
unsigned int i=0; i<in_f_p_d_d.dimension(0); i++)
2877 for (
unsigned int j=0; j<in_f_p_d_d.dimension(1); j++)
2878 for (
unsigned int k=0; k<in_f_p_d_d.dimension(2); k++)
2879 for (
unsigned int l=0; l<in_f_p_d_d.dimension(3); l++){
2880 in_f_p_d_d(i,j,k,l) = Teuchos::ScalarTraits<double>::random();
2882 for (
unsigned int i=0; i<data_c_p_d.dimension(0); i++)
2883 for (
unsigned int j=0; j<data_c_p_d.dimension(1); j++)
2884 for (
unsigned int k=0; k<data_c_p_d.dimension(2); k++){
2885 data_c_p_d(i,j,k) = Teuchos::ScalarTraits<double>::random();
2886 datainv_c_p_d(i,j,k) = 1.0 / data_c_p_d(i,j,k);
2888 for (
unsigned int i=0; i<data_c_1_d.dimension(0); i++)
2889 for (
unsigned int j=0; j<data_c_1_d.dimension(1); j++)
2890 for (
unsigned int k=0; k<data_c_1_d.dimension(2); k++){
2891 data_c_1_d(i,j,k) = Teuchos::ScalarTraits<double>::random();
2892 datainv_c_1_d(i,j,k) = 1.0 / data_c_1_d(i,j,k);
2895 art::matmatProductDataField<double>(in_c_f_p_d_d, data_c_p_one, in_f_p_d_d);
2896 art::matmatProductDataField<double>(out_c_f_p_d_d, data_c_p_d, in_f_p_d_d);
2897 art::matmatProductDataField<double>(outi_c_f_p_d_d, datainv_c_p_d, out_c_f_p_d_d);
2898 rst::subtract(outi_c_f_p_d_d, in_c_f_p_d_d);
2899 if (rst::vectorNorm(outi_c_f_p_d_d, NORM_ONE) > zero) {
2900 *outStream <<
"\n\nINCORRECT matmatProductDataField (13): check scalar inverse property\n\n";
2904 art::matmatProductDataField<double>(in_c_f_p_d_d, data_c_p_one, in_f_p_d_d);
2905 art::matmatProductDataField<double>(out_c_f_p_d_d, data_c_1_d, in_f_p_d_d);
2906 art::matmatProductDataField<double>(outi_c_f_p_d_d, datainv_c_1_d, out_c_f_p_d_d);
2907 rst::subtract(outi_c_f_p_d_d, in_c_f_p_d_d);
2908 if (rst::vectorNorm(outi_c_f_p_d_d, NORM_ONE) > zero) {
2909 *outStream <<
"\n\nINCORRECT matmatProductDataField (14): check scalar inverse property\n\n";
2915 for (
unsigned int i=0; i<in_f_p_d_d.dimension(0); i++)
2916 for (
unsigned int j=0; j<in_f_p_d_d.dimension(1); j++)
2917 for (
unsigned int k=0; k<in_f_p_d_d.dimension(2); k++)
2918 for (
unsigned int l=0; l<in_f_p_d_d.dimension(3); l++){
2919 in_f_p_d_d(i,j,k,l) = Teuchos::ScalarTraits<double>::random();
2923 for (
int ic=0; ic < c; ic++) {
2924 for (
int ip=0; ip < p; ip++) {
2925 for (
int i=0; i<d1; i++) {
2926 for (
int j=0; j<d1; j++) {
2927 data_c_p_d_d(ic, ip, i, j) = Teuchos::ScalarTraits<double>::random();
2934 for (
int ic=0; ic < c; ic++) {
2935 for (
int ip=0; ip < 1; ip++) {
2936 for (
int i=0; i<d1; i++) {
2937 for (
int j=0; j<d1; j++) {
2938 data_c_1_d_d(ic, 0, i, j) = Teuchos::ScalarTraits<double>::random();
2945 art::matmatProductDataField<double>(in_c_f_p_d_d, data_c_p_one, in_f_p_d_d);
2946 art::matmatProductDataField<double>(out_c_f_p_d_d, data_c_p_d_d, in_f_p_d_d);
2947 art::matmatProductDataField<double>(outi_c_f_p_d_d, datainv_c_p_d_d, out_c_f_p_d_d);
2948 rst::subtract(outi_c_f_p_d_d, in_c_f_p_d_d);
2949 if (rst::vectorNorm(outi_c_f_p_d_d, NORM_ONE) > zero) {
2950 *outStream <<
"\n\nINCORRECT matmatProductDataField (15): check matrix inverse property\n\n";
2953 art::matmatProductDataField<double>(in_c_f_p_d_d, data_c_p_one, in_f_p_d_d);
2954 art::matmatProductDataField<double>(out_c_f_p_d_d, data_c_p_d_d, in_f_p_d_d,
't');
2955 art::matmatProductDataField<double>(outi_c_f_p_d_d, datainv_c_p_d_d, out_c_f_p_d_d,
't');
2956 rst::subtract(outi_c_f_p_d_d, in_c_f_p_d_d);
2957 if (rst::vectorNorm(outi_c_f_p_d_d, NORM_ONE) > zero) {
2958 *outStream <<
"\n\nINCORRECT matmatProductDataField (16): check matrix inverse property, w/ double transpose\n\n";
2962 art::matmatProductDataField<double>(in_c_f_p_d_d, data_c_p_one, in_f_p_d_d);
2963 art::matmatProductDataField<double>(out_c_f_p_d_d, data_c_1_d_d, in_f_p_d_d);
2964 art::matmatProductDataField<double>(outi_c_f_p_d_d, datainv_c_1_d_d, out_c_f_p_d_d);
2965 rst::subtract(outi_c_f_p_d_d, in_c_f_p_d_d);
2966 if (rst::vectorNorm(outi_c_f_p_d_d, NORM_ONE) > zero) {
2967 *outStream <<
"\n\nINCORRECT matmatProductDataField (17): check matrix inverse property\n\n";
2970 art::matmatProductDataField<double>(in_c_f_p_d_d, data_c_p_one, in_f_p_d_d);
2971 art::matmatProductDataField<double>(out_c_f_p_d_d, data_c_1_d_d, in_f_p_d_d,
't');
2972 art::matmatProductDataField<double>(outi_c_f_p_d_d, datainv_c_1_d_d, out_c_f_p_d_d,
't');
2973 rst::subtract(outi_c_f_p_d_d, in_c_f_p_d_d);
2974 if (rst::vectorNorm(outi_c_f_p_d_d, NORM_ONE) > zero) {
2975 *outStream <<
"\n\nINCORRECT matmatProductDataField (18): check matrix inverse property, w/ double transpose\n\n";
2981 for (
unsigned int i=0; i<in_f_p_d_d.dimension(0); i++)
2982 for (
unsigned int j=0; j<in_f_p_d_d.dimension(1); j++)
2983 for (
unsigned int k=0; k<in_f_p_d_d.dimension(2); k++)
2984 for (
unsigned int l=0; l<in_f_p_d_d.dimension(3); l++){
2985 in_f_p_d_d(i,j,k,l) = Teuchos::ScalarTraits<double>::random();
2987 for (
int ic=0; ic < c; ic++) {
2988 for (
int ip=0; ip < p; ip++) {
2989 for (
int i=0; i<d1; i++) {
2990 for (
int j=0; j<d1; j++) {
2991 data_c_p_d_d(ic, ip, i, j) = Teuchos::ScalarTraits<double>::random();
2999 for (
int ic=0; ic < c; ic++) {
3000 for (
int ip=0; ip < 1; ip++) {
3001 for (
int i=0; i<d1; i++) {
3002 for (
int j=0; j<d1; j++) {
3003 data_c_1_d_d(ic, 0, i, j) = Teuchos::ScalarTraits<double>::random();
3011 art::matmatProductDataField<double>(in_c_f_p_d_d, data_c_p_one, in_f_p_d_d);
3012 art::matmatProductDataField<double>(out_c_f_p_d_d, data_c_p_d_d, in_f_p_d_d);
3013 art::matmatProductDataField<double>(outi_c_f_p_d_d, datainvtrn_c_p_d_d, out_c_f_p_d_d,
't');
3014 rst::subtract(outi_c_f_p_d_d, in_c_f_p_d_d);
3015 if (rst::vectorNorm(outi_c_f_p_d_d, NORM_ONE) > zero) {
3016 *outStream <<
"\n\nINCORRECT matmatProductDataField (19): check matrix inverse transpose property\n\n";
3020 art::matmatProductDataField<double>(in_c_f_p_d_d, data_c_p_one, in_f_p_d_d);
3021 art::matmatProductDataField<double>(out_c_f_p_d_d, data_c_1_d_d, in_f_p_d_d);
3022 art::matmatProductDataField<double>(outi_c_f_p_d_d, datainvtrn_c_1_d_d, out_c_f_p_d_d,
't');
3023 rst::subtract(outi_c_f_p_d_d, in_c_f_p_d_d);
3024 if (rst::vectorNorm(outi_c_f_p_d_d, NORM_ONE) > zero) {
3025 *outStream <<
"\n\nINCORRECT matmatProductDataField (20): check matrix inverse transpose property\n\n";
3034 <<
"===============================================================================\n"\
3035 <<
"| TEST 8.a: matmatProductDataData random tests: branch inputDataRight(C,P,D,D)|\n"\
3036 <<
"===============================================================================\n";
3042 double zero = INTREPID_TOL*10000.0;
3044 Kokkos::View<double****> in_c_p_d_d(
"in_c_p_d_d",c, p, d1, d1);
3045 Kokkos::View<double****> out_c_p_d_d(
"out_c_p_d_d",c, p, d1, d1);
3046 Kokkos::View<double****> outi_c_p_d_d(
"outi_c_p_d_d",c, p, d1, d1);
3048 Kokkos::View<double**> data_c_p(
"data_c_p",c, p);
3049 Kokkos::View<double**> datainv_c_p(
"datainv_c_p",c, p);
3050 Kokkos::View<double**> data_c_1(
"data_c_1",c, 1);
3051 Kokkos::View<double**> datainv_c_1(
"datainv_c_1",c, 1);
3052 Kokkos::View<double***> data_c_p_d(
"data_c_p_d",c, p, d1);
3053 Kokkos::View<double***> datainv_c_p_d(
"datainv_c_p_d",c, p, d1);
3054 Kokkos::View<double***> data_c_1_d(
"data_c_1_d",c, 1, d1);
3055 Kokkos::View<double***> datainv_c_1_d(
"datainv_c_1_d",c, 1, d1);
3056 Kokkos::View<double****> data_c_p_d_d(
"data_c_p_d_d",c, p, d1, d1);
3057 Kokkos::View<double****> datainv_c_p_d_d(
"datainv_c_p_d_d",c, p, d1, d1);
3058 Kokkos::View<double****> datainvtrn_c_p_d_d(
"datainvtrn_c_p_d_d",c, p, d1, d1);
3059 Kokkos::View<double****> data_c_1_d_d(
"data_c_1_d_d",c, 1, d1, d1);
3060 Kokkos::View<double****> datainv_c_1_d_d(
"datainv_c_1_d_d",c, 1, d1, d1);
3061 Kokkos::View<double****> datainvtrn_c_1_d_d(
"datainvtrn_c_1_d_d",c, 1, d1, d1);
3065 for (
unsigned int i=0; i<in_c_p_d_d.dimension(0); i++)
3066 for (
unsigned int j=0; j<in_c_p_d_d.dimension(1); j++)
3067 for (
unsigned int k=0; k<in_c_p_d_d.dimension(2); k++)
3068 for (
unsigned int l=0; l<in_c_p_d_d.dimension(3); l++){
3069 in_c_p_d_d(i,j,k,l) = Teuchos::ScalarTraits<double>::random();
3071 for (
unsigned int i=0; i<data_c_p.dimension(0); i++)
3072 for (
unsigned int j=0; j<data_c_p.dimension(1); j++){
3073 data_c_p(i,j) = Teuchos::ScalarTraits<double>::random();
3074 datainv_c_p(i,j) = 1.0 / data_c_p(i,j);
3076 for (
unsigned int i=0; i<data_c_1.dimension(0); i++)
3077 for (
unsigned int j=0; j<data_c_1.dimension(1); j++){
3078 data_c_1(i,j) = Teuchos::ScalarTraits<double>::random();
3079 datainv_c_1(i,j) = 1.0 / data_c_1(i,j);
3083 art::matmatProductDataData<double>(out_c_p_d_d, data_c_p, in_c_p_d_d);
3084 art::matmatProductDataData<double>(out_c_p_d_d, datainv_c_p, out_c_p_d_d);
3085 rst::subtract(out_c_p_d_d, in_c_p_d_d);
3086 if (rst::vectorNorm(out_c_p_d_d, NORM_ONE) > zero) {
3087 *outStream <<
"\n\nINCORRECT matmatProductDataData (1): check scalar inverse property\n\n";
3091 art::matmatProductDataData<double>(out_c_p_d_d, data_c_1, in_c_p_d_d);
3092 art::matmatProductDataData<double>(out_c_p_d_d, datainv_c_1, out_c_p_d_d);
3093 rst::subtract(out_c_p_d_d, in_c_p_d_d);
3094 if (rst::vectorNorm(out_c_p_d_d, NORM_ONE) > zero) {
3095 *outStream <<
"\n\nINCORRECT matmatProductDataData (2): check scalar inverse property\n\n";
3101 for (
unsigned int i=0; i<in_c_p_d_d.dimension(0); i++)
3102 for (
unsigned int j=0; j<in_c_p_d_d.dimension(1); j++)
3103 for (
unsigned int k=0; k<in_c_p_d_d.dimension(2); k++)
3104 for (
unsigned int l=0; l<in_c_p_d_d.dimension(3); l++){
3105 in_c_p_d_d(i,j,k,l) = Teuchos::ScalarTraits<double>::random();
3107 for (
unsigned int i=0; i<data_c_p_d.dimension(0); i++)
3108 for (
unsigned int j=0; j<data_c_p_d.dimension(1); j++)
3109 for (
unsigned int k=0; k<data_c_p_d.dimension(2); k++){
3110 data_c_p_d(i,j,k) = Teuchos::ScalarTraits<double>::random();
3111 datainv_c_p_d(i,j,k) = 1.0 / data_c_p_d(i,j,k);
3113 for (
unsigned int i=0; i<data_c_1_d.dimension(0); i++)
3114 for (
unsigned int j=0; j<data_c_1_d.dimension(1); j++)
3115 for (
unsigned int k=0; k<data_c_1_d.dimension(2); k++){
3116 data_c_1_d(i,j,k) = Teuchos::ScalarTraits<double>::random();
3117 datainv_c_1_d(i,j,k) = 1.0 / data_c_1_d(i,j,k);
3120 art::matmatProductDataData<double>(out_c_p_d_d, data_c_p_d, in_c_p_d_d);
3121 art::matmatProductDataData<double>(out_c_p_d_d, datainv_c_p_d, out_c_p_d_d);
3122 rst::subtract(out_c_p_d_d, in_c_p_d_d);
3123 if (rst::vectorNorm(out_c_p_d_d,NORM_ONE) > zero) {
3124 *outStream <<
"\n\nINCORRECT matmatProductDataData (3): check scalar inverse property\n\n";
3128 art::matmatProductDataData<double>(out_c_p_d_d, data_c_1_d, in_c_p_d_d);
3129 art::matmatProductDataData<double>(out_c_p_d_d, datainv_c_1_d, out_c_p_d_d);
3130 rst::subtract(out_c_p_d_d, in_c_p_d_d);
3131 if (rst::vectorNorm(out_c_p_d_d, NORM_ONE) > zero) {
3132 *outStream <<
"\n\nINCORRECT matmatProductDataData (4): check scalar inverse property\n\n";
3138 for (
unsigned int i=0; i<in_c_p_d_d.dimension(0); i++)
3139 for (
unsigned int j=0; j<in_c_p_d_d.dimension(1); j++)
3140 for (
unsigned int k=0; k<in_c_p_d_d.dimension(2); k++)
3141 for (
unsigned int l=0; l<in_c_p_d_d.dimension(3); l++){
3142 in_c_p_d_d(i,j,k,l) = Teuchos::ScalarTraits<double>::random();
3144 for (
int ic=0; ic < c; ic++) {
3145 for (
int ip=0; ip < p; ip++) {
3146 for (
int i=0; i<d1; i++) {
3147 for (
int j=0; j<d1; j++) {
3148 data_c_p_d_d(ic, ip, i, j) = Teuchos::ScalarTraits<double>::random();
3155 for (
int ic=0; ic < c; ic++) {
3156 for (
int ip=0; ip < 1; ip++) {
3157 for (
int i=0; i<d1; i++) {
3158 for (
int j=0; j<d1; j++) {
3159 data_c_1_d_d(ic, 0, i, j) = Teuchos::ScalarTraits<double>::random();
3167 art::matmatProductDataData<double>(out_c_p_d_d, data_c_p_d_d, in_c_p_d_d);
3168 art::matmatProductDataData<double>(outi_c_p_d_d, datainv_c_p_d_d, out_c_p_d_d);
3169 rst::subtract(outi_c_p_d_d, in_c_p_d_d);
3170 if (rst::vectorNorm(outi_c_p_d_d, NORM_ONE) > zero) {
3171 *outStream <<
"\n\nINCORRECT matmatProductDataData (5): check matrix inverse property\n\n";
3174 art::matmatProductDataData<double>(out_c_p_d_d, data_c_p_d_d, in_c_p_d_d,
't');
3175 art::matmatProductDataData<double>(outi_c_p_d_d, datainv_c_p_d_d, out_c_p_d_d,
't');
3176 rst::subtract(outi_c_p_d_d, in_c_p_d_d);
3177 if (rst::vectorNorm(outi_c_p_d_d, NORM_ONE) > zero) {
3178 *outStream <<
"\n\nINCORRECT matmatProductDataData (6): check matrix inverse property, w/ double transpose\n\n";
3182 art::matmatProductDataData<double>(out_c_p_d_d, data_c_1_d_d, in_c_p_d_d);
3183 art::matmatProductDataData<double>(outi_c_p_d_d, datainv_c_1_d_d, out_c_p_d_d);
3184 rst::subtract(outi_c_p_d_d, in_c_p_d_d);
3185 if (rst::vectorNorm(outi_c_p_d_d, NORM_ONE) > zero) {
3186 *outStream <<
"\n\nINCORRECT matmatProductDataData (7): check matrix inverse property\n\n";
3189 art::matmatProductDataData<double>(out_c_p_d_d, data_c_1_d_d, in_c_p_d_d,
't');
3190 art::matmatProductDataData<double>(outi_c_p_d_d, datainv_c_1_d_d, out_c_p_d_d,
't');
3191 rst::subtract(outi_c_p_d_d, in_c_p_d_d);
3192 if (rst::vectorNorm(outi_c_p_d_d, NORM_ONE) > zero) {
3193 *outStream <<
"\n\nINCORRECT matmatProductDataData (8): check matrix inverse property, w/ double transpose\n\n";
3199 for (
unsigned int i=0; i<in_c_p_d_d.dimension(0); i++)
3200 for (
unsigned int j=0; j<in_c_p_d_d.dimension(1); j++)
3201 for (
unsigned int k=0; k<in_c_p_d_d.dimension(2); k++)
3202 for (
unsigned int l=0; l<in_c_p_d_d.dimension(3); l++){
3203 in_c_p_d_d(i,j,k,l) = Teuchos::ScalarTraits<double>::random();
3205 for (
int ic=0; ic < c; ic++) {
3206 for (
int ip=0; ip < p; ip++) {
3207 for (
int i=0; i<d1; i++) {
3208 for (
int j=0; j<d1; j++) {
3209 data_c_p_d_d(ic, ip, i, j) = Teuchos::ScalarTraits<double>::random();
3217 for (
int ic=0; ic < c; ic++) {
3218 for (
int ip=0; ip < 1; ip++) {
3219 for (
int i=0; i<d1; i++) {
3220 for (
int j=0; j<d1; j++) {
3221 data_c_1_d_d(ic, 0, i, j) = Teuchos::ScalarTraits<double>::random();
3229 art::matmatProductDataData<double>(out_c_p_d_d, data_c_p_d_d, in_c_p_d_d);
3230 art::matmatProductDataData<double>(outi_c_p_d_d, datainvtrn_c_p_d_d, out_c_p_d_d,
't');
3231 rst::subtract(outi_c_p_d_d, in_c_p_d_d);
3232 if (rst::vectorNorm(outi_c_p_d_d, NORM_ONE) > zero) {
3233 *outStream <<
"\n\nINCORRECT matmatProductDataData (9): check matrix inverse transpose property\n\n";
3237 art::matmatProductDataData<double>(out_c_p_d_d, data_c_1_d_d, in_c_p_d_d);
3238 art::matmatProductDataData<double>(outi_c_p_d_d, datainvtrn_c_1_d_d, out_c_p_d_d,
't');
3239 rst::subtract(outi_c_p_d_d, in_c_p_d_d);
3240 if (rst::vectorNorm(outi_c_p_d_d, NORM_ONE) > zero) {
3241 *outStream <<
"\n\nINCORRECT matmatProductDataData (10): check matrix inverse transpose property\n\n";
3247 <<
"===============================================================================\n"\
3248 <<
"| TEST 8.b: matmatProductDataData random tests: branch inputDataRight(P,D,D) |\n"\
3249 <<
"===============================================================================\n";
3255 double zero = INTREPID_TOL*10000.0;
3257 Kokkos::View<double***> in_p_d_d(
"in_p_d_d",p, d1, d1);
3258 Kokkos::View<double****> in_c_p_d_d(
"in_c_p_d_d",c, p, d1, d1);
3259 Kokkos::View<double****> out_c_p_d_d(
"out_c_p_d_d",c, p, d1, d1);
3260 Kokkos::View<double****> outi_c_p_d_d(
"outi_c_p_d_d",c, p, d1, d1);
3262 Kokkos::View<double**> data_c_p(
"data_c_p",c, p);
3263 Kokkos::View<double**> datainv_c_p(
"datainv_c_p",c, p);
3264 Kokkos::View<double**> data_c_1(
"data_c_1",c, 1);
3265 Kokkos::View<double**> datainv_c_1(
"datainv_c_1",c, 1);
3266 Kokkos::View<double***> data_c_p_d(
"data_c_p_d",c, p, d1);
3267 Kokkos::View<double***> datainv_c_p_d(
"datainv_c_p_d",c, p, d1);
3268 Kokkos::View<double***> data_c_1_d(
"data_c_1_d",c, 1, d1);
3269 Kokkos::View<double***> datainv_c_1_d(
"datainv_c_1_d",c, 1, d1);
3270 Kokkos::View<double****> data_c_p_d_d(
"data_c_p_d_d",c, p, d1, d1);
3271 Kokkos::View<double****> datainv_c_p_d_d(
"datainv_c_p_d_d",c, p, d1, d1);
3272 Kokkos::View<double****> datainvtrn_c_p_d_d(
"datainvtrn_c_p_d_d",c, p, d1, d1);
3273 Kokkos::View<double****> data_c_1_d_d(
"data_c_1_d_d",c, 1, d1, d1);
3274 Kokkos::View<double****> datainv_c_1_d_d(
"datainv_c_1_d_d",c, 1, d1, d1);
3275 Kokkos::View<double****> datainvtrn_c_1_d_d(
"datainvtrn_c_1_d_d",c, 1, d1, d1);
3276 Kokkos::View<double**> data_c_p_one(
"data_c_p_one",c, p);
3277 Kokkos::View<double**> data_c_1_one(
"data_c_1_one",c, 1);
3281 for (
unsigned int i=0; i<in_p_d_d.dimension(0); i++)
3282 for (
unsigned int j=0; j<in_p_d_d.dimension(1); j++)
3283 for (
unsigned int k=0; k<in_p_d_d.dimension(2); k++){
3284 in_p_d_d(i,j,k) = Teuchos::ScalarTraits<double>::random();
3286 for (
unsigned int i=0; i<data_c_p.dimension(0); i++)
3287 for (
unsigned int j=0; j<data_c_p.dimension(1); j++){
3288 data_c_p(i,j) = Teuchos::ScalarTraits<double>::random();
3289 datainv_c_p(i,j) = 1.0 / data_c_p(i,j);
3290 data_c_p_one(i,j) = 1.0;
3293 for (
unsigned int i=0; i<data_c_1.dimension(0); i++)
3294 for (
unsigned int j=0; j<data_c_1.dimension(1); j++){
3295 data_c_1(i,j) = Teuchos::ScalarTraits<double>::random();
3296 datainv_c_1(i,j) = 1.0 / data_c_1(i,j);
3299 art::matmatProductDataData<double>(in_c_p_d_d, data_c_p_one, in_p_d_d);
3300 art::matmatProductDataData<double>(out_c_p_d_d, data_c_p, in_p_d_d);
3301 art::matmatProductDataData<double>(outi_c_p_d_d, datainv_c_p, out_c_p_d_d);
3302 rst::subtract(outi_c_p_d_d, in_c_p_d_d);
3303 if (rst::vectorNorm(outi_c_p_d_d, NORM_ONE) > zero) {
3304 *outStream <<
"\n\nINCORRECT matmatProductDataData (11): check scalar inverse property\n\n";
3308 art::matmatProductDataData<double>(in_c_p_d_d, data_c_p_one, in_p_d_d);
3309 art::matmatProductDataData<double>(out_c_p_d_d, data_c_1, in_p_d_d);
3310 art::matmatProductDataData<double>(outi_c_p_d_d, datainv_c_1, out_c_p_d_d);
3311 rst::subtract(outi_c_p_d_d, in_c_p_d_d);
3312 if (rst::vectorNorm(outi_c_p_d_d, NORM_ONE) > zero) {
3313 *outStream <<
"\n\nINCORRECT matmatProductDataData (12): check scalar inverse property\n\n";
3319 for (
unsigned int i=0; i<in_p_d_d.dimension(0); i++)
3320 for (
unsigned int j=0; j<in_p_d_d.dimension(1); j++)
3321 for (
unsigned int k=0; k<in_p_d_d.dimension(2); k++){
3322 in_p_d_d(i,j,k) = Teuchos::ScalarTraits<double>::random();
3324 for (
unsigned int i=0; i<data_c_p_d.dimension(0); i++)
3325 for (
unsigned int j=0; j<data_c_p_d.dimension(1); j++)
3326 for (
unsigned int k=0; k<data_c_p_d.dimension(2); k++){
3327 data_c_p_d(i,j,k) = Teuchos::ScalarTraits<double>::random();
3328 datainv_c_p_d(i,j,k) = 1.0 / data_c_p_d(i,j,k);
3330 for (
unsigned int i=0; i<data_c_1_d.dimension(0); i++)
3331 for (
unsigned int j=0; j<data_c_1_d.dimension(1); j++)
3332 for (
unsigned int k=0; k<data_c_1_d.dimension(2); k++){
3333 data_c_1_d(i,j,k) = Teuchos::ScalarTraits<double>::random();
3334 datainv_c_1_d(i,j,k) = 1.0 / data_c_1_d(i,j,k);
3338 art::matmatProductDataData<double>(in_c_p_d_d, data_c_p_one, in_p_d_d);
3339 art::matmatProductDataData<double>(out_c_p_d_d, data_c_p_d, in_p_d_d);
3340 art::matmatProductDataData<double>(outi_c_p_d_d, datainv_c_p_d, out_c_p_d_d);
3341 rst::subtract(outi_c_p_d_d, in_c_p_d_d);
3342 if (rst::vectorNorm(outi_c_p_d_d, NORM_ONE) > zero) {
3343 *outStream <<
"\n\nINCORRECT matmatProductDataData (13): check scalar inverse property\n\n";
3347 art::matmatProductDataData<double>(in_c_p_d_d, data_c_p_one, in_p_d_d);
3348 art::matmatProductDataData<double>(out_c_p_d_d, data_c_1_d, in_p_d_d);
3349 art::matmatProductDataData<double>(outi_c_p_d_d, datainv_c_1_d, out_c_p_d_d);
3350 rst::subtract(outi_c_p_d_d, in_c_p_d_d);
3351 if (rst::vectorNorm(outi_c_p_d_d, NORM_ONE) > zero) {
3352 *outStream <<
"\n\nINCORRECT matmatProductDataData (14): check scalar inverse property\n\n";
3358 for (
unsigned int i=0; i<in_p_d_d.dimension(0); i++)
3359 for (
unsigned int j=0; j<in_p_d_d.dimension(1); j++)
3360 for (
unsigned int k=0; k<in_p_d_d.dimension(2); k++){
3361 in_p_d_d(i,j,k) = Teuchos::ScalarTraits<double>::random();
3363 for (
int ic=0; ic < c; ic++) {
3364 for (
int ip=0; ip < p; ip++) {
3365 for (
int i=0; i<d1; i++) {
3366 for (
int j=0; j<d1; j++) {
3367 data_c_p_d_d(ic, ip, i, j) = Teuchos::ScalarTraits<double>::random();
3374 for (
int ic=0; ic < c; ic++) {
3375 for (
int ip=0; ip < 1; ip++) {
3376 for (
int i=0; i<d1; i++) {
3377 for (
int j=0; j<d1; j++) {
3378 data_c_1_d_d(ic, 0, i, j) = Teuchos::ScalarTraits<double>::random();
3386 art::matmatProductDataData<double>(in_c_p_d_d, data_c_p_one, in_p_d_d);
3387 art::matmatProductDataData<double>(out_c_p_d_d, data_c_p_d_d, in_p_d_d);
3388 art::matmatProductDataData<double>(outi_c_p_d_d, datainv_c_p_d_d, out_c_p_d_d);
3389 rst::subtract(outi_c_p_d_d, in_c_p_d_d);
3390 if (rst::vectorNorm(outi_c_p_d_d, NORM_ONE) > zero) {
3391 *outStream <<
"\n\nINCORRECT matmatProductDataData (15): check matrix inverse property\n\n";
3394 art::matmatProductDataData<double>(in_c_p_d_d, data_c_p_one, in_p_d_d);
3395 art::matmatProductDataData<double>(out_c_p_d_d, data_c_p_d_d, in_p_d_d,
't');
3396 art::matmatProductDataData<double>(outi_c_p_d_d, datainv_c_p_d_d, out_c_p_d_d,
't');
3397 rst::subtract(outi_c_p_d_d, in_c_p_d_d);
3398 if (rst::vectorNorm(outi_c_p_d_d, NORM_ONE) > zero) {
3399 *outStream <<
"\n\nINCORRECT matmatProductDataData (16): check matrix inverse property, w/ double transpose\n\n";
3403 art::matmatProductDataData<double>(in_c_p_d_d, data_c_p_one, in_p_d_d);
3404 art::matmatProductDataData<double>(out_c_p_d_d, data_c_1_d_d, in_p_d_d);
3405 art::matmatProductDataData<double>(outi_c_p_d_d, datainv_c_1_d_d, out_c_p_d_d);
3406 rst::subtract(outi_c_p_d_d, in_c_p_d_d);
3407 if (rst::vectorNorm(outi_c_p_d_d, NORM_ONE) > zero) {
3408 *outStream <<
"\n\nINCORRECT matmatProductDataData (17): check matrix inverse property\n\n";
3411 art::matmatProductDataData<double>(in_c_p_d_d, data_c_p_one, in_p_d_d);
3412 art::matmatProductDataData<double>(out_c_p_d_d, data_c_1_d_d, in_p_d_d,
't');
3413 art::matmatProductDataData<double>(outi_c_p_d_d, datainv_c_1_d_d, out_c_p_d_d,
't');
3414 rst::subtract(outi_c_p_d_d, in_c_p_d_d);
3415 if (rst::vectorNorm(outi_c_p_d_d, NORM_ONE) > zero) {
3416 *outStream <<
"\n\nINCORRECT matmatProductDataData (18): check matrix inverse property, w/ double transpose\n\n";
3422 for (
unsigned int i=0; i<in_p_d_d.dimension(0); i++)
3423 for (
unsigned int j=0; j<in_p_d_d.dimension(1); j++)
3424 for (
unsigned int k=0; k<in_p_d_d.dimension(2); k++){
3425 in_p_d_d(i,j,k) = Teuchos::ScalarTraits<double>::random();
3427 for (
int ic=0; ic < c; ic++) {
3428 for (
int ip=0; ip < p; ip++) {
3429 for (
int i=0; i<d1; i++) {
3430 for (
int j=0; j<d1; j++) {
3431 data_c_p_d_d(ic, ip, i, j) = Teuchos::ScalarTraits<double>::random();
3439 for (
int ic=0; ic < c; ic++) {
3440 for (
int ip=0; ip < 1; ip++) {
3441 for (
int i=0; i<d1; i++) {
3442 for (
int j=0; j<d1; j++) {
3443 data_c_1_d_d(ic, 0, i, j) = Teuchos::ScalarTraits<double>::random();
3451 art::matmatProductDataData<double>(in_c_p_d_d, data_c_p_one, in_p_d_d);
3452 art::matmatProductDataData<double>(out_c_p_d_d, data_c_p_d_d, in_p_d_d);
3453 art::matmatProductDataData<double>(outi_c_p_d_d, datainvtrn_c_p_d_d, out_c_p_d_d,
't');
3454 rst::subtract(outi_c_p_d_d, in_c_p_d_d);
3455 if (rst::vectorNorm(outi_c_p_d_d, NORM_ONE) > zero) {
3456 *outStream <<
"\n\nINCORRECT matmatProductDataData (19): check matrix inverse transpose property\n\n";
3460 art::matmatProductDataData<double>(in_c_p_d_d, data_c_p_one, in_p_d_d);
3461 art::matmatProductDataData<double>(out_c_p_d_d, data_c_1_d_d, in_p_d_d);
3462 art::matmatProductDataData<double>(outi_c_p_d_d, datainvtrn_c_1_d_d, out_c_p_d_d,
't');
3463 rst::subtract(outi_c_p_d_d, in_c_p_d_d);
3464 if (rst::vectorNorm(outi_c_p_d_d, NORM_ONE) > zero) {
3465 *outStream <<
"\n\nINCORRECT matmatProductDataData (20): check matrix inverse transpose property\n\n";
3475 catch (std::logic_error err) {
3476 *outStream <<
"UNEXPECTED ERROR !!! ----------------------------------------------------------\n";
3477 *outStream << err.what() <<
'\n';
3478 *outStream <<
"-------------------------------------------------------------------------------" <<
"\n\n";
3484 std::cout <<
"End Result: TEST FAILED\n";
3486 std::cout <<
"End Result: TEST PASSED\n";
3489 std::cout.copyfmt(oldFormatState);
Header file for utility class to provide multidimensional containers.