Intrepid
http://trilinos.sandia.gov/packages/docs/r11.2/packages/intrepid/src/Discretization/TensorProductSpaceTools/Intrepid_TensorProductSpaceTools.hpp
Go to the documentation of this file.
00001 // @HEADER
00002 // ************************************************************************
00003 //
00004 //                           Intrepid Package
00005 //                 Copytest (2007) Sandia Corporation
00006 //
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 //
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Pavel Bochev (pbboche@sandia.gov) or
00025 //                    Denis Ridzal (dridzal@sandia.gov).
00026 //
00027 // ************************************************************************
00028 // @HEADER
00029 
00035 #ifndef INTREPID_TENSORPRODUCTSPACETOOLS_HPP
00036 #define INTREPID_TENSORPRODUCTSPACETOOLS_HPP
00037 
00038 #include "Intrepid_Basis.hpp"
00039 #include "Intrepid_FieldContainer.hpp"
00040 #include "Teuchos_Array.hpp"
00041 #include "Teuchos_RCP.hpp"
00042 
00043 using Teuchos::Array;
00044 using Teuchos::RCP;
00045 using Intrepid::FieldContainer;
00046 
00047 namespace Intrepid {
00048 
00055 class TensorProductSpaceTools
00056 {
00057 public:
00072   template<class Scalar, class ArrayTypeOut, class ArrayTypeCoeffs,
00073            class ArrayTypeBasis>
00074   static void evaluate(  ArrayTypeOut &vals ,
00075                          const ArrayTypeCoeffs &coeffs ,
00076                          const Array<RCP<ArrayTypeBasis> > &bases );
00077 
00078   // /** \brief Computes point values of a set of array-valued
00079   //            polynomials expressed in a  
00080   //            tensor product basis at output points.  The array
00081   //            <b>coeffs</b> is assumed to have dimensions (C,F1,F2),
00082   //         where F1 runs over the number of different polynomials per cell and
00083   //            F2 runs over the coefficients run over a tensor product
00084   //            basis (lowest space dimension runs fastest).  The
00085   //         Teuchos::Array of (pointers to) Arrays bases
00086   //         have the one-dimensional bases tabulated at the
00087   //            one-dimensional points.  The output array is (C,F1,P,D).
00088   //         This method assumes that the nodes for the basis coincide with
00089   //         the evaluation points, which leads to a big simplification.
00090              
00091   //      \param vals  [out] - output point values of the discrete function
00092   //      \param coeffs [in] - coefficients of the input function
00093   //      \param bases  [in] - one-dimensional bases tabulated at points
00094   //  */
00095   // template<class Scalar, class ArrayTypeOut, class ArrayTypeCoeffs,
00096   //       class ArrayTypeBasis>
00097   // static void evaluateCollocated(  ArrayTypeOut &vals ,
00098   //                               const ArrayTypeCoeffs &coeffs ,
00099   //                               const Array<Array<RCP<ArrayTypeBasis> > > &bases );
00100 
00117   template<class Scalar, class ArrayTypeOut, class ArrayTypeCoeffs,
00118            class ArrayTypeBasis>
00119   static void evaluateCollocated(  ArrayTypeOut &vals ,
00120                                    const ArrayTypeCoeffs &coeffs ,
00121                                    const Array<RCP<ArrayTypeBasis> > &bases );
00122 
00138   template<class Scalar, class ArrayTypeOut, class ArrayTypeCoeffs,
00139            class ArrayTypeBasis>
00140   static void evaluateGradient(  ArrayTypeOut &vals ,
00141                                  const ArrayTypeCoeffs &coeffs ,
00142                                  const Array<RCP<ArrayTypeBasis> > &bases ,
00143                                  const Array<RCP<ArrayTypeBasis> > &Dbases );
00144 
00162   template<class Scalar, class ArrayTypeOut, class ArrayTypeCoeffs,
00163            class ArrayTypeBasis>
00164   static void evaluateGradientCollocated( ArrayTypeOut &vals ,
00165                                           const ArrayTypeCoeffs &coeffs ,
00166                                           const Array<RCP<ArrayTypeBasis> > &bases ,
00167                                           const Array<RCP<ArrayTypeBasis> > &Dbases );
00168 
00179   template<class Scalar, class ArrayTypeOut, class ArrayTypeData,
00180            class ArrayTypeBasis, class ArrayTypeWeights>
00181   static void moments( ArrayTypeOut &vals ,
00182                        const ArrayTypeData &data ,
00183                        const Array<RCP<ArrayTypeBasis> > &basisVals ,
00184                        const Array<RCP<ArrayTypeWeights> > &wts );
00185 
00197   template<class Scalar, class ArrayTypeOut, class ArrayTypeData,
00198            class ArrayTypeBasis, class ArrayTypeWeights>
00199   static void momentsCollocated( ArrayTypeOut &vals ,
00200                                  const ArrayTypeData &data ,
00201                                  const Array<RCP<ArrayTypeBasis> > &basisVals ,
00202                        const Array<RCP<ArrayTypeWeights> > &wts );
00203 
00216   template<class Scalar, class ArrayTypeOut, class ArrayTypeData,
00217            class ArrayTypeBasis, class ArrayTypeWeights>
00218   static void momentsGrad( ArrayTypeOut &vals ,
00219                            const ArrayTypeData &data ,
00220                            const Array<RCP<ArrayTypeBasis> > &basisVals ,
00221                            const Array<RCP<ArrayTypeBasis> > &basisDVals ,
00222                            const Array<RCP<ArrayTypeWeights> > &wts );
00223 
00237   template<class Scalar, class ArrayTypeOut, class ArrayTypeData,
00238            class ArrayTypeBasis, class ArrayTypeWeights>
00239   static void momentsGradCollocated( ArrayTypeOut &vals ,
00240                                      const ArrayTypeData &data ,
00241                                      const Array<RCP<ArrayTypeBasis> > &basisVals ,
00242                                      const Array<RCP<ArrayTypeBasis> > &basisDVals ,
00243                                      const Array<RCP<ArrayTypeWeights> > &wts );
00244 
00245 
00246 private:
00247   template<class Scalar, class ArrayTypeOut, class ArrayTypeCoeffs,
00248            class ArrayTypeBasis>
00249   static void evaluate2D( ArrayTypeOut &vals ,
00250                           const ArrayTypeCoeffs &coeffs ,
00251                           const Array<RCP<ArrayTypeBasis> > &basisVals );
00252 
00253   template<class Scalar, class ArrayTypeOut, class ArrayTypeCoeffs,
00254            class ArrayTypeBasis>
00255   static void evaluate3D( ArrayTypeOut &vals ,
00256                           const ArrayTypeCoeffs &coeffs ,
00257                           const Array<RCP<ArrayTypeBasis> > &basisDVals );
00258 
00259   template<class Scalar, class ArrayTypeOut, class ArrayTypeCoeffs,
00260            class ArrayTypeBasis>
00261   static void evaluateCollocated2D( ArrayTypeOut &vals ,
00262                                     const ArrayTypeCoeffs &coeffs ,
00263                                     const Array<RCP<ArrayTypeBasis> > &basisVals );
00264 
00265   template<class Scalar, class ArrayTypeOut, class ArrayTypeCoeffs,
00266            class ArrayTypeBasis>
00267   static void evaluateCollocated3D( ArrayTypeOut &vals ,
00268                                     const ArrayTypeCoeffs &coeffs ,
00269                                     const Array<RCP<ArrayTypeBasis> > &basisDVals );
00270 
00271   template<class Scalar, class ArrayTypeOut, class ArrayTypeCoeffs,
00272            class ArrayTypeBasis>
00273   static void evaluateGradient2D( ArrayTypeOut &vals ,
00274                                   const ArrayTypeCoeffs &coeffs ,
00275                                   const Array<RCP<ArrayTypeBasis> > &basisVals ,
00276                                   const Array<RCP<ArrayTypeBasis> > &basisDVals );
00277 
00278   template<class Scalar, class ArrayTypeOut, class ArrayTypeCoeffs,
00279            class ArrayTypeBasis>
00280   static void evaluateGradient3D( ArrayTypeOut &vals ,
00281                                   const ArrayTypeCoeffs &coeffs ,
00282                                   const Array<RCP<ArrayTypeBasis> > &basisVals ,
00283                                   const Array<RCP<ArrayTypeBasis> > &basisDVals );
00284 
00285 
00286   template<class Scalar, class ArrayTypeOut, class ArrayTypeCoeffs,
00287            class ArrayTypeBasis>
00288   static void evaluateGradientCollocated2D( ArrayTypeOut &vals ,
00289                                   const ArrayTypeCoeffs &coeffs ,
00290                                   const Array<RCP<ArrayTypeBasis> > &basisVals ,
00291                                   const Array<RCP<ArrayTypeBasis> > &basisDVals );
00292 
00293   template<class Scalar, class ArrayTypeOut, class ArrayTypeCoeffs,
00294            class ArrayTypeBasis>
00295   static void evaluateGradientCollocated3D( ArrayTypeOut &vals ,
00296                                   const ArrayTypeCoeffs &coeffs ,
00297                                   const Array<RCP<ArrayTypeBasis> > &basisVals ,
00298                                   const Array<RCP<ArrayTypeBasis> > &basisDVals );
00299 
00300   template<class Scalar, class ArrayTypeOut, class ArrayTypeData,
00301            class ArrayTypeBasis, class ArrayTypeWeights>
00302   static void moments2D( ArrayTypeOut &vals ,
00303                          const ArrayTypeData &data ,
00304                          const Array<RCP<ArrayTypeBasis> > &basisVals ,
00305                          const Array<RCP<ArrayTypeWeights> > &wts );
00306 
00307   template<class Scalar, class ArrayTypeOut, class ArrayTypeData,
00308            class ArrayTypeBasis, class ArrayTypeWeights>
00309   static void moments3D( ArrayTypeOut &vals ,
00310                          const ArrayTypeData &data ,
00311                          const Array<RCP<ArrayTypeBasis> > &basisVals ,
00312                          const Array<RCP<ArrayTypeWeights> > &wts );
00313 
00314   template<class Scalar, class ArrayTypeOut, class ArrayTypeData,
00315            class ArrayTypeBasis, class ArrayTypeWeights>
00316   static void momentsCollocated2D( ArrayTypeOut &vals ,
00317                          const ArrayTypeData &data ,
00318                          const Array<RCP<ArrayTypeBasis> > &basisVals ,
00319                          const Array<RCP<ArrayTypeWeights> > &wts );
00320 
00321   template<class Scalar, class ArrayTypeOut, class ArrayTypeData,
00322            class ArrayTypeBasis, class ArrayTypeWeights>
00323   static void momentsCollocated3D( ArrayTypeOut &vals ,
00324                          const ArrayTypeData &data ,
00325                          const Array<RCP<ArrayTypeBasis> > &basisVals ,
00326                          const Array<RCP<ArrayTypeWeights> > &wts );
00327 
00328   template<class Scalar, class ArrayTypeOut, class ArrayTypeData,
00329            class ArrayTypeBasis, class ArrayTypeWeights>
00330   static void momentsGradCollocated2D( ArrayTypeOut &vals ,
00331                              const ArrayTypeData &data ,
00332                              const Array<RCP<ArrayTypeBasis> > &basisVals ,
00333                              const Array<RCP<ArrayTypeBasis> > &basisDVals ,
00334                              const Array<RCP<ArrayTypeWeights> > &wts );
00335 
00336   template<class Scalar, class ArrayTypeOut, class ArrayTypeData,
00337            class ArrayTypeBasis, class ArrayTypeWeights>
00338   static void momentsGradCollocated3D( ArrayTypeOut &vals ,
00339                              const ArrayTypeData &data ,
00340                              const Array<RCP<ArrayTypeBasis> > &basisVals ,
00341                              const Array<RCP<ArrayTypeBasis> > &basisDVals ,
00342                              const Array<RCP<ArrayTypeWeights> > &wts );
00343 
00344  template<class Scalar, class ArrayTypeOut, class ArrayTypeData,
00345            class ArrayTypeBasis, class ArrayTypeWeights>
00346   static void momentsGrad2D( ArrayTypeOut &vals ,
00347                              const ArrayTypeData &data ,
00348                              const Array<RCP<ArrayTypeBasis> > &basisVals ,
00349                              const Array<RCP<ArrayTypeBasis> > &basisDVals ,
00350                              const Array<RCP<ArrayTypeWeights> > &wts );
00351 
00352   template<class Scalar, class ArrayTypeOut, class ArrayTypeData,
00353            class ArrayTypeBasis, class ArrayTypeWeights>
00354   static void momentsGrad3D( ArrayTypeOut &vals ,
00355                              const ArrayTypeData &data ,
00356                              const Array<RCP<ArrayTypeBasis> > &basisVals ,
00357                              const Array<RCP<ArrayTypeBasis> > &basisDVals ,
00358                              const Array<RCP<ArrayTypeWeights> > &wts );
00359 };
00360 
00361 } //end namespace Intrepid
00362 
00363 #include "Intrepid_TensorProductSpaceToolsDef.hpp"
00364 #endif