48#ifndef __INTREPID2_HDIV_TRI_I1_FEM_DEF_HPP__
49#define __INTREPID2_HDIV_TRI_I1_FEM_DEF_HPP__
56 template<EOperator opType>
57 template<
typename OutputViewType,
58 typename inputViewType>
59 KOKKOS_INLINE_FUNCTION
63 const inputViewType input ) {
65 case OPERATOR_VALUE: {
66 const auto x = input(0);
67 const auto y = input(1);
70 output.access(0, 0) = 2.0*x;
71 output.access(0, 1) = 2.0*(y - 1.0);
73 output.access(1, 0) = 2.0*x;
74 output.access(1, 1) = 2.0*y;
76 output.access(2, 0) = 2.0*(x - 1.0);
77 output.access(2, 1) = 2.0*y;
82 output.access(0) = 4.0;
83 output.access(1) = 4.0;
84 output.access(2) = 4.0;
88 INTREPID2_TEST_FOR_ABORT( opType != OPERATOR_VALUE &&
89 opType != OPERATOR_DIV,
90 ">>> ERROR: (Intrepid2::Basis_HDIV_TRI_I1_FEM::Serial::getValues) operator is not supported");
97 typename outputValueValueType,
class ...outputValueProperties,
98 typename inputPointValueType,
class ...inputPointProperties>
100 Basis_HDIV_TRI_I1_FEM::
101 getValues( Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValues,
102 const Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPoints,
103 const EOperator operatorType ) {
104 typedef Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValueViewType;
105 typedef Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPointViewType;
106 typedef typename ExecSpace<typename inputPointViewType::execution_space,typename DT::execution_space>::ExecSpaceType ExecSpaceType;
109 const auto loopSize = inputPoints.extent(0);
110 Kokkos::RangePolicy<ExecSpaceType,Kokkos::Schedule<Kokkos::Static> > policy(0, loopSize);
112 switch (operatorType) {
113 case OPERATOR_VALUE: {
115 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
120 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
123 case OPERATOR_CURL: {
124 INTREPID2_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_CURL), std::invalid_argument,
125 ">>> ERROR (Basis_HDIV_TRI_I1_FEM): CURL is invalid operator for HDIV Basis Functions");
129 case OPERATOR_GRAD: {
130 INTREPID2_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_GRAD), std::invalid_argument,
131 ">>> ERROR (Basis_HDIV_TRI_I1_FEM): GRAD is invalid operator for HDIV Basis Functions");
144 INTREPID2_TEST_FOR_EXCEPTION( ( (operatorType == OPERATOR_D1) &&
145 (operatorType == OPERATOR_D2) &&
146 (operatorType == OPERATOR_D3) &&
147 (operatorType == OPERATOR_D4) &&
148 (operatorType == OPERATOR_D5) &&
149 (operatorType == OPERATOR_D6) &&
150 (operatorType == OPERATOR_D7) &&
151 (operatorType == OPERATOR_D8) &&
152 (operatorType == OPERATOR_D9) &&
153 (operatorType == OPERATOR_D10) ),
154 std::invalid_argument,
155 ">>> ERROR (Basis_HDIV_TRI_I1_FEM): Invalid operator type");
159 INTREPID2_TEST_FOR_EXCEPTION( ( (operatorType != OPERATOR_VALUE) &&
160 (operatorType != OPERATOR_GRAD) &&
161 (operatorType != OPERATOR_CURL) &&
162 (operatorType != OPERATOR_DIV) &&
163 (operatorType != OPERATOR_D1) &&
164 (operatorType != OPERATOR_D2) &&
165 (operatorType != OPERATOR_D3) &&
166 (operatorType != OPERATOR_D4) &&
167 (operatorType != OPERATOR_D5) &&
168 (operatorType != OPERATOR_D6) &&
169 (operatorType != OPERATOR_D7) &&
170 (operatorType != OPERATOR_D8) &&
171 (operatorType != OPERATOR_D9) &&
172 (operatorType != OPERATOR_D10) ),
173 std::invalid_argument,
174 ">>> ERROR (Basis_HDIV_TRI_I1_FEM): Invalid operator type");
181 template<
typename DT,
typename OT,
typename PT>
186 this->
basisCellTopology_ = shards::CellTopology(shards::getCellTopologyData<shards::Triangle<3> >() );
194 const ordinal_type tagSize = 4;
195 const ordinal_type posScDim = 0;
196 const ordinal_type posScOrd = 1;
197 const ordinal_type posDfOrd = 2;
200 ordinal_type tags[12] = { 1, 0, 0, 1,
205 OrdinalTypeArray1DHost tagView(&tags[0], 12);
227 Kokkos::DynRankView<typename ScalarViewType::value_type,typename DT::execution_space::array_layout,Kokkos::HostSpace>
230 dofCoords(0,0) = 0.5; dofCoords(0,1) = 0.0;
231 dofCoords(1,0) = 0.5; dofCoords(1,1) = 0.5;
232 dofCoords(2,0) = 0.0; dofCoords(2,1) = 0.5;
234 this->
dofCoords_ = Kokkos::create_mirror_view(
typename DT::memory_space(), dofCoords);
235 Kokkos::deep_copy(this->
dofCoords_, dofCoords);
238 Kokkos::DynRankView<typename ScalarViewType::value_type,typename DT::execution_space::array_layout,Kokkos::HostSpace>
242 dofCoeffs(0,0) = 0.0; dofCoeffs(0,1) = -0.5;
243 dofCoeffs(1,0) = 0.5; dofCoeffs(1,1) = 0.5;
244 dofCoeffs(2,0) = -0.5; dofCoeffs(2,1) = 0.0;
246 this->
dofCoeffs_ = Kokkos::create_mirror_view(
typename DT::memory_space(), dofCoeffs); Kokkos::deep_copy(this->
dofCoeffs_, dofCoeffs);
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_
shards::CellTopology basisCellTopology_
EFunctionSpace functionSpace_
See Intrepid2::Basis_HDIV_TRI_I1_FEM.
See Intrepid2::Basis_HDIV_TRI_I1_FEM.