Intrepid
Intrepid_FunctionSpaceTools.hpp
Go to the documentation of this file.
1 // @HEADER
2 // ************************************************************************
3 //
4 // Intrepid Package
5 // Copyright (2007) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Pavel Bochev (pbboche@sandia.gov)
38 // Denis Ridzal (dridzal@sandia.gov), or
39 // Kara Peterson (kjpeter@sandia.gov)
40 //
41 // ************************************************************************
42 // @HEADER
43 
49 #ifndef INTREPID_FUNCTIONSPACETOOLS_HPP
50 #define INTREPID_FUNCTIONSPACETOOLS_HPP
51 
52 #include "Intrepid_ConfigDefs.hpp"
53 #include "Intrepid_ArrayTools.hpp"
56 #include "Intrepid_CellTools.hpp"
57 
58 #include <Intrepid_Rank.hpp>
59 
60 
61 namespace Intrepid {
62 
70  public:
106  template<class Scalar, class ArrayTypeOut, class ArrayTypeIn>
107  static void HGRADtransformVALUE(ArrayTypeOut & outVals,
108  const ArrayTypeIn & inVals);
109 /*
110  template<class Scalar, class ArrayTypeOut, class ArrayTypeIn>
111  static void HGRADtransformVALUETemp(ArrayTypeOut & outVals,
112  const ArrayTypeIn & inVals);*/
149  template<class Scalar, class ArrayTypeOut, class ArrayTypeJac, class ArrayTypeIn>
150  static void HGRADtransformGRAD(ArrayTypeOut & outVals,
151  const ArrayTypeJac & jacobianInverse,
152  const ArrayTypeIn & inVals,
153  const char transpose = 'T');
154  /*
155  template<class Scalar, class ArrayTypeOut, class ArrayTypeJac, class ArrayTypeIn>
156  static void HGRADtransformGRADTemp(ArrayTypeOut & outVals,
157  const ArrayTypeJac & jacobianInverse,
158  const ArrayTypeIn & inVals,
159  const char transpose = 'T');
160 */
196  template<class Scalar, class ArrayTypeOut, class ArrayTypeJac, class ArrayTypeIn>
197  static void HCURLtransformVALUE(ArrayTypeOut & outVals,
198  const ArrayTypeJac & jacobianInverse,
199  const ArrayTypeIn & inVals,
200  const char transpose = 'T');
201  /*
202  template<class Scalar, class ArrayTypeOut, class ArrayTypeJac, class ArrayTypeIn>
203  static void HCURLtransformVALUETemp(ArrayTypeOut & outVals,
204  const ArrayTypeJac & jacobianInverse,
205  const ArrayTypeIn & inVals,
206  const char transpose = 'T');*/
244  template<class Scalar, class ArrayTypeOut, class ArrayTypeJac, class ArrayTypeDet, class ArrayTypeIn>
245  static void HCURLtransformCURL(ArrayTypeOut & outVals,
246  const ArrayTypeJac & jacobian,
247  const ArrayTypeDet & jacobianDet,
248  const ArrayTypeIn & inVals,
249  const char transpose = 'N');
250  /*
251  template<class Scalar, class ArrayTypeOut, class ArrayTypeJac, class ArrayTypeDet, class ArrayTypeIn>
252  static void HCURLtransformCURLTemp(ArrayTypeOut & outVals,
253  const ArrayTypeJac & jacobian,
254  const ArrayTypeDet & jacobianDet,
255  const ArrayTypeIn & inVals,
256  const char transpose = 'N');*/
294  template<class Scalar, class ArrayTypeOut, class ArrayTypeJac, class ArrayTypeDet, class ArrayTypeIn>
295  static void HDIVtransformVALUE(ArrayTypeOut & outVals,
296  const ArrayTypeJac & jacobian,
297  const ArrayTypeDet & jacobianDet,
298  const ArrayTypeIn & inVals,
299  const char transpose = 'N');
300  /*
301  template<class Scalar, class ArrayTypeOut, class ArrayTypeJac, class ArrayTypeDet, class ArrayTypeIn>
302  static void HDIVtransformVALUETemp(ArrayTypeOut & outVals,
303  const ArrayTypeJac & jacobian,
304  const ArrayTypeDet & jacobianDet,
305  const ArrayTypeIn & inVals,
306  const char transpose = 'N');*/
343  template<class Scalar, class ArrayTypeOut, class ArrayTypeDet, class ArrayTypeIn>
344  static void HDIVtransformDIV(ArrayTypeOut & outVals,
345  const ArrayTypeDet & jacobianDet,
346  const ArrayTypeIn & inVals);
347  /*
348  template<class Scalar, class ArrayTypeOut, class ArrayTypeDet, class ArrayTypeIn>
349  static void HDIVtransformDIVTemp(ArrayTypeOut & outVals,
350  const ArrayTypeDet & jacobianDet,
351  const ArrayTypeIn & inVals);
352 */
389  template<class Scalar, class ArrayTypeOut, class ArrayTypeDet, class ArrayTypeIn>
390  static void HVOLtransformVALUE(ArrayTypeOut & outVals,
391  const ArrayTypeDet & jacobianDet,
392  const ArrayTypeIn & inVals);
393 
408  template<class Scalar>
409  static void integrate(Intrepid::FieldContainer<Scalar> & outputValues,
410  const Intrepid::FieldContainer<Scalar> & leftValues,
411  const Intrepid::FieldContainer<Scalar> & rightValues,
412  const ECompEngine compEngine,
413  const bool sumInto = false);
414 
415  template<class Scalar, class ArrayOut, class ArrayInLeft, class ArrayInRight>
416  static void integrate(ArrayOut & outputValues,
417  const ArrayInLeft & leftValues,
418  const ArrayInRight & rightValues,
419  const ECompEngine compEngine,
420  const bool sumInto = false);
421 
422  /* template<class Scalar, class ArrayOut, class ArrayInLeft, class ArrayInRight>
423  static void integrateTemp(ArrayOut & outputValues,
424  const ArrayInLeft & leftValues,
425  const ArrayInRight & rightValues,
426  const ECompEngine compEngine,
427  const bool sumInto = false);
428  */
429  template<class Scalar, class ArrayOut, class ArrayInLeft, class ArrayInRight,int leftrank,int outrank>
431 
455  template<class Scalar, class ArrayOutFields, class ArrayInFieldsLeft, class ArrayInFieldsRight>
456  static void operatorIntegral(ArrayOutFields & outputFields,
457  const ArrayInFieldsLeft & leftFields,
458  const ArrayInFieldsRight & rightFields,
459  const ECompEngine compEngine,
460  const bool sumInto = false);
461 /* template<class Scalar, class ArrayOutFields, class ArrayInFieldsLeft, class ArrayInFieldsRight>
462  static void operatorIntegralTemp(ArrayOutFields & outputFields,
463  const ArrayInFieldsLeft & leftFields,
464  const ArrayInFieldsRight & rightFields,
465  const ECompEngine compEngine,
466  const bool sumInto = false);*/
489  template<class Scalar, class ArrayOutFields, class ArrayInData, class ArrayInFields>
490  static void functionalIntegral(ArrayOutFields & outputFields,
491  const ArrayInData & inputData,
492  const ArrayInFields & inputFields,
493  const ECompEngine compEngine,
494  const bool sumInto = false);
495  /* template<class Scalar, class ArrayOutFields, class ArrayInData, class ArrayInFields>
496  static void functionalIntegralTemp(ArrayOutFields & outputFields,
497  const ArrayInData & inputData,
498  const ArrayInFields & inputFields,
499  const ECompEngine compEngine,
500  const bool sumInto = false);
501 */
521  template<class Scalar, class ArrayOutData, class ArrayInDataLeft, class ArrayInDataRight>
522  static void dataIntegral(ArrayOutData & outputData,
523  const ArrayInDataLeft & inputDataLeft,
524  const ArrayInDataRight & inputDataRight,
525  const ECompEngine compEngine,
526  const bool sumInto = false);
527  /* template<class Scalar, class ArrayOutData, class ArrayInDataLeft, class ArrayInDataRight>
528  static void dataIntegralTemp(ArrayOutData & outputData,
529  const ArrayInDataLeft & inputDataLeft,
530  const ArrayInDataRight & inputDataRight,
531  const ECompEngine compEngine,
532  const bool sumInto = false);
533 */
564  template<class Scalar, class ArrayOut, class ArrayDet, class ArrayWeights>
565  static void computeCellMeasure(ArrayOut & outVals,
566  const ArrayDet & inDet,
567  const ArrayWeights & inWeights);
568 
569  /*template<class Scalar, class ArrayOut, class ArrayDet, class ArrayWeights>
570  static void computeCellMeasureTemp(ArrayOut & outVals,
571  const ArrayDet & inDet,
572  const ArrayWeights & inWeights);*/
617  template<class Scalar, class ArrayOut, class ArrayJac, class ArrayWeights>
618  static void computeFaceMeasure(ArrayOut & outVals,
619  const ArrayJac & inJac,
620  const ArrayWeights & inWeights,
621  const int whichFace,
622  const shards::CellTopology & parentCell);
623 
624 /* template<class Scalar, class ArrayOut, class ArrayJac, class ArrayWeights>
625  static void computeFaceMeasureTemp(ArrayOut & outVals,
626  const ArrayJac & inJac,
627  const ArrayWeights & inWeights,
628  const int whichFace,
629  const shards::CellTopology & parentCell);*/
672  template<class Scalar, class ArrayOut, class ArrayJac, class ArrayWeights>
673  static void computeEdgeMeasure(ArrayOut & outVals,
674  const ArrayJac & inJac,
675  const ArrayWeights & inWeights,
676  const int whichEdge,
677  const shards::CellTopology & parentCell);
678 
679 /* template<class Scalar, class ArrayOut, class ArrayJac, class ArrayWeights>
680  static void computeEdgeMeasureTemp(ArrayOut & outVals,
681  const ArrayJac & inJac,
682  const ArrayWeights & inWeights,
683  const int whichEdge,
684  const shards::CellTopology & parentCell);*/
693  template<class Scalar, class ArrayTypeOut, class ArrayTypeMeasure, class ArrayTypeIn>
694  static void multiplyMeasure(ArrayTypeOut & outVals,
695  const ArrayTypeMeasure & inMeasure,
696  const ArrayTypeIn & inVals);
697  /* template<class Scalar, class ArrayTypeOut, class ArrayTypeMeasure, class ArrayTypeIn>
698  static void multiplyMeasureTemp(ArrayTypeOut & outVals,
699  const ArrayTypeMeasure & inMeasure,
700  const ArrayTypeIn & inVals);*/
734  template<class Scalar, class ArrayOutFields, class ArrayInData, class ArrayInFields>
735  static void scalarMultiplyDataField(ArrayOutFields & outputFields,
736  ArrayInData & inputData,
737  ArrayInFields & inputFields,
738  const bool reciprocal = false);
739 
772  template<class Scalar, class ArrayOutData, class ArrayInDataLeft, class ArrayInDataRight>
773  static void scalarMultiplyDataData(ArrayOutData & outputData,
774  ArrayInDataLeft & inputDataLeft,
775  ArrayInDataRight & inputDataRight,
776  const bool reciprocal = false);
777 
809  template<class Scalar, class ArrayOutFields, class ArrayInData, class ArrayInFields>
810  static void dotMultiplyDataField(ArrayOutFields & outputFields,
811  const ArrayInData & inputData,
812  const ArrayInFields & inputFields);
813 
844  template<class Scalar, class ArrayOutData, class ArrayInDataLeft, class ArrayInDataRight>
845  static void dotMultiplyDataData(ArrayOutData & outputData,
846  const ArrayInDataLeft & inputDataLeft,
847  const ArrayInDataRight & inputDataRight);
848 
883  template<class Scalar, class ArrayOutFields, class ArrayInData, class ArrayInFields>
884  static void vectorMultiplyDataField(ArrayOutFields & outputFields,
885  const ArrayInData & inputData,
886  const ArrayInFields & inputFields);
887 
921  template<class Scalar, class ArrayOutData, class ArrayInDataLeft, class ArrayInDataRight>
922  static void vectorMultiplyDataData(ArrayOutData & outputData,
923  const ArrayInDataLeft & inputDataLeft,
924  const ArrayInDataRight & inputDataRight);
925 
976  template<class Scalar, class ArrayOutFields, class ArrayInData, class ArrayInFields>
977  static void tensorMultiplyDataField(ArrayOutFields & outputFields,
978  const ArrayInData & inputData,
979  const ArrayInFields & inputFields,
980  const char transpose = 'N');
981 
1031  template<class Scalar, class ArrayOutData, class ArrayInDataLeft, class ArrayInDataRight>
1032  static void tensorMultiplyDataData(ArrayOutData & outputData,
1033  const ArrayInDataLeft & inputDataLeft,
1034  const ArrayInDataRight & inputDataRight,
1035  const char transpose = 'N');
1036 
1037 /* template<class Scalar, class ArrayOutData, class ArrayInDataLeft, class ArrayInDataRight>
1038  static void tensorMultiplyDataDataTemp(ArrayOutData & outputData,
1039  const ArrayInDataLeft & inputDataLeft,
1040  const ArrayInDataRight & inputDataRight,
1041  const char transpose = 'N');
1042  */
1043  template<class Scalar, class ArrayOutData, class ArrayInDataLeft, class ArrayInDataRight,int outvalRank>
1071  template<class Scalar, class ArrayTypeInOut, class ArrayTypeSign>
1072  static void applyLeftFieldSigns(ArrayTypeInOut & inoutOperator,
1073  const ArrayTypeSign & fieldSigns);
1074 
1101  template<class Scalar, class ArrayTypeInOut, class ArrayTypeSign>
1102  static void applyRightFieldSigns(ArrayTypeInOut & inoutOperator,
1103  const ArrayTypeSign & fieldSigns);
1104 
1127  template<class Scalar, class ArrayTypeInOut, class ArrayTypeSign>
1128  static void applyFieldSigns(ArrayTypeInOut & inoutFunction,
1129  const ArrayTypeSign & fieldSigns);
1130  /* template<class Scalar, class ArrayTypeInOut, class ArrayTypeSign>
1131  static void applyFieldSignsTemp(ArrayTypeInOut & inoutFunction,
1132  const ArrayTypeSign & fieldSigns);
1133 */
1169  template<class Scalar, class ArrayOutPointVals, class ArrayInCoeffs, class ArrayInFields>
1170  static void evaluate(ArrayOutPointVals & outPointVals,
1171  const ArrayInCoeffs & inCoeffs,
1172  const ArrayInFields & inFields);
1173 
1174 }; // end FunctionSpaceTools
1175 
1176 } // end namespace Intrepid
1177 
1178 // include templated definitions
1180 
1181 #endif
1182 
1183 /***************************************************************************************************
1184  ** **
1185  ** D O C U M E N T A T I O N P A G E S **
1186  ** **
1187  **************************************************************************************************/
1188 
static void computeEdgeMeasure(ArrayOut &outVals, const ArrayJac &inJac, const ArrayWeights &inWeights, const int whichEdge, const shards::CellTopology &parentCell)
Returns the weighted integration measures outVals with dimensions (C,P) used for the computation of e...
static void evaluate(ArrayOutPointVals &outPointVals, const ArrayInCoeffs &inCoeffs, const ArrayInFields &inFields)
Computes point values outPointVals of a discrete function specified by the basis inFields and coeffic...
static void HDIVtransformDIV(ArrayTypeOut &outVals, const ArrayTypeDet &jacobianDet, const ArrayTypeIn &inVals)
Transformation of a divergence field in the H-div space, defined at points on a reference cell...
static void dotMultiplyDataData(ArrayOutData &outputData, const ArrayInDataLeft &inputDataLeft, const ArrayInDataRight &inputDataRight)
Dot product of data and data; please read the description below.
static void tensorMultiplyDataData(ArrayOutData &outputData, const ArrayInDataLeft &inputDataLeft, const ArrayInDataRight &inputDataRight, const char transpose= 'N')
Matrix-vector or matrix-matrix product of data and data; please read the description below...
static void integrate(Intrepid::FieldContainer< Scalar > &outputValues, const Intrepid::FieldContainer< Scalar > &leftValues, const Intrepid::FieldContainer< Scalar > &rightValues, const ECompEngine compEngine, const bool sumInto=false)
Contracts leftValues and rightValues arrays on the point and possibly space dimensions and stores the...
Header file for the Intrepid::CellTools class.
static void scalarMultiplyDataData(ArrayOutData &outputData, ArrayInDataLeft &inputDataLeft, ArrayInDataRight &inputDataRight, const bool reciprocal=false)
Scalar multiplication of data and data; please read the description below.
static void multiplyMeasure(ArrayTypeOut &outVals, const ArrayTypeMeasure &inMeasure, const ArrayTypeIn &inVals)
Multiplies fields inVals by weighted measures inMeasure and returns the field array outVals; this is ...
static void HVOLtransformVALUE(ArrayTypeOut &outVals, const ArrayTypeDet &jacobianDet, const ArrayTypeIn &inVals)
Transformation of a (scalar) value field in the H-vol space, defined at points on a reference cell...
Header file for utility class to provide multidimensional containers.
static void applyRightFieldSigns(ArrayTypeInOut &inoutOperator, const ArrayTypeSign &fieldSigns)
Applies right (column) signs, stored in the user-provided container fieldSigns and indexed by (C...
Header file for utility class to provide array tools, such as tensor contractions, etc.
static void functionalIntegral(ArrayOutFields &outputFields, const ArrayInData &inputData, const ArrayInFields &inputFields, const ECompEngine compEngine, const bool sumInto=false)
Contracts the point (and space) dimensions P (and D1 and D2) of a rank-3, 4, or 5 container and a ran...
static void applyLeftFieldSigns(ArrayTypeInOut &inoutOperator, const ArrayTypeSign &fieldSigns)
Applies left (row) signs, stored in the user-provided container fieldSigns and indexed by (C...
static void HDIVtransformVALUE(ArrayTypeOut &outVals, const ArrayTypeJac &jacobian, const ArrayTypeDet &jacobianDet, const ArrayTypeIn &inVals, const char transpose= 'N')
Transformation of a (vector) value field in the H-div space, defined at points on a reference cell...
Defines expert-level interfaces for the evaluation of functions and operators in physical space (supp...
static void HCURLtransformVALUE(ArrayTypeOut &outVals, const ArrayTypeJac &jacobianInverse, const ArrayTypeIn &inVals, const char transpose= 'T')
Transformation of a (vector) value field in the H-curl space, defined at points on a reference cell...
static void dataIntegral(ArrayOutData &outputData, const ArrayInDataLeft &inputDataLeft, const ArrayInDataRight &inputDataRight, const ECompEngine compEngine, const bool sumInto=false)
Contracts the point (and space) dimensions P (and D1 and D2) of two rank-2, 3, or 4 containers with d...
Definition file for the Intrepid::FunctionSpaceTools class.
static void operatorIntegral(ArrayOutFields &outputFields, const ArrayInFieldsLeft &leftFields, const ArrayInFieldsRight &rightFields, const ECompEngine compEngine, const bool sumInto=false)
Contracts the point (and space) dimensions P (and D1 and D2) of two rank-3, 4, or 5 containers with d...
static void vectorMultiplyDataData(ArrayOutData &outputData, const ArrayInDataLeft &inputDataLeft, const ArrayInDataRight &inputDataRight)
Cross or outer product of data and data; please read the description below.
static void computeCellMeasure(ArrayOut &outVals, const ArrayDet &inDet, const ArrayWeights &inWeights)
Returns the weighted integration measures outVals with dimensions (C,P) used for the computation of c...
static void vectorMultiplyDataField(ArrayOutFields &outputFields, const ArrayInData &inputData, const ArrayInFields &inputFields)
Cross or outer product of data and fields; please read the description below.
Header file for classes providing basic linear algebra functionality in 1D, 2D and 3D...
static void dotMultiplyDataField(ArrayOutFields &outputFields, const ArrayInData &inputData, const ArrayInFields &inputFields)
Dot product of data and fields; please read the description below.
static void applyFieldSigns(ArrayTypeInOut &inoutFunction, const ArrayTypeSign &fieldSigns)
Applies field signs, stored in the user-provided container fieldSigns and indexed by (C...
static void tensorMultiplyDataField(ArrayOutFields &outputFields, const ArrayInData &inputData, const ArrayInFields &inputFields, const char transpose= 'N')
Matrix-vector or matrix-matrix product of data and fields; please read the description below...
static void HGRADtransformGRAD(ArrayTypeOut &outVals, const ArrayTypeJac &jacobianInverse, const ArrayTypeIn &inVals, const char transpose= 'T')
Transformation of a gradient field in the H-grad space, defined at points on a reference cell...
static void scalarMultiplyDataField(ArrayOutFields &outputFields, ArrayInData &inputData, ArrayInFields &inputFields, const bool reciprocal=false)
Scalar multiplication of data and fields; please read the description below.
static void HGRADtransformVALUE(ArrayTypeOut &outVals, const ArrayTypeIn &inVals)
Transformation of a (scalar) value field in the H-grad space, defined at points on a reference cell...
static void computeFaceMeasure(ArrayOut &outVals, const ArrayJac &inJac, const ArrayWeights &inWeights, const int whichFace, const shards::CellTopology &parentCell)
Returns the weighted integration measures outVals with dimensions (C,P) used for the computation of f...
static void HCURLtransformCURL(ArrayTypeOut &outVals, const ArrayTypeJac &jacobian, const ArrayTypeDet &jacobianDet, const ArrayTypeIn &inVals, const char transpose= 'N')
Transformation of a curl field in the H-curl space, defined at points on a reference cell...