70 #ifndef Intrepid2_DerivedBasis_HCURL_WEDGE_h
71 #define Intrepid2_DerivedBasis_HCURL_WEDGE_h
73 #include <Kokkos_DynRankView.hpp>
83 template<
class HCURL_TRI,
class HGRAD_LINE>
88 using OutputViewType =
typename HGRAD_LINE::OutputViewType;
89 using PointViewType =
typename HGRAD_LINE::PointViewType ;
90 using ScalarViewType =
typename HGRAD_LINE::ScalarViewType;
92 using BasisBase =
typename HGRAD_LINE::BasisBase;
94 using DeviceType =
typename BasisBase::DeviceType;
95 using ExecutionSpace =
typename BasisBase::ExecutionSpace;
96 using OutputValueType =
typename BasisBase::OutputValueType;
97 using PointValueType =
typename BasisBase::PointValueType;
99 using TriCurlBasis = HCURL_TRI;
100 using LineGradBasis = HGRAD_LINE;
111 TensorBasis(Teuchos::rcp( new TriCurlBasis(polyOrder_xy,pointType)),
112 Teuchos::rcp( new LineGradBasis(polyOrder_z,pointType)))
114 this->functionSpace_ = FUNCTION_SPACE_HCURL;
115 this->setShardsTopologyAndTags();
124 const EOperator & VALUE = OPERATOR_VALUE;
125 const EOperator & GRAD = OPERATOR_GRAD;
126 const EOperator & CURL = OPERATOR_CURL;
127 if (operatorType == VALUE)
130 std::vector< std::vector<EOperator> > ops(2);
131 ops[0] = std::vector<EOperator>{VALUE,VALUE};
132 ops[1] = std::vector<EOperator>{};
133 std::vector<double> weights {1.0, 0.0};
136 else if (operatorType == CURL)
141 std::vector< std::vector<EOperator> > ops(2);
142 ops[0] = std::vector<EOperator>{VALUE,GRAD};
143 ops[1] = std::vector<EOperator>{CURL,VALUE};
144 std::vector<double> weights {1.0, 1.0};
146 opDecomposition.setRotateXYNinetyDegrees(
true);
147 return opDecomposition;
151 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
"Unsupported operator type");
162 virtual void getValues(OutputViewType outputValues,
const EOperator operatorType,
163 const PointViewType inputPoints1,
const PointViewType inputPoints2,
164 bool tensorPoints)
const override
167 if (operatorType == OPERATOR_VALUE)
169 op1 = OPERATOR_VALUE;
170 op2 = OPERATOR_VALUE;
173 auto outputValuesComponent12 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),std::pair<int,int>{0,2});
174 auto outputValuesComponent3 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),2);
177 Kokkos::deep_copy(outputValuesComponent3, 0.0);
180 inputPoints2, op2, tensorPoints);
183 else if (operatorType == OPERATOR_CURL)
189 auto outputValuesComponent12 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),std::pair<int,int>{0,2});
190 auto outputValuesComponent3 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),2);
192 op1 = OPERATOR_VALUE;
197 inputPoints2, op2, tensorPoints);
199 auto policy = Kokkos::MDRangePolicy<ExecutionSpace,Kokkos::Rank<2>>({0,0},{outputValuesComponent12.extent_int(0),outputValuesComponent12.extent_int(1)});
200 Kokkos::parallel_for(
"wedge family 1 curl: rotateXYNinetyDegrees CW", policy,
201 KOKKOS_LAMBDA (
const int &fieldOrdinal,
const int &pointOrdinal) {
202 const auto f_x = outputValuesComponent12(fieldOrdinal,pointOrdinal,0);
203 const auto &f_y = outputValuesComponent12(fieldOrdinal,pointOrdinal,1);
204 outputValuesComponent12(fieldOrdinal,pointOrdinal,0) = -f_y;
205 outputValuesComponent12(fieldOrdinal,pointOrdinal,1) = f_x;
209 op2 = OPERATOR_VALUE;
212 inputPoints2, op2, tensorPoints);
216 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"operator not yet supported");
232 auto dofCoeffs1 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),std::make_pair(0,2));
233 auto dofCoeffs2 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),2);
235 Kokkos::deep_copy(dofCoeffs2,0.0);
239 template<
class HGRAD_TRI,
class HVOL_LINE>
245 using OutputViewType =
typename HVOL_LINE::OutputViewType;
246 using PointViewType =
typename HVOL_LINE::PointViewType ;
247 using ScalarViewType =
typename HVOL_LINE::ScalarViewType;
249 using TriGradBasis = HGRAD_TRI;
250 using LineHVolBasis = HVOL_LINE;
252 using BasisBase =
typename HVOL_LINE::BasisBase;
255 using DeviceType =
typename BasisBase::DeviceType;
256 using ExecutionSpace =
typename BasisBase::ExecutionSpace;
257 using OutputValueType =
typename BasisBase::OutputValueType;
258 using PointValueType =
typename BasisBase::PointValueType;
267 TensorBasis(Teuchos::rcp( new TriGradBasis(polyOrder_xy, pointType) ),
268 Teuchos::rcp( new LineHVolBasis(polyOrder_z-1, pointType) ))
270 this->functionSpace_ = FUNCTION_SPACE_HCURL;
271 this->setShardsTopologyAndTags();
278 if (operatorType == OPERATOR_CURL)
283 std::vector< std::vector<EOperator> > ops(2);
284 ops[0] = std::vector<EOperator>{OPERATOR_GRAD,OPERATOR_VALUE};
285 ops[1] = std::vector<EOperator>{};
286 std::vector<double> weights {-1.0, 0.0};
288 opDecomposition.setRotateXYNinetyDegrees(
true);
289 return opDecomposition;
291 else if (OPERATOR_VALUE == operatorType)
294 std::vector< std::vector<EOperator> > ops(2);
295 ops[0] = std::vector<EOperator>{};
296 ops[1] = std::vector<EOperator>{OPERATOR_VALUE,OPERATOR_VALUE};
297 std::vector<double> weights {0.0, 1.0};
302 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
"Unsupported operator type");
315 virtual void getValues(OutputViewType outputValues,
const EOperator operatorType,
316 const PointViewType inputPoints1,
const PointViewType inputPoints2,
317 bool tensorPoints)
const override
320 if (operatorType == OPERATOR_VALUE)
322 op1 = OPERATOR_VALUE;
323 op2 = OPERATOR_VALUE;
326 auto outputValuesComponent12 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),std::pair<int,int>{0,2});
327 auto outputValuesComponent3 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),2);
330 Kokkos::deep_copy(outputValuesComponent12, 0.0);
333 inputPoints2, op2, tensorPoints);
336 else if (operatorType == OPERATOR_CURL)
340 auto outputValuesComponent12 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),std::pair<int,int>{0,2});
341 auto outputValuesComponent3 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),2);
344 op2 = OPERATOR_VALUE;
348 inputPoints2, op2, tensorPoints);
350 auto policy = Kokkos::MDRangePolicy<ExecutionSpace,Kokkos::Rank<2>>({0,0},{outputValuesComponent12.extent_int(0),outputValuesComponent12.extent_int(1)});
351 Kokkos::parallel_for(
"wedge family 2 curl: rotateXYNinetyDegrees CCW", policy,
352 KOKKOS_LAMBDA (
const int &fieldOrdinal,
const int &pointOrdinal) {
353 const auto f_x = outputValuesComponent12(fieldOrdinal,pointOrdinal,0);
354 const auto &f_y = outputValuesComponent12(fieldOrdinal,pointOrdinal,1);
355 outputValuesComponent12(fieldOrdinal,pointOrdinal,0) = f_y;
356 outputValuesComponent12(fieldOrdinal,pointOrdinal,1) = -f_x;
359 Kokkos::deep_copy(outputValuesComponent3, 0.0);
363 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"operator not yet supported");
379 auto dofCoeffs1 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),std::make_pair(0,2));
380 auto dofCoeffs2 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),2);
381 Kokkos::deep_copy(dofCoeffs1,0.0);
386 template<
class HGRAD_TRI,
class HCURL_TRI,
class HGRAD_LINE,
class HVOL_LINE>
394 using BasisBase =
typename HGRAD_LINE::BasisBase;
398 ordinal_type order_xy_;
399 ordinal_type order_z_;
400 EPointType pointType_;
403 using ExecutionSpace =
typename HGRAD_LINE::ExecutionSpace;
404 using OutputValueType =
typename HGRAD_LINE::OutputValueType;
405 using PointValueType =
typename HGRAD_LINE::PointValueType;
415 Teuchos::rcp( new
Family2(polyOrder_xy, polyOrder_z, pointType) ))
417 this->functionSpace_ = FUNCTION_SPACE_HCURL;
419 std::ostringstream basisName;
421 name_ = basisName.str();
423 order_xy_ = polyOrder_xy;
424 order_z_ = polyOrder_z;
425 pointType_ = pointType;
448 return name_.c_str();
460 Teuchos::RCP<BasisBase>
463 using LineBasis = HVOL_LINE;
464 using TriCurlBasis = HCURL_TRI;
466 if(subCellDim == 1) {
468 return Teuchos::rcp(
new LineBasis(order_xy_-1, pointType_) );
470 return Teuchos::rcp(
new LineBasis(order_z_-1, pointType_) );
472 else if(subCellDim == 2) {
475 return Teuchos::rcp(
new QuadCurlBasis(order_xy_, order_z_, pointType_) );
477 return Teuchos::rcp(
new QuadCurlBasis(order_xy_, order_z_, pointType_) );
479 return Teuchos::rcp(
new QuadCurlBasis(order_z_, order_xy_, pointType_) );
481 return Teuchos::rcp(
new TriCurlBasis(order_xy_, pointType_) );
483 return Teuchos::rcp(
new TriCurlBasis(order_xy_, pointType_) );
485 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"subCellOrd is out of bounds");
488 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"subCellDim is out of bounds");
495 virtual HostBasisPtr<OutputValueType, PointValueType>
499 auto hostBasis = Teuchos::rcp(
new HostBasis(order_xy_, order_z_, 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...
Implementation of bases that are tensor products of two or three component bases. ...
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...
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(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)
Implementation of a basis that is the direct sum of two other bases.
virtual void getDofCoeffs(ScalarViewType dofCoeffs) const override
Fills in coefficients of degrees of freedom for Lagrangian basis on the reference cell...
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 bool requireOrientation() const override
True if orientation is required.
virtual const char * getName() const override
Returns basis name.
Basis_Derived_HCURL_Family2_WEDGE(int polyOrder_xy, 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...
Teuchos::RCP< BasisBase > getSubCellRefBasis(const ordinal_type subCellDim, const ordinal_type subCellOrd) const override
returns the basis associated to a subCell.
Basis_Derived_HCURL_Family1_WEDGE(int polyOrder_xy, int polyOrder_z, const EPointType pointType=POINTTYPE_DEFAULT)
Constructor.
Basis_Derived_HCURL_WEDGE(int polyOrder_xy, int polyOrder_z, 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.
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_Derived_HCURL_WEDGE(int polyOrder, const EPointType pointType=POINTTYPE_DEFAULT)
Constructor.
Basis defined as the tensor product of two component bases.
virtual const char * getName() const override
Returns basis name.