53 #ifndef Intrepid2_DerivedBasis_HCURL_QUAD_h 54 #define Intrepid2_DerivedBasis_HCURL_QUAD_h 56 #include <Kokkos_View.hpp> 57 #include <Kokkos_DynRankView.hpp> 67 template<
class HGRAD_LINE,
class HVOL_LINE>
72 using ExecutionSpace =
typename HGRAD_LINE::ExecutionSpace;
73 using OutputValueType =
typename HGRAD_LINE::OutputValueType;
74 using PointValueType =
typename HGRAD_LINE::PointValueType;
76 using OutputViewType =
typename HGRAD_LINE::OutputViewType;
77 using PointViewType =
typename HGRAD_LINE::PointViewType ;
78 using ScalarViewType =
typename HGRAD_LINE::ScalarViewType;
80 using BasisBase =
typename HGRAD_LINE::BasisBase;
82 using LineGradBasis = HGRAD_LINE;
83 using LineHVolBasis = HVOL_LINE;
94 TensorBasis(Teuchos::rcp( new LineHVolBasis(polyOrder_x-1,pointType)),
95 Teuchos::rcp( new LineGradBasis(polyOrder_y,pointType)))
97 this->functionSpace_ = FUNCTION_SPACE_HCURL;
104 const EOperator VALUE = Intrepid2::OPERATOR_VALUE;
105 const EOperator GRAD = Intrepid2::OPERATOR_GRAD;
106 const EOperator CURL = Intrepid2::OPERATOR_CURL;
107 if (operatorType == VALUE)
110 std::vector< std::vector<EOperator> > ops(2);
111 ops[0] = std::vector<EOperator>{VALUE,VALUE};
112 ops[1] = std::vector<EOperator>{};
113 std::vector<double> weights {1.0, 0.0};
116 else if (operatorType == CURL)
124 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
"Unsupported operator type");
138 const PointViewType inputPoints1,
const PointViewType inputPoints2,
139 bool tensorPoints)
const override 142 if (operatorType == Intrepid2::OPERATOR_VALUE)
144 op1 = Intrepid2::OPERATOR_VALUE;
145 op2 = Intrepid2::OPERATOR_VALUE;
148 OutputViewType outputValuesComponent1 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),0);
149 OutputViewType outputValuesComponent2 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),1);
153 inputPoints2, op2, tensorPoints);
155 Kokkos::deep_copy(outputValuesComponent2,0);
157 else if (operatorType == Intrepid2::OPERATOR_CURL)
161 op1 = Intrepid2::OPERATOR_VALUE;
162 op2 = Intrepid2::OPERATOR_GRAD;
164 double weight = -1.0;
167 inputPoints2, op2, tensorPoints, weight);
171 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"operator not yet supported");
187 auto dofCoeffs1 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),0);
188 auto dofCoeffs2 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),1);
190 Kokkos::deep_copy(dofCoeffs2,0.0);
194 template<
class HGRAD_LINE,
class HVOL_LINE>
200 using ExecutionSpace =
typename HGRAD_LINE::ExecutionSpace;
201 using OutputValueType =
typename HGRAD_LINE::OutputValueType;
202 using PointValueType =
typename HGRAD_LINE::PointValueType;
204 using OutputViewType =
typename HGRAD_LINE::OutputViewType;
205 using PointViewType =
typename HGRAD_LINE::PointViewType ;
206 using ScalarViewType =
typename HGRAD_LINE::ScalarViewType;
208 using LineGradBasis = HGRAD_LINE;
209 using LineHVolBasis = HVOL_LINE;
211 using BasisBase =
typename HGRAD_LINE::BasisBase;
222 TensorBasis(Teuchos::rcp( new LineGradBasis(polyOrder_x,pointType) ),
223 Teuchos::rcp( new LineHVolBasis(polyOrder_y-1,pointType) ))
225 this->functionSpace_ = FUNCTION_SPACE_HCURL;
232 const EOperator VALUE = Intrepid2::OPERATOR_VALUE;
233 const EOperator GRAD = Intrepid2::OPERATOR_GRAD;
234 const EOperator CURL = Intrepid2::OPERATOR_CURL;
235 if (operatorType == VALUE)
238 std::vector< std::vector<EOperator> > ops(2);
239 ops[0] = std::vector<EOperator>{};
240 ops[1] = std::vector<EOperator>{VALUE,VALUE};
241 std::vector<double> weights {0.0, 1.0};
244 else if (operatorType == CURL)
252 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
"Unsupported operator type");
266 const PointViewType inputPoints1,
const PointViewType inputPoints2,
267 bool tensorPoints)
const override 270 if (operatorType == Intrepid2::OPERATOR_VALUE)
272 op1 = Intrepid2::OPERATOR_VALUE;
273 op2 = Intrepid2::OPERATOR_VALUE;
276 auto outputValuesComponent1 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),0);
277 auto outputValuesComponent2 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),1);
280 Kokkos::deep_copy(outputValuesComponent1, 0.0);
283 inputPoints2, op2, tensorPoints);
286 else if (operatorType == Intrepid2::OPERATOR_CURL)
290 op1 = Intrepid2::OPERATOR_GRAD;
291 op2 = Intrepid2::OPERATOR_VALUE;
295 inputPoints2, op2, tensorPoints);
299 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"operator not yet supported");
315 auto dofCoeffs1 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),0);
316 auto dofCoeffs2 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),1);
317 Kokkos::deep_copy(dofCoeffs1,0.0);
322 template<
class HGRAD_LINE,
class HVOL_LINE>
330 using BasisBase =
typename HGRAD_LINE::BasisBase;
334 ordinal_type order_x_;
335 ordinal_type order_y_;
339 using ExecutionSpace =
typename HGRAD_LINE::ExecutionSpace;
340 using OutputValueType =
typename HGRAD_LINE::OutputValueType;
341 using PointValueType =
typename HGRAD_LINE::PointValueType;
351 Teuchos::rcp( new
Family2(polyOrder_x, polyOrder_y, pointType) ))
353 this->functionSpace_ = FUNCTION_SPACE_HCURL;
355 std::ostringstream basisName;
357 name_ = basisName.str();
359 order_x_ = polyOrder_x;
360 order_y_ = polyOrder_y;
361 pointType_ = pointType;
374 return (this->getDofCount(1,0) > 0);
384 return name_.c_str();
397 Teuchos::RCP<BasisBase>
399 if(subCellDim == 1) {
403 return Teuchos::rcp(
new HVOL_LINE(order_x_-1, pointType_) );
406 return Teuchos::rcp(
new HVOL_LINE(order_y_-1, pointType_) );
410 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"Input parameters out of bounds");
421 auto hostBasis = Teuchos::rcp(
new HostBasis(order_x_, order_y_, pointType_));
Basis_Derived_HCURL_QUAD(int polyOrder_x, int polyOrder_y, const EPointType pointType=POINTTYPE_DEFAULT)
Constructor.
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 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...
Implementation of a basis that is the direct sum of two other bases.
BasisPtr< typename Kokkos::HostSpace::device_type, OutputType, PointType > HostBasisPtr
Pointer to a Basis whose device type is on the host (Kokkos::HostSpace::device_type), allowing host access to input and output views, and ensuring host execution of basis evaluation.
Basis_Derived_HCURL_Family1_QUAD(int polyOrder_x, int polyOrder_y, const EPointType pointType=POINTTYPE_DEFAULT)
Constructor.
virtual void getDofCoeffs(typename BasisBase::ScalarViewType dofCoeffs) const override
Fills in coefficients of degrees of freedom on the reference cell.
A basis that is the direct sum of two other bases.
virtual const char * getName() const override
Returns basis name.
EOperator
Enumeration of primitive operators available in Intrepid. Primitive operators act on reconstructed fu...
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)
EPointType
Enumeration of types of point distributions in Intrepid.
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 OperatorTensorDecomposition getSimpleOperatorDecomposition(const EOperator operatorType) const override
Returns a simple decomposition of the specified operator: what operator(s) should be applied to basis...
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 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.