16 #ifndef __INTREPID2_HCURL_WEDGE_I1_FEM_DEF_HPP__
17 #define __INTREPID2_HCURL_WEDGE_I1_FEM_DEF_HPP__
24 template<EOperator opType>
25 template<
typename OutputViewType,
26 typename inputViewType>
27 KOKKOS_INLINE_FUNCTION
29 Basis_HCURL_WEDGE_I1_FEM::Serial<opType>::
30 getValues( OutputViewType output,
31 const inputViewType input ) {
33 case OPERATOR_VALUE: {
34 const auto x = input(0);
35 const auto y = input(1);
36 const auto z = input(2);
39 output.access(0, 0) = (1.0 - z)*(1.0 - y);
40 output.access(0, 1) = x*(1.0 - z);
41 output.access(0, 2) = 0.0;
43 output.access(1, 0) = y*(z - 1.0);
44 output.access(1, 1) = x*(1.0 - z);
45 output.access(1, 2) = 0.0;
47 output.access(2, 0) = y*(z - 1.0);
48 output.access(2, 1) = (1.0 - x)*(z - 1.0);
49 output.access(2, 2) = 0.0;
51 output.access(3, 0) = (1.0 - y)*(1.0 + z);
52 output.access(3, 1) = x*(1.0 + z);
53 output.access(3, 2) = 0.0;
55 output.access(4, 0) =-y*(1.0 + z);
56 output.access(4, 1) = x*(1.0 + z);
57 output.access(4, 2) = 0.0;
59 output.access(5, 0) = -y*(1.0 + z);
60 output.access(5, 1) = (x - 1.0)*(1.0 + z);
61 output.access(5, 2) = 0.0;
63 output.access(6, 0) = 0.0;
64 output.access(6, 1) = 0.0;
65 output.access(6, 2) = (1.0 - x - y);
67 output.access(7, 0) = 0.0;
68 output.access(7, 1) = 0.0;
69 output.access(7, 2) = x;
71 output.access(8, 0) = 0.0;
72 output.access(8, 1) = 0.0;
73 output.access(8, 2) = y;
77 const auto x = input(0);
78 const auto y = input(1);
79 const auto z = input(2);
81 output.access(0, 0) = x;
82 output.access(0, 1) = (y - 1.0);
83 output.access(0, 2) = 2*(1.0 - z);
85 output.access(1, 0) = x;
86 output.access(1, 1) = y;
87 output.access(1, 2) = 2.0*(1.0 - z);
89 output.access(2, 0) = (x - 1.0);
90 output.access(2, 1) = y;
91 output.access(2, 2) = 2.0*(1.0 - z);
93 output.access(3, 0) = -x;
94 output.access(3, 1) = (1.0 - y);
95 output.access(3, 2) = 2.0*(1.0 + z);
97 output.access(4, 0) = -x;
98 output.access(4, 1) = -y;
99 output.access(4, 2) = 2*(1.0 + z);
101 output.access(5, 0) = (1.0 - x);
102 output.access(5, 1) = -y;
103 output.access(5, 2) = 2.0*(1.0 + z);
105 output.access(6, 0) =-1.0;
106 output.access(6, 1) = 1.0;
107 output.access(6, 2) = 0.0;
109 output.access(7, 0) = 0.0;
110 output.access(7, 1) =-1.0;
111 output.access(7, 2) = 0.0;
113 output.access(8, 0) = 1.0;
114 output.access(8, 1) = 0.0;
115 output.access(8, 2) = 0.0;
119 INTREPID2_TEST_FOR_ABORT( opType != OPERATOR_VALUE &&
120 opType != OPERATOR_CURL,
121 ">>> ERROR: (Intrepid2::Basis_HCURL_WEDGE_I1_FEM::Serial::getValues) operator is not supported");
127 template<
typename DT,
128 typename outputValueValueType,
class ...outputValueProperties,
129 typename inputPointValueType,
class ...inputPointProperties>
130 void Basis_HCURL_WEDGE_I1_FEM::
131 getValues( Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValues,
132 const Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPoints,
133 const EOperator operatorType ) {
134 typedef Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValueViewType;
135 typedef Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPointViewType;
136 typedef typename ExecSpace<typename inputPointViewType::execution_space,typename DT::execution_space>::ExecSpaceType ExecSpaceType;
139 const auto loopSize = inputPoints.extent(0);
140 Kokkos::RangePolicy<ExecSpaceType,Kokkos::Schedule<Kokkos::Static> > policy(0, loopSize);
142 switch (operatorType) {
143 case OPERATOR_VALUE: {
144 typedef Functor<outputValueViewType,inputPointViewType,OPERATOR_VALUE> FunctorType;
145 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
148 case OPERATOR_CURL: {
149 typedef Functor<outputValueViewType,inputPointViewType,OPERATOR_CURL> FunctorType;
150 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
154 INTREPID2_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_DIV), std::invalid_argument,
155 ">>> ERROR (Basis_HCURL_WEDGE_I1_FEM): DIV is invalid operator for HCURL Basis Functions");
158 case OPERATOR_GRAD: {
159 INTREPID2_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_GRAD), std::invalid_argument,
160 ">>> ERROR (Basis_HCURL_WEDGE_I1_FEM): GRAD is invalid operator for HCURL Basis Functions");
173 INTREPID2_TEST_FOR_EXCEPTION( ( (operatorType == OPERATOR_D1) ||
174 (operatorType == OPERATOR_D2) ||
175 (operatorType == OPERATOR_D3) ||
176 (operatorType == OPERATOR_D4) ||
177 (operatorType == OPERATOR_D5) ||
178 (operatorType == OPERATOR_D6) ||
179 (operatorType == OPERATOR_D7) ||
180 (operatorType == OPERATOR_D8) ||
181 (operatorType == OPERATOR_D9) ||
182 (operatorType == OPERATOR_D10) ),
183 std::invalid_argument,
184 ">>> ERROR (Basis_HCURL_WEDGE_I1_FEM): Invalid operator type");
188 INTREPID2_TEST_FOR_EXCEPTION( !(Intrepid2::isValidOperator(operatorType)),
189 std::invalid_argument,
190 ">>> ERROR (Basis_HCURL_WEDGE_I1_FEM): Invalid operator type");
197 template<
typename DT,
typename OT,
typename PT>
200 const ordinal_type spaceDim = 3;
201 this->basisCardinality_ = 9;
202 this->basisDegree_ = 1;
203 this->basisCellTopologyKey_ = shards::Wedge<6>::key;
204 this->basisType_ = BASIS_FEM_DEFAULT;
205 this->basisCoordinates_ = COORDINATES_CARTESIAN;
206 this->functionSpace_ = FUNCTION_SPACE_HCURL;
212 const ordinal_type tagSize = 4;
213 const ordinal_type posScDim = 0;
214 const ordinal_type posScOrd = 1;
215 const ordinal_type posDfOrd = 2;
218 ordinal_type tags[36] = {
230 OrdinalTypeArray1DHost tagView(&tags[0],36);
233 this->setOrdinalTagData(this->tagToOrdinal_,
236 this->basisCardinality_,
243 Kokkos::DynRankView<typename ScalarViewType::value_type,typename DT::execution_space::array_layout,Kokkos::HostSpace>
244 dofCoords(
"dofCoordsHost", this->basisCardinality_,spaceDim);
246 dofCoords(0,0) = 0.5; dofCoords(0,1) = 0.0; dofCoords(0,2) = -1.0;
247 dofCoords(1,0) = 0.5; dofCoords(1,1) = 0.5; dofCoords(1,2) = -1.0;
248 dofCoords(2,0) = 0.0; dofCoords(2,1) = 0.5; dofCoords(2,2) = -1.0;
249 dofCoords(3,0) = 0.5; dofCoords(3,1) = 0.0; dofCoords(3,2) = 1.0;
250 dofCoords(4,0) = 0.5; dofCoords(4,1) = 0.5; dofCoords(4,2) = 1.0;
251 dofCoords(5,0) = 0.0; dofCoords(5,1) = 0.5; dofCoords(5,2) = 1.0;
252 dofCoords(6,0) = 0.0; dofCoords(6,1) = 0.0; dofCoords(6,2) = 0.0;
253 dofCoords(7,0) = 1.0; dofCoords(7,1) = 0.0; dofCoords(7,2) = 0.0;
254 dofCoords(8,0) = 0.0; dofCoords(8,1) = 1.0; dofCoords(8,2) = 0.0;
256 this->dofCoords_ = Kokkos::create_mirror_view(
typename DT::memory_space(), dofCoords);
257 Kokkos::deep_copy(this->dofCoords_, dofCoords);
260 Kokkos::DynRankView<typename ScalarViewType::value_type,typename DT::execution_space::array_layout,Kokkos::HostSpace>
261 dofCoeffs(
"dofCoeffsHost", this->basisCardinality_,spaceDim);
264 dofCoeffs(0,0) = 0.5; dofCoeffs(0,1) = 0.0; dofCoeffs(0,2) = 0.0;
265 dofCoeffs(1,0) = -0.5; dofCoeffs(1,1) = 0.5; dofCoeffs(1,2) = 0.0;
266 dofCoeffs(2,0) = 0.0; dofCoeffs(2,1) = -0.5; dofCoeffs(2,2) = 0.0;
267 dofCoeffs(3,0) = 0.5; dofCoeffs(3,1) = 0.0; dofCoeffs(3,2) = 0.0;
268 dofCoeffs(4,0) = -0.5; dofCoeffs(4,1) = 0.5; dofCoeffs(4,2) = 0.0;
269 dofCoeffs(5,0) = 0.0; dofCoeffs(5,1) = -0.5; dofCoeffs(5,2) = 0.0;
270 dofCoeffs(6,0) = 0.0; dofCoeffs(6,1) = 0.0; dofCoeffs(6,2) = 1.0;
271 dofCoeffs(7,0) = 0.0; dofCoeffs(7,1) = 0.0; dofCoeffs(7,2) = 1.0;
272 dofCoeffs(8,0) = 0.0; dofCoeffs(8,1) = 0.0; dofCoeffs(8,2) = 1.0;
274 this->dofCoeffs_ = Kokkos::create_mirror_view(
typename DT::memory_space(), dofCoeffs);
275 Kokkos::deep_copy(this->dofCoeffs_, dofCoeffs);
279 template<
typename DT,
typename OT,
typename PT>
282 ordinal_type& perTeamSpaceSize,
283 ordinal_type& perThreadSpaceSize,
284 const PointViewType inputPoints,
285 const EOperator operatorType)
const {
286 perTeamSpaceSize = 0;
287 perThreadSpaceSize = 0;
290 template<
typename DT,
typename OT,
typename PT>
291 KOKKOS_INLINE_FUNCTION
293 Basis_HCURL_WEDGE_I1_FEM<DT,OT,PT>::getValues(
294 OutputViewType outputValues,
295 const PointViewType inputPoints,
296 const EOperator operatorType,
297 const typename Kokkos::TeamPolicy<typename DT::execution_space>::member_type& team_member,
298 const typename DT::execution_space::scratch_memory_space & scratchStorage,
299 const ordinal_type subcellDim,
300 const ordinal_type subcellOrdinal)
const {
302 INTREPID2_TEST_FOR_ABORT( !((subcellDim == -1) && (subcellOrdinal == -1)),
303 ">>> ERROR: (Intrepid2::Basis_HCURL_WEDGE_I1_FEM::getValues), The capability of selecting subsets of basis functions has not been implemented yet.");
305 (void) scratchStorage;
307 const int numPoints = inputPoints.extent(0);
309 switch(operatorType) {
311 Kokkos::parallel_for (Kokkos::TeamThreadRange (team_member, numPoints), [=] (ordinal_type& pt) {
312 auto output = Kokkos::subview( outputValues, Kokkos::ALL(), pt, Kokkos::ALL() );
313 const auto input = Kokkos::subview( inputPoints, pt, Kokkos::ALL() );
314 Impl::Basis_HCURL_WEDGE_I1_FEM::Serial<OPERATOR_VALUE>::getValues( output, input);
318 Kokkos::parallel_for (Kokkos::TeamThreadRange (team_member, numPoints), [=] (ordinal_type& pt) {
319 auto output = Kokkos::subview( outputValues, Kokkos::ALL(), pt, Kokkos::ALL() );
320 const auto input = Kokkos::subview( inputPoints, pt, Kokkos::ALL() );
321 Impl::Basis_HCURL_WEDGE_I1_FEM::Serial<OPERATOR_CURL>::getValues( output, input);
325 INTREPID2_TEST_FOR_ABORT(
true,
">>> ERROR: (Intrepid2::Basis_HCURL_WEDGE_I1_FEM::getValues), Operator Type not supported.");
Implementation of the default H(curl)-compatible FEM basis of degree 1 on Wedge cell.
Basis_HCURL_WEDGE_I1_FEM()
Constructor.