16 #ifndef __INTREPID2_HDIV_WEDGE_I1_FEM_DEF_HPP__
17 #define __INTREPID2_HDIV_WEDGE_I1_FEM_DEF_HPP__
24 template<EOperator opType>
25 template<
typename OutputViewType,
26 typename inputViewType>
27 KOKKOS_INLINE_FUNCTION
29 Basis_HDIV_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) = x*2.0;
40 output.access(0, 1) = (y - 1.0)*2.0;
41 output.access(0, 2) = 0.0;
43 output.access(1, 0) = x*2.0;
44 output.access(1, 1) = y*2.0;
45 output.access(1, 2) = 0.0;
47 output.access(2, 0) = (x - 1.0)*2.0;
48 output.access(2, 1) = y*2.0;
49 output.access(2, 2) = 0.0;
51 output.access(3, 0) = 0.0;
52 output.access(3, 1) = 0.0;
53 output.access(3, 2) = (z - 1.0)/2.0;
55 output.access(4, 0) = 0.0;
56 output.access(4, 1) = 0.0;
57 output.access(4, 2) = (1.0 + z)/2.0;
63 output.access(0) = 4.0;
64 output.access(1) = 4.0;
65 output.access(2) = 4.0;
66 output.access(3) = 0.5;
67 output.access(4) = 0.5;
71 INTREPID2_TEST_FOR_ABORT( opType != OPERATOR_VALUE &&
72 opType != OPERATOR_DIV,
73 ">>> ERROR: (Intrepid2::Basis_HDIV_WEDGE_I1_FEM::Serial::getValues) operator is not supported");
80 typename outputValueValueType,
class ...outputValueProperties,
81 typename inputPointValueType,
class ...inputPointProperties>
83 Basis_HDIV_WEDGE_I1_FEM::
84 getValues( Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValues,
85 const Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPoints,
86 const EOperator operatorType ) {
87 typedef Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValueViewType;
88 typedef Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPointViewType;
89 typedef typename ExecSpace<typename inputPointViewType::execution_space,typename DT::execution_space>::ExecSpaceType ExecSpaceType;
92 const auto loopSize = inputPoints.extent(0);
93 Kokkos::RangePolicy<ExecSpaceType,Kokkos::Schedule<Kokkos::Static> > policy(0, loopSize);
95 switch (operatorType) {
97 case OPERATOR_VALUE: {
98 typedef Functor<outputValueViewType,inputPointViewType,OPERATOR_VALUE> FunctorType;
99 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
103 typedef Functor<outputValueViewType,inputPointViewType,OPERATOR_DIV> FunctorType;
104 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
108 INTREPID2_TEST_FOR_EXCEPTION( !( Intrepid2::isValidOperator(operatorType) ), std::invalid_argument,
109 ">>> ERROR (Basis_HDIV_WEDGE_I1_FEM): Invalid operator type");
118 template<
typename DT,
typename OT,
typename PT>
121 const ordinal_type spaceDim = 3;
122 this->basisCardinality_ = 5;
123 this->basisDegree_ = 1;
124 this->basisCellTopologyKey_ = shards::Wedge<6>::key;
125 this->basisType_ = BASIS_FEM_DEFAULT;
126 this->basisCoordinates_ = COORDINATES_CARTESIAN;
127 this->functionSpace_ = FUNCTION_SPACE_HDIV;
132 const ordinal_type tagSize = 4;
133 const ordinal_type posScDim = 0;
134 const ordinal_type posScOrd = 1;
135 const ordinal_type posDfOrd = 2;
138 ordinal_type tags[20] = { 2, 0, 0, 1,
145 OrdinalTypeArray1DHost tagView(&tags[0], 20);
150 this->setOrdinalTagData(this->tagToOrdinal_,
153 this->basisCardinality_,
161 Kokkos::DynRankView<typename ScalarViewType::value_type,typename DT::execution_space::array_layout,Kokkos::HostSpace>
162 dofCoords(
"dofCoordsHost", this->basisCardinality_,spaceDim);
164 dofCoords(0,0) = 0.5; dofCoords(0,1) = 0.0; dofCoords(0,2) = 0.0;
165 dofCoords(1,0) = 0.5; dofCoords(1,1) = 0.5; dofCoords(1,2) = 0.0;
166 dofCoords(2,0) = 0.0; dofCoords(2,1) = 0.5; dofCoords(2,2) = 0.0;
167 dofCoords(3,0) = 1.0/3.0; dofCoords(3,1) = 1.0/3.0; dofCoords(3,2) = -1.0;
168 dofCoords(4,0) = 1.0/3.0; dofCoords(4,1) = 1.0/3.0; dofCoords(4,2) = 1.0;
170 this->dofCoords_ = Kokkos::create_mirror_view(
typename DT::memory_space(), dofCoords);
171 Kokkos::deep_copy(this->dofCoords_, dofCoords);
174 Kokkos::DynRankView<typename ScalarViewType::value_type,typename DT::execution_space::array_layout,Kokkos::HostSpace>
175 dofCoeffs(
"dofCoeffsHost", this->basisCardinality_,spaceDim);
178 dofCoeffs(0,0) = 0.0; dofCoeffs(0,1) = -0.5; dofCoeffs(0,2) = 0.0;
179 dofCoeffs(1,0) = 0.5; dofCoeffs(1,1) = 0.5; dofCoeffs(1,2) = 0.0;
180 dofCoeffs(2,0) = -0.5; dofCoeffs(2,1) = 0.0; dofCoeffs(2,2) = 0.0;
181 dofCoeffs(3,0) = 0.0; dofCoeffs(3,1) = 0.0; dofCoeffs(3,2) = -1.0;
182 dofCoeffs(4,0) = 0.0; dofCoeffs(4,1) = 0.0; dofCoeffs(4,2) = 1.0;
184 this->dofCoeffs_ = Kokkos::create_mirror_view(
typename DT::memory_space(), dofCoeffs);
185 Kokkos::deep_copy(this->dofCoeffs_, dofCoeffs);
189 template<
typename DT,
typename OT,
typename PT>
192 ordinal_type& perTeamSpaceSize,
193 ordinal_type& perThreadSpaceSize,
194 const PointViewType inputPoints,
195 const EOperator operatorType)
const {
196 perTeamSpaceSize = 0;
197 perThreadSpaceSize = 0;
200 template<
typename DT,
typename OT,
typename PT>
201 KOKKOS_INLINE_FUNCTION
203 Basis_HDIV_WEDGE_I1_FEM<DT,OT,PT>::getValues(
204 OutputViewType outputValues,
205 const PointViewType inputPoints,
206 const EOperator operatorType,
207 const typename Kokkos::TeamPolicy<typename DT::execution_space>::member_type& team_member,
208 const typename DT::execution_space::scratch_memory_space & scratchStorage,
209 const ordinal_type subcellDim,
210 const ordinal_type subcellOrdinal)
const {
212 INTREPID2_TEST_FOR_ABORT( !((subcellDim == -1) && (subcellOrdinal == -1)),
213 ">>> ERROR: (Intrepid2::Basis_HDIV_WEDGE_I1_FEM::getValues), The capability of selecting subsets of basis functions has not been implemented yet.");
215 (void) scratchStorage;
217 const int numPoints = inputPoints.extent(0);
219 switch(operatorType) {
221 Kokkos::parallel_for (Kokkos::TeamThreadRange (team_member, numPoints), [=] (ordinal_type& pt) {
222 auto output = Kokkos::subview( outputValues, Kokkos::ALL(), pt, Kokkos::ALL() );
223 const auto input = Kokkos::subview( inputPoints, pt, Kokkos::ALL() );
224 Impl::Basis_HDIV_WEDGE_I1_FEM::Serial<OPERATOR_VALUE>::getValues( output, input);
228 Kokkos::parallel_for (Kokkos::TeamThreadRange (team_member, numPoints), [=] (ordinal_type& pt) {
229 auto output = Kokkos::subview( outputValues, Kokkos::ALL(), pt, Kokkos::ALL() );
230 const auto input = Kokkos::subview( inputPoints, pt, Kokkos::ALL() );
231 Impl::Basis_HDIV_WEDGE_I1_FEM::Serial<OPERATOR_DIV>::getValues( output, input);
235 INTREPID2_TEST_FOR_ABORT(
true,
">>> ERROR: (Intrepid2::Basis_HDIV_WEDGE_I1_FEM::getValues), Operator Type not supported.");
Basis_HDIV_WEDGE_I1_FEM()
Constructor.
Implementation of the default H(grad)-compatible FEM basis of degree 1 on Wedge cell.