30 #ifndef Intrepid2_DerivedBasis_HDIV_WEDGE_h
31 #define Intrepid2_DerivedBasis_HDIV_WEDGE_h
33 #include <Kokkos_DynRankView.hpp>
43 template<
class HDIV_TRI,
class HVOL_LINE>
49 using OutputViewType =
typename HVOL_LINE::OutputViewType;
50 using PointViewType =
typename HVOL_LINE::PointViewType ;
51 using ScalarViewType =
typename HVOL_LINE::ScalarViewType;
53 using TriDivBasis = HDIV_TRI;
54 using LineHVolBasis = HVOL_LINE;
56 using BasisBase =
typename HVOL_LINE::BasisBase;
59 using DeviceType =
typename BasisBase::DeviceType;
60 using ExecutionSpace =
typename BasisBase::ExecutionSpace;
61 using OutputValueType =
typename BasisBase::OutputValueType;
62 using PointValueType =
typename BasisBase::PointValueType;
71 TensorBasis(Teuchos::rcp( new TriDivBasis(polyOrder_xy, pointType) ),
72 Teuchos::rcp( new LineHVolBasis(polyOrder_z-1, pointType) ))
74 this->functionSpace_ = FUNCTION_SPACE_HDIV;
75 this->setShardsTopologyAndTags();
82 if (operatorType == OPERATOR_DIV)
86 std::vector< std::vector<EOperator> > ops(1);
87 ops[0] = std::vector<EOperator>{OPERATOR_DIV,OPERATOR_VALUE};
88 std::vector<double> weights {1.0};
90 return opDecomposition;
92 else if (OPERATOR_VALUE == operatorType)
95 std::vector< std::vector<EOperator> > ops(2);
96 ops[0] = std::vector<EOperator>{OPERATOR_VALUE,OPERATOR_VALUE};
97 ops[1] = std::vector<EOperator>{};
98 std::vector<double> weights {1.0,0.0};
103 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
"Unsupported operator type");
116 virtual void getValues(OutputViewType outputValues,
const EOperator operatorType,
117 const PointViewType inputPoints1,
const PointViewType inputPoints2,
118 bool tensorPoints)
const override
121 if (operatorType == OPERATOR_VALUE)
123 op1 = OPERATOR_VALUE;
124 op2 = OPERATOR_VALUE;
127 auto outputValuesComponent12 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),std::pair<int,int>{0,2});
128 auto outputValuesComponent3 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),2);
131 Kokkos::deep_copy(outputValuesComponent3, 0.0);
134 inputPoints2, op2, tensorPoints);
137 else if (operatorType == OPERATOR_DIV)
142 op2 = OPERATOR_VALUE;
146 inputPoints2, op2, tensorPoints);
150 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"operator not yet supported");
166 auto dofCoeffs1 = Kokkos::subview(dofCoeffs,Kokkos::ALL(), std::make_pair(0,2));
167 auto dofCoeffs2 = Kokkos::subview(dofCoeffs,Kokkos::ALL(), 2);
169 Kokkos::deep_copy(dofCoeffs2,0.0);
173 template<
class HVOL_TRI,
class HGRAD_LINE>
178 using OutputViewType =
typename HGRAD_LINE::OutputViewType;
179 using PointViewType =
typename HGRAD_LINE::PointViewType ;
180 using ScalarViewType =
typename HGRAD_LINE::ScalarViewType;
182 using BasisBase =
typename HGRAD_LINE::BasisBase;
184 using DeviceType =
typename BasisBase::DeviceType;
185 using ExecutionSpace =
typename BasisBase::ExecutionSpace;
186 using OutputValueType =
typename BasisBase::OutputValueType;
187 using PointValueType =
typename BasisBase::PointValueType;
189 using TriVolBasis = HVOL_TRI;
190 using LineGradBasis = HGRAD_LINE;
201 TensorBasis(Teuchos::rcp( new TriVolBasis(polyOrder_xy-1,pointType)),
202 Teuchos::rcp( new LineGradBasis(polyOrder_z,pointType)))
204 this->functionSpace_ = FUNCTION_SPACE_HDIV;
205 this->setShardsTopologyAndTags();
214 const EOperator & VALUE = OPERATOR_VALUE;
215 const EOperator & GRAD = OPERATOR_GRAD;
216 const EOperator & DIV = OPERATOR_DIV;
217 if (operatorType == VALUE)
220 std::vector< std::vector<EOperator> > ops(2);
221 ops[0] = std::vector<EOperator>{};
222 ops[1] = std::vector<EOperator>{VALUE,VALUE};
223 std::vector<double> weights {0.,1.0};
225 return opDecomposition;
227 else if (operatorType == DIV)
230 std::vector< std::vector<EOperator> > ops(1);
231 ops[0] = std::vector<EOperator>{VALUE,GRAD};
232 std::vector<double> weights {1.0};
234 return opDecomposition;
238 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
"Unsupported operator type");
249 virtual void getValues(OutputViewType outputValues,
const EOperator operatorType,
250 const PointViewType inputPoints1,
const PointViewType inputPoints2,
251 bool tensorPoints)
const override
254 if (operatorType == OPERATOR_VALUE)
256 op1 = OPERATOR_VALUE;
257 op2 = OPERATOR_VALUE;
260 auto outputValuesComponent12 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),std::pair<int,int>{0,2});
261 auto outputValuesComponent3 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),2);
264 Kokkos::deep_copy(outputValuesComponent12, 0.0);
267 inputPoints2, op2, tensorPoints);
270 else if (operatorType == OPERATOR_DIV)
273 op1 = OPERATOR_VALUE;
278 inputPoints2, op2, tensorPoints);
282 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"operator not yet supported");
298 auto dofCoeffs1 = Kokkos::subview(dofCoeffs,Kokkos::ALL(), std::make_pair(0,2));
299 auto dofCoeffs2 = Kokkos::subview(dofCoeffs,Kokkos::ALL(), 2);
300 Kokkos::deep_copy(dofCoeffs1,0.0);
306 template<
class HDIV_TRI,
class HVOL_TRI,
class HGRAD_LINE,
class HVOL_LINE>
314 using BasisBase =
typename HGRAD_LINE::BasisBase;
318 ordinal_type order_xy_;
319 ordinal_type order_z_;
320 EPointType pointType_;
323 using ExecutionSpace =
typename HGRAD_LINE::ExecutionSpace;
324 using OutputValueType =
typename HGRAD_LINE::OutputValueType;
325 using PointValueType =
typename HGRAD_LINE::PointValueType;
335 Teuchos::rcp( new
Family2(polyOrder_xy, polyOrder_z, pointType) ))
337 this->functionSpace_ = FUNCTION_SPACE_HDIV;
339 std::ostringstream basisName;
341 name_ = basisName.str();
343 order_xy_ = polyOrder_xy;
344 order_z_ = polyOrder_z;
345 pointType_ = pointType;
368 return name_.c_str();
381 Teuchos::RCP<BasisBase>
385 using TriBasis = HVOL_TRI;
387 if(subCellDim == 2) {
390 return Teuchos::rcp(
new QuadBasis(order_xy_-1, order_z_-1, pointType_) );
392 return Teuchos::rcp(
new QuadBasis(order_xy_-1, order_z_-1, pointType_) );
394 return Teuchos::rcp(
new QuadBasis(order_z_-1, order_xy_-1, pointType_) );
396 return Teuchos::rcp(
new TriBasis(order_xy_-1, pointType_) );
398 return Teuchos::rcp(
new TriBasis(order_xy_-1, pointType_) );
400 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"subCellOrd is out of bounds");
403 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"subCellDim is out of bounds");
410 virtual HostBasisPtr<OutputValueType, PointValueType>
414 auto hostBasis = Teuchos::rcp(
new HostBasis(order_xy_, order_z_, pointType_));
virtual HostBasisPtr< OutputValueType, PointValueType > getHostBasis() const override
Creates and returns a Basis object whose DeviceType template argument is Kokkos::HostSpace::device_ty...
virtual bool requireOrientation() const override
True if orientation is required.
Implementation of bases that are tensor products of two or three component bases. ...
virtual void getValues(OutputViewType outputValues, const EOperator operatorType, const PointViewType inputPoints1, const PointViewType inputPoints2, bool tensorPoints) const override
multi-component getValues() method (required/called by TensorBasis)
virtual void getDofCoeffs(ScalarViewType dofCoeffs) const override
Fills in coefficients of degrees of freedom for Lagrangian basis on the reference cell...
Implementation of H(vol) basis on the quadrilateral that is templated on H(vol) on the line...
Teuchos::RCP< BasisBase > getSubCellRefBasis(const ordinal_type subCellDim, const ordinal_type subCellOrd) const override
returns the basis associated to a subCell.
Free functions, callable from device code, that implement various polynomials useful in basis definit...
For a multi-component tensor basis, specifies the operators to be applied to the components to produc...
Basis_Derived_HDIV_Family1_WEDGE(int polyOrder_xy, int polyOrder_z, const EPointType pointType=POINTTYPE_DEFAULT)
Constructor.
virtual void getValues(BasisValues< OutputValueType, DeviceType > outputValues, const TensorPoints< PointValueType, DeviceType > inputPoints, const EOperator operatorType=OPERATOR_VALUE) const override
Evaluation of a FEM basis on a reference cell, using point and output value containers that allow pre...
Implementation of a basis that is the direct sum of two other bases.
OperatorTensorDecomposition getSimpleOperatorDecomposition(const EOperator &operatorType) const override
Returns a simple decomposition of the specified operator: what operator(s) should be applied to basis...
Basis_Derived_HDIV_WEDGE(int polyOrder_xy, int polyOrder_z, const EPointType pointType=POINTTYPE_DEFAULT)
Constructor.
A basis that is the direct sum of two other bases.
virtual const char * getName() const override
Returns basis name.
virtual void getDofCoeffs(ScalarViewType dofCoeffs) const override
Fills in coefficients of degrees of freedom for Lagrangian basis on the reference cell...
Header file to include all Sacado headers that are required if using Intrepid2 with Sacado types...
virtual OperatorTensorDecomposition getSimpleOperatorDecomposition(const EOperator &operatorType) const override
Returns a simple decomposition of the specified operator: what operator(s) should be applied to basis...
Basis_Derived_HDIV_Family2_WEDGE(int polyOrder_xy, int polyOrder_z, const EPointType pointType=POINTTYPE_DEFAULT)
Constructor.
virtual const char * getName() const override
Returns basis name.
virtual void getDofCoeffs(typename BasisBase::ScalarViewType dofCoeffs) const override
Fills in coefficients of degrees of freedom on the reference cell.
Basis_Derived_HDIV_WEDGE(int polyOrder, const EPointType pointType=POINTTYPE_DEFAULT)
Constructor.
Basis defined as the tensor product of two component bases.
virtual void getValues(OutputViewType outputValues, const EOperator operatorType, const PointViewType inputPoints1, const PointViewType inputPoints2, bool tensorPoints) const override
multi-component getValues() method (required/called by TensorBasis)