Intrepid2
Intrepid2_ProjectionStruct.hpp
Go to the documentation of this file.
1 // @HEADER
2 // ************************************************************************
3 //
4 // Intrepid2 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 Kyungjoo Kim (kyukim@sandia.gov), or
38 // Mauro Perego (mperego@sandia.gov)
39 //
40 // ************************************************************************
41 // @HEADER
42 
47 #ifndef __INTREPID2_PROJECTIONSTRUCT_HPP__
48 #define __INTREPID2_PROJECTIONSTRUCT_HPP__
49 
50 #include "Intrepid2_ConfigDefs.hpp"
51 #include "Intrepid2_Types.hpp"
52 
53 namespace Intrepid2 {
54 
55 namespace Experimental {
56 
77 template<typename SpT, typename ValueType>
79 public:
80 
81  typedef Kokkos::pair<ordinal_type,ordinal_type> range_type;
82  typedef typename Kokkos::Impl::is_space<SpT>::host_mirror_space::execution_space host_space_type;
83  typedef Kokkos::DynRankView<ValueType,host_space_type> view_type;
84  typedef std::array<std::array<range_type, 12>,4> range_tag;
85  typedef std::array<std::array<view_type, 12>,4> view_tag;
86  typedef std::array<std::array<unsigned, 12>,4> key_tag;
87 
90  ordinal_type getNumBasisEvalPoints() {
91  return numBasisEvalPoints;
92  }
93 
96  ordinal_type getNumBasisDerivEvalPoints() {
97  return numBasisDerivEvalPoints;
98  }
99 
102  ordinal_type getNumTargetEvalPoints() {
103  return numTargetEvalPoints;
104  }
105 
109  return numTargetDerivEvalPoints;
110  }
111 
118  ordinal_type getNumBasisEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId) {
119  return basisCubPoints[subCellDim][subCellId].extent(0);
120  }
121 
128  ordinal_type getNumBasisDerivEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId) {
129  return basisDerivCubPoints[subCellDim][subCellId].extent(0);
130  }
131 
138  ordinal_type getNumTargetEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId) {
139  return targetCubPoints[subCellDim][subCellId].extent(0);
140  }
141 
148  ordinal_type getNumTargetDerivEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId) {
149  return targetDerivCubPoints[subCellDim][subCellId].extent(0);
150  }
151 
164  view_type getBasisEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId) {
165  return basisCubPoints[subCellDim][subCellId];
166  }
167 
180  view_type getBasisDerivEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId) {
181  return basisDerivCubPoints[subCellDim][subCellId];
182  }
183 
196  view_type getTargetEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId) {
197  return targetCubPoints[subCellDim][subCellId];
198  }
199 
212  view_type getTargetDerivEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId) {
213  return targetDerivCubPoints[subCellDim][subCellId];
214  }
215 
227  view_type getBasisEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId) {
228  return basisCubWeights[subCellDim][subCellId];
229  }
230 
242  view_type getBasisDerivEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId) {
243  return basisDerivCubWeights[subCellDim][subCellId];
244  }
245 
257  view_type getTargetEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId) {
258  return targetCubWeights[subCellDim][subCellId];
259  }
260 
272  view_type getTargetDerivEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId) {
273  return targetDerivCubWeights[subCellDim][subCellId];
274  }
275 
282  range_type getBasisPointsRange(const ordinal_type subCellDim, const ordinal_type subCellId) {
283  return basisPointsRange[subCellDim][subCellId];
284  }
285 
292  range_type getBasisDerivPointsRange(const ordinal_type subCellDim, const ordinal_type subCellId) {
293  return basisDerivPointsRange[subCellDim][subCellId];
294  }
295 
302  range_type getTargetPointsRange(const ordinal_type subCellDim, const ordinal_type subCellId) {
303  return targetPointsRange[subCellDim][subCellId];
304  }
305 
312  range_type getTargetDerivPointsRange(const ordinal_type subCellDim, const ordinal_type subCellId) {
313  return targetDerivPointsRange[subCellDim][subCellId];
314  }
315 
322  unsigned getTopologyKey(const ordinal_type subCellDim, const ordinal_type subCellId) {
323  return subCellTopologyKey[subCellDim][subCellId];
324  }
325 
330  template<typename BasisPtrType>
331  void createL2ProjectionStruct(const BasisPtrType cellBasis,
332  const ordinal_type targetCubDegree);
333 
339  template<typename BasisPtrType>
340  void createHGradProjectionStruct(const BasisPtrType cellBasis,
341  const ordinal_type targetCubDegree,
342  const ordinal_type targetGradCubDegre);
343 
349  template<typename BasisPtrType>
350  void createHCurlProjectionStruct(const BasisPtrType cellBasis,
351  const ordinal_type targetCubDegree,
352  const ordinal_type targetCurlCubDegre);
353 
359  template<typename BasisPtrType>
360  void createHDivProjectionStruct(const BasisPtrType cellBasis,
361  const ordinal_type targetCubDegree,
362  const ordinal_type targetDivCubDegre);
363 
368  template<typename BasisPtrType>
369  void createHVolProjectionStruct(const BasisPtrType cellBasis,
370  const ordinal_type targetCubDegree);
371 
372  key_tag subCellTopologyKey;
373  range_tag basisPointsRange;
374  range_tag basisDerivPointsRange;
375  range_tag targetPointsRange;
376  range_tag targetDerivPointsRange;
377  view_tag basisCubPoints;
378  view_tag basisCubWeights;
379  view_tag basisDerivCubPoints;
380  view_tag basisDerivCubWeights;
381  view_tag targetCubPoints;
382  view_tag targetCubWeights;
383  view_tag targetDerivCubPoints;
384  view_tag targetDerivCubWeights;
385  ordinal_type numBasisEvalPoints;
386  ordinal_type numBasisDerivEvalPoints;
387  ordinal_type numTargetEvalPoints;
388  ordinal_type numTargetDerivEvalPoints;
389 };
390 
391 }
392 }
394 #endif
395 
396 
397 
398 
399 
range_type getTargetDerivPointsRange(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the range of the target function derivative evaluation points corresponding to a subcell...
unsigned getTopologyKey(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the key of a subcell topology.
void createL2ProjectionStruct(const BasisPtrType cellBasis, const ordinal_type targetCubDegree)
Initialize the ProjectionStruct for L2 projections.
void createHDivProjectionStruct(const BasisPtrType cellBasis, const ordinal_type targetCubDegree, const ordinal_type targetDivCubDegre)
Initialize the ProjectionStruct for HDIV projections.
ordinal_type getNumTargetEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns number of points where to evaluate the target function on a subcell.
ordinal_type getNumBasisEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns number of basis evaluation points on a subcell.
range_type getTargetPointsRange(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the range of the target function evaluation points corresponding to a subcell.
view_type getTargetDerivEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the points where to evaluate the derivatives of the target function on a subcell.
view_type getTargetEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the function evaluation weights on a subcell.
view_type getTargetDerivEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the function derivatives evaluation weights on a subcell.
view_type getBasisEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the basis evaluation points on a subcell.
ordinal_type getNumTargetDerivEvalPoints()
Returns number of points where to evaluate the derivatives of the target function.
Contains definitions of custom data types in Intrepid2.
ordinal_type getNumBasisDerivEvalPoints()
Returns number of evaluation points for basis derivatives.
void createHVolProjectionStruct(const BasisPtrType cellBasis, const ordinal_type targetCubDegree)
Initialize the ProjectionStruct for HVOL (local-L2) projection.
void createHCurlProjectionStruct(const BasisPtrType cellBasis, const ordinal_type targetCubDegree, const ordinal_type targetCurlCubDegre)
Initialize the ProjectionStruct for HCURL projections.
void createHGradProjectionStruct(const BasisPtrType cellBasis, const ordinal_type targetCubDegree, const ordinal_type targetGradCubDegre)
Initialize the ProjectionStruct for HGRAD projections.
ordinal_type getNumTargetDerivEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns number of points where to evaluate the derivatives of the target function on a subcell...
view_type getBasisDerivEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the evaluation points for basis derivatives on a subcell.
ordinal_type getNumBasisEvalPoints()
Returns number of basis evaluation points.
view_type getBasisDerivEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the basis derivatives evaluation weights on a subcell.
view_type getTargetEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the points where to evaluate the target function on a subcell.
An helper class to compute the evaluation points and weights needed for performing projections...
ordinal_type getNumTargetEvalPoints()
Returns number of points where to evaluate the target function.
view_type getBasisEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the basis evaluation weights on a subcell.
range_type getBasisPointsRange(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the range of the basis evaluation points corresponding to a subcell.
ordinal_type getNumBasisDerivEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns number of evaluation points for basis derivatives on a subcell.
Header file for the Intrepid2::Experimental::ProjectionStruct containing definitions.
range_type getBasisDerivPointsRange(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the range of the basis derivative evaluation points corresponding to a subcell.