49 #ifndef __INTREPID2_HGRAD_TET_C1_FEM_DEF_HPP__
50 #define __INTREPID2_HGRAD_TET_C1_FEM_DEF_HPP__
58 template<EOperator opType>
59 template<
typename OutputViewType,
60 typename inputViewType>
61 KOKKOS_INLINE_FUNCTION
63 Basis_HGRAD_TET_C1_FEM::Serial<opType>::
64 getValues( OutputViewType output,
65 const inputViewType input ) {
67 case OPERATOR_VALUE: {
68 const auto x = input(0);
69 const auto y = input(1);
70 const auto z = input(2);
73 output.access(0) = 1.0 - x - y -z;
81 output.access(0, 0) = -1.0;
82 output.access(0, 1) = -1.0;
83 output.access(0, 2) = -1.0;
85 output.access(1, 0) = 1.0;
86 output.access(1, 1) = 0.0;
87 output.access(1, 2) = 0.0;
89 output.access(2, 0) = 0.0;
90 output.access(2, 1) = 1.0;
91 output.access(2, 2) = 0.0;
93 output.access(3, 0) = 0.0;
94 output.access(3, 1) = 0.0;
95 output.access(3, 2) = 1.0;
99 const ordinal_type jend = output.extent(1);
100 const ordinal_type iend = output.extent(0);
102 for (ordinal_type j=0;j<jend;++j)
103 for (ordinal_type i=0;i<iend;++i)
104 output.access(i, j) = 0.0;
108 INTREPID2_TEST_FOR_ABORT( opType != OPERATOR_VALUE &&
109 opType != OPERATOR_GRAD &&
110 opType != OPERATOR_MAX,
111 ">>> ERROR: (Intrepid2::Basis_HGRAD_TET_C1_FEM::Serial::getValues) operator is not supported");
116 template<
typename SpT,
117 typename outputValueValueType,
class ...outputValueProperties,
118 typename inputPointValueType,
class ...inputPointProperties>
120 Basis_HGRAD_TET_C1_FEM::
121 getValues( Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValues,
122 const Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPoints,
123 const EOperator operatorType ) {
124 typedef Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValueViewType;
125 typedef Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPointViewType;
126 typedef typename ExecSpace<typename inputPointViewType::execution_space,SpT>::ExecSpaceType ExecSpaceType;
129 const auto loopSize = inputPoints.extent(0);
130 Kokkos::RangePolicy<ExecSpaceType,Kokkos::Schedule<Kokkos::Static> > policy(0, loopSize);
132 switch (operatorType) {
134 case OPERATOR_VALUE: {
135 typedef Functor<outputValueViewType,inputPointViewType,OPERATOR_VALUE> FunctorType;
136 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
141 typedef Functor<outputValueViewType,inputPointViewType,OPERATOR_GRAD> FunctorType;
142 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
145 case OPERATOR_CURL: {
146 INTREPID2_TEST_FOR_EXCEPTION( operatorType == OPERATOR_CURL, std::invalid_argument,
147 ">>> ERROR (Basis_HGRAD_TET_C1_FEM): CURL is invalid operator for rank-0 (scalar) functions in 3D");
151 INTREPID2_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_DIV), std::invalid_argument,
152 ">>> ERROR (Basis_HGRAD_TET_C1_FEM): DIV is invalid operator for rank-0 (scalar) functions in 3D");
164 typedef Functor<outputValueViewType,inputPointViewType,OPERATOR_MAX> FunctorType;
165 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
169 INTREPID2_TEST_FOR_EXCEPTION( !( Intrepid2::isValidOperator(operatorType) ), std::invalid_argument,
170 ">>> ERROR (Basis_HGRAD_TET_C1_FEM): Invalid operator type");
177 template<
typename SpT,
typename OT,
typename PT>
180 this->basisCardinality_ = 4;
181 this->basisDegree_ = 1;
182 this->basisCellTopology_ = shards::CellTopology(shards::getCellTopologyData<shards::Tetrahedron<4> >() );
183 this->basisType_ = BASIS_FEM_DEFAULT;
184 this->basisCoordinates_ = COORDINATES_CARTESIAN;
185 this->functionSpace_ = FUNCTION_SPACE_HGRAD;
190 const ordinal_type tagSize = 4;
191 const ordinal_type posScDim = 0;
192 const ordinal_type posScOrd = 1;
193 const ordinal_type posDfOrd = 2;
196 ordinal_type tags[16] = { 0, 0, 0, 1,
207 this->setOrdinalTagData(this->tagToOrdinal_,
210 this->basisCardinality_,
224 Kokkos::DynRankView<typename ScalarViewType::value_type,typename SpT::array_layout,Kokkos::HostSpace>
225 dofCoords(
"dofCoordsHost", this->basisCardinality_,this->basisCellTopology_.getDimension());
227 dofCoords(0,0) = 0.0; dofCoords(0,1) = 0.0; dofCoords(0,2) = 0.0;
228 dofCoords(1,0) = 1.0; dofCoords(1,1) = 0.0; dofCoords(1,2) = 0.0;
229 dofCoords(2,0) = 0.0; dofCoords(2,1) = 1.0; dofCoords(2,2) = 0.0;
230 dofCoords(3,0) = 0.0; dofCoords(3,1) = 0.0; dofCoords(3,2) = 1.0;
232 this->dofCoords_ = Kokkos::create_mirror_view(
typename SpT::memory_space(), dofCoords);
233 Kokkos::deep_copy(this->dofCoords_, dofCoords);
Kokkos::View< ordinal_type *, typename ExecSpaceType::array_layout, Kokkos::HostSpace > OrdinalTypeArray1DHost
View type for 1d host array.
Basis_HGRAD_TET_C1_FEM()
Constructor.