15 #ifndef __INTREPID2_HVOL_C0_FEM_DEF_HPP__
16 #define __INTREPID2_HVOL_C0_FEM_DEF_HPP__
22 template<EOperator opType>
23 template<
typename OutputViewType,
24 typename inputViewType>
25 KOKKOS_INLINE_FUNCTION
27 Basis_HVOL_C0_FEM::Serial<opType>::
28 getValues( OutputViewType output,
29 const inputViewType ) {
31 case OPERATOR_VALUE : {
32 output.access(0) = 1.0;
36 const ordinal_type jend = output.extent(1);
37 const ordinal_type iend = output.extent(0);
39 for (ordinal_type j=0;j<jend;++j)
40 for (ordinal_type i=0;i<iend;++i)
41 output.access(i, j) = 0.0;
45 INTREPID2_TEST_FOR_ABORT( opType != OPERATOR_VALUE &&
46 opType != OPERATOR_MAX,
47 ">>> ERROR: (Intrepid2::Basis_HVOL_C0_FEM::Serial::getValues) operator is not supported");
53 typename outputValueValueType,
class ...outputValueProperties,
54 typename inputPointValueType,
class ...inputPointProperties>
57 getValues( Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValues,
58 const Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPoints,
59 const EOperator operatorType ) {
60 typedef Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValueViewType;
61 typedef Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPointViewType;
62 typedef typename ExecSpace<typename inputPointViewType::execution_space,typename DT::execution_space>::ExecSpaceType ExecSpaceType;
65 const auto loopSize = inputPoints.extent(0);
66 Kokkos::RangePolicy<ExecSpaceType,Kokkos::Schedule<Kokkos::Static> > policy(0, loopSize);
68 switch (operatorType) {
69 case OPERATOR_VALUE: {
70 typedef Functor<outputValueViewType,inputPointViewType,OPERATOR_VALUE> FunctorType;
71 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
87 typedef Functor<outputValueViewType,inputPointViewType,OPERATOR_MAX> FunctorType;
88 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
92 INTREPID2_TEST_FOR_EXCEPTION( !Intrepid2::isValidOperator(operatorType), std::invalid_argument,
93 ">>> ERROR (Basis_HVOL_C0_FEM): Invalid operator type");
99 template<
typename DT,
typename OT,
typename PT>
102 const ordinal_type spaceDim = cellTopo.getDimension();
104 this->basisCardinality_ = 1;
105 this->basisDegree_ = 0;
106 this->basisCellTopologyKey_ = cellTopo.getKey();
107 this->basisType_ = Intrepid2::BASIS_FEM_DEFAULT;
108 this->basisCoordinates_ = Intrepid2::COORDINATES_CARTESIAN;
109 this->functionSpace_ = FUNCTION_SPACE_HVOL;
111 basisName_ =
"Intrepid2_HVOL_";
112 basisName_ += cellTopo.getName();
113 basisName_ +=
"_C0_FEM";
118 const ordinal_type tagSize = 4;
119 const ordinal_type posScDim = 0;
120 const ordinal_type posScOrd = 1;
121 const ordinal_type posDfOrd = 2;
124 ordinal_type tags[4] = { spaceDim, 0, 0, 1 };
126 OrdinalTypeArray1DHost tagView(&tags[0], 4);
128 this->setOrdinalTagData(this->tagToOrdinal_,
131 this->basisCardinality_,
139 Kokkos::DynRankView<typename ScalarViewType::value_type,typename DT::execution_space::array_layout,Kokkos::HostSpace>
140 dofCoords(
"dofCoordsHost", this->basisCardinality_, spaceDim);
144 this->dofCoords_ = Kokkos::create_mirror_view(
typename DT::memory_space(), dofCoords);
145 Kokkos::deep_copy(this->dofCoords_, dofCoords);
Basis_HVOL_C0_FEM()=delete
Constructor.