49 #ifndef __INTREPID2_HGRAD_LINE_C1_FEM_DEF_HPP__
50 #define __INTREPID2_HGRAD_LINE_C1_FEM_DEF_HPP__
58 template<EOperator opType>
59 template<
typename OutputViewType,
60 typename inputViewType>
61 KOKKOS_INLINE_FUNCTION
63 Basis_HGRAD_LINE_C1_FEM::Serial<opType>::
64 getValues( OutputViewType output,
65 const inputViewType input ) {
67 case OPERATOR_VALUE : {
68 const auto x = input(0);
70 output.access(0) = (1.0 - x)/2.0;
71 output.access(1) = (1.0 + x)/2.0;
74 case OPERATOR_GRAD : {
75 output.access(0, 0) = -0.5;
76 output.access(1, 0) = 0.5;
80 const ordinal_type jend = output.extent(1);
81 const ordinal_type iend = output.extent(0);
83 for (ordinal_type j=0;j<jend;++j)
84 for (ordinal_type i=0;i<iend;++i)
85 output.access(i, j) = 0.0;
89 INTREPID2_TEST_FOR_ABORT( opType != OPERATOR_VALUE &&
90 opType != OPERATOR_GRAD &&
91 opType != OPERATOR_MAX,
92 ">>> ERROR: (Intrepid2::Basis_HGRAD_LINE_C1_FEM::Serial::getValues) operator is not supported");
99 typename outputValueValueType,
class ...outputValueProperties,
100 typename inputPointValueType,
class ...inputPointProperties>
102 Basis_HGRAD_LINE_C1_FEM::
103 getValues(
const typename DT::execution_space& space,
104 Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValues,
105 const Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPoints,
106 const EOperator operatorType ) {
107 typedef Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValueViewType;
108 typedef Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPointViewType;
109 typedef typename ExecSpace<typename inputPointViewType::execution_space,typename DT::execution_space>::ExecSpaceType ExecSpaceType;
112 const auto loopSize = inputPoints.extent(0);
113 Kokkos::RangePolicy<ExecSpaceType,Kokkos::Schedule<Kokkos::Static> > policy(space, 0, loopSize);
115 switch (operatorType) {
117 case OPERATOR_VALUE: {
118 typedef Functor<outputValueViewType,inputPointViewType,OPERATOR_VALUE> FunctorType;
119 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
126 typedef Functor<outputValueViewType,inputPointViewType,OPERATOR_GRAD> FunctorType;
127 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
139 typedef Functor<outputValueViewType,inputPointViewType,OPERATOR_MAX> FunctorType;
140 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
144 INTREPID2_TEST_FOR_EXCEPTION( !Intrepid2::isValidOperator(operatorType), std::invalid_argument,
145 ">>> ERROR (Basis_HGRAD_LINE_C1_FEM): Invalid operator type");
156 template<
typename DT,
typename OT,
typename PT>
159 this->basisCardinality_ = 2;
160 this->basisDegree_ = 1;
161 this->basisCellTopology_ = shards::CellTopology(shards::getCellTopologyData<shards::Line<2> >() );
162 this->basisType_ = BASIS_FEM_DEFAULT;
163 this->basisCoordinates_ = COORDINATES_CARTESIAN;
164 this->functionSpace_ = FUNCTION_SPACE_HGRAD;
169 const ordinal_type tagSize = 4;
170 const ordinal_type posScDim = 0;
171 const ordinal_type posScOrd = 1;
172 const ordinal_type posDfOrd = 2;
175 ordinal_type tags[8] = { 0, 0, 0, 1,
185 this->setOrdinalTagData(this->tagToOrdinal_,
188 this->basisCardinality_,
202 Kokkos::DynRankView<typename ScalarViewType::value_type,typename DT::execution_space::array_layout,Kokkos::HostSpace>
203 dofCoords(
"dofCoordsHost", this->basisCardinality_,this->basisCellTopology_.getDimension());
205 dofCoords(0,0) = -1.0;
206 dofCoords(1,0) = 1.0;
208 this->dofCoords_ = Kokkos::create_mirror_view(
typename DT::memory_space(), dofCoords);
209 Kokkos::deep_copy(this->dofCoords_, dofCoords);
Kokkos::View< ordinal_type *, typename ExecutionSpace::array_layout, Kokkos::HostSpace > OrdinalTypeArray1DHost
View type for 1d host array.
Basis_HGRAD_LINE_C1_FEM()
Constructor.