16#ifndef __INTREPID2_HGRAD_LINE_C1_FEM_DEF_HPP__
17#define __INTREPID2_HGRAD_LINE_C1_FEM_DEF_HPP__
25 template<EOperator opType>
26 template<
typename OutputViewType,
27 typename inputViewType>
28 KOKKOS_INLINE_FUNCTION
32 const inputViewType input ) {
34 case OPERATOR_VALUE : {
35 const auto x = input(0);
37 output.access(0) = (1.0 - x)/2.0;
38 output.access(1) = (1.0 + x)/2.0;
41 case OPERATOR_GRAD : {
42 output.access(0, 0) = -0.5;
43 output.access(1, 0) = 0.5;
47 const ordinal_type jend = output.extent(1);
48 const ordinal_type iend = output.extent(0);
50 for (ordinal_type j=0;j<jend;++j)
51 for (ordinal_type i=0;i<iend;++i)
52 output.access(i, j) = 0.0;
56 INTREPID2_TEST_FOR_ABORT( opType != OPERATOR_VALUE &&
57 opType != OPERATOR_GRAD &&
58 opType != OPERATOR_MAX,
59 ">>> ERROR: (Intrepid2::Basis_HGRAD_LINE_C1_FEM::Serial::getValues) operator is not supported");
66 typename outputValueValueType,
class ...outputValueProperties,
67 typename inputPointValueType,
class ...inputPointProperties>
69 Basis_HGRAD_LINE_C1_FEM::
70 getValues(
const typename DT::execution_space& space,
71 Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValues,
72 const Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPoints,
73 const EOperator operatorType ) {
74 typedef Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValueViewType;
75 typedef Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPointViewType;
76 typedef typename ExecSpace<typename inputPointViewType::execution_space,typename DT::execution_space>::ExecSpaceType ExecSpaceType;
79 const auto loopSize = inputPoints.extent(0);
80 Kokkos::RangePolicy<ExecSpaceType,Kokkos::Schedule<Kokkos::Static> > policy(space, 0, loopSize);
82 switch (operatorType) {
84 case OPERATOR_VALUE: {
86 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
94 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
107 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
111 INTREPID2_TEST_FOR_EXCEPTION( !Intrepid2::isValidOperator(operatorType), std::invalid_argument,
112 ">>> ERROR (Basis_HGRAD_LINE_C1_FEM): Invalid operator type");
123 template<
typename DT,
typename OT,
typename PT>
126 const ordinal_type spaceDim = 1;
137 const ordinal_type tagSize = 4;
138 const ordinal_type posScDim = 0;
139 const ordinal_type posScOrd = 1;
140 const ordinal_type posDfOrd = 2;
143 ordinal_type tags[8] = { 0, 0, 0, 1,
170 Kokkos::DynRankView<typename ScalarViewType::value_type,typename DT::execution_space::array_layout,Kokkos::HostSpace>
173 dofCoords(0,0) = -1.0;
174 dofCoords(1,0) = 1.0;
176 this->
dofCoords_ = Kokkos::create_mirror_view(
typename DT::memory_space(), dofCoords);
177 Kokkos::deep_copy(this->
dofCoords_, dofCoords);
180 template<
typename DT,
typename OT,
typename PT>
182 Basis_HGRAD_LINE_C1_FEM<DT,OT,PT>::getScratchSpaceSize(
183 ordinal_type& perTeamSpaceSize,
184 ordinal_type& perThreadSpaceSize,
186 const EOperator operatorType)
const {
187 perTeamSpaceSize = 0;
188 perThreadSpaceSize = 0;
191 template<
typename DT,
typename OT,
typename PT>
192 KOKKOS_INLINE_FUNCTION
194 Basis_HGRAD_LINE_C1_FEM<DT,OT,PT>::getValues(
195 OutputViewType outputValues,
196 const PointViewType inputPoints,
197 const EOperator operatorType,
198 const typename Kokkos::TeamPolicy<typename DT::execution_space>::member_type& team_member,
199 const typename DT::execution_space::scratch_memory_space & scratchStorage,
200 const ordinal_type subcellDim,
201 const ordinal_type subcellOrdinal)
const {
203 INTREPID2_TEST_FOR_ABORT( !((subcellDim <= 0) && (subcellOrdinal == -1)),
204 ">>> ERROR: (Intrepid2::Basis_HGRAD_LINE_C1_FEM::getValues), The capability of selecting subsets of basis functions has not been implemented yet.");
206 (void) scratchStorage;
208 const int numPoints = inputPoints.extent(0);
210 switch(operatorType) {
212 Kokkos::parallel_for (Kokkos::TeamThreadRange (team_member, numPoints), [=] (ordinal_type& pt) {
213 auto output = Kokkos::subview( outputValues, Kokkos::ALL(), pt, Kokkos::ALL() );
214 const auto input = Kokkos::subview( inputPoints, pt, Kokkos::ALL() );
215 Impl::Basis_HGRAD_LINE_C1_FEM::Serial<OPERATOR_VALUE>::getValues( output, input);
219 Kokkos::parallel_for (Kokkos::TeamThreadRange (team_member, numPoints), [=] (ordinal_type& pt) {
220 auto output = Kokkos::subview( outputValues, Kokkos::ALL(), pt, Kokkos::ALL() );
221 const auto input = Kokkos::subview( inputPoints, pt, Kokkos::ALL() );
222 Impl::Basis_HGRAD_LINE_C1_FEM::Serial<OPERATOR_GRAD>::getValues( output, input);
Basis_HGRAD_LINE_C1_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_C1_FEM.
See Intrepid2::Basis_HGRAD_LINE_C1_FEM.