37 #ifndef Intrepid2_DerivedBasis_HCURL_WEDGE_h
38 #define Intrepid2_DerivedBasis_HCURL_WEDGE_h
40 #include <Kokkos_DynRankView.hpp>
50 template<
class HCURL_TRI,
class HGRAD_LINE>
55 using OutputViewType =
typename HGRAD_LINE::OutputViewType;
56 using PointViewType =
typename HGRAD_LINE::PointViewType ;
57 using ScalarViewType =
typename HGRAD_LINE::ScalarViewType;
59 using BasisBase =
typename HGRAD_LINE::BasisBase;
61 using DeviceType =
typename BasisBase::DeviceType;
62 using ExecutionSpace =
typename BasisBase::ExecutionSpace;
63 using OutputValueType =
typename BasisBase::OutputValueType;
64 using PointValueType =
typename BasisBase::PointValueType;
66 using TriCurlBasis = HCURL_TRI;
67 using LineGradBasis = HGRAD_LINE;
78 TensorBasis(Teuchos::rcp( new TriCurlBasis(polyOrder_xy,pointType)),
79 Teuchos::rcp( new LineGradBasis(polyOrder_z,pointType)))
81 this->functionSpace_ = FUNCTION_SPACE_HCURL;
82 this->setShardsTopologyAndTags();
91 const EOperator & VALUE = OPERATOR_VALUE;
92 const EOperator & GRAD = OPERATOR_GRAD;
93 const EOperator & CURL = OPERATOR_CURL;
94 if (operatorType == VALUE)
97 std::vector< std::vector<EOperator> > ops(2);
98 ops[0] = std::vector<EOperator>{VALUE,VALUE};
99 ops[1] = std::vector<EOperator>{};
100 std::vector<double> weights {1.0, 0.0};
103 else if (operatorType == CURL)
108 std::vector< std::vector<EOperator> > ops(2);
109 ops[0] = std::vector<EOperator>{VALUE,GRAD};
110 ops[1] = std::vector<EOperator>{CURL,VALUE};
111 std::vector<double> weights {1.0, 1.0};
113 opDecomposition.setRotateXYNinetyDegrees(
true);
114 return opDecomposition;
118 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
"Unsupported operator type");
129 virtual void getValues(OutputViewType outputValues,
const EOperator operatorType,
130 const PointViewType inputPoints1,
const PointViewType inputPoints2,
131 bool tensorPoints)
const override
134 if (operatorType == OPERATOR_VALUE)
136 op1 = OPERATOR_VALUE;
137 op2 = OPERATOR_VALUE;
140 auto outputValuesComponent12 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),std::pair<int,int>{0,2});
141 auto outputValuesComponent3 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),2);
144 Kokkos::deep_copy(outputValuesComponent3, 0.0);
147 inputPoints2, op2, tensorPoints);
150 else if (operatorType == OPERATOR_CURL)
156 auto outputValuesComponent12 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),std::pair<int,int>{0,2});
157 auto outputValuesComponent3 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),2);
159 op1 = OPERATOR_VALUE;
164 inputPoints2, op2, tensorPoints);
166 auto policy = Kokkos::MDRangePolicy<ExecutionSpace,Kokkos::Rank<2>>({0,0},{outputValuesComponent12.extent_int(0),outputValuesComponent12.extent_int(1)});
167 Kokkos::parallel_for(
"wedge family 1 curl: rotateXYNinetyDegrees CW", policy,
168 KOKKOS_LAMBDA (
const int &fieldOrdinal,
const int &pointOrdinal) {
169 const auto f_x = outputValuesComponent12(fieldOrdinal,pointOrdinal,0);
170 const auto &f_y = outputValuesComponent12(fieldOrdinal,pointOrdinal,1);
171 outputValuesComponent12(fieldOrdinal,pointOrdinal,0) = -f_y;
172 outputValuesComponent12(fieldOrdinal,pointOrdinal,1) = f_x;
176 op2 = OPERATOR_VALUE;
179 inputPoints2, op2, tensorPoints);
183 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"operator not yet supported");
199 auto dofCoeffs1 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),std::make_pair(0,2));
200 auto dofCoeffs2 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),2);
202 Kokkos::deep_copy(dofCoeffs2,0.0);
206 template<
class HGRAD_TRI,
class HVOL_LINE>
212 using OutputViewType =
typename HVOL_LINE::OutputViewType;
213 using PointViewType =
typename HVOL_LINE::PointViewType ;
214 using ScalarViewType =
typename HVOL_LINE::ScalarViewType;
216 using TriGradBasis = HGRAD_TRI;
217 using LineHVolBasis = HVOL_LINE;
219 using BasisBase =
typename HVOL_LINE::BasisBase;
222 using DeviceType =
typename BasisBase::DeviceType;
223 using ExecutionSpace =
typename BasisBase::ExecutionSpace;
224 using OutputValueType =
typename BasisBase::OutputValueType;
225 using PointValueType =
typename BasisBase::PointValueType;
234 TensorBasis(Teuchos::rcp( new TriGradBasis(polyOrder_xy, pointType) ),
235 Teuchos::rcp( new LineHVolBasis(polyOrder_z-1, pointType) ))
237 this->functionSpace_ = FUNCTION_SPACE_HCURL;
238 this->setShardsTopologyAndTags();
245 if (operatorType == OPERATOR_CURL)
250 std::vector< std::vector<EOperator> > ops(2);
251 ops[0] = std::vector<EOperator>{OPERATOR_GRAD,OPERATOR_VALUE};
252 ops[1] = std::vector<EOperator>{};
253 std::vector<double> weights {-1.0, 0.0};
255 opDecomposition.setRotateXYNinetyDegrees(
true);
256 return opDecomposition;
258 else if (OPERATOR_VALUE == operatorType)
261 std::vector< std::vector<EOperator> > ops(2);
262 ops[0] = std::vector<EOperator>{};
263 ops[1] = std::vector<EOperator>{OPERATOR_VALUE,OPERATOR_VALUE};
264 std::vector<double> weights {0.0, 1.0};
269 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
"Unsupported operator type");
282 virtual void getValues(OutputViewType outputValues,
const EOperator operatorType,
283 const PointViewType inputPoints1,
const PointViewType inputPoints2,
284 bool tensorPoints)
const override
287 if (operatorType == OPERATOR_VALUE)
289 op1 = OPERATOR_VALUE;
290 op2 = OPERATOR_VALUE;
293 auto outputValuesComponent12 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),std::pair<int,int>{0,2});
294 auto outputValuesComponent3 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),2);
297 Kokkos::deep_copy(outputValuesComponent12, 0.0);
300 inputPoints2, op2, tensorPoints);
303 else if (operatorType == OPERATOR_CURL)
307 auto outputValuesComponent12 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),std::pair<int,int>{0,2});
308 auto outputValuesComponent3 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),2);
311 op2 = OPERATOR_VALUE;
315 inputPoints2, op2, tensorPoints);
317 auto policy = Kokkos::MDRangePolicy<ExecutionSpace,Kokkos::Rank<2>>({0,0},{outputValuesComponent12.extent_int(0),outputValuesComponent12.extent_int(1)});
318 Kokkos::parallel_for(
"wedge family 2 curl: rotateXYNinetyDegrees CCW", policy,
319 KOKKOS_LAMBDA (
const int &fieldOrdinal,
const int &pointOrdinal) {
320 const auto f_x = outputValuesComponent12(fieldOrdinal,pointOrdinal,0);
321 const auto &f_y = outputValuesComponent12(fieldOrdinal,pointOrdinal,1);
322 outputValuesComponent12(fieldOrdinal,pointOrdinal,0) = f_y;
323 outputValuesComponent12(fieldOrdinal,pointOrdinal,1) = -f_x;
326 Kokkos::deep_copy(outputValuesComponent3, 0.0);
330 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"operator not yet supported");
346 auto dofCoeffs1 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),std::make_pair(0,2));
347 auto dofCoeffs2 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),2);
348 Kokkos::deep_copy(dofCoeffs1,0.0);
353 template<
class HGRAD_TRI,
class HCURL_TRI,
class HGRAD_LINE,
class HVOL_LINE>
361 using BasisBase =
typename HGRAD_LINE::BasisBase;
365 ordinal_type order_xy_;
366 ordinal_type order_z_;
367 EPointType pointType_;
370 using ExecutionSpace =
typename HGRAD_LINE::ExecutionSpace;
371 using OutputValueType =
typename HGRAD_LINE::OutputValueType;
372 using PointValueType =
typename HGRAD_LINE::PointValueType;
382 Teuchos::rcp( new
Family2(polyOrder_xy, polyOrder_z, pointType) ))
384 this->functionSpace_ = FUNCTION_SPACE_HCURL;
386 std::ostringstream basisName;
388 name_ = basisName.str();
390 order_xy_ = polyOrder_xy;
391 order_z_ = polyOrder_z;
392 pointType_ = pointType;
415 return name_.c_str();
427 Teuchos::RCP<BasisBase>
430 using LineBasis = HVOL_LINE;
431 using TriCurlBasis = HCURL_TRI;
433 if(subCellDim == 1) {
435 return Teuchos::rcp(
new LineBasis(order_xy_-1, pointType_) );
437 return Teuchos::rcp(
new LineBasis(order_z_-1, pointType_) );
439 else if(subCellDim == 2) {
442 return Teuchos::rcp(
new QuadCurlBasis(order_xy_, order_z_, pointType_) );
444 return Teuchos::rcp(
new QuadCurlBasis(order_xy_, order_z_, pointType_) );
446 return Teuchos::rcp(
new QuadCurlBasis(order_z_, order_xy_, pointType_) );
448 return Teuchos::rcp(
new TriCurlBasis(order_xy_, pointType_) );
450 return Teuchos::rcp(
new TriCurlBasis(order_xy_, pointType_) );
452 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"subCellOrd is out of bounds");
455 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"subCellDim is out of bounds");
462 virtual HostBasisPtr<OutputValueType, PointValueType>
466 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.