57 #ifndef Intrepid2_DerivedBasis_HDIV_HEX_h 58 #define Intrepid2_DerivedBasis_HDIV_HEX_h 60 #include <Kokkos_View.hpp> 61 #include <Kokkos_DynRankView.hpp> 71 template<
class HGRAD_LINE,
class HVOL_LINE>
77 using OutputViewType =
typename HGRAD_LINE::OutputViewType;
78 using PointViewType =
typename HGRAD_LINE::PointViewType ;
79 using ScalarViewType =
typename HGRAD_LINE::ScalarViewType;
81 using LineGradBasis = HGRAD_LINE;
82 using LineHVolBasis = HVOL_LINE;
94 TensorBasis3(Teuchos::rcp( new LineGradBasis(polyOrder_x,pointType)),
95 Teuchos::rcp( new LineHVolBasis(polyOrder_y-1,pointType)),
96 Teuchos::rcp( new LineHVolBasis(polyOrder_z-1,pointType)))
98 this->functionSpace_ = FUNCTION_SPACE_HDIV;
105 const EOperator VALUE = Intrepid2::OPERATOR_VALUE;
106 const EOperator GRAD = Intrepid2::OPERATOR_GRAD;
107 const EOperator DIV = Intrepid2::OPERATOR_DIV;
109 const double weight = 1.0;
110 if (operatorType == VALUE)
112 std::vector< std::vector<EOperator> > ops(3);
113 ops[0] = std::vector<EOperator>{VALUE,VALUE,VALUE};
114 ops[1] = std::vector<EOperator>{};
115 ops[2] = std::vector<EOperator>{};
116 std::vector<double> weights {weight,0.0,0.0};
119 else if (operatorType == DIV)
122 std::vector< std::vector<EOperator> > ops(1);
123 ops[0] = std::vector<EOperator>{GRAD,VALUE,VALUE};
124 std::vector<double> weights {weight};
129 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
"Unsupported operator type");
144 const PointViewType inputPoints1,
const PointViewType inputPoints2,
const PointViewType inputPoints3,
145 bool tensorPoints)
const override 148 if (operatorType == Intrepid2::OPERATOR_VALUE)
150 op1 = Intrepid2::OPERATOR_VALUE;
151 op2 = Intrepid2::OPERATOR_VALUE;
152 op3 = Intrepid2::OPERATOR_VALUE;
155 auto outputValuesComponent1 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),0);
156 auto outputValuesComponent23 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),std::make_pair(1,3));
161 inputPoints3, op3, tensorPoints);
163 Kokkos::deep_copy(outputValuesComponent23,0.0);
165 else if (operatorType == Intrepid2::OPERATOR_DIV)
170 op1 = Intrepid2::OPERATOR_GRAD;
171 op2 = Intrepid2::OPERATOR_VALUE;
172 op3 = Intrepid2::OPERATOR_VALUE;
178 inputPoints3, op3, tensorPoints, weight);
182 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"operator not yet supported");
198 auto dofCoeffs1 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),0);
199 auto dofCoeffs23 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),std::make_pair(1,3));
201 Kokkos::deep_copy(dofCoeffs23,0.0);
205 template<
class HGRAD_LINE,
class HVOL_LINE>
211 using OutputViewType =
typename HGRAD_LINE::OutputViewType;
212 using PointViewType =
typename HGRAD_LINE::PointViewType ;
213 using ScalarViewType =
typename HGRAD_LINE::ScalarViewType;
215 using LineGradBasis = HGRAD_LINE;
216 using LineHVolBasis = HVOL_LINE;
228 TensorBasis3(Teuchos::rcp( new LineHVolBasis(polyOrder_x-1,pointType) ),
229 Teuchos::rcp( new LineGradBasis(polyOrder_y,pointType) ),
230 Teuchos::rcp( new LineHVolBasis(polyOrder_z-1,pointType) ))
232 this->functionSpace_ = FUNCTION_SPACE_HDIV;
239 const EOperator VALUE = Intrepid2::OPERATOR_VALUE;
240 const EOperator GRAD = Intrepid2::OPERATOR_GRAD;
241 const EOperator DIV = Intrepid2::OPERATOR_DIV;
243 const double weight = 1.0;
244 if (operatorType == VALUE)
246 std::vector< std::vector<EOperator> > ops(3);
247 ops[0] = std::vector<EOperator>{};
248 ops[1] = std::vector<EOperator>{VALUE,VALUE,VALUE};
249 ops[2] = std::vector<EOperator>{};
250 std::vector<double> weights {0.0,weight,0.0};
253 else if (operatorType == DIV)
256 std::vector< std::vector<EOperator> > ops(1);
257 ops[0] = std::vector<EOperator>{VALUE,GRAD,VALUE};
258 std::vector<double> weights {weight};
263 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
"Unsupported operator type");
278 const PointViewType inputPoints1,
const PointViewType inputPoints2,
const PointViewType inputPoints3,
279 bool tensorPoints)
const override 282 if (operatorType == Intrepid2::OPERATOR_VALUE)
284 op1 = Intrepid2::OPERATOR_VALUE;
285 op2 = Intrepid2::OPERATOR_VALUE;
286 op3 = Intrepid2::OPERATOR_VALUE;
289 auto outputValuesComponent_x = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),0);
290 auto outputValuesComponent_y = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),1);
291 auto outputValuesComponent_z = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),2);
294 Kokkos::deep_copy(outputValuesComponent_x,0.0);
300 inputPoints3, op3, tensorPoints, weight);
303 Kokkos::deep_copy(outputValuesComponent_z,0.0);
305 else if (operatorType == Intrepid2::OPERATOR_DIV)
308 op1 = Intrepid2::OPERATOR_VALUE;
309 op2 = Intrepid2::OPERATOR_GRAD;
310 op3 = Intrepid2::OPERATOR_VALUE;
316 inputPoints3, op3, tensorPoints, weight);
320 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"operator not yet supported");
336 auto dofCoeffs1 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),0);
337 auto dofCoeffs2 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),1);
338 auto dofCoeffs3 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),2);
339 Kokkos::deep_copy(dofCoeffs1,0.0);
341 Kokkos::deep_copy(dofCoeffs3,0.0);
345 template<
class HGRAD_LINE,
class HVOL_LINE>
350 using OutputViewType =
typename HGRAD_LINE::OutputViewType;
351 using PointViewType =
typename HGRAD_LINE::PointViewType ;
352 using ScalarViewType =
typename HGRAD_LINE::ScalarViewType;
354 using LineGradBasis = HGRAD_LINE;
355 using LineHVolBasis = HVOL_LINE;
367 TensorBasis3(Teuchos::rcp( new LineHVolBasis(polyOrder_x-1,pointType) ),
368 Teuchos::rcp( new LineHVolBasis(polyOrder_y-1,pointType) ),
369 Teuchos::rcp( new LineGradBasis(polyOrder_z,pointType) ))
371 this->functionSpace_ = FUNCTION_SPACE_HDIV;
378 const EOperator VALUE = Intrepid2::OPERATOR_VALUE;
379 const EOperator GRAD = Intrepid2::OPERATOR_GRAD;
380 const EOperator DIV = Intrepid2::OPERATOR_DIV;
382 const double weight = 1.0;
383 if (operatorType == VALUE)
385 std::vector< std::vector<EOperator> > ops(3);
386 ops[0] = std::vector<EOperator>{};
387 ops[1] = std::vector<EOperator>{};
388 ops[2] = std::vector<EOperator>{VALUE,VALUE,VALUE};
389 std::vector<double> weights {0.0,0.0,weight};
392 else if (operatorType == DIV)
395 std::vector< std::vector<EOperator> > ops(1);
396 ops[0] = std::vector<EOperator>{VALUE,VALUE,GRAD};
397 std::vector<double> weights {weight};
402 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
"Unsupported operator type");
417 const PointViewType inputPoints1,
const PointViewType inputPoints2,
const PointViewType inputPoints3,
418 bool tensorPoints)
const override 421 if (operatorType == Intrepid2::OPERATOR_VALUE)
423 op1 = Intrepid2::OPERATOR_VALUE;
424 op2 = Intrepid2::OPERATOR_VALUE;
425 op3 = Intrepid2::OPERATOR_VALUE;
428 auto outputValuesComponent_xy = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),std::make_pair(0,2));
429 auto outputValuesComponent_z = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),2);
432 Kokkos::deep_copy(outputValuesComponent_xy,0.0);
438 inputPoints3, op3, tensorPoints);
440 else if (operatorType == Intrepid2::OPERATOR_DIV)
445 op1 = Intrepid2::OPERATOR_VALUE;
446 op2 = Intrepid2::OPERATOR_VALUE;
447 op3 = Intrepid2::OPERATOR_GRAD;
453 inputPoints3, op3, tensorPoints, weight);
457 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"operator not yet supported");
473 auto dofCoeffs12 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),std::make_pair(0,2));
474 auto dofCoeffs3 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),2);
475 Kokkos::deep_copy(dofCoeffs12,0.0);
484 template<
class HGRAD_LINE,
class HVOL_LINE>
501 Teuchos::rcp( new
Family1(polyOrder_x, polyOrder_y, polyOrder_z, pointType))) {
502 this->functionSpace_ = FUNCTION_SPACE_HDIV;
506 template<
class HGRAD_LINE,
class HVOL_LINE>
515 ordinal_type order_x_;
516 ordinal_type order_y_;
517 ordinal_type order_z_;
521 using ExecutionSpace =
typename HGRAD_LINE::ExecutionSpace;
522 using OutputValueType =
typename HGRAD_LINE::OutputValueType;
523 using PointValueType =
typename HGRAD_LINE::PointValueType;
525 using BasisBase =
typename HGRAD_LINE::BasisBase;
536 Teuchos::rcp(new
Family2 (polyOrder_x, polyOrder_y, polyOrder_z, pointType))) {
537 this->functionSpace_ = FUNCTION_SPACE_HDIV;
539 std::ostringstream basisName;
541 name_ = basisName.str();
543 order_x_ = polyOrder_x;
544 order_y_ = polyOrder_y;
545 order_z_ = polyOrder_z;
546 pointType_ = pointType;
557 return (this->getDofCount(2,0) > 0);
567 return name_.c_str();
580 Teuchos::RCP<BasisBase>
585 if(subCellDim == 2) {
588 return Teuchos::rcp(
new QuadBasis(order_x_-1, order_z_-1, pointType_) );
590 return Teuchos::rcp(
new QuadBasis(order_y_-1,order_z_-1, pointType_) );
592 return Teuchos::rcp(
new QuadBasis(order_x_-1, order_z_-1, pointType_) );
594 return Teuchos::rcp(
new QuadBasis(order_z_-1, order_y_-1, pointType_) );
596 return Teuchos::rcp(
new QuadBasis(order_y_-1, order_x_-1, pointType_) );
598 return Teuchos::rcp(
new QuadBasis(order_x_-1, order_y_-1, pointType_) );
602 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"Input parameters out of bounds");
613 auto hostBasis = Teuchos::rcp(
new HostBasis(order_x_, order_y_, order_z_, pointType_));
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, const PointViewType inputPoints3, bool tensorPoints) const override
multi-component getValues() method (required/called by TensorBasis3)
Implementation of H(vol) basis on the quadrilateral that is templated on H(vol) on the line...
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_HEX(int polyOrder_x, int polyOrder_y, int polyOrder_z, const EPointType pointType=POINTTYPE_DEFAULT)
Constructor.
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 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 inputPoints12, const PointViewType inputPoints3, bool tensorPoints) const override
Evaluation of a tensor FEM basis on a reference cell.
virtual const char * getName() const override
Returns basis name.
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.
virtual bool requireOrientation() const override
True if orientation is required.
EOperator
Enumeration of primitive operators available in Intrepid. Primitive operators act on reconstructed fu...
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_HEX(int polyOrder, const EPointType pointType=POINTTYPE_DEFAULT)
Constructor.
Basis_Derived_HDIV_HEX(int polyOrder_x, int polyOrder_y, int polyOrder_z, const EPointType pointType=POINTTYPE_DEFAULT)
Constructor.
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...
Basis_Derived_HDIV_Family3_HEX(int polyOrder_x, int polyOrder_y, int polyOrder_z, const EPointType pointType=POINTTYPE_DEFAULT)
Constructor.
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...
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 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_HDIV_Family1_HEX(int polyOrder_x, int polyOrder_y, int polyOrder_z, const EPointType pointType=POINTTYPE_DEFAULT)
Constructor.
Basis_Derived_HDIV_Family3_Family1_HEX(int polyOrder_x, int polyOrder_y, int polyOrder_z, const EPointType pointType)
Constructor.
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.