15#ifndef __INTREPID2_HDIV_TRI_I1_FEM_DEF_HPP__
16#define __INTREPID2_HDIV_TRI_I1_FEM_DEF_HPP__
23 template<EOperator opType>
24 template<
typename OutputViewType,
25 typename inputViewType>
26 KOKKOS_INLINE_FUNCTION
30 const inputViewType input ) {
32 case OPERATOR_VALUE: {
33 const auto x = input(0);
34 const auto y = input(1);
37 output.access(0, 0) = 2.0*x;
38 output.access(0, 1) = 2.0*(y - 1.0);
40 output.access(1, 0) = 2.0*x;
41 output.access(1, 1) = 2.0*y;
43 output.access(2, 0) = 2.0*(x - 1.0);
44 output.access(2, 1) = 2.0*y;
49 output.access(0) = 4.0;
50 output.access(1) = 4.0;
51 output.access(2) = 4.0;
55 INTREPID2_TEST_FOR_ABORT( opType != OPERATOR_VALUE &&
56 opType != OPERATOR_DIV,
57 ">>> ERROR: (Intrepid2::Basis_HDIV_TRI_I1_FEM::Serial::getValues) operator is not supported");
64 typename outputValueValueType,
class ...outputValueProperties,
65 typename inputPointValueType,
class ...inputPointProperties>
67 Basis_HDIV_TRI_I1_FEM::
68 getValues( Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValues,
69 const Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPoints,
70 const EOperator operatorType ) {
71 typedef Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValueViewType;
72 typedef Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPointViewType;
73 typedef typename ExecSpace<typename inputPointViewType::execution_space,typename DT::execution_space>::ExecSpaceType ExecSpaceType;
77 const auto loopSize = inputPoints.extent(0);
78 Kokkos::RangePolicy<ExecSpaceType,Kokkos::Schedule<Kokkos::Static> > policy(0, loopSize);
80 switch (operatorType) {
81 case OPERATOR_VALUE: {
83 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
88 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
92 INTREPID2_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_CURL), std::invalid_argument,
93 ">>> ERROR (Basis_HDIV_TRI_I1_FEM): CURL is invalid operator for HDIV Basis Functions");
98 INTREPID2_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_GRAD), std::invalid_argument,
99 ">>> ERROR (Basis_HDIV_TRI_I1_FEM): GRAD is invalid operator for HDIV Basis Functions");
112 INTREPID2_TEST_FOR_EXCEPTION( ( (operatorType == OPERATOR_D1) &&
113 (operatorType == OPERATOR_D2) &&
114 (operatorType == OPERATOR_D3) &&
115 (operatorType == OPERATOR_D4) &&
116 (operatorType == OPERATOR_D5) &&
117 (operatorType == OPERATOR_D6) &&
118 (operatorType == OPERATOR_D7) &&
119 (operatorType == OPERATOR_D8) &&
120 (operatorType == OPERATOR_D9) &&
121 (operatorType == OPERATOR_D10) ),
122 std::invalid_argument,
123 ">>> ERROR (Basis_HDIV_TRI_I1_FEM): Invalid operator type");
127 INTREPID2_TEST_FOR_EXCEPTION( ( (operatorType != OPERATOR_VALUE) &&
128 (operatorType != OPERATOR_GRAD) &&
129 (operatorType != OPERATOR_CURL) &&
130 (operatorType != OPERATOR_DIV) &&
131 (operatorType != OPERATOR_D1) &&
132 (operatorType != OPERATOR_D2) &&
133 (operatorType != OPERATOR_D3) &&
134 (operatorType != OPERATOR_D4) &&
135 (operatorType != OPERATOR_D5) &&
136 (operatorType != OPERATOR_D6) &&
137 (operatorType != OPERATOR_D7) &&
138 (operatorType != OPERATOR_D8) &&
139 (operatorType != OPERATOR_D9) &&
140 (operatorType != OPERATOR_D10) ),
141 std::invalid_argument,
142 ">>> ERROR (Basis_HDIV_TRI_I1_FEM): Invalid operator type");
149 template<
typename DT,
typename OT,
typename PT>
154 constexpr ordinal_type spaceDim = 2;
163 const ordinal_type tagSize = 4;
164 const ordinal_type posScDim = 0;
165 const ordinal_type posScOrd = 1;
166 const ordinal_type posDfOrd = 2;
169 ordinal_type tags[12] = { 1, 0, 0, 1,
196 Kokkos::DynRankView<typename ScalarViewType::value_type,typename DT::execution_space::array_layout,Kokkos::HostSpace>
199 dofCoords(0,0) = 0.5; dofCoords(0,1) = 0.0;
200 dofCoords(1,0) = 0.5; dofCoords(1,1) = 0.5;
201 dofCoords(2,0) = 0.0; dofCoords(2,1) = 0.5;
203 this->
dofCoords_ = Kokkos::create_mirror_view(
typename DT::memory_space(), dofCoords);
204 Kokkos::deep_copy(this->
dofCoords_, dofCoords);
207 Kokkos::DynRankView<typename ScalarViewType::value_type,typename DT::execution_space::array_layout,Kokkos::HostSpace>
211 dofCoeffs(0,0) = 0.0; dofCoeffs(0,1) = -0.5;
212 dofCoeffs(1,0) = 0.5; dofCoeffs(1,1) = 0.5;
213 dofCoeffs(2,0) = -0.5; dofCoeffs(2,1) = 0.0;
215 this->
dofCoeffs_ = Kokkos::create_mirror_view(
typename DT::memory_space(), dofCoeffs); Kokkos::deep_copy(this->
dofCoeffs_, dofCoeffs);
219 template<
typename DT,
typename OT,
typename PT>
221 Basis_HDIV_TRI_I1_FEM<DT,OT,PT>::getScratchSpaceSize(
222 ordinal_type& perTeamSpaceSize,
223 ordinal_type& perThreadSpaceSize,
225 const EOperator operatorType)
const {
226 perTeamSpaceSize = 0;
227 perThreadSpaceSize = 0;
230 template<
typename DT,
typename OT,
typename PT>
231 KOKKOS_INLINE_FUNCTION
233 Basis_HDIV_TRI_I1_FEM<DT,OT,PT>::getValues(
234 OutputViewType outputValues,
235 const PointViewType inputPoints,
236 const EOperator operatorType,
237 const typename Kokkos::TeamPolicy<typename DT::execution_space>::member_type& team_member,
238 const typename DT::execution_space::scratch_memory_space & scratchStorage,
239 const ordinal_type subcellDim,
240 const ordinal_type subcellOrdinal)
const {
242 INTREPID2_TEST_FOR_ABORT( !((subcellDim == -1) && (subcellOrdinal == -1)),
243 ">>> ERROR: (Intrepid2::Basis_HDIV_TRI_I1_FEM::getValues), The capability of selecting subsets of basis functions has not been implemented yet.");
245 (void) scratchStorage;
247 const int numPoints = inputPoints.extent(0);
249 switch(operatorType) {
251 Kokkos::parallel_for (Kokkos::TeamThreadRange (team_member, numPoints), [=] (ordinal_type& pt) {
252 auto output = Kokkos::subview( outputValues, Kokkos::ALL(), pt, Kokkos::ALL() );
253 const auto input = Kokkos::subview( inputPoints, pt, Kokkos::ALL() );
254 Impl::Basis_HDIV_TRI_I1_FEM::Serial<OPERATOR_VALUE>::getValues( output, input);
258 Kokkos::parallel_for (Kokkos::TeamThreadRange (team_member, numPoints), [=] (ordinal_type& pt) {
259 auto output = Kokkos::subview( outputValues, Kokkos::ALL(), pt, Kokkos::ALL() );
260 const auto input = Kokkos::subview( inputPoints, pt, Kokkos::ALL() );
261 Impl::Basis_HDIV_TRI_I1_FEM::Serial<OPERATOR_DIV>::getValues( output, input);
265 INTREPID2_TEST_FOR_ABORT(
true,
">>> ERROR: (Intrepid2::Basis_HDIV_TRI_!1_FEM::getValues), Operator Type not supported.");
Basis_HDIV_TRI_I1_FEM()
Constructor.
ECoordinates basisCoordinates_
ordinal_type basisDegree_
void setOrdinalTagData(OrdinalTypeView3D &tagToOrdinal, OrdinalTypeView2D &ordinalToTag, const OrdinalTypeView1D tags, const ordinal_type basisCard, const ordinal_type tagSize, const ordinal_type posScDim, const ordinal_type posScOrd, const ordinal_type posDfOrd)
OrdinalTypeArray2DHost ordinalToTag_
Kokkos::DynRankView< scalarType, DeviceType > dofCoords_
Kokkos::DynRankView< scalarType, DeviceType > dofCoeffs_
ordinal_type basisCardinality_
OrdinalTypeArray3DHost tagToOrdinal_
Kokkos::View< ordinal_type *, typename ExecutionSpace::array_layout, Kokkos::HostSpace > OrdinalTypeArray1DHost
unsigned basisCellTopologyKey_
EFunctionSpace functionSpace_
See Intrepid2::Basis_HDIV_TRI_I1_FEM.
See Intrepid2::Basis_HDIV_TRI_I1_FEM.