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 #ifdef HAVE_INTREPID2_KOKKOSKERNELS
106 #include "KokkosBatched_QR_Serial_Internal.hpp"
107 #include "KokkosBatched_ApplyQ_Serial_Internal.hpp"
108 #include "KokkosBatched_Trsv_Serial_Internal.hpp"
109 #include "KokkosBatched_Util.hpp"
110 #endif
111 
112 namespace Intrepid2 {
113 
114 namespace Experimental {
115 
116 
117 
182 template<typename ExecSpaceType>
184 public:
185 
186  using EvalPointsType = typename ProjectionStruct<ExecSpaceType, double>::EvalPointsType;
187 
188 
205  template<typename BasisType,
206  typename ortValueType, class ...ortProperties>
207  static void
208  getL2EvaluationPoints(typename BasisType::ScalarViewType evaluationPoints,
209  const Kokkos::DynRankView<ortValueType, ortProperties...> cellOrientations,
210  const BasisType* cellBasis,
212  const EvalPointsType evalPointType = EvalPointsType::TARGET
213  );
214 
234  template<typename basisCoeffsValueType, class ...basisCoeffsProperties,
235  typename funValsValueType, class ...funValsProperties,
236  typename BasisType,
237  typename ortValueType, class ...ortProperties>
238  static void
239  getL2BasisCoeffs(Kokkos::DynRankView<basisCoeffsValueType,basisCoeffsProperties...> basisCoeffs,
240  const Kokkos::DynRankView<funValsValueType,funValsProperties...> targetAtEvalPoints,
241  const typename BasisType::ScalarViewType evaluationPoints,
242  const Kokkos::DynRankView<ortValueType, ortProperties...> cellOrientations,
243  const BasisType* cellBasis,
245 
246 
266  template<typename BasisType,
267  typename ortValueType, class ...ortProperties>
268  static void
269  getHGradEvaluationPoints(typename BasisType::ScalarViewType evaluationPoints,
270  typename BasisType::ScalarViewType gradEvalPoints,
271  const Kokkos::DynRankView<ortValueType, ortProperties...> cellOrientations,
272  const BasisType* cellBasis,
274  const EvalPointsType evalPointType = EvalPointsType::TARGET
275  );
276 
300  template<typename basisCoeffsValueType, class ...basisCoeffsProperties,
301  typename funValsValueType, class ...funValsProperties,
302  typename BasisType,
303  typename ortValueType, class ...ortProperties>
304  static void
305  getHGradBasisCoeffs(Kokkos::DynRankView<basisCoeffsValueType,basisCoeffsProperties...> basisCoeffs,
306  const Kokkos::DynRankView<funValsValueType,funValsProperties...> targetAtEvalPoints,
307  const Kokkos::DynRankView<funValsValueType,funValsProperties...> targetGradAtGradEvalPoints,
308  const typename BasisType::ScalarViewType evaluationPoints,
309  const typename BasisType::ScalarViewType gradEvalPoints,
310  const Kokkos::DynRankView<ortValueType, ortProperties...> cellOrientations,
311  const BasisType* cellBasis,
313 
314 
334  template<typename BasisType,
335  typename ortValueType, class ...ortProperties>
336  static void
337  getHCurlEvaluationPoints(typename BasisType::ScalarViewType evaluationPoints,
338  typename BasisType::ScalarViewType curlEvalPoints,
339  const Kokkos::DynRankView<ortValueType, ortProperties...> cellOrientations,
340  const BasisType* cellBasis,
342  const EvalPointsType evalPointType = EvalPointsType::TARGET
343  );
344 
370  template<typename basisCoeffsValueType, class ...basisCoeffsProperties,
371  typename funValsValueType, class ...funValsProperties,
372  typename BasisType,
373  typename ortValueType, class ...ortProperties>
374  static void
375  getHCurlBasisCoeffs(Kokkos::DynRankView<basisCoeffsValueType,basisCoeffsProperties...> basisCoeffs,
376  const Kokkos::DynRankView<funValsValueType,funValsProperties...> targetAtEvalPoints,
377  const Kokkos::DynRankView<funValsValueType,funValsProperties...> targetCurlAtCurlEvalPoints,
378  const typename BasisType::ScalarViewType evaluationPoints,
379  const typename BasisType::ScalarViewType curlEvalPoints,
380  const Kokkos::DynRankView<ortValueType, ortProperties...> cellOrientations,
381  const BasisType* cellBasis,
383 
384 
404  template<typename BasisType,
405  typename ortValueType, class ...ortProperties>
406  static void
407  getHDivEvaluationPoints(typename BasisType::ScalarViewType evaluationPoints,
408  typename BasisType::ScalarViewType divEvalPoints,
409  const Kokkos::DynRankView<ortValueType, ortProperties...> cellOrientations,
410  const BasisType* cellBasis,
412  const EvalPointsType evalPointType = EvalPointsType::TARGET
413  );
414 
438  template<typename basisCoeffsValueType, class ...basisCoeffsProperties,
439  typename funValsValueType, class ...funValsProperties,
440  typename BasisType,
441  typename ortValueType, class ...ortProperties>
442  static void
443  getHDivBasisCoeffs(Kokkos::DynRankView<basisCoeffsValueType,basisCoeffsProperties...> basisCoeffs,
444  const Kokkos::DynRankView<funValsValueType,funValsProperties...> targetAtEvalPoints,
445  const Kokkos::DynRankView<funValsValueType,funValsProperties...> targetDivAtDivEvalPoints,
446  const typename BasisType::ScalarViewType evaluationPoints,
447  const typename BasisType::ScalarViewType divEvalPoints,
448  const Kokkos::DynRankView<ortValueType, ortProperties...> cellOrientations,
449  const BasisType* cellBasis,
451 
468  template<typename BasisType,
469  typename ortValueType, class ...ortProperties>
470  static void
471  getHVolEvaluationPoints(typename BasisType::ScalarViewType evaluationPoints,
472  const Kokkos::DynRankView<ortValueType, ortProperties...> cellOrientations,
473  const BasisType* cellBasis,
475  const EvalPointsType evalPointType = EvalPointsType::TARGET
476  );
477 
496  template<typename basisCoeffsValueType, class ...basisCoeffsProperties,
497  typename funValsValueType, class ...funValsProperties,
498  typename BasisType,
499  typename ortValueType, class ...ortProperties>
500  static void
501  getHVolBasisCoeffs(Kokkos::DynRankView<basisCoeffsValueType,basisCoeffsProperties...> basisCoeffs,
502  const Kokkos::DynRankView<funValsValueType,funValsProperties...> targetAtEvalPoints,
503  const typename BasisType::ScalarViewType evaluationPoints,
504  const Kokkos::DynRankView<ortValueType, ortProperties...> cellOrientations,
505  const BasisType* cellBasis,
507 
508 
518  struct ElemSystem {
519 
520 
521  std::string systemName_;
522  bool matrixIndependentOfCell_;
523 
531  ElemSystem (std::string systemName, bool matrixIndependentOfCell) :
532  systemName_(systemName), matrixIndependentOfCell_(matrixIndependentOfCell){};
533 
534 
535 
561  template<typename ViewType1, typename ViewType2, typename ViewType3, typename ViewType4>
562  void solve(ViewType1 basisCoeffs, ViewType2 elemMat, ViewType2 elemRhs, ViewType2 tau,
563  ViewType3 w,const ViewType4 elemDof, ordinal_type n, ordinal_type m=0) {
564 #ifdef HAVE_INTREPID2_KOKKOSKERNELS
565  solveParallel(basisCoeffs, elemMat, elemRhs, tau,
566  w, elemDof, n, m);
567 #else
568  solveSerial(basisCoeffs, elemMat, elemRhs, tau,
569  w, elemDof, n, m);
570 #endif
571 
572  }
573 
576 #ifdef HAVE_INTREPID2_KOKKOSKERNELS
577  template<typename ViewType1, typename ViewType2, typename ViewType3, typename ViewType4>
578  void solveParallel(ViewType1 basisCoeffs, ViewType2 elemMat, ViewType2 elemRhs, ViewType2 taul,
579  ViewType3 work,const ViewType4 elemDof, ordinal_type n, ordinal_type m) {
580 
581  ordinal_type numCells = basisCoeffs.extent(0);
582 
583  if(matrixIndependentOfCell_) {
584  auto A0 = Kokkos::subview(elemMat, 0, Kokkos::ALL(), Kokkos::ALL());
585  auto tau0 = Kokkos::subview(taul, 0, Kokkos::ALL());
586 
587  auto A0_host = Kokkos::create_mirror_view_and_copy(typename ExecSpaceType::memory_space(), A0);
588  auto tau0_host = Kokkos::create_mirror_view(typename ExecSpaceType::memory_space(), tau0);
589 
590 
591  for(ordinal_type i=n; i<n+m; ++i)
592  for(ordinal_type j=0; j<n; ++j)
593  A0_host(i,j) = A0_host(j,i);
594 
595  auto w0_host = Kokkos::create_mirror_view(Kokkos::subview(work, 0, Kokkos::ALL()));
596 
597  //computing QR of A0. QR is saved in A0 and tau0
598  KokkosBatched::SerialQR_Internal::invoke(A0_host.extent(0), A0_host.extent(1),
599  A0_host.data(), A0_host.stride_0(), A0_host.stride_1(),
600  tau0_host.data(), tau0_host.stride_0(), w0_host.data());
601 
602  Kokkos::deep_copy(A0, A0_host);
603  Kokkos::deep_copy(tau0, tau0_host);
604 
605  Kokkos::parallel_for (systemName_,
606  Kokkos::RangePolicy<ExecSpaceType, int> (0, numCells),
607  KOKKOS_LAMBDA (const size_t ic) {
608  auto w = Kokkos::subview(work, ic, Kokkos::ALL());
609 
610  auto b = Kokkos::subview(elemRhs, ic, Kokkos::ALL());
611 
612  //b'*Q0 -> b
613  KokkosBatched::SerialApplyQ_RightNoTransForwardInternal::invoke(
614  1, A0.extent(0), A0.extent(1),
615  A0.data(), A0.stride_0(), A0.stride_1(),
616  tau0.data(), tau0.stride_0(),
617  b.data(), 1, b.stride_0(),
618  w.data());
619 
620  // R0^{-1} b -> b
621  KokkosBatched::SerialTrsvInternalUpper<KokkosBatched::Algo::Trsv::Unblocked>::invoke(false,
622  A0.extent(0),
623  1.0,
624  A0.data(), A0.stride_0(), A0.stride_1(),
625  b.data(), b.stride_0());
626 
627  //scattering b into the basis coefficients
628  for(ordinal_type i=0; i<n; ++i){
629  basisCoeffs(ic,elemDof(i)) = b(i);
630  }
631  });
632 
633  } else {
634 
635  Kokkos::parallel_for (systemName_,
636  Kokkos::RangePolicy<ExecSpaceType, int> (0, numCells),
637  KOKKOS_LAMBDA (const size_t ic) {
638 
639  auto A = Kokkos::subview(elemMat, ic, Kokkos::ALL(), Kokkos::ALL());
640  auto tau = Kokkos::subview(taul, ic, Kokkos::ALL());
641  auto w = Kokkos::subview(work, ic, Kokkos::ALL());
642 
643  for(ordinal_type i=n; i<n+m; ++i)
644  for(ordinal_type j=0; j<n; ++j)
645  A(i,j) = A(j,i);
646 
647  //computing QR of A. QR is saved in A and tau
648  KokkosBatched::SerialQR_Internal::invoke(A.extent(0), A.extent(1),
649  A.data(), A.stride_0(), A.stride_1(), tau.data(), tau.stride_0(), w.data());
650 
651  auto b = Kokkos::subview(elemRhs, ic, Kokkos::ALL());
652 
653  //b'*Q -> b
654  KokkosBatched::SerialApplyQ_RightNoTransForwardInternal::invoke(
655  1, A.extent(0), A.extent(1),
656  A.data(), A.stride_0(), A.stride_1(),
657  tau.data(), tau.stride_0(),
658  b.data(), 1, b.stride_0(),
659  w.data());
660 
661  // R^{-1} b -> b
662  KokkosBatched::SerialTrsvInternalUpper<KokkosBatched::Algo::Trsv::Unblocked>::invoke(false,
663  A.extent(0),
664  1.0,
665  A.data(), A.stride_0(), A.stride_1(),
666  b.data(), b.stride_0());
667 
668  //scattering b into the basis coefficients
669  for(ordinal_type i=0; i<n; ++i){
670  basisCoeffs(ic,elemDof(i)) = b(i);
671  }
672  });
673  }
674  }
675 #endif
676 
680  template<typename ViewType1, typename ViewType2, typename ViewType3, typename ViewType4>
681  void solveSerial(ViewType1 basisCoeffs, ViewType2 elemMat, ViewType2 elemRhs, ViewType2 ,
682  ViewType3, const ViewType4 elemDof, ordinal_type n, ordinal_type m) {
683  using valueType = typename ViewType2::value_type;
684  using host_space_type = typename Kokkos::Impl::is_space<ExecSpaceType>::host_mirror_space::execution_space;
685  Kokkos::View<valueType**,Kokkos::LayoutLeft,host_space_type>
686  serialElemMat("serialElemMat", n+m, n+m);
687  Teuchos::LAPACK<ordinal_type,valueType> lapack_;
688  ordinal_type numCells = basisCoeffs.extent(0);
689 
690  if(matrixIndependentOfCell_) {
691  ViewType2 elemRhsTrans("transRhs", elemRhs.extent(1), elemRhs.extent(0));
692  Kokkos::View<valueType**,Kokkos::LayoutLeft,host_space_type>
693  pivVec("pivVec", m+n + std::max(m+n, numCells), 1);
694 
695  Kokkos::View<valueType**,Kokkos::LayoutLeft,host_space_type> serialElemRhs("serialElemRhs", n+m, numCells);
696 
697  auto A = Kokkos::create_mirror_view_and_copy(typename ExecSpaceType::memory_space(),
698  Kokkos::subview(elemMat, 0, Kokkos::ALL(), Kokkos::ALL()));
699  auto b = Kokkos::create_mirror_view_and_copy(typename ExecSpaceType::memory_space(), elemRhs);
700 
701  auto serialBasisCoeffs = Kokkos::create_mirror_view_and_copy(
702  typename ExecSpaceType::memory_space(), basisCoeffs);
703 
704  for(ordinal_type i=0; i<m+n; ++i) {
705  for(ordinal_type ic=0; ic< numCells; ++ic)
706  serialElemRhs(i,ic) = b(ic,i);
707  for(ordinal_type j=0; j<n; ++j)
708  serialElemMat(j,i) = A(j,i);
709  }
710 
711  for(ordinal_type i=n; i<n+m; ++i)
712  for(ordinal_type j=0; j<n; ++j)
713  serialElemMat(i,j) = serialElemMat(j,i);
714 
715  ordinal_type info = 0;
716  lapack_.GELS('N', n+m, n+m, numCells,
717  serialElemMat.data(), serialElemMat.stride_1(),
718  serialElemRhs.data(), serialElemRhs.stride_1(),
719  pivVec.data(), pivVec.extent(0),
720  &info);
721 
722  for(ordinal_type i=0; i<n; ++i) {
723  for (ordinal_type ic = 0; ic < numCells; ic++)
724  serialBasisCoeffs(ic,elemDof(i)) = serialElemRhs(i,ic);
725  }
726  }
727  else {
728  Kokkos::View<valueType**,Kokkos::LayoutLeft,host_space_type> pivVec("pivVec", 2*(m+n), 1);
729  Kokkos::View<valueType**,Kokkos::LayoutLeft,host_space_type> serialElemRhs("serialElemRhs", n+m, 1 );
730  for (ordinal_type ic = 0; ic < numCells; ic++) {
731  auto A = Kokkos::create_mirror_view_and_copy(typename ExecSpaceType::memory_space(),
732  Kokkos::subview(elemMat, ic, Kokkos::ALL(), Kokkos::ALL()));
733  auto b = Kokkos::create_mirror_view_and_copy(typename ExecSpaceType::memory_space(),
734  Kokkos::subview(elemRhs, ic, Kokkos::ALL()));
735  auto basisCoeffs_ = Kokkos::subview(basisCoeffs, ic, Kokkos::ALL());
736  auto serialBasisCoeffs = Kokkos::create_mirror_view_and_copy(typename ExecSpaceType::memory_space(),
737  basisCoeffs_);
738 
739  Kokkos::deep_copy(serialElemMat,valueType(0)); //LAPACK might overwrite the matrix
740 
741  for(ordinal_type i=0; i<m+n; ++i) {
742  serialElemRhs(i,0) = b(i);
743  for(ordinal_type j=0; j<n; ++j)
744  serialElemMat(j,i) = A(j,i);
745  }
746 
747  for(ordinal_type i=n; i<n+m; ++i)
748  for(ordinal_type j=0; j<n; ++j)
749  serialElemMat(i,j) = serialElemMat(j,i);
750 
751  // Using GELS because the matrix can be close to singular.
752  ordinal_type info = 0;
753  lapack_.GELS('N', n+m, n+m, 1,
754  serialElemMat.data(), serialElemMat.stride_1(),
755  serialElemRhs.data(), serialElemRhs.stride_1(),
756  pivVec.data(), pivVec.extent(0),
757  &info);
758 
759  if (info) {
760  std::stringstream ss;
761  ss << ">>> ERROR (Intrepid::ProjectionTools::getBasisCoeffs): "
762  << "LAPACK return with error code: "
763  << info;
764  INTREPID2_TEST_FOR_EXCEPTION( true, std::runtime_error, ss.str().c_str() );
765  }
766 
767  for(ordinal_type i=0; i<n; ++i) {
768  serialBasisCoeffs(elemDof(i)) = serialElemRhs(i,0);
769  }
770  Kokkos::deep_copy(basisCoeffs_,serialBasisCoeffs);
771  }
772  }
773  }
774  };
775 
776 };
777 
778 } //Experimental
779 } //Intrepid2
780 
781 
782 // include templated function definitions
788 
789 #endif
790 
791 
792 
793 
794 
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::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.
Header file for the Intrepid2::Experimental::ProjectionTools containing definitions for HCURL project...
Header file for the Intrepid2::Basis_HDIV_HEX_In_FEM class.
Header file for the Intrepid2::Experimental::ProjectionTools containing definitions for L2 projection...
void solve(ViewType1 basisCoeffs, ViewType2 elemMat, ViewType2 elemRhs, ViewType2 tau, ViewType3 w, const ViewType4 elemDof, ordinal_type n, ordinal_type m=0)
Solve the system and returns the basis coefficients solve the system either using Kokkos Kernel QR or...
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.
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.
Header function for Intrepid2::Util class and other utility functions.
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.
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.
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=EvalPointsType::TARGET)
Computes evaluation points for HDiv projection.
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 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=EvalPointsType::TARGET)
Computes evaluation points for HCurl projection.
Header file for the Intrepid2::Basis_HDIV_TRI_In_FEM class.
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.
Class to solve a square system A x = b on each cell A is expected to be saddle a point (KKT) matrix o...
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.
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...
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=EvalPointsType::TARGET)
Computes evaluation points for L2 projection.
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=EvalPointsType::TARGET)
Computes evaluation points for HGrad projection.
ElemSystem(std::string systemName, bool matrixIndependentOfCell)
Functor constructor.
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.
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 getHVolEvaluationPoints(typename BasisType::ScalarViewType evaluationPoints, const Kokkos::DynRankView< ortValueType, ortProperties...> cellOrientations, const BasisType *cellBasis, ProjectionStruct< ExecSpaceType, typename BasisType::scalarType > *projStruct, const EvalPointsType evalPointType=EvalPointsType::TARGET)
Computes evaluation points for HVol 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.
void solveSerial(ViewType1 basisCoeffs, ViewType2 elemMat, ViewType2 elemRhs, ViewType2, ViewType3, const ViewType4 elemDof, ordinal_type n, ordinal_type m)
Parallel implementation of solve, using Kokkos Kernels QR factoriation.
Header file for the Intrepid2::Basis_HVOL_TRI_Cn_FEM class.
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 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.