23 #ifndef Intrepid2_DerivedBasis_HDIV_HEX_h
24 #define Intrepid2_DerivedBasis_HDIV_HEX_h
26 #include <Kokkos_DynRankView.hpp>
36 template<
class HGRAD_LINE,
class HVOL_LINE>
42 using OutputViewType =
typename HGRAD_LINE::OutputViewType;
43 using PointViewType =
typename HGRAD_LINE::PointViewType ;
44 using ScalarViewType =
typename HGRAD_LINE::ScalarViewType;
46 using LineGradBasis = HGRAD_LINE;
47 using LineHVolBasis = HVOL_LINE;
59 TensorBasis3(Teuchos::rcp( new LineGradBasis(polyOrder_x,pointType)),
60 Teuchos::rcp( new LineHVolBasis(polyOrder_y-1,pointType)),
61 Teuchos::rcp( new LineHVolBasis(polyOrder_z-1,pointType)),
64 this->functionSpace_ = FUNCTION_SPACE_HDIV;
71 const EOperator VALUE = Intrepid2::OPERATOR_VALUE;
72 const EOperator GRAD = Intrepid2::OPERATOR_GRAD;
73 const EOperator DIV = Intrepid2::OPERATOR_DIV;
75 const double weight = 1.0;
76 if (operatorType == VALUE)
78 std::vector< std::vector<EOperator> > ops(3);
79 ops[0] = std::vector<EOperator>{VALUE,VALUE,VALUE};
80 ops[1] = std::vector<EOperator>{};
81 ops[2] = std::vector<EOperator>{};
82 std::vector<double> weights {weight,0.0,0.0};
85 else if (operatorType == DIV)
88 std::vector< std::vector<EOperator> > ops(1);
89 ops[0] = std::vector<EOperator>{GRAD,VALUE,VALUE};
90 std::vector<double> weights {weight};
95 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
"Unsupported operator type");
109 virtual void getValues(OutputViewType outputValues,
const EOperator operatorType,
110 const PointViewType inputPoints1,
const PointViewType inputPoints2,
const PointViewType inputPoints3,
111 bool tensorPoints)
const override
113 Intrepid2::EOperator op1, op2, op3;
114 if (operatorType == Intrepid2::OPERATOR_VALUE)
116 op1 = Intrepid2::OPERATOR_VALUE;
117 op2 = Intrepid2::OPERATOR_VALUE;
118 op3 = Intrepid2::OPERATOR_VALUE;
121 auto outputValuesComponent1 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),0);
122 auto outputValuesComponent23 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),std::make_pair(1,3));
127 inputPoints3, op3, tensorPoints);
129 Kokkos::deep_copy(outputValuesComponent23,0.0);
131 else if (operatorType == Intrepid2::OPERATOR_DIV)
136 op1 = Intrepid2::OPERATOR_GRAD;
137 op2 = Intrepid2::OPERATOR_VALUE;
138 op3 = Intrepid2::OPERATOR_VALUE;
144 inputPoints3, op3, tensorPoints, weight);
148 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"operator not yet supported");
164 auto dofCoeffs1 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),0);
165 auto dofCoeffs23 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),std::make_pair(1,3));
167 Kokkos::deep_copy(dofCoeffs23,0.0);
171 template<
class HGRAD_LINE,
class HVOL_LINE>
177 using OutputViewType =
typename HGRAD_LINE::OutputViewType;
178 using PointViewType =
typename HGRAD_LINE::PointViewType ;
179 using ScalarViewType =
typename HGRAD_LINE::ScalarViewType;
181 using LineGradBasis = HGRAD_LINE;
182 using LineHVolBasis = HVOL_LINE;
194 TensorBasis3(Teuchos::rcp( new LineHVolBasis(polyOrder_x-1,pointType) ),
195 Teuchos::rcp( new LineGradBasis(polyOrder_y,pointType) ),
196 Teuchos::rcp( new LineHVolBasis(polyOrder_z-1,pointType) ),
199 this->functionSpace_ = FUNCTION_SPACE_HDIV;
206 const EOperator VALUE = Intrepid2::OPERATOR_VALUE;
207 const EOperator GRAD = Intrepid2::OPERATOR_GRAD;
208 const EOperator DIV = Intrepid2::OPERATOR_DIV;
210 const double weight = 1.0;
211 if (operatorType == VALUE)
213 std::vector< std::vector<EOperator> > ops(3);
214 ops[0] = std::vector<EOperator>{};
215 ops[1] = std::vector<EOperator>{VALUE,VALUE,VALUE};
216 ops[2] = std::vector<EOperator>{};
217 std::vector<double> weights {0.0,weight,0.0};
220 else if (operatorType == DIV)
223 std::vector< std::vector<EOperator> > ops(1);
224 ops[0] = std::vector<EOperator>{VALUE,GRAD,VALUE};
225 std::vector<double> weights {weight};
230 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
"Unsupported operator type");
244 virtual void getValues(OutputViewType outputValues,
const EOperator operatorType,
245 const PointViewType inputPoints1,
const PointViewType inputPoints2,
const PointViewType inputPoints3,
246 bool tensorPoints)
const override
248 Intrepid2::EOperator op1, op2, op3;
249 if (operatorType == Intrepid2::OPERATOR_VALUE)
251 op1 = Intrepid2::OPERATOR_VALUE;
252 op2 = Intrepid2::OPERATOR_VALUE;
253 op3 = Intrepid2::OPERATOR_VALUE;
256 auto outputValuesComponent_x = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),0);
257 auto outputValuesComponent_y = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),1);
258 auto outputValuesComponent_z = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),2);
261 Kokkos::deep_copy(outputValuesComponent_x,0.0);
267 inputPoints3, op3, tensorPoints, weight);
270 Kokkos::deep_copy(outputValuesComponent_z,0.0);
272 else if (operatorType == Intrepid2::OPERATOR_DIV)
275 op1 = Intrepid2::OPERATOR_VALUE;
276 op2 = Intrepid2::OPERATOR_GRAD;
277 op3 = Intrepid2::OPERATOR_VALUE;
283 inputPoints3, op3, tensorPoints, weight);
287 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"operator not yet supported");
303 auto dofCoeffs1 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),0);
304 auto dofCoeffs2 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),1);
305 auto dofCoeffs3 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),2);
306 Kokkos::deep_copy(dofCoeffs1,0.0);
308 Kokkos::deep_copy(dofCoeffs3,0.0);
312 template<
class HGRAD_LINE,
class HVOL_LINE>
317 using OutputViewType =
typename HGRAD_LINE::OutputViewType;
318 using PointViewType =
typename HGRAD_LINE::PointViewType ;
319 using ScalarViewType =
typename HGRAD_LINE::ScalarViewType;
321 using LineGradBasis = HGRAD_LINE;
322 using LineHVolBasis = HVOL_LINE;
334 TensorBasis3(Teuchos::rcp( new LineHVolBasis(polyOrder_x-1,pointType) ),
335 Teuchos::rcp( new LineHVolBasis(polyOrder_y-1,pointType) ),
336 Teuchos::rcp( new LineGradBasis(polyOrder_z,pointType) ),
339 this->functionSpace_ = FUNCTION_SPACE_HDIV;
346 const EOperator VALUE = Intrepid2::OPERATOR_VALUE;
347 const EOperator GRAD = Intrepid2::OPERATOR_GRAD;
348 const EOperator DIV = Intrepid2::OPERATOR_DIV;
350 const double weight = 1.0;
351 if (operatorType == VALUE)
353 std::vector< std::vector<EOperator> > ops(3);
354 ops[0] = std::vector<EOperator>{};
355 ops[1] = std::vector<EOperator>{};
356 ops[2] = std::vector<EOperator>{VALUE,VALUE,VALUE};
357 std::vector<double> weights {0.0,0.0,weight};
360 else if (operatorType == DIV)
363 std::vector< std::vector<EOperator> > ops(1);
364 ops[0] = std::vector<EOperator>{VALUE,VALUE,GRAD};
365 std::vector<double> weights {weight};
370 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
"Unsupported operator type");
384 virtual void getValues(OutputViewType outputValues,
const EOperator operatorType,
385 const PointViewType inputPoints1,
const PointViewType inputPoints2,
const PointViewType inputPoints3,
386 bool tensorPoints)
const override
388 Intrepid2::EOperator op1, op2, op3;
389 if (operatorType == Intrepid2::OPERATOR_VALUE)
391 op1 = Intrepid2::OPERATOR_VALUE;
392 op2 = Intrepid2::OPERATOR_VALUE;
393 op3 = Intrepid2::OPERATOR_VALUE;
396 auto outputValuesComponent_xy = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),std::make_pair(0,2));
397 auto outputValuesComponent_z = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),2);
400 Kokkos::deep_copy(outputValuesComponent_xy,0.0);
406 inputPoints3, op3, tensorPoints);
408 else if (operatorType == Intrepid2::OPERATOR_DIV)
413 op1 = Intrepid2::OPERATOR_VALUE;
414 op2 = Intrepid2::OPERATOR_VALUE;
415 op3 = Intrepid2::OPERATOR_GRAD;
421 inputPoints3, op3, tensorPoints, weight);
425 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"operator not yet supported");
441 auto dofCoeffs12 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),std::make_pair(0,2));
442 auto dofCoeffs3 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),2);
443 Kokkos::deep_copy(dofCoeffs12,0.0);
452 template<
class HGRAD_LINE,
class HVOL_LINE>
469 Teuchos::rcp( new
Family1(polyOrder_x, polyOrder_y, polyOrder_z, pointType))) {
470 this->functionSpace_ = FUNCTION_SPACE_HDIV;
474 template<
class HGRAD_LINE,
class HVOL_LINE>
483 ordinal_type order_x_;
484 ordinal_type order_y_;
485 ordinal_type order_z_;
486 EPointType pointType_;
489 using ExecutionSpace =
typename HGRAD_LINE::ExecutionSpace;
490 using OutputValueType =
typename HGRAD_LINE::OutputValueType;
491 using PointValueType =
typename HGRAD_LINE::PointValueType;
493 using BasisBase =
typename HGRAD_LINE::BasisBase;
504 Teuchos::rcp(new
Family2 (polyOrder_x, polyOrder_y, polyOrder_z, pointType))) {
505 this->functionSpace_ = FUNCTION_SPACE_HDIV;
507 std::ostringstream basisName;
509 name_ = basisName.str();
511 order_x_ = polyOrder_x;
512 order_y_ = polyOrder_y;
513 order_z_ = polyOrder_z;
514 pointType_ = pointType;
535 return name_.c_str();
548 Teuchos::RCP<BasisBase>
553 if(subCellDim == 2) {
556 return Teuchos::rcp(
new QuadBasis(order_x_-1, order_z_-1, pointType_) );
558 return Teuchos::rcp(
new QuadBasis(order_y_-1,order_z_-1, pointType_) );
560 return Teuchos::rcp(
new QuadBasis(order_x_-1, order_z_-1, pointType_) );
562 return Teuchos::rcp(
new QuadBasis(order_z_-1, order_y_-1, pointType_) );
564 return Teuchos::rcp(
new QuadBasis(order_y_-1, order_x_-1, pointType_) );
566 return Teuchos::rcp(
new QuadBasis(order_x_-1, order_y_-1, pointType_) );
570 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"Input parameters out of bounds");
577 virtual HostBasisPtr<OutputValueType, PointValueType>
581 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...
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.
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.
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.
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 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, 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)
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_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.