Intrepid2
Intrepid2_ProjectionTools.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_PROJECTIONTOOLS_HPP__
48 #define __INTREPID2_PROJECTIONTOOLS_HPP__
49 
50 #include "Intrepid2_ConfigDefs.hpp"
51 #include "Intrepid2_Types.hpp"
52 #include "Intrepid2_Utils.hpp"
53 
54 #include "Shards_CellTopology.hpp"
55 #include "Shards_BasicTopologies.hpp"
56 
57 #include "Intrepid2_PointTools.hpp"
58 
59 #include "Intrepid2_Basis.hpp"
60 
61 // -- HGRAD family
65 
68 
69 // -- HCURL family
72 
76 
77 // -- HDIV family
80 
84 
85 // -- Lower order family
88 
91 
95 
99 
100 #include "Teuchos_LAPACK.hpp"
102 
104 
105 
106 
107 namespace Intrepid2 {
108 
109 namespace Experimental {
110 
111 
112 
168 template<typename ExecSpaceType>
170 public:
171 
172  enum EvalPointsType {BASIS, TARGET};
173 
174 
191  template<typename BasisType,
192  typename ortValueType, class ...ortProperties>
193  static void
194  getL2EvaluationPoints(typename BasisType::scalarViewType evaluationPoints,
195  const Kokkos::DynRankView<ortValueType, ortProperties...> cellOrientations,
196  const BasisType* cellBasis,
198  const EvalPointsType evalPointType = TARGET
199  );
200 
220  template<typename basisCoeffsValueType, class ...basisCoeffsProperties,
221  typename funValsValueType, class ...funValsProperties,
222  typename BasisType,
223  typename ortValueType, class ...ortProperties>
224  static void
225  getL2BasisCoeffs(Kokkos::DynRankView<basisCoeffsValueType,basisCoeffsProperties...> basisCoeffs,
226  const Kokkos::DynRankView<funValsValueType,funValsProperties...> targetAtEvalPoints,
227  const typename BasisType::scalarViewType evaluationPoints,
228  const Kokkos::DynRankView<ortValueType, ortProperties...> cellOrientations,
229  const BasisType* cellBasis,
231 
232 
252  template<typename BasisType,
253  typename ortValueType, class ...ortProperties>
254  static void
255  getHGradEvaluationPoints(typename BasisType::scalarViewType evaluationPoints,
256  typename BasisType::scalarViewType gradEvalPoints,
257  const Kokkos::DynRankView<ortValueType, ortProperties...> cellOrientations,
258  const BasisType* cellBasis,
260  const EvalPointsType evalPointType = TARGET
261  );
262 
286  template<typename basisCoeffsValueType, class ...basisCoeffsProperties,
287  typename funValsValueType, class ...funValsProperties,
288  typename BasisType,
289  typename ortValueType, class ...ortProperties>
290  static void
291  getHGradBasisCoeffs(Kokkos::DynRankView<basisCoeffsValueType,basisCoeffsProperties...> basisCoeffs,
292  const Kokkos::DynRankView<funValsValueType,funValsProperties...> targetAtEvalPoints,
293  const Kokkos::DynRankView<funValsValueType,funValsProperties...> targetGradAtGradEvalPoints,
294  const typename BasisType::scalarViewType evaluationPoints,
295  const typename BasisType::scalarViewType gradEvalPoints,
296  const Kokkos::DynRankView<ortValueType, ortProperties...> cellOrientations,
297  const BasisType* cellBasis,
299 
300 
320  template<typename BasisType,
321  typename ortValueType, class ...ortProperties>
322  static void
323  getHCurlEvaluationPoints(typename BasisType::scalarViewType evaluationPoints,
324  typename BasisType::scalarViewType curlEvalPoints,
325  const Kokkos::DynRankView<ortValueType, ortProperties...> cellOrientations,
326  const BasisType* cellBasis,
328  const EvalPointsType evalPointType = TARGET
329  );
330 
356  template<typename basisCoeffsValueType, class ...basisCoeffsProperties,
357  typename funValsValueType, class ...funValsProperties,
358  typename BasisType,
359  typename ortValueType, class ...ortProperties>
360  static void
361  getHCurlBasisCoeffs(Kokkos::DynRankView<basisCoeffsValueType,basisCoeffsProperties...> basisCoeffs,
362  const Kokkos::DynRankView<funValsValueType,funValsProperties...> targetAtEvalPoints,
363  const Kokkos::DynRankView<funValsValueType,funValsProperties...> targetCurlAtCurlEvalPoints,
364  const typename BasisType::scalarViewType evaluationPoints,
365  const typename BasisType::scalarViewType curlEvalPoints,
366  const Kokkos::DynRankView<ortValueType, ortProperties...> cellOrientations,
367  const BasisType* cellBasis,
369 
370 
390  template<typename BasisType,
391  typename ortValueType, class ...ortProperties>
392  static void
393  getHDivEvaluationPoints(typename BasisType::scalarViewType evaluationPoints,
394  typename BasisType::scalarViewType divEvalPoints,
395  const Kokkos::DynRankView<ortValueType, ortProperties...> cellOrientations,
396  const BasisType* cellBasis,
398  const EvalPointsType evalPointType = TARGET
399  );
400 
424  template<typename basisCoeffsValueType, class ...basisCoeffsProperties,
425  typename funValsValueType, class ...funValsProperties,
426  typename BasisType,
427  typename ortValueType, class ...ortProperties>
428  static void
429  getHDivBasisCoeffs(Kokkos::DynRankView<basisCoeffsValueType,basisCoeffsProperties...> basisCoeffs,
430  const Kokkos::DynRankView<funValsValueType,funValsProperties...> targetAtEvalPoints,
431  const Kokkos::DynRankView<funValsValueType,funValsProperties...> targetDivAtDivEvalPoints,
432  const typename BasisType::scalarViewType evaluationPoints,
433  const typename BasisType::scalarViewType divEvalPoints,
434  const Kokkos::DynRankView<ortValueType, ortProperties...> cellOrientations,
435  const BasisType* cellBasis,
437 
454  template<typename BasisType,
455  typename ortValueType, class ...ortProperties>
456  static void
457  getHVolEvaluationPoints(typename BasisType::scalarViewType evaluationPoints,
458  const Kokkos::DynRankView<ortValueType, ortProperties...> cellOrientations,
459  const BasisType* cellBasis,
461  const EvalPointsType evalPointType = TARGET
462  );
463 
482  template<typename basisCoeffsValueType, class ...basisCoeffsProperties,
483  typename funValsValueType, class ...funValsProperties,
484  typename BasisType,
485  typename ortValueType, class ...ortProperties>
486  static void
487  getHVolBasisCoeffs(Kokkos::DynRankView<basisCoeffsValueType,basisCoeffsProperties...> basisCoeffs,
488  const Kokkos::DynRankView<funValsValueType,funValsProperties...> targetAtEvalPoints,
489  const typename BasisType::scalarViewType evaluationPoints,
490  const Kokkos::DynRankView<ortValueType, ortProperties...> cellOrientations,
491  const BasisType* cellBasis,
493 
494 
495 
496 };
497 }
498 }
499 
500 
501 // include templated function definitions
507 
508 #endif
509 
510 
511 
512 
513 
Header file for the Intrepid2::Basis_HGRAD_LINE_Cn_FEM class.
Header file for the Intrepid2::Basis_HDIV_TET_I1_FEM class.
Header file for the Intrepid2::Basis_HCURL_HEX_In_FEM class.
Header file for the Intrepid2::Basis_HDIV_HEX_I1_FEM class.
Header file for the Intrepid2::Basis_HDIV_WEDGE_I1_FEM class.
static void getHDivBasisCoeffs(Kokkos::DynRankView< basisCoeffsValueType, basisCoeffsProperties...> basisCoeffs, const Kokkos::DynRankView< funValsValueType, funValsProperties...> targetAtEvalPoints, const Kokkos::DynRankView< funValsValueType, funValsProperties...> targetDivAtDivEvalPoints, const typename BasisType::scalarViewType evaluationPoints, const typename BasisType::scalarViewType divEvalPoints, const Kokkos::DynRankView< ortValueType, ortProperties...> cellOrientations, const BasisType *cellBasis, ProjectionStruct< ExecSpaceType, typename BasisType::scalarType > *projStruct)
Computes the basis coefficients of the HDiv projection of the target function.
Header file for the Intrepid2::Experimental::ProjectionTools containing definitions for HCURL project...
Header file for the Intrepid2::Basis_HDIV_HEX_In_FEM class.
static void getHGradBasisCoeffs(Kokkos::DynRankView< basisCoeffsValueType, basisCoeffsProperties...> basisCoeffs, const Kokkos::DynRankView< funValsValueType, funValsProperties...> targetAtEvalPoints, const Kokkos::DynRankView< funValsValueType, funValsProperties...> targetGradAtGradEvalPoints, const typename BasisType::scalarViewType evaluationPoints, const typename BasisType::scalarViewType gradEvalPoints, const Kokkos::DynRankView< ortValueType, ortProperties...> cellOrientations, const BasisType *cellBasis, ProjectionStruct< ExecSpaceType, typename BasisType::scalarType > *projStruct)
Computes the basis coefficients of the HGrad projection of the target function.
static void getHVolBasisCoeffs(Kokkos::DynRankView< basisCoeffsValueType, basisCoeffsProperties...> basisCoeffs, const Kokkos::DynRankView< funValsValueType, funValsProperties...> targetAtEvalPoints, const typename BasisType::scalarViewType evaluationPoints, const Kokkos::DynRankView< ortValueType, ortProperties...> cellOrientations, const BasisType *cellBasis, ProjectionStruct< ExecSpaceType, typename BasisType::scalarType > *projStruct)
Computes the basis coefficients of the HVol projection of the target function.
Header file for the Intrepid2::Experimental::ProjectionTools containing definitions for L2 projection...
Header function for Intrepid2::Util class and other utility functions.
static void getHCurlEvaluationPoints(typename BasisType::scalarViewType evaluationPoints, typename BasisType::scalarViewType curlEvalPoints, const Kokkos::DynRankView< ortValueType, ortProperties...> cellOrientations, const BasisType *cellBasis, ProjectionStruct< ExecSpaceType, typename BasisType::scalarType > *projStruct, const EvalPointsType evalPointType=TARGET)
Computes evaluation points for HCurl projection.
Header file for the Intrepid2::Basis_HGRAD_TRI_Cn_FEM class.
Header file for the Intrepid2::Basis_HVOL_LINE_Cn_FEM class.
Header file for the Intrepid2::Basis_HDIV_QUAD_I1_FEM class.
Header file for the Intrepid2::Basis_HCURL_TET_In_FEM class.
static void getL2EvaluationPoints(typename BasisType::scalarViewType evaluationPoints, const Kokkos::DynRankView< ortValueType, ortProperties...> cellOrientations, const BasisType *cellBasis, ProjectionStruct< ExecSpaceType, typename BasisType::scalarType > *projStruct, const EvalPointsType evalPointType=TARGET)
Computes evaluation points for L2 projection.
A class providing static members to perform projection-based interpolations:
Header file for the Intrepid2::Basis_HGRAD_TET_Cn_FEM class.
Header file for the Intrepid2::Basis_HDIV_TRI_I1_FEM class.
Header file for the Intrepid2::Basis_HDIV_QUAD_In_FEM class.
Header file for the Intrepid2::OrientationTools and Intrepid2::Impl::OrientationTools classes...
Header file for the Intrepid2::Basis_HCURL_QUAD_In_FEM class.
static void getL2BasisCoeffs(Kokkos::DynRankView< basisCoeffsValueType, basisCoeffsProperties...> basisCoeffs, const Kokkos::DynRankView< funValsValueType, funValsProperties...> targetAtEvalPoints, const typename BasisType::scalarViewType evaluationPoints, const Kokkos::DynRankView< ortValueType, ortProperties...> cellOrientations, const BasisType *cellBasis, ProjectionStruct< ExecSpaceType, typename BasisType::scalarType > *projStruct)
Computes the basis coefficients of the L2 projection of the target function.
Header file for the Intrepid2::Basis_HDIV_TRI_In_FEM class.
Header file for the Intrepid2::Experimental::ProjectionTools containing definitions for HDIV projecti...
Contains definitions of custom data types in Intrepid2.
Header file for the Intrepid2::Basis_HGRAD_QUAD_Cn_FEM class.
static void getHGradEvaluationPoints(typename BasisType::scalarViewType evaluationPoints, typename BasisType::scalarViewType gradEvalPoints, const Kokkos::DynRankView< ortValueType, ortProperties...> cellOrientations, const BasisType *cellBasis, ProjectionStruct< ExecSpaceType, typename BasisType::scalarType > *projStruct, const EvalPointsType evalPointType=TARGET)
Computes evaluation points for HGrad projection.
static void getHCurlBasisCoeffs(Kokkos::DynRankView< basisCoeffsValueType, basisCoeffsProperties...> basisCoeffs, const Kokkos::DynRankView< funValsValueType, funValsProperties...> targetAtEvalPoints, const Kokkos::DynRankView< funValsValueType, funValsProperties...> targetCurlAtCurlEvalPoints, const typename BasisType::scalarViewType evaluationPoints, const typename BasisType::scalarViewType curlEvalPoints, const Kokkos::DynRankView< ortValueType, ortProperties...> cellOrientations, const BasisType *cellBasis, ProjectionStruct< ExecSpaceType, typename BasisType::scalarType > *projStruct)
Computes the basis coefficients of the HCurl projection of the target function.
Header file for the Intrepid2::Basis_HDIV_TET_In_FEM class.
Header file for the Intrepid2::Experimental::ProjectionStruct.
Header file for the Intrepid2::Experimental::ProjectionTools containing definitions for HGRAD project...
Header file for the Intrepid2::Basis_HCURL_QUAD_I1_FEM class.
Header file for the Intrepid2::Basis_HCURL_WEDGE_I1_FEM class.
Header file for the Intrepid2::Basis_HCURL_TET_I1_FEM class.
static void getHVolEvaluationPoints(typename BasisType::scalarViewType evaluationPoints, const Kokkos::DynRankView< ortValueType, ortProperties...> cellOrientations, const BasisType *cellBasis, ProjectionStruct< ExecSpaceType, typename BasisType::scalarType > *projStruct, const EvalPointsType evalPointType=TARGET)
Computes evaluation points for HVol projection.
Header file for the Intrepid2::Basis_HCURL_HEX_I1_FEM class.
Header file for the Intrepid2::Experimental::ProjectionTools containing definitions for HVOL projecti...
static void getHDivEvaluationPoints(typename BasisType::scalarViewType evaluationPoints, typename BasisType::scalarViewType divEvalPoints, const Kokkos::DynRankView< ortValueType, ortProperties...> cellOrientations, const BasisType *cellBasis, ProjectionStruct< ExecSpaceType, typename BasisType::scalarType > *projStruct, const EvalPointsType evalPointType=TARGET)
Computes evaluation points for HDiv projection.
An helper class to compute the evaluation points and weights needed for performing projections...
Header file for the Intrepid2::Basis_HCURL_TRI_I1_FEM class.
Header file for the Intrepid2::Basis_HVOL_TRI_Cn_FEM class.
Header file for the abstract base class Intrepid2::Basis.
Header file for the Intrepid2::Basis_HCURL_TRI_In_FEM class.
Header file for Intrepid2::PointTools class to provide utilities for barycentric coordinates, equispaced lattices, and warp-blend point distrubtions.
Header file for the Intrepid2::Basis_HGRAD_HEX_Cn_FEM class.