49#ifndef Intrepid2_DerivedBasisFamily_h
50#define Intrepid2_DerivedBasisFamily_h
56#include "Intrepid2_DerivedBasis_HDIV_QUAD.hpp"
69#include "Intrepid2_SerendipityBasis.hpp"
88 template<
class LineBasisHGRAD,
class LineBasisHVOL,
class TriangleBasisFamily = EmptyBasisFamily,
class TetrahedronBasisFamily = EmptyBasisFamily>
92 using ExecutionSpace =
typename LineBasisHGRAD::ExecutionSpace;
93 using OutputValueType =
typename LineBasisHGRAD::OutputValueType;
94 using PointValueType =
typename LineBasisHGRAD::PointValueType;
96 using Basis =
typename LineBasisHGRAD::BasisBase;
97 using BasisPtr = Teuchos::RCP<Basis>;
101 using HGRAD_LINE = LineBasisHGRAD;
102 using HVOL_LINE = LineBasisHVOL;
107 using HDIV_QUAD = Basis_Derived_HDIV_QUAD <HGRAD_LINE, HVOL_LINE>;
108 using HVOL_QUAD = Basis_Derived_HVOL_QUAD <HVOL_LINE>;
113 using HDIV_HEX = Basis_Derived_HDIV_HEX <HGRAD_LINE, HVOL_LINE>;
114 using HVOL_HEX = Basis_Derived_HVOL_HEX <HVOL_LINE>;
117 using HGRAD_TRI =
typename TriangleBasisFamily::HGRAD;
118 using HCURL_TRI =
typename TriangleBasisFamily::HCURL;
119 using HDIV_TRI =
typename TriangleBasisFamily::HDIV;
120 using HVOL_TRI =
typename TriangleBasisFamily::HVOL;
123 using HGRAD_TET =
typename TetrahedronBasisFamily::HGRAD;
124 using HCURL_TET =
typename TetrahedronBasisFamily::HCURL;
125 using HDIV_TET =
typename TetrahedronBasisFamily::HDIV;
126 using HVOL_TET =
typename TetrahedronBasisFamily::HVOL;
131 using HDIV_WEDGE = Basis_Derived_HDIV_WEDGE < HDIV_TRI, HVOL_TRI, HGRAD_LINE, HVOL_LINE>;
132 using HVOL_WEDGE = Basis_Derived_HVOL_WEDGE < HVOL_TRI, HVOL_LINE>;
140 template<
class BasisFamily>
141 static typename BasisFamily::BasisPtr
getLineBasis(Intrepid2::EFunctionSpace fs,
int polyOrder,
const EPointType pointType=POINTTYPE_DEFAULT)
146 case FUNCTION_SPACE_HVOL:
return rcp(
new typename BasisFamily::HVOL_LINE (polyOrder,pointType));
147 case FUNCTION_SPACE_HGRAD:
return rcp(
new typename BasisFamily::HGRAD_LINE(polyOrder,pointType));
149 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
"Unsupported function space");
158 template<
class BasisFamily>
159 static typename BasisFamily::BasisPtr
getQuadrilateralBasis(Intrepid2::EFunctionSpace fs,
int polyOrder,
const EPointType pointType=POINTTYPE_DEFAULT)
164 case FUNCTION_SPACE_HVOL:
return rcp(
new typename BasisFamily::HVOL_QUAD (polyOrder,pointType));
165 case FUNCTION_SPACE_HCURL:
return rcp(
new typename BasisFamily::HCURL_QUAD(polyOrder,pointType));
166 case FUNCTION_SPACE_HDIV:
return rcp(
new typename BasisFamily::HDIV_QUAD (polyOrder,pointType));
167 case FUNCTION_SPACE_HGRAD:
return rcp(
new typename BasisFamily::HGRAD_QUAD(polyOrder,pointType));
169 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
"Unsupported function space");
179 template<
class BasisFamily>
180 static typename BasisFamily::BasisPtr
getQuadrilateralBasis(Intrepid2::EFunctionSpace fs,
int polyOrder_x,
int polyOrder_y,
const EPointType pointType=POINTTYPE_DEFAULT)
185 case FUNCTION_SPACE_HVOL:
return rcp(
new typename BasisFamily::HVOL_QUAD (polyOrder_x,polyOrder_y,pointType));
186 case FUNCTION_SPACE_HCURL:
return rcp(
new typename BasisFamily::HCURL_QUAD(polyOrder_x,polyOrder_y,pointType));
187 case FUNCTION_SPACE_HDIV:
return rcp(
new typename BasisFamily::HDIV_QUAD (polyOrder_x,polyOrder_y,pointType));
188 case FUNCTION_SPACE_HGRAD:
return rcp(
new typename BasisFamily::HGRAD_QUAD(polyOrder_x,polyOrder_y,pointType));
190 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
"Unsupported function space");
199 template<
class BasisFamily>
200 static typename BasisFamily::BasisPtr
getHexahedronBasis(Intrepid2::EFunctionSpace fs,
int polyOrder,
const EPointType pointType=POINTTYPE_DEFAULT)
205 case FUNCTION_SPACE_HVOL:
return rcp(
new typename BasisFamily::HVOL_HEX (polyOrder,pointType));
206 case FUNCTION_SPACE_HCURL:
return rcp(
new typename BasisFamily::HCURL_HEX(polyOrder,pointType));
207 case FUNCTION_SPACE_HDIV:
return rcp(
new typename BasisFamily::HDIV_HEX (polyOrder,pointType));
208 case FUNCTION_SPACE_HGRAD:
return rcp(
new typename BasisFamily::HGRAD_HEX(polyOrder,pointType));
210 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
"Unsupported function space");
219 template<
class BasisFamily>
220 static typename BasisFamily::BasisPtr
getHypercubeBasis_HGRAD(
int polyOrder,
int spaceDim,
const EPointType pointType=POINTTYPE_DEFAULT)
224 using BasisBase =
typename BasisFamily::HGRAD_LINE::BasisBase;
225 using BasisPtr =
typename BasisFamily::BasisPtr;
227 BasisPtr lineBasis = getLineBasis<BasisFamily>(FUNCTION_SPACE_HGRAD, polyOrder);
230 for (
int d=1; d<spaceDim; d++)
243 template<
class BasisFamily>
244 static typename BasisFamily::BasisPtr
getHypercubeBasis_HVOL(
int polyOrder,
int spaceDim,
const EPointType pointType=POINTTYPE_DEFAULT)
248 using BasisBase =
typename BasisFamily::HGRAD_LINE::BasisBase;
249 using BasisPtr =
typename BasisFamily::BasisPtr;
251 BasisPtr lineBasis = getLineBasis<BasisFamily>(FUNCTION_SPACE_HVOL, polyOrder);
254 for (
int d=1; d<spaceDim; d++)
269 template<
class BasisFamily>
270 static typename BasisFamily::BasisPtr
getHexahedronBasis(Intrepid2::EFunctionSpace fs,
int polyOrder_x,
int polyOrder_y,
int polyOrder_z,
const EPointType pointType=POINTTYPE_DEFAULT)
275 case FUNCTION_SPACE_HVOL:
return rcp(
new typename BasisFamily::HVOL_HEX (polyOrder_x,polyOrder_y,polyOrder_z,pointType));
276 case FUNCTION_SPACE_HCURL:
return rcp(
new typename BasisFamily::HCURL_HEX(polyOrder_x,polyOrder_y,polyOrder_z,pointType));
277 case FUNCTION_SPACE_HDIV:
return rcp(
new typename BasisFamily::HDIV_HEX (polyOrder_x,polyOrder_y,polyOrder_z,pointType));
278 case FUNCTION_SPACE_HGRAD:
return rcp(
new typename BasisFamily::HGRAD_HEX(polyOrder_x,polyOrder_y,polyOrder_z,pointType));
280 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
"Unsupported function space");
288 template<
class BasisFamily>
291 auto fullBasis = getHypercubeBasis_HGRAD<BasisFamily>(polyOrder, spaceDim);
293 using BasisBase =
typename BasisFamily::HGRAD_LINE::BasisBase;
296 return serendipityBasis;
303 template<
class BasisFamily>
306 auto fullBasis = getHypercubeBasis_HVOL<BasisFamily>(polyOrder, spaceDim);
308 using BasisBase =
typename BasisFamily::HGRAD_LINE::BasisBase;
311 return serendipityBasis;
319 template<
class BasisFamily>
320 static typename BasisFamily::BasisPtr
getTetrahedronBasis(Intrepid2::EFunctionSpace fs,
int polyOrder,
const EPointType pointType=POINTTYPE_DEFAULT)
325 case FUNCTION_SPACE_HVOL:
return rcp(
new typename BasisFamily::HVOL_TET (polyOrder,pointType));
326 case FUNCTION_SPACE_HCURL:
return rcp(
new typename BasisFamily::HCURL_TET(polyOrder,pointType));
327 case FUNCTION_SPACE_HDIV:
return rcp(
new typename BasisFamily::HDIV_TET (polyOrder,pointType));
328 case FUNCTION_SPACE_HGRAD:
return rcp(
new typename BasisFamily::HGRAD_TET(polyOrder,pointType));
330 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
"Unsupported function space");
339 template<
class BasisFamily>
340 static typename BasisFamily::BasisPtr
getTriangleBasis(Intrepid2::EFunctionSpace fs,
int polyOrder,
const EPointType pointType=POINTTYPE_DEFAULT)
345 case FUNCTION_SPACE_HVOL:
return rcp(
new typename BasisFamily::HVOL_TRI (polyOrder,pointType));
346 case FUNCTION_SPACE_HCURL:
return rcp(
new typename BasisFamily::HCURL_TRI(polyOrder,pointType));
347 case FUNCTION_SPACE_HDIV:
return rcp(
new typename BasisFamily::HDIV_TRI (polyOrder,pointType));
348 case FUNCTION_SPACE_HGRAD:
return rcp(
new typename BasisFamily::HGRAD_TRI(polyOrder,pointType));
350 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
"Unsupported function space");
359 template<
class BasisFamily>
360 static typename BasisFamily::BasisPtr
getWedgeBasis(Intrepid2::EFunctionSpace fs,
int polyOrder,
const EPointType pointType=POINTTYPE_DEFAULT)
365 case FUNCTION_SPACE_HVOL:
return rcp(
new typename BasisFamily::HVOL_WEDGE (polyOrder, pointType));
366 case FUNCTION_SPACE_HCURL:
return rcp(
new typename BasisFamily::HCURL_WEDGE(polyOrder, pointType));
367 case FUNCTION_SPACE_HDIV:
return rcp(
new typename BasisFamily::HDIV_WEDGE (polyOrder, pointType));
368 case FUNCTION_SPACE_HGRAD:
return rcp(
new typename BasisFamily::HGRAD_WEDGE(polyOrder, pointType));
370 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
"Unsupported function space");
379 template<
class BasisFamily>
380 static typename BasisFamily::BasisPtr
getWedgeBasis(Intrepid2::EFunctionSpace fs, ordinal_type polyOrder_xy, ordinal_type polyOrder_z,
const EPointType pointType=POINTTYPE_DEFAULT)
385 case FUNCTION_SPACE_HVOL:
return rcp(
new typename BasisFamily::HVOL_WEDGE (polyOrder_xy, polyOrder_z, pointType));
386 case FUNCTION_SPACE_HCURL:
return rcp(
new typename BasisFamily::HCURL_WEDGE(polyOrder_xy, polyOrder_z, pointType));
387 case FUNCTION_SPACE_HDIV:
return rcp(
new typename BasisFamily::HDIV_WEDGE (polyOrder_xy, polyOrder_z, pointType));
388 case FUNCTION_SPACE_HGRAD:
return rcp(
new typename BasisFamily::HGRAD_WEDGE(polyOrder_xy, polyOrder_z, pointType));
390 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
"Unsupported function space");
403 template<
class BasisFamily>
404 static typename BasisFamily::BasisPtr
getBasis(
const shards::CellTopology &cellTopo, Intrepid2::EFunctionSpace fs,
int polyOrder,
const EPointType pointType = POINTTYPE_DEFAULT)
407 switch (cellTopo.getBaseKey())
409 case shards::Line<>::key:
return getLineBasis<BasisFamily>(fs,polyOrder, pointType);
410 case shards::Quadrilateral<>::key:
return getQuadrilateralBasis<BasisFamily>(fs,polyOrder,pointType);
411 case shards::Triangle<>::key:
return getTriangleBasis<BasisFamily>(fs,polyOrder,pointType);
412 case shards::Hexahedron<>::key:
return getHexahedronBasis<BasisFamily>(fs,polyOrder,pointType);
413 case shards::Tetrahedron<>::key:
return getTetrahedronBasis<BasisFamily>(fs,polyOrder,pointType);
415 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
"Unsupported cell topology");
Header file for the abstract base class Intrepid2::Basis.
Teuchos::RCP< Basis< DeviceType, OutputType, PointType > > BasisPtr
Basis Pointer.
static BasisFamily::BasisPtr getSerendipityBasis_HGRAD(int polyOrder, int spaceDim)
Factory method for isotropic HGRAD Serendipity bases on a hypercube for the given family....
static BasisFamily::BasisPtr getWedgeBasis(Intrepid2::EFunctionSpace fs, int polyOrder, const EPointType pointType=POINTTYPE_DEFAULT)
Factory method for isotropic wedge bases in the given family.
static BasisFamily::BasisPtr getHypercubeBasis_HVOL(int polyOrder, int spaceDim, const EPointType pointType=POINTTYPE_DEFAULT)
Factory method for isotropic HVOL bases on a hypercube for the given family. Note that this will retu...
static BasisFamily::BasisPtr getHexahedronBasis(Intrepid2::EFunctionSpace fs, int polyOrder, const EPointType pointType=POINTTYPE_DEFAULT)
Factory method for isotropic bases on the hexahedron in the given family.
static BasisFamily::BasisPtr getQuadrilateralBasis(Intrepid2::EFunctionSpace fs, int polyOrder, const EPointType pointType=POINTTYPE_DEFAULT)
Factory method for isotropic quadrilateral bases in the given family.
static BasisFamily::BasisPtr getTetrahedronBasis(Intrepid2::EFunctionSpace fs, int polyOrder, const EPointType pointType=POINTTYPE_DEFAULT)
Factory method for isotropic tetrahedron bases in the given family.
static BasisFamily::BasisPtr getTriangleBasis(Intrepid2::EFunctionSpace fs, int polyOrder, const EPointType pointType=POINTTYPE_DEFAULT)
Factory method for isotropic triangle bases in the given family.
static BasisFamily::BasisPtr getHypercubeBasis_HGRAD(int polyOrder, int spaceDim, const EPointType pointType=POINTTYPE_DEFAULT)
Factory method for isotropic HGRAD bases on a hypercube for the given family. Note that this will ret...
static BasisFamily::BasisPtr getLineBasis(Intrepid2::EFunctionSpace fs, int polyOrder, const EPointType pointType=POINTTYPE_DEFAULT)
Factory method for line bases in the given family.
static BasisFamily::BasisPtr getSerendipityBasis_HVOL(int polyOrder, int spaceDim)
Factory method for isotropic HGRAD Serendipity bases on a hypercube for the given family....
static BasisFamily::BasisPtr getBasis(const shards::CellTopology &cellTopo, Intrepid2::EFunctionSpace fs, int polyOrder, const EPointType pointType=POINTTYPE_DEFAULT)
Factory method for isotropic bases in the given family on the specified cell topology.
Implementation of H(curl) 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...
Implementation of H(curl) basis on the wedge that is templated on H(grad,tri), H(curl,...
Implementation of H(div) basis on the hexahedron that is templated on H(vol) and H(grad) on the line.
Implementation of H(div) basis on the wedge that is templated on H(div,tri), H(vol,...
Implementation of H(grad) basis on the hexahedron that is templated on 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(grad) basis on the wedge 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.
Implementation of H(vol) basis on the quadrilateral that is templated on H(vol) on the line.
Implementation of H(vol) basis on the wedge 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.
Implementation of H(vol) basis on the quadrilateral that is templated on H(vol) on the line.
Basis defined as the tensor product of two component bases.
Device DeviceType
(Kokkos) Device type on which Basis is templated. Does not necessarily return true for Kokkos::is_dev...
A family of basis functions, constructed from H(vol) and H(grad) bases on the line.
EmptyBasisFamily allows us to set a default void family for a given topology.
Serendipity Basis, defined as the sub-basis of a provided basis, consisting of basis elements for whi...