14#ifndef __INTREPID2_HGRAD_LINE_C2_FEM_DEF_HPP__
15#define __INTREPID2_HGRAD_LINE_C2_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);
35 output.access(0) = (x - 1.0)*x/2.0;
36 output.access(1) = (1.0 + x)*x/2.0;
37 output.access(2) = (1.0 + x)*(1.0 - x);
40 case OPERATOR_GRAD : {
41 const auto x = input(0);
43 output.access(0, 0) = x-0.5;
44 output.access(1, 0) = x+0.5;
45 output.access(2, 0) = -2.0*x;
49 const ordinal_type jend = output.extent(1);
50 const ordinal_type iend = output.extent(0);
52 for (ordinal_type j=0;j<jend;++j)
53 for (ordinal_type i=0;i<iend;++i)
54 output.access(i, j) = 0.0;
58 INTREPID2_TEST_FOR_ABORT( opType != OPERATOR_VALUE &&
59 opType != OPERATOR_GRAD &&
60 opType != OPERATOR_MAX,
61 ">>> ERROR: (Intrepid2::Basis_HGRAD_LINE_C2_FEM::Serial::getValues) operator is not supported");
68 typename outputValueValueType,
class ...outputValueProperties,
69 typename inputPointValueType,
class ...inputPointProperties>
71 Basis_HGRAD_LINE_C2_FEM::
72 getValues(
const typename DT::execution_space& space,
73 Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValues,
74 const Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPoints,
75 const EOperator operatorType ) {
76 typedef Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValueViewType;
77 typedef Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPointViewType;
78 typedef typename ExecSpace<typename inputPointViewType::execution_space,typename DT::execution_space>::ExecSpaceType ExecSpaceType;
81 const auto loopSize = inputPoints.extent(0);
82 Kokkos::RangePolicy<ExecSpaceType,Kokkos::Schedule<Kokkos::Static> > policy(space, 0, loopSize);
84 switch (operatorType) {
86 case OPERATOR_VALUE: {
88 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
96 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
109 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
113 INTREPID2_TEST_FOR_EXCEPTION( !Intrepid2::isValidOperator(operatorType), std::invalid_argument,
114 ">>> ERROR (Basis_HGRAD_LINE_C2_FEM): Invalid operator type");
125 template<
typename DT,
typename OT,
typename PT>
128 const ordinal_type spaceDim = 1;
139 const ordinal_type tagSize = 4;
140 const ordinal_type posScDim = 0;
141 const ordinal_type posScOrd = 1;
142 const ordinal_type posDfOrd = 2;
145 ordinal_type tags[12] = { 0, 0, 0, 1,
165 Kokkos::DynRankView<typename ScalarViewType::value_type,typename DT::execution_space::array_layout,Kokkos::HostSpace>
168 dofCoords(0,0) = -1.0;
169 dofCoords(1,0) = 1.0;
170 dofCoords(2,0) = 0.0;
172 this->
dofCoords_ = Kokkos::create_mirror_view(
typename DT::memory_space(), dofCoords);
173 Kokkos::deep_copy(this->
dofCoords_, dofCoords);
176 template<
typename DT,
typename OT,
typename PT>
178 Basis_HGRAD_LINE_C2_FEM<DT,OT,PT>::getScratchSpaceSize(
179 ordinal_type& perTeamSpaceSize,
180 ordinal_type& perThreadSpaceSize,
182 const EOperator operatorType)
const {
183 perTeamSpaceSize = 0;
184 perThreadSpaceSize = 0;
187 template<
typename DT,
typename OT,
typename PT>
188 KOKKOS_INLINE_FUNCTION
190 Basis_HGRAD_LINE_C2_FEM<DT,OT,PT>::getValues(
191 OutputViewType outputValues,
192 const PointViewType inputPoints,
193 const EOperator operatorType,
194 const typename Kokkos::TeamPolicy<typename DT::execution_space>::member_type& team_member,
195 const typename DT::execution_space::scratch_memory_space & scratchStorage,
196 const ordinal_type subcellDim,
197 const ordinal_type subcellOrdinal)
const {
199 INTREPID2_TEST_FOR_ABORT( !((subcellDim == -1) && (subcellOrdinal == -1)),
200 ">>> ERROR: (Intrepid2::Basis_HGRAD_LINE_C2_FEM::getValues), The capability of selecting subsets of basis functions has not been implemented yet.");
202 (void) scratchStorage;
204 const int numPoints = inputPoints.extent(0);
206 switch(operatorType) {
208 Kokkos::parallel_for (Kokkos::TeamThreadRange (team_member, numPoints), [=] (ordinal_type& pt) {
209 auto output = Kokkos::subview( outputValues, Kokkos::ALL(), pt, Kokkos::ALL() );
210 const auto input = Kokkos::subview( inputPoints, pt, Kokkos::ALL() );
211 Impl::Basis_HGRAD_LINE_C2_FEM::Serial<OPERATOR_VALUE>::getValues( output, input);
215 Kokkos::parallel_for (Kokkos::TeamThreadRange (team_member, numPoints), [=] (ordinal_type& pt) {
216 auto output = Kokkos::subview( outputValues, Kokkos::ALL(), pt, Kokkos::ALL() );
217 const auto input = Kokkos::subview( inputPoints, pt, Kokkos::ALL() );
218 Impl::Basis_HGRAD_LINE_C2_FEM::Serial<OPERATOR_GRAD>::getValues( output, input);
Basis_HGRAD_LINE_C2_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_
ordinal_type basisCardinality_
OrdinalTypeArray3DHost tagToOrdinal_
Kokkos::View< ordinal_type *, typename ExecutionSpace::array_layout, Kokkos::HostSpace > OrdinalTypeArray1DHost
unsigned basisCellTopologyKey_
EFunctionSpace functionSpace_
See Intrepid2::Basis_HGRAD_LINE_C2_FEM.
See Intrepid2::Basis_HGRAD_LINE_C2_FEM.