52 template<
class Scalar,
class ArrayType>
58 template<
class Scalar,
class ArrayType>
64 template<
class Scalar,
class ArrayType,
class ArrayTypeJac>
66 const ArrayTypeJac & jacobianInverse,
74 for (
int c=0;c<inOutVals.dimension(0);c++)
76 for (
int f=0;f<inOutVals.dimension(1);f++)
78 for (
int p=0;p<inOutVals.dimension(2);p++)
80 for (
int d1=0;d1<inOutVals.dimension(3);d1++)
83 for (
int d2=0;d2<inOutVals.dimension(3);d2++)
85 tmp(d1) += jacobianInverse(c,p,d2,d1) * inOutVals(c,f,p,d2);
88 for (
int d1=0;d1<inOutVals.dimension(3);d1++)
90 inOutVals(c,f,p,d1) = tmp(d1);
96 else if (transpose ==
'N')
98 for (
int c=0;c<inOutVals.dimension(0);c++)
100 for (
int f=0;f<inOutVals.dimension(1);f++)
102 for (
int p=0;p<inOutVals.dimension(2);p++)
104 for (
int d1=0;d1<inOutVals.dimension(3);d1++)
107 for (
int d2=0;d2<inOutVals.dimension(3);d2++)
109 tmp(d1) += jacobianInverse(c,p,d1,d2) * inOutVals(c,f,p,d2);
112 for (
int d1=0;d1<inOutVals.dimension(3);d1++)
114 inOutVals(c,f,p,d1) = tmp(d1);
122 TEUCHOS_TEST_FOR_EXCEPTION(
true , std::invalid_argument ,
123 "Intrepid:FunctionSpaceToolsInPlace::HGRADtransformGRAD::Unknown transpose type" );
127 template<
class Scalar,
class ArrayType,
class ArrayTypeJac>
129 const ArrayTypeJac & jacobianInverse,
130 const char transpose)
133 if (transpose ==
'T')
137 else if (transpose ==
'N')
143 TEUCHOS_TEST_FOR_EXCEPTION(
true , std::invalid_argument ,
144 "Intrepid:FunctionSpaceToolsInPlace::HGRADtransformGRADDual::Unknown transpose type" );
146 FunctionSpaceToolsInPlace::HGRADtransformGRAD<Scalar,ArrayType,ArrayTypeJac>( inOutVals,
152 template<
class Scalar,
class ArrayType,
class ArrayTypeJac>
154 const ArrayTypeJac & jacobianInverse,
155 const char transpose)
157 FunctionSpaceToolsInPlace::HGRADtransformGRAD<Scalar,ArrayType,ArrayTypeJac>( inOutVals , jacobianInverse, transpose );
160 template<
class Scalar,
class ArrayType,
class ArrayTypeJac>
162 const ArrayTypeJac & jacobianInverse,
163 const char transpose)
166 if (transpose ==
'T')
170 else if (transpose ==
'N')
176 TEUCHOS_TEST_FOR_EXCEPTION(
true , std::invalid_argument ,
177 "Intrepid:FunctionSpaceToolsInPlace::HCURLtransformVALUEDual::Unknown transpose type" );
179 FunctionSpaceToolsInPlace::HCURLtransformVALUEDual<Scalar,ArrayType,ArrayTypeJac>(inOutVals,
185 template<
class Scalar,
class ArrayType,
class ArrayTypeJac,
class ArrayTypeDet>
187 const ArrayTypeJac & jacobian,
188 const ArrayTypeDet & jacobianDet,
189 const char transpose)
194 if (transpose ==
'T')
196 for (
int c=0;c<inOutVals.dimension(0);c++)
198 for (
int f=0;f<inOutVals.dimension(1);f++)
200 for (
int p=0;p<inOutVals.dimension(2);p++)
202 for (
int d1=0;d1<inOutVals.dimension(3);d1++)
205 for (
int d2=0;d2<inOutVals.dimension(3);d2++)
207 tmp(d1) += jacobian(c,p,d2,d1) * inOutVals(c,f,p,d2);
210 for (
int d1=0;d1<inOutVals.dimension(3);d1++)
212 inOutVals(c,f,p,d1) = tmp(d1) / jacobianDet(c,p);
218 else if (transpose ==
'N')
220 for (
int c=0;c<inOutVals.dimension(0);c++)
222 for (
int f=0;f<inOutVals.dimension(1);f++)
224 for (
int p=0;p<inOutVals.dimension(2);p++)
226 for (
int d1=0;d1<inOutVals.dimension(3);d1++)
229 for (
int d2=0;d2<inOutVals.dimension(3);d2++)
231 tmp(d1) += jacobian(c,p,d1,d2) * inOutVals(c,f,p,d2);
234 for (
int d1=0;d1<inOutVals.dimension(3);d1++)
236 inOutVals(c,f,p,d1) = tmp(d1) / jacobianDet(c,p);
244 TEUCHOS_TEST_FOR_EXCEPTION(
true , std::invalid_argument ,
245 "Intrepid:FunctionSpaceToolsInPlace::HCURLtransformCURL::Unknown transpose type" );
250 template<
class Scalar,
class ArrayType,
class ArrayTypeJac,
class ArrayTypeDet>
252 const ArrayTypeJac & jacobian,
253 const ArrayTypeDet & jacobianDet,
254 const char transpose)
257 if (transpose ==
'T')
261 else if (transpose ==
'N')
267 TEUCHOS_TEST_FOR_EXCEPTION(
true , std::invalid_argument ,
268 "Intrepid:FunctionSpaceToolsInPlace::HCURLtransformCURLDual::Unknown transpose type" );
270 FunctionSpaceToolsInPlace::HCURLtransformCURLDual<Scalar,ArrayType,ArrayTypeJac>(inOutVals,
276 template<
class Scalar,
class ArrayType,
class ArrayTypeJac,
class ArrayTypeDet>
278 const ArrayTypeJac & jacobian,
279 const ArrayTypeDet & jacobianDet,
280 const char transpose)
282 FunctionSpaceToolsInPlace::HCURLtransformCURL<Scalar,ArrayType,ArrayTypeJac,ArrayTypeDet>( inOutVals,jacobian,jacobianDet,transpose);
285 template<
class Scalar,
class ArrayType,
class ArrayTypeJac,
class ArrayTypeDet>
287 const ArrayTypeJac & jacobian,
288 const ArrayTypeDet & jacobianDet,
289 const char transpose)
292 if (transpose ==
'T')
296 else if (transpose ==
'N')
302 TEUCHOS_TEST_FOR_EXCEPTION(
true , std::invalid_argument ,
303 "FunctionSpaceToolsInPlace::HDIVtransformVALUEDual: invalid transpose character");
305 FunctionSpaceToolsInPlace::HDIVtransformVALUE<Scalar,ArrayType,ArrayTypeJac,ArrayTypeDet>( inOutVals,
311 template<
class Scalar,
class ArrayType,
class ArrayTypeDet>
313 const ArrayTypeDet & jacobianDet)
315 for (
int c=0;c<inOutVals.dimension(0);c++)
317 for (
int f=0;f<inOutVals.dimension(1);f++)
319 for (
int p=0;p<inOutVals.dimension(2);p++)
321 inOutVals(c,f,p) /= jacobianDet(c,p);
327 template<
class Scalar,
class ArrayType,
class ArrayTypeDet>
329 const ArrayTypeDet & jacobianDet)
331 FunctionSpaceToolsInPlace::HDIVtransformDIV<Scalar,ArrayType,ArrayTypeDet>( inOutVals ,
335 template<
class Scalar,
class ArrayType,
class ArrayTypeDet>
337 const ArrayTypeDet & jacobianDet)
339 FunctionSpaceToolsInPlace::HDIVtransformDIV<Scalar,ArrayType,ArrayTypeDet>( inOutVals,jacobianDet);
342 template<
class Scalar,
class ArrayType,
class ArrayTypeDet>
344 const ArrayTypeDet & jacobianDet)
351 template<
class Scalar,
class ArrayType,
class ArrayTypeMeasure>
352 void FunctionSpaceToolsInPlace::multiplyMeasure(ArrayType & inOutVals,
353 const ArrayTypeMeasure & inMeasure)
355 if (inOutVals.rank() == 2)
357 for (
int c=0;c<inOutVals.dimension(0);c++)
359 for (
int p=0;p<inOutVals.dimension(0);p++)
361 inOutVals(c,p) *= inMeasure(c,p);
365 else if (inOutVals.rank() == 3)
367 for (
int c=0;c<inOutVals.dimension(0);c++)
369 for (
int f=0;f<inOutVals.dimension(1);f++)
371 for (
int p=0;p<inOutVals.dimension(2);p++)
373 inOutVals(c,f,p) *= inMeasure(c,p);
378 else if (inOutVals.rank() == 4)
380 for (
int c=0;c<inOutVals.dimension(0);c++)
382 for (
int f=0;f<inOutVals.dimension(1);f++)
384 for (
int p=0;p<inOutVals.dimension(2);p++)
386 for (
int d=0;d<inOutVals.dimension(3);d++)
388 inOutVals(c,f,p,d) *= inMeasure(c,p);