Intrepid2
Intrepid2_SerendipityBasisFamily.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),
38 // Mauro Perego (mperego@sandia.gov), or
39 // Nate Roberts (nvrober@sandia.gov)
40 //
41 // ************************************************************************
42 // @HEADER
43 
49 #ifndef Intrepid2_SerendipityBasisFamily_h
50 #define Intrepid2_SerendipityBasisFamily_h
51 
52 #include "Intrepid2_Basis.hpp"
53 
56 #include "Intrepid2_DerivedBasis_HDIV_QUAD.hpp"
58 
63 
64 namespace Intrepid2 {
68  template<class FullBasis, int numPolyOrderArgs>
70  :
71  public SerendipityBasis<typename FullBasis::BasisBase>
72  {
73  public:
74  using BasisBase = typename FullBasis::BasisBase;
75  using BasisPtr = Teuchos::RCP<BasisBase>;
76  using DeviceType = typename BasisBase::DeviceType;
77  using ExecutionSpace = typename BasisBase::ExecutionSpace;
78  using OutputValueType = typename BasisBase::OutputValueType;
79  using PointValueType = typename BasisBase::PointValueType;
80 
81  using OrdinalTypeArray1D = typename BasisBase::OrdinalTypeArray1D;
82  using OrdinalTypeArray1DHost = typename BasisBase::OrdinalTypeArray1DHost;
83  using OrdinalTypeArray2DHost = typename BasisBase::OrdinalTypeArray2DHost;
84  using OutputViewType = typename BasisBase::OutputViewType;
85  using PointViewType = typename BasisBase::PointViewType;
86 
88  SerendipityBasisWrapper(int polyOrder, const EPointType pointType=POINTTYPE_DEFAULT)
89  :
90  SerendipityBasis<typename FullBasis::BasisBase>(Teuchos::rcp(new FullBasis(polyOrder)) )
91  {}
92 
94  template<bool M=(numPolyOrderArgs==2)>
95  SerendipityBasisWrapper(int polyOrder_x, int polyOrder_y, const EPointType pointType=POINTTYPE_DEFAULT, typename std::enable_if<M>::type* = 0)
96  :
97  SerendipityBasis<typename FullBasis::BasisBase>(Teuchos::rcp(new FullBasis(polyOrder_x, polyOrder_y)) )
98  {}
99 
101  template<bool M=(numPolyOrderArgs==3)>
102  SerendipityBasisWrapper(int polyOrder_x, int polyOrder_y, int polyOrder_z, const EPointType pointType=POINTTYPE_DEFAULT, typename std::enable_if<M>::type* = 0)
103  :
104  SerendipityBasis<typename FullBasis::BasisBase>(Teuchos::rcp(new FullBasis(polyOrder_x, polyOrder_y, polyOrder_z)) )
105  {}
106  };
107 
111  template<class LineBasisHGRAD, class LineBasisHVOL, class TriangleBasisFamily, class TetrahedronBasisFamily >
113  {
114  public:
115  using ExecutionSpace = typename LineBasisHGRAD::ExecutionSpace;
116  using OutputValueType = typename LineBasisHGRAD::OutputValueType;
117  using PointValueType = typename LineBasisHGRAD::PointValueType;
118 
119  using Basis = typename LineBasisHGRAD::BasisBase;
120  using BasisPtr = Teuchos::RCP<Basis>;
121  using DeviceType = typename Basis::DeviceType;
122 
123  // line bases
124  using HGRAD_LINE = LineBasisHGRAD;
125  using HVOL_LINE = LineBasisHVOL;
126 
127  // quadrilateral bases
132 
133  // hexahedron bases
138 
139  // triangle bases
140  using HGRAD_TRI = typename TriangleBasisFamily::HGRAD;
141  using HCURL_TRI = typename TriangleBasisFamily::HCURL;
142  using HDIV_TRI = typename TriangleBasisFamily::HDIV;
143  using HVOL_TRI = typename TriangleBasisFamily::HVOL;
144 
145  // tetrahedron bases
146  using HGRAD_TET = typename TetrahedronBasisFamily::HGRAD;
147  using HCURL_TET = typename TetrahedronBasisFamily::HCURL;
148  using HDIV_TET = typename TetrahedronBasisFamily::HDIV;
149  using HVOL_TET = typename TetrahedronBasisFamily::HVOL;
150  };
151 
155  template<typename DeviceType,
156  typename OutputScalar = double,
157  typename PointScalar = double>
162  >;
163 
170  template<typename DeviceType,
171  typename OutputScalar = double,
172  typename PointScalar = double>
177  >;
178 }
179 
180 #endif /* Intrepid2_HierarchicalBasisFamily_h */
SerendipityBasisWrapper(int polyOrder_x, int polyOrder_y, int polyOrder_z, const EPointType pointType=POINTTYPE_DEFAULT, typename std::enable_if< M >::type *=0)
three-argument constructor; enabled if numPolyOrderArgs is 3.
Serendipity Basis, defined as the sub-basis of a provided basis, consisting of basis elements for whi...
Serendipity basis family constructed using the DG hierarchical basis family.
SerendipityBasisWrapper(int polyOrder, const EPointType pointType=POINTTYPE_DEFAULT)
single-argument constructor, for isotropic bases.
Serendipity basis family constructed in terms of arbitrary bases on the line, triangle, and tetrahedron. (These must be hierarchical bases.)
Implementation of H(div) basis on the hexahedron that is templated on H(vol) and H(grad) on the line...
Implementation of H(curl) basis on the quadrilateral that is templated on H(vol) and H(grad) on the l...
Device DeviceType
(Kokkos) Device type on which Basis is templated. Does not necessarily return true for Kokkos::is_dev...
Helper class that allows SerendipityBasis construction with poly order arguments that are passed to t...
Implementation of H(curl) basis on the hexahedron that is templated on H(vol) and H(grad) on the line...
Implementation of H(grad) basis on the quadrilateral that is templated on H(grad) on the line...
Implementation of H(vol) basis on the hexahedron that is templated on H(vol) on the line...
Basis defining Legendre basis on the line, a polynomial subspace of L^2 (a.k.a. H(vol)) on the line...
SerendipityBasisWrapper(int polyOrder_x, int polyOrder_y, const EPointType pointType=POINTTYPE_DEFAULT, typename std::enable_if< M >::type *=0)
two-argument constructor; enabled if numPolyOrderArgs is 2.
Implementation of H(grad) basis on the hexahedron that is templated on H(grad) on the line...
Implementation of H(vol) basis on the quadrilateral that is templated on H(vol) on the line...
Header file for the abstract base class Intrepid2::Basis.