Intrepid
Intrepid_TensorProductSpaceTools.hpp
Go to the documentation of this file.
1 // @HEADER
2 // ************************************************************************
3 //
4 // Intrepid Package
5 // Copytest (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 // This library is free software; you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as
12 // published by the Free Software Foundation; either version 2.1 of the
13 // License, or (at your option) any later version.
14 //
15 // This library is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
23 // USA
24 // Questions? Contact Pavel Bochev (pbboche@sandia.gov) or
25 // Denis Ridzal (dridzal@sandia.gov).
26 //
27 // ************************************************************************
28 // @HEADER
29 
35 #ifndef INTREPID_TENSORPRODUCTSPACETOOLS_HPP
36 #define INTREPID_TENSORPRODUCTSPACETOOLS_HPP
37 
38 #include "Intrepid_Basis.hpp"
40 #include "Teuchos_Array.hpp"
41 #include "Teuchos_RCP.hpp"
42 
43 using Teuchos::Array;
44 using Teuchos::RCP;
46 
47 namespace Intrepid {
48 
56 {
57 public:
72  template<class Scalar, class ArrayTypeOut, class ArrayTypeCoeffs,
73  class ArrayTypeBasis>
74  static void evaluate( ArrayTypeOut &vals ,
75  const ArrayTypeCoeffs &coeffs ,
76  const Array<RCP<ArrayTypeBasis> > &bases );
77 
78  // /** \brief Computes point values of a set of array-valued
79  // polynomials expressed in a
80  // tensor product basis at output points. The array
81  // <b>coeffs</b> is assumed to have dimensions (C,F1,F2),
82  // where F1 runs over the number of different polynomials per cell and
83  // F2 runs over the coefficients run over a tensor product
84  // basis (lowest space dimension runs fastest). The
85  // Teuchos::Array of (pointers to) Arrays bases
86  // have the one-dimensional bases tabulated at the
87  // one-dimensional points. The output array is (C,F1,P,D).
88  // This method assumes that the nodes for the basis coincide with
89  // the evaluation points, which leads to a big simplification.
90 
91  // \param vals [out] - output point values of the discrete function
92  // \param coeffs [in] - coefficients of the input function
93  // \param bases [in] - one-dimensional bases tabulated at points
94  // */
95  // template<class Scalar, class ArrayTypeOut, class ArrayTypeCoeffs,
96  // class ArrayTypeBasis>
97  // static void evaluateCollocated( ArrayTypeOut &vals ,
98  // const ArrayTypeCoeffs &coeffs ,
99  // const Array<Array<RCP<ArrayTypeBasis> > > &bases );
100 
117  template<class Scalar, class ArrayTypeOut, class ArrayTypeCoeffs,
118  class ArrayTypeBasis>
119  static void evaluateCollocated( ArrayTypeOut &vals ,
120  const ArrayTypeCoeffs &coeffs ,
121  const Array<RCP<ArrayTypeBasis> > &bases );
122 
138  template<class Scalar, class ArrayTypeOut, class ArrayTypeCoeffs,
139  class ArrayTypeBasis>
140  static void evaluateGradient( ArrayTypeOut &vals ,
141  const ArrayTypeCoeffs &coeffs ,
142  const Array<RCP<ArrayTypeBasis> > &bases ,
143  const Array<RCP<ArrayTypeBasis> > &Dbases );
144 
162  template<class Scalar, class ArrayTypeOut, class ArrayTypeCoeffs,
163  class ArrayTypeBasis>
164  static void evaluateGradientCollocated( ArrayTypeOut &vals ,
165  const ArrayTypeCoeffs &coeffs ,
166  const Array<RCP<ArrayTypeBasis> > &bases ,
167  const Array<RCP<ArrayTypeBasis> > &Dbases );
168 
179  template<class Scalar, class ArrayTypeOut, class ArrayTypeData,
180  class ArrayTypeBasis, class ArrayTypeWeights>
181  static void moments( ArrayTypeOut &vals ,
182  const ArrayTypeData &data ,
183  const Array<RCP<ArrayTypeBasis> > &basisVals ,
184  const Array<RCP<ArrayTypeWeights> > &wts );
185 
197  template<class Scalar, class ArrayTypeOut, class ArrayTypeData,
198  class ArrayTypeBasis, class ArrayTypeWeights>
199  static void momentsCollocated( ArrayTypeOut &vals ,
200  const ArrayTypeData &data ,
201  const Array<RCP<ArrayTypeBasis> > &basisVals ,
202  const Array<RCP<ArrayTypeWeights> > &wts );
203 
216  template<class Scalar, class ArrayTypeOut, class ArrayTypeData,
217  class ArrayTypeBasis, class ArrayTypeWeights>
218  static void momentsGrad( ArrayTypeOut &vals ,
219  const ArrayTypeData &data ,
220  const Array<RCP<ArrayTypeBasis> > &basisVals ,
221  const Array<RCP<ArrayTypeBasis> > &basisDVals ,
222  const Array<RCP<ArrayTypeWeights> > &wts );
223 
237  template<class Scalar, class ArrayTypeOut, class ArrayTypeData,
238  class ArrayTypeBasis, class ArrayTypeWeights>
239  static void momentsGradCollocated( ArrayTypeOut &vals ,
240  const ArrayTypeData &data ,
241  const Array<RCP<ArrayTypeBasis> > &basisVals ,
242  const Array<RCP<ArrayTypeBasis> > &basisDVals ,
243  const Array<RCP<ArrayTypeWeights> > &wts );
244 
245 
246 private:
247  template<class Scalar, class ArrayTypeOut, class ArrayTypeCoeffs,
248  class ArrayTypeBasis>
249  static void evaluate2D( ArrayTypeOut &vals ,
250  const ArrayTypeCoeffs &coeffs ,
251  const Array<RCP<ArrayTypeBasis> > &basisVals );
252 
253  template<class Scalar, class ArrayTypeOut, class ArrayTypeCoeffs,
254  class ArrayTypeBasis>
255  static void evaluate3D( ArrayTypeOut &vals ,
256  const ArrayTypeCoeffs &coeffs ,
257  const Array<RCP<ArrayTypeBasis> > &basisDVals );
258 
259  template<class Scalar, class ArrayTypeOut, class ArrayTypeCoeffs,
260  class ArrayTypeBasis>
261  static void evaluateCollocated2D( ArrayTypeOut &vals ,
262  const ArrayTypeCoeffs &coeffs ,
263  const Array<RCP<ArrayTypeBasis> > &basisVals );
264 
265  template<class Scalar, class ArrayTypeOut, class ArrayTypeCoeffs,
266  class ArrayTypeBasis>
267  static void evaluateCollocated3D( ArrayTypeOut &vals ,
268  const ArrayTypeCoeffs &coeffs ,
269  const Array<RCP<ArrayTypeBasis> > &basisDVals );
270 
271  template<class Scalar, class ArrayTypeOut, class ArrayTypeCoeffs,
272  class ArrayTypeBasis>
273  static void evaluateGradient2D( ArrayTypeOut &vals ,
274  const ArrayTypeCoeffs &coeffs ,
275  const Array<RCP<ArrayTypeBasis> > &basisVals ,
276  const Array<RCP<ArrayTypeBasis> > &basisDVals );
277 
278  template<class Scalar, class ArrayTypeOut, class ArrayTypeCoeffs,
279  class ArrayTypeBasis>
280  static void evaluateGradient3D( ArrayTypeOut &vals ,
281  const ArrayTypeCoeffs &coeffs ,
282  const Array<RCP<ArrayTypeBasis> > &basisVals ,
283  const Array<RCP<ArrayTypeBasis> > &basisDVals );
284 
285 
286  template<class Scalar, class ArrayTypeOut, class ArrayTypeCoeffs,
287  class ArrayTypeBasis>
288  static void evaluateGradientCollocated2D( ArrayTypeOut &vals ,
289  const ArrayTypeCoeffs &coeffs ,
290  const Array<RCP<ArrayTypeBasis> > &basisVals ,
291  const Array<RCP<ArrayTypeBasis> > &basisDVals );
292 
293  template<class Scalar, class ArrayTypeOut, class ArrayTypeCoeffs,
294  class ArrayTypeBasis>
295  static void evaluateGradientCollocated3D( ArrayTypeOut &vals ,
296  const ArrayTypeCoeffs &coeffs ,
297  const Array<RCP<ArrayTypeBasis> > &basisVals ,
298  const Array<RCP<ArrayTypeBasis> > &basisDVals );
299 
300  template<class Scalar, class ArrayTypeOut, class ArrayTypeData,
301  class ArrayTypeBasis, class ArrayTypeWeights>
302  static void moments2D( ArrayTypeOut &vals ,
303  const ArrayTypeData &data ,
304  const Array<RCP<ArrayTypeBasis> > &basisVals ,
305  const Array<RCP<ArrayTypeWeights> > &wts );
306 
307  template<class Scalar, class ArrayTypeOut, class ArrayTypeData,
308  class ArrayTypeBasis, class ArrayTypeWeights>
309  static void moments3D( ArrayTypeOut &vals ,
310  const ArrayTypeData &data ,
311  const Array<RCP<ArrayTypeBasis> > &basisVals ,
312  const Array<RCP<ArrayTypeWeights> > &wts );
313 
314  template<class Scalar, class ArrayTypeOut, class ArrayTypeData,
315  class ArrayTypeBasis, class ArrayTypeWeights>
316  static void momentsCollocated2D( ArrayTypeOut &vals ,
317  const ArrayTypeData &data ,
318  const Array<RCP<ArrayTypeBasis> > &basisVals ,
319  const Array<RCP<ArrayTypeWeights> > &wts );
320 
321  template<class Scalar, class ArrayTypeOut, class ArrayTypeData,
322  class ArrayTypeBasis, class ArrayTypeWeights>
323  static void momentsCollocated3D( ArrayTypeOut &vals ,
324  const ArrayTypeData &data ,
325  const Array<RCP<ArrayTypeBasis> > &basisVals ,
326  const Array<RCP<ArrayTypeWeights> > &wts );
327 
328  template<class Scalar, class ArrayTypeOut, class ArrayTypeData,
329  class ArrayTypeBasis, class ArrayTypeWeights>
330  static void momentsGradCollocated2D( ArrayTypeOut &vals ,
331  const ArrayTypeData &data ,
332  const Array<RCP<ArrayTypeBasis> > &basisVals ,
333  const Array<RCP<ArrayTypeBasis> > &basisDVals ,
334  const Array<RCP<ArrayTypeWeights> > &wts );
335 
336  template<class Scalar, class ArrayTypeOut, class ArrayTypeData,
337  class ArrayTypeBasis, class ArrayTypeWeights>
338  static void momentsGradCollocated3D( ArrayTypeOut &vals ,
339  const ArrayTypeData &data ,
340  const Array<RCP<ArrayTypeBasis> > &basisVals ,
341  const Array<RCP<ArrayTypeBasis> > &basisDVals ,
342  const Array<RCP<ArrayTypeWeights> > &wts );
343 
344  template<class Scalar, class ArrayTypeOut, class ArrayTypeData,
345  class ArrayTypeBasis, class ArrayTypeWeights>
346  static void momentsGrad2D( ArrayTypeOut &vals ,
347  const ArrayTypeData &data ,
348  const Array<RCP<ArrayTypeBasis> > &basisVals ,
349  const Array<RCP<ArrayTypeBasis> > &basisDVals ,
350  const Array<RCP<ArrayTypeWeights> > &wts );
351 
352  template<class Scalar, class ArrayTypeOut, class ArrayTypeData,
353  class ArrayTypeBasis, class ArrayTypeWeights>
354  static void momentsGrad3D( ArrayTypeOut &vals ,
355  const ArrayTypeData &data ,
356  const Array<RCP<ArrayTypeBasis> > &basisVals ,
357  const Array<RCP<ArrayTypeBasis> > &basisDVals ,
358  const Array<RCP<ArrayTypeWeights> > &wts );
359 };
360 
361 } //end namespace Intrepid
362 
364 #endif
365 
366 #if defined(Intrepid_SHOW_DEPRECATED_WARNINGS)
367 #ifdef __GNUC__
368 #warning "The Intrepid package is deprecated"
369 #endif
370 #endif
371 
Definition file for the Intrepid::TensorProductSpaceTools class.
static void evaluateGradient(ArrayTypeOut &vals, const ArrayTypeCoeffs &coeffs, const Array< RCP< ArrayTypeBasis > > &bases, const Array< RCP< ArrayTypeBasis > > &Dbases)
Given a polynomial expressed in a tensor product basis, evaluates the gradient at a tensor product of...
static void momentsGradCollocated(ArrayTypeOut &vals, const ArrayTypeData &data, const Array< RCP< ArrayTypeBasis > > &basisVals, const Array< RCP< ArrayTypeBasis > > &basisDVals, const Array< RCP< ArrayTypeWeights > > &wts)
Computes the moments of a collection of F1 data integrated against a list of functions tabulated at p...
Defines expert-level interfaces for the evaluation, differentiation and integration of finite element...
static void moments(ArrayTypeOut &vals, const ArrayTypeData &data, const Array< RCP< ArrayTypeBasis > > &basisVals, const Array< RCP< ArrayTypeWeights > > &wts)
Computes the moments of a set of data integrated against a basis tabulated at points.
static void momentsGrad(ArrayTypeOut &vals, const ArrayTypeData &data, const Array< RCP< ArrayTypeBasis > > &basisVals, const Array< RCP< ArrayTypeBasis > > &basisDVals, const Array< RCP< ArrayTypeWeights > > &wts)
Computes the moments of a collection of F1 data integrated against a list of functions tabulated at p...
Header file for utility class to provide multidimensional containers.
Header file for the abstract base class Intrepid::Basis.
static void evaluate(ArrayTypeOut &vals, const ArrayTypeCoeffs &coeffs, const Array< RCP< ArrayTypeBasis > > &bases)
Computes point values of a set of polynomials expressed in a tensor product basis at output points...
Implementation of a templated lexicographical container for a multi-indexed scalar quantity...
static void momentsCollocated(ArrayTypeOut &vals, const ArrayTypeData &data, const Array< RCP< ArrayTypeBasis > > &basisVals, const Array< RCP< ArrayTypeWeights > > &wts)
Computes the moments of a set of data integrated against a basis tabulated at points, assuming that the basis nodes and integration points coincide.
static void evaluateCollocated(ArrayTypeOut &vals, const ArrayTypeCoeffs &coeffs, const Array< RCP< ArrayTypeBasis > > &bases)
Computes point values of a set of array-valued polynomials expressed in a tensor product basis at out...
static void evaluateGradientCollocated(ArrayTypeOut &vals, const ArrayTypeCoeffs &coeffs, const Array< RCP< ArrayTypeBasis > > &bases, const Array< RCP< ArrayTypeBasis > > &Dbases)
Given a polynomial expressed in a tensor product basis, evaluates the gradient at a tensor product of...