54 #ifndef Intrepid2_DerivedBasis_HCURL_HEX_h 55 #define Intrepid2_DerivedBasis_HCURL_HEX_h 57 #include <Kokkos_View.hpp> 58 #include <Kokkos_DynRankView.hpp> 68 template<
class HGRAD_LINE,
class HVOL_LINE>
73 using OutputViewType =
typename HGRAD_LINE::OutputViewType;
74 using PointViewType =
typename HGRAD_LINE::PointViewType ;
75 using ScalarViewType =
typename HGRAD_LINE::ScalarViewType;
77 using LineGradBasis = HGRAD_LINE;
78 using LineVolBasis = HVOL_LINE;
90 TensorBasis3(Teuchos::rcp(new LineVolBasis (polyOrder_x-1,pointType)),
91 Teuchos::rcp(new LineGradBasis(polyOrder_y,pointType)),
92 Teuchos::rcp(new LineGradBasis(polyOrder_z,pointType)))
94 this->functionSpace_ = FUNCTION_SPACE_HCURL;
101 const EOperator VALUE = Intrepid2::OPERATOR_VALUE;
102 const EOperator GRAD = Intrepid2::OPERATOR_GRAD;
104 if (operatorType == Intrepid2::OPERATOR_VALUE)
107 std::vector< std::vector<EOperator> > ops(3);
108 ops[0] = std::vector<EOperator>{VALUE,VALUE,VALUE};
109 ops[1] = std::vector<EOperator>{};
110 ops[2] = std::vector<EOperator>{};
111 std::vector<double> weights {1.0, 0.0, 0.0};
114 else if (operatorType == Intrepid2::OPERATOR_CURL)
121 std::vector< std::vector<EOperator> > ops(3);
122 ops[0] = std::vector<EOperator>{};
123 ops[1] = std::vector<EOperator>{VALUE,VALUE,GRAD};
124 ops[2] = std::vector<EOperator>{VALUE,GRAD,VALUE};
126 std::vector<double> weights {0.0, 1.0, -1.0};
131 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
"Unsupported operator type");
146 const PointViewType inputPoints1,
const PointViewType inputPoints2,
const PointViewType inputPoints3,
147 bool tensorPoints)
const override 150 if (operatorType == Intrepid2::OPERATOR_VALUE)
152 op1 = Intrepid2::OPERATOR_VALUE;
153 op2 = Intrepid2::OPERATOR_VALUE;
154 op3 = Intrepid2::OPERATOR_VALUE;
157 auto outputValuesComponent1 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),0);
158 auto outputValuesComponent23 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),std::make_pair(1,3));
163 inputPoints3, op3, tensorPoints);
165 Kokkos::deep_copy(outputValuesComponent23,0.0);
167 else if (operatorType == Intrepid2::OPERATOR_CURL)
170 auto outputValuesComponent_x = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),0);
171 auto outputValuesComponent_y = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),1);
172 auto outputValuesComponent_z = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),2);
175 Kokkos::deep_copy(outputValuesComponent_x, 0.0);
178 op1 = Intrepid2::OPERATOR_VALUE;
179 op2 = Intrepid2::OPERATOR_VALUE;
180 op3 = Intrepid2::OPERATOR_GRAD;
186 inputPoints3, op3, tensorPoints, weight);
189 op1 = Intrepid2::OPERATOR_VALUE;
190 op2 = Intrepid2::OPERATOR_GRAD;
191 op3 = Intrepid2::OPERATOR_VALUE;
196 inputPoints3, op3, tensorPoints, weight);
200 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"operator not yet supported");
216 auto dofCoeffs1 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),0);
217 auto dofCoeffs23 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),std::make_pair(1,3));
219 Kokkos::deep_copy(dofCoeffs23,0.0);
223 template<
class HGRAD_LINE,
class HVOL_LINE>
228 using OutputViewType =
typename HGRAD_LINE::OutputViewType;
229 using PointViewType =
typename HGRAD_LINE::PointViewType ;
230 using ScalarViewType =
typename HGRAD_LINE::ScalarViewType;
232 using LineGradBasis = HGRAD_LINE;
233 using LineVolBasis = HVOL_LINE;
245 TensorBasis3(Teuchos::rcp( new LineGradBasis(polyOrder_x,pointType)),
246 Teuchos::rcp( new LineVolBasis (polyOrder_y-1,pointType)),
247 Teuchos::rcp( new LineGradBasis(polyOrder_z,pointType)))
249 this->functionSpace_ = FUNCTION_SPACE_HCURL;
256 const EOperator VALUE = Intrepid2::OPERATOR_VALUE;
257 const EOperator GRAD = Intrepid2::OPERATOR_GRAD;
258 const EOperator CURL = Intrepid2::OPERATOR_CURL;
259 if (operatorType == VALUE)
262 std::vector< std::vector<EOperator> > ops(3);
263 ops[0] = std::vector<EOperator>{};
264 ops[1] = std::vector<EOperator>{VALUE,VALUE,VALUE};
265 ops[2] = std::vector<EOperator>{};
266 std::vector<double> weights {0.0, 1.0, 0.0};
269 else if (operatorType == CURL)
275 std::vector< std::vector<EOperator> > ops(3);
276 ops[0] = std::vector<EOperator>{VALUE,VALUE,GRAD};
277 ops[1] = std::vector<EOperator>{};
278 ops[2] = std::vector<EOperator>{GRAD,VALUE,VALUE};
280 std::vector<double> weights {-1.0, 0.0, 1.0};
285 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
"Unsupported operator type");
300 const PointViewType inputPoints1,
const PointViewType inputPoints2,
const PointViewType inputPoints3,
301 bool tensorPoints)
const override 304 if (operatorType == Intrepid2::OPERATOR_VALUE)
306 op1 = Intrepid2::OPERATOR_VALUE;
307 op2 = Intrepid2::OPERATOR_VALUE;
308 op3 = Intrepid2::OPERATOR_VALUE;
311 auto outputValuesComponent_x = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),0);
312 auto outputValuesComponent_y = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),1);
313 auto outputValuesComponent_z = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),2);
316 Kokkos::deep_copy(outputValuesComponent_x,0.0);
321 inputPoints3, op3, tensorPoints);
323 Kokkos::deep_copy(outputValuesComponent_z,0.0);
325 else if (operatorType == Intrepid2::OPERATOR_CURL)
328 auto outputValuesComponent_x = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),0);
329 auto outputValuesComponent_y = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),1);
330 auto outputValuesComponent_z = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),2);
333 op1 = Intrepid2::OPERATOR_VALUE;
334 op2 = Intrepid2::OPERATOR_VALUE;
335 op3 = Intrepid2::OPERATOR_GRAD;
337 double weight = -1.0;
341 inputPoints3, op3, tensorPoints, weight);
344 Kokkos::deep_copy(outputValuesComponent_y, 0.0);
347 op1 = Intrepid2::OPERATOR_GRAD;
348 op2 = Intrepid2::OPERATOR_VALUE;
349 op3 = Intrepid2::OPERATOR_VALUE;
354 inputPoints3, op3, tensorPoints, weight);
358 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"operator not yet supported");
374 auto dofCoeffs1 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),0);
375 auto dofCoeffs2 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),1);
376 auto dofCoeffs3 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),2);
377 Kokkos::deep_copy(dofCoeffs1,0.0);
379 Kokkos::deep_copy(dofCoeffs3,0.0);
385 template<
class HGRAD_LINE,
class HVOL_LINE>
389 using OutputViewType =
typename HGRAD_LINE::OutputViewType;
390 using PointViewType =
typename HGRAD_LINE::PointViewType ;
391 using ScalarViewType =
typename HGRAD_LINE::ScalarViewType;
393 using LineGradBasis = HGRAD_LINE;
394 using LineVolBasis = HVOL_LINE;
406 TensorBasis3(Teuchos::rcp(new LineGradBasis(polyOrder_x,pointType)),
407 Teuchos::rcp(new LineGradBasis(polyOrder_y,pointType)),
408 Teuchos::rcp(new LineVolBasis (polyOrder_z-1,pointType)))
415 const EOperator VALUE = Intrepid2::OPERATOR_VALUE;
416 const EOperator GRAD = Intrepid2::OPERATOR_GRAD;
417 if (operatorType == Intrepid2::OPERATOR_VALUE)
420 std::vector< std::vector<EOperator> > ops(3);
421 ops[0] = std::vector<EOperator>{};
422 ops[1] = std::vector<EOperator>{};
423 ops[2] = std::vector<EOperator>{VALUE,VALUE,VALUE};
424 std::vector<double> weights {0.0, 0.0, 1.0};
427 else if (operatorType == Intrepid2::OPERATOR_CURL)
433 std::vector< std::vector<EOperator> > ops(3);
434 ops[0] = std::vector<EOperator>{VALUE,GRAD,VALUE};
435 ops[1] = std::vector<EOperator>{GRAD,VALUE,VALUE};
436 ops[2] = std::vector<EOperator>{};
438 std::vector<double> weights {1.0, -1.0, 0.0};
443 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
"Unsupported operator type");
458 const PointViewType inputPoints1,
const PointViewType inputPoints2,
const PointViewType inputPoints3,
459 bool tensorPoints)
const override 462 if (operatorType == Intrepid2::OPERATOR_VALUE)
464 op1 = Intrepid2::OPERATOR_VALUE;
465 op2 = Intrepid2::OPERATOR_VALUE;
466 op3 = Intrepid2::OPERATOR_VALUE;
469 auto outputValuesComponent_xy = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),std::make_pair(0,2));
470 auto outputValuesComponent_z = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),2);
473 Kokkos::deep_copy(outputValuesComponent_xy,0.0);
478 inputPoints3, op3, tensorPoints);
480 else if (operatorType == Intrepid2::OPERATOR_CURL)
483 auto outputValuesComponent_x = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),0);
484 auto outputValuesComponent_y = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),1);
485 auto outputValuesComponent_z = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),2);
488 op1 = Intrepid2::OPERATOR_VALUE;
489 op2 = Intrepid2::OPERATOR_GRAD;
490 op3 = Intrepid2::OPERATOR_VALUE;
496 inputPoints3, op3, tensorPoints, weight);
498 op1 = Intrepid2::OPERATOR_GRAD;
499 op2 = Intrepid2::OPERATOR_VALUE;
500 op3 = Intrepid2::OPERATOR_VALUE;
505 inputPoints3, op3, tensorPoints, weight);
508 Kokkos::deep_copy(outputValuesComponent_z, 0.0);
512 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"operator not yet supported");
528 auto dofCoeffs12 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),std::make_pair(0,2));
529 auto dofCoeffs3 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),2);
530 Kokkos::deep_copy(dofCoeffs12,0.0);
535 template<
class HGRAD_LINE,
class HVOL_LINE>
552 Teuchos::rcp(new
Family2(polyOrder_x, polyOrder_y, polyOrder_z, pointType))) {}
555 template<
class HGRAD_LINE,
class HVOL_LINE>
564 ordinal_type order_x_;
565 ordinal_type order_y_;
566 ordinal_type order_z_;
571 using ExecutionSpace =
typename HGRAD_LINE::ExecutionSpace;
572 using OutputValueType =
typename HGRAD_LINE::OutputValueType;
573 using PointValueType =
typename HGRAD_LINE::PointValueType;
575 using BasisBase =
typename HGRAD_LINE::BasisBase;
586 Teuchos::rcp(new
Family3 (polyOrder_x, polyOrder_y, polyOrder_z, pointType))) {
587 this->functionSpace_ = FUNCTION_SPACE_HCURL;
589 std::ostringstream basisName;
591 name_ = basisName.str();
593 order_x_ = polyOrder_x;
594 order_y_ = polyOrder_y;
595 order_z_ = polyOrder_z;
596 pointType_ = pointType;
607 return (this->getDofCount(1,0) > 0);
617 return name_.c_str();
630 Teuchos::RCP<BasisBase>
633 using LineBasis = HVOL_LINE;
636 if(subCellDim == 1) {
642 return Teuchos::rcp(
new LineBasis(order_x_-1, pointType_) );
647 return Teuchos::rcp(
new LineBasis(order_y_-1, pointType_) );
652 return Teuchos::rcp(
new LineBasis(order_z_-1, pointType_) );
654 }
else if(subCellDim == 2) {
657 return Teuchos::rcp(
new QuadBasis(order_x_, order_z_, pointType_) );
659 return Teuchos::rcp(
new QuadBasis(order_y_,order_z_, pointType_) );
661 return Teuchos::rcp(
new QuadBasis(order_x_, order_z_, pointType_) );
663 return Teuchos::rcp(
new QuadBasis(order_z_, order_y_, pointType_) );
665 return Teuchos::rcp(
new QuadBasis(order_y_, order_x_, pointType_) );
667 return Teuchos::rcp(
new QuadBasis(order_x_, order_y_, pointType_) );
671 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"Input parameters out of bounds");
681 auto hostBasis = Teuchos::rcp(
new HostBasis(order_x_, order_y_, order_z_, pointType_));
virtual void getDofCoeffs(ScalarViewType dofCoeffs) const override
Fills in coefficients of degrees of freedom for Lagrangian basis on the reference cell...
Teuchos::RCP< BasisBase > getSubCellRefBasis(const ordinal_type subCellDim, const ordinal_type subCellOrd) const override
returns the basis associated to a subCell.
virtual bool requireOrientation() const override
True if orientation is required.
Basis_Derived_HCURL_Family1_HEX(int polyOrder_x, int polyOrder_y, int polyOrder_z, const EPointType pointType=POINTTYPE_DEFAULT)
Constructor.
Basis_Derived_HCURL_Family1_Family2_HEX(int polyOrder_x, int polyOrder_y, int polyOrder_z, const EPointType pointType)
Constructor.
virtual const char * getName() const override
Returns basis name.
Implementation of bases that are tensor products of two or three component bases. ...
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...
virtual void getValues(OutputViewType outputValues, const EOperator operatorType, const PointViewType inputPoints12, const PointViewType inputPoints3, bool tensorPoints) const override
Evaluation of a tensor FEM basis on a reference cell.
Basis_Derived_HCURL_Family2_HEX(int polyOrder_x, int polyOrder_y, int polyOrder_z, const EPointType pointType=POINTTYPE_DEFAULT)
Constructor.
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.
virtual void getDofCoeffs(typename BasisBase::ScalarViewType dofCoeffs) const override
Fills in coefficients of degrees of freedom on the reference cell.
virtual OperatorTensorDecomposition getSimpleOperatorDecomposition(const EOperator operatorType) const override
Returns a simple decomposition of the specified operator: what operator(s) should be applied to basis...
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...
Basis_Derived_HCURL_Family3_HEX(int polyOrder_x, int polyOrder_y, int polyOrder_z, const EPointType pointType=POINTTYPE_DEFAULT)
Constructor.
Basis_Derived_HCURL_HEX(int polyOrder_x, int polyOrder_y, int polyOrder_z, 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...
virtual void getValues(OutputViewType outputValues, const EOperator operatorType, const PointViewType inputPoints1, const PointViewType inputPoints2, const PointViewType inputPoints3, bool tensorPoints) const override
multi-component getValues() method (required/called by TensorBasis3)
virtual void getDofCoeffs(ScalarViewType dofCoeffs) const override
Fills in coefficients of degrees of freedom for Lagrangian basis on the reference cell...
EPointType
Enumeration of types of point distributions in Intrepid.
virtual void getValues(OutputViewType outputValues, const EOperator operatorType, const PointViewType inputPoints1, const PointViewType inputPoints2, const PointViewType inputPoints3, bool tensorPoints) const override
multi-component getValues() method (required/called by TensorBasis3)
Header file to include all Sacado headers that are required if using Intrepid2 with Sacado types...
virtual void getValues(OutputViewType outputValues, const EOperator operatorType, const PointViewType inputPoints1, const PointViewType inputPoints2, const PointViewType inputPoints3, bool tensorPoints) const override
multi-component getValues() method (required/called by TensorBasis3)
Basis_Derived_HCURL_HEX(int polyOrder, 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...
virtual HostBasisPtr< OutputValueType, PointValueType > getHostBasis() const override
Creates and returns a Basis object whose DeviceType template argument is Kokkos::HostSpace::device_ty...
virtual void getDofCoeffs(ScalarViewType dofCoeffs) const override
Fills in coefficients of degrees of freedom for Lagrangian basis on the reference cell...