19 #ifndef Intrepid2_DerivedBasis_HCURL_QUAD_h
20 #define Intrepid2_DerivedBasis_HCURL_QUAD_h
22 #include <Kokkos_DynRankView.hpp>
32 template<
class HGRAD_LINE,
class HVOL_LINE>
37 using ExecutionSpace =
typename HGRAD_LINE::ExecutionSpace;
38 using OutputValueType =
typename HGRAD_LINE::OutputValueType;
39 using PointValueType =
typename HGRAD_LINE::PointValueType;
41 using OutputViewType =
typename HGRAD_LINE::OutputViewType;
42 using PointViewType =
typename HGRAD_LINE::PointViewType ;
43 using ScalarViewType =
typename HGRAD_LINE::ScalarViewType;
45 using BasisBase =
typename HGRAD_LINE::BasisBase;
47 using LineGradBasis = HGRAD_LINE;
48 using LineHVolBasis = HVOL_LINE;
59 TensorBasis(Teuchos::rcp( new LineHVolBasis(polyOrder_x-1,pointType)),
60 Teuchos::rcp( new LineGradBasis(polyOrder_y,pointType)))
62 this->functionSpace_ = FUNCTION_SPACE_HCURL;
63 this->setShardsTopologyAndTags();
70 const EOperator VALUE = Intrepid2::OPERATOR_VALUE;
71 const EOperator GRAD = Intrepid2::OPERATOR_GRAD;
72 const EOperator CURL = Intrepid2::OPERATOR_CURL;
73 if (operatorType == VALUE)
76 std::vector< std::vector<EOperator> > ops(2);
77 ops[0] = std::vector<EOperator>{VALUE,VALUE};
78 ops[1] = std::vector<EOperator>{};
79 std::vector<double> weights {1.0, 0.0};
82 else if (operatorType == CURL)
90 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
"Unsupported operator type");
103 virtual void getValues(OutputViewType outputValues,
const EOperator operatorType,
104 const PointViewType inputPoints1,
const PointViewType inputPoints2,
105 bool tensorPoints)
const override
107 Intrepid2::EOperator op1, op2;
108 if (operatorType == Intrepid2::OPERATOR_VALUE)
110 op1 = Intrepid2::OPERATOR_VALUE;
111 op2 = Intrepid2::OPERATOR_VALUE;
114 OutputViewType outputValuesComponent1 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),0);
115 OutputViewType outputValuesComponent2 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),1);
119 inputPoints2, op2, tensorPoints);
121 Kokkos::deep_copy(outputValuesComponent2,0);
123 else if (operatorType == Intrepid2::OPERATOR_CURL)
127 op1 = Intrepid2::OPERATOR_VALUE;
128 op2 = Intrepid2::OPERATOR_GRAD;
130 double weight = -1.0;
133 inputPoints2, op2, tensorPoints, weight);
137 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"operator not yet supported");
153 auto dofCoeffs1 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),0);
154 auto dofCoeffs2 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),1);
156 Kokkos::deep_copy(dofCoeffs2,0.0);
160 template<
class HGRAD_LINE,
class HVOL_LINE>
166 using ExecutionSpace =
typename HGRAD_LINE::ExecutionSpace;
167 using OutputValueType =
typename HGRAD_LINE::OutputValueType;
168 using PointValueType =
typename HGRAD_LINE::PointValueType;
170 using OutputViewType =
typename HGRAD_LINE::OutputViewType;
171 using PointViewType =
typename HGRAD_LINE::PointViewType ;
172 using ScalarViewType =
typename HGRAD_LINE::ScalarViewType;
174 using LineGradBasis = HGRAD_LINE;
175 using LineHVolBasis = HVOL_LINE;
177 using BasisBase =
typename HGRAD_LINE::BasisBase;
188 TensorBasis(Teuchos::rcp( new LineGradBasis(polyOrder_x,pointType) ),
189 Teuchos::rcp( new LineHVolBasis(polyOrder_y-1,pointType) ))
191 this->functionSpace_ = FUNCTION_SPACE_HCURL;
192 this->setShardsTopologyAndTags();
199 const EOperator VALUE = Intrepid2::OPERATOR_VALUE;
200 const EOperator GRAD = Intrepid2::OPERATOR_GRAD;
201 const EOperator CURL = Intrepid2::OPERATOR_CURL;
202 if (operatorType == VALUE)
205 std::vector< std::vector<EOperator> > ops(2);
206 ops[0] = std::vector<EOperator>{};
207 ops[1] = std::vector<EOperator>{VALUE,VALUE};
208 std::vector<double> weights {0.0, 1.0};
211 else if (operatorType == CURL)
219 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
"Unsupported operator type");
232 virtual void getValues(OutputViewType outputValues,
const EOperator operatorType,
233 const PointViewType inputPoints1,
const PointViewType inputPoints2,
234 bool tensorPoints)
const override
236 Intrepid2::EOperator op1, op2;
237 if (operatorType == Intrepid2::OPERATOR_VALUE)
239 op1 = Intrepid2::OPERATOR_VALUE;
240 op2 = Intrepid2::OPERATOR_VALUE;
243 auto outputValuesComponent1 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),0);
244 auto outputValuesComponent2 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),1);
247 Kokkos::deep_copy(outputValuesComponent1, 0.0);
250 inputPoints2, op2, tensorPoints);
253 else if (operatorType == Intrepid2::OPERATOR_CURL)
257 op1 = Intrepid2::OPERATOR_GRAD;
258 op2 = Intrepid2::OPERATOR_VALUE;
262 inputPoints2, op2, tensorPoints);
266 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"operator not yet supported");
282 auto dofCoeffs1 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),0);
283 auto dofCoeffs2 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),1);
284 Kokkos::deep_copy(dofCoeffs1,0.0);
289 template<
class HGRAD_LINE,
class HVOL_LINE>
297 using BasisBase =
typename HGRAD_LINE::BasisBase;
301 ordinal_type order_x_;
302 ordinal_type order_y_;
303 EPointType pointType_;
306 using ExecutionSpace =
typename HGRAD_LINE::ExecutionSpace;
307 using OutputValueType =
typename HGRAD_LINE::OutputValueType;
308 using PointValueType =
typename HGRAD_LINE::PointValueType;
318 Teuchos::rcp( new
Family2(polyOrder_x, polyOrder_y, pointType) ))
320 this->functionSpace_ = FUNCTION_SPACE_HCURL;
322 std::ostringstream basisName;
324 name_ = basisName.str();
326 order_x_ = polyOrder_x;
327 order_y_ = polyOrder_y;
328 pointType_ = pointType;
351 return name_.c_str();
364 Teuchos::RCP<BasisBase>
366 if(subCellDim == 1) {
370 return Teuchos::rcp(
new HVOL_LINE(order_x_-1, pointType_) );
373 return Teuchos::rcp(
new HVOL_LINE(order_y_-1, pointType_) );
377 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"Input parameters out of bounds");
384 virtual HostBasisPtr<OutputValueType, PointValueType>
388 auto hostBasis = Teuchos::rcp(
new HostBasis(order_x_, order_y_, pointType_));
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_HCURL_QUAD(int polyOrder_x, int polyOrder_y, const EPointType pointType=POINTTYPE_DEFAULT)
Constructor.
Implementation of bases that are tensor products of two or three component bases. ...
Teuchos::RCP< BasisBase > getSubCellRefBasis(const ordinal_type subCellDim, const ordinal_type subCellOrd) const override
returns the basis associated to a subCell.
virtual void getDofCoeffs(ScalarViewType dofCoeffs) const override
Fills in coefficients of degrees of freedom for Lagrangian basis on the reference cell...
virtual void getDofCoeffs(ScalarViewType dofCoeffs) const override
Fills in coefficients of degrees of freedom for Lagrangian basis on the reference cell...
Free functions, callable from device code, that implement various polynomials useful in basis definit...
virtual bool requireOrientation() const override
True if orientation is required.
For a multi-component tensor basis, specifies the operators to be applied to the components to produc...
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...
virtual OperatorTensorDecomposition getSimpleOperatorDecomposition(const EOperator &operatorType) const override
Returns a simple decomposition of the specified operator: what operator(s) should be applied to basis...
Implementation of a basis that is the direct sum of two other bases.
Basis_Derived_HCURL_Family1_QUAD(int polyOrder_x, int polyOrder_y, 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 HostBasisPtr< OutputValueType, PointValueType > getHostBasis() const override
Creates and returns a Basis object whose DeviceType template argument is Kokkos::HostSpace::device_ty...
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)
Header file to include all Sacado headers that are required if using Intrepid2 with Sacado types...
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.
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)
Basis defined as the tensor product of two component bases.
Basis_Derived_HCURL_Family2_QUAD(int polyOrder_x, int polyOrder_y, const EPointType pointType=POINTTYPE_DEFAULT)
Constructor.
Basis_Derived_HCURL_QUAD(int polyOrder, const EPointType pointType=POINTTYPE_DEFAULT)
Constructor.