Intrepid2
Intrepid2_ProjectionToolsDefHGRAD.hpp
Go to the documentation of this file.
1// @HEADER
2// ************************************************************************
3//
4// Intrepid2 Package
5// Copyright (2007) Sandia Corporation
6//
7// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8// license for use of this work by or on behalf of the U.S. Government.
9//
10// Redistribution and use in source and binary forms, with or without
11// modification, are permitted provided that the following conditions are
12// met:
13//
14// 1. Redistributions of source code must retain the above copyright
15// notice, this list of conditions and the following disclaimer.
16//
17// 2. Redistributions in binary form must reproduce the above copyright
18// notice, this list of conditions and the following disclaimer in the
19// documentation and/or other materials provided with the distribution.
20//
21// 3. Neither the name of the Corporation nor the names of the
22// contributors may be used to endorse or promote products derived from
23// this software without specific prior written permission.
24//
25// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36//
37// Questions? Contact Kyungjoo Kim (kyukim@sandia.gov), or
38// Mauro Perego (mperego@sandia.gov)
39//
40// ************************************************************************
41// @HEADER
42
49#ifndef __INTREPID2_PROJECTIONTOOLSDEFHGRAD_HPP__
50#define __INTREPID2_PROJECTIONTOOLSDEFHGRAD_HPP__
51
55
57
58namespace Intrepid2 {
59namespace Experimental {
60
61template<typename ViewType1, typename ViewType2, typename ViewType3,
62typename ViewType4, typename ViewType5>
64 ViewType1 basisCoeffs_;
65 const ViewType2 tagToOrdinal_;
66 const ViewType3 targetEPointsRange_;
67 const ViewType4 targetAtTargetEPoints_;
68 const ViewType5 basisAtTargetEPoints_;
69 ordinal_type numVertices_;
70
71
72 ComputeBasisCoeffsOnVertices_HGRAD(ViewType1 basisCoeffs, ViewType2 tagToOrdinal, ViewType3 targetEPointsRange,
73 ViewType4 targetAtTargetEPoints, ViewType5 basisAtTargetEPoints, ordinal_type numVertices) :
74 basisCoeffs_(basisCoeffs), tagToOrdinal_(tagToOrdinal), targetEPointsRange_(targetEPointsRange),
75 targetAtTargetEPoints_(targetAtTargetEPoints), basisAtTargetEPoints_(basisAtTargetEPoints), numVertices_(numVertices) {}
76
77 void
78 KOKKOS_INLINE_FUNCTION
79 operator()(const ordinal_type ic) const {
80
81
82 for(ordinal_type iv=0; iv<numVertices_; ++iv) {
83 ordinal_type idof = tagToOrdinal_(0, iv, 0);
84 ordinal_type pt = targetEPointsRange_(0,iv).first;
85 //the value of the basis at the vertex might be different than 1; HGrad basis, so the function is scalar
86 basisCoeffs_(ic,idof) = targetAtTargetEPoints_(ic,pt)/basisAtTargetEPoints_(ic,idof,pt,0);
87 }
88 }
89};
90
91template<typename ViewType1, typename ViewType2, typename ViewType3,
92typename ViewType4, typename ViewType5, typename ViewType6>
94 const ViewType1 basisCoeffs_;
95 const ViewType2 negPartialProjGrad_;
96 const ViewType2 basisTanAtEPoints_;
97 const ViewType2 basisGradAtBasisGradEPoints_;
98 const ViewType3 basisGradEWeights_;
99 const ViewType2 wBasisAtBasisGradEPoints_;
100 const ViewType3 targetGradEWeights_;
101 const ViewType2 basisGradAtTargetGradEPoints_;
102 const ViewType2 wBasisAtTargetGradEPoints_;
103 const ViewType4 computedDofs_;
104 const ViewType5 tagToOrdinal_;
105 const ViewType2 targetGradTanAtTargetGradEPoints_;
106 const ViewType6 targetGradAtTargetGradEPoints_;
107 const ViewType2 refEdgesTan_;
108 ordinal_type edgeCardinality_;
109 ordinal_type offsetBasis_;
110 ordinal_type offsetTarget_;
111 ordinal_type numVertexDofs_;
112 ordinal_type edgeDim_;
113 ordinal_type dim_;
114 ordinal_type iedge_;
115
116 ComputeBasisCoeffsOnEdges_HGRAD(const ViewType1 basisCoeffs, ViewType2 negPartialProjGrad, const ViewType2 basisTanAtEPoints,
117 const ViewType2 basisGradAtBasisGradEPoints, const ViewType3 basisGradEWeights, const ViewType2 wBasisAtBasisGradEPoints, const ViewType3 targetGradEWeights,
118 const ViewType2 basisGradAtTargetGradEPoints, const ViewType2 wBasisAtTargetGradEPoints, const ViewType4 computedDofs, const ViewType5 tagToOrdinal,
119 const ViewType2 targetGradTanAtTargetGradEPoints, const ViewType6 targetGradAtTargetGradEPoints, const ViewType2 refEdgesTan,
120 ordinal_type edgeCardinality, ordinal_type offsetBasis,
121 ordinal_type offsetTarget, ordinal_type numVertexDofs, ordinal_type edgeDim, ordinal_type dim, ordinal_type iedge) :
122 basisCoeffs_(basisCoeffs), negPartialProjGrad_(negPartialProjGrad), basisTanAtEPoints_(basisTanAtEPoints),
123 basisGradAtBasisGradEPoints_(basisGradAtBasisGradEPoints), basisGradEWeights_(basisGradEWeights), wBasisAtBasisGradEPoints_(wBasisAtBasisGradEPoints), targetGradEWeights_(targetGradEWeights),
124 basisGradAtTargetGradEPoints_(basisGradAtTargetGradEPoints), wBasisAtTargetGradEPoints_(wBasisAtTargetGradEPoints),
125 computedDofs_(computedDofs), tagToOrdinal_(tagToOrdinal), targetGradTanAtTargetGradEPoints_(targetGradTanAtTargetGradEPoints),
126 targetGradAtTargetGradEPoints_(targetGradAtTargetGradEPoints), refEdgesTan_(refEdgesTan),
127 edgeCardinality_(edgeCardinality), offsetBasis_(offsetBasis),
128 offsetTarget_(offsetTarget), numVertexDofs_(numVertexDofs), edgeDim_(edgeDim), dim_(dim), iedge_(iedge)
129 {}
130
131 void
132 KOKKOS_INLINE_FUNCTION
133 operator()(const ordinal_type ic) const {
134
135 ordinal_type numBasisGradEPoints = basisGradEWeights_.extent(0);
136 ordinal_type numTargetGradEPoints = targetGradEWeights_.extent(0);
137 for(ordinal_type j=0; j <edgeCardinality_; ++j) {
138 ordinal_type jdof = tagToOrdinal_(edgeDim_, iedge_, j);
139
140 //Note: we are not considering the orientation map since it is simply results in a scalar term for the integrals and it does not affect the projection
141 for(ordinal_type iq=0; iq <numBasisGradEPoints; ++iq) {
142 for(ordinal_type d=0; d <dim_; ++d)
143 basisTanAtEPoints_(ic,j,iq) += basisGradAtBasisGradEPoints_(ic,jdof,offsetBasis_+iq,d)*refEdgesTan_(iedge_, d);
144 wBasisAtBasisGradEPoints_(ic,j,iq) = basisTanAtEPoints_(ic,j,iq)*basisGradEWeights_(iq);
145 }
146 for(ordinal_type iq=0; iq <numTargetGradEPoints; ++iq) {
147 for(ordinal_type d=0; d <dim_; ++d)
148 wBasisAtTargetGradEPoints_(ic,j,iq) += basisGradAtTargetGradEPoints_(ic,jdof,offsetTarget_+iq,d)*refEdgesTan_(iedge_, d)*targetGradEWeights_(iq);
149 }
150 }
151
152 for(ordinal_type iq=0; iq <numTargetGradEPoints; ++iq)
153 for(ordinal_type d=0; d <dim_; ++d)
154 targetGradTanAtTargetGradEPoints_(ic,iq) += targetGradAtTargetGradEPoints_(ic,offsetTarget_+iq,d)*refEdgesTan_(iedge_, d);
155
156 for(ordinal_type j=0; j <numVertexDofs_; ++j) {
157 ordinal_type jdof = computedDofs_(j);
158 for(ordinal_type iq=0; iq <numBasisGradEPoints; ++iq)
159 for(ordinal_type d=0; d <dim_; ++d)
160 negPartialProjGrad_(ic,iq) -= basisCoeffs_(ic,jdof)*basisGradAtBasisGradEPoints_(ic,jdof,offsetBasis_+iq,d)*refEdgesTan_(iedge_, d);
161 }
162 }
163};
164
165template<typename ViewType1, typename ViewType2, typename ViewType3,
166typename ViewType4, typename ViewType5, typename ViewType6, typename ViewType7, typename ViewType8>
168 const ViewType1 basisCoeffs_;
169 const ViewType2 negPartialProjGrad_;
170 const ViewType2 faceBasisGradAtGradEPoints_;
171 const ViewType2 basisGradAtBasisGradEPoints_;
172 const ViewType3 basisGradEWeights_;
173 const ViewType2 wBasisGradAtGradEPoints_;
174 const ViewType3 targetGradEWeights_;
175 const ViewType2 basisGradAtTargetGradEPoints_;
176 const ViewType2 wBasisGradBasisAtTargetGradEPoints_;
177 const ViewType4 computedDofs_;
178 const ViewType5 tagToOrdinal_;
179 const ViewType6 orts_;
180 const ViewType2 targetGradTanAtTargetGradEPoints_;
181 const ViewType7 targetGradAtTargetGradEPoints_;
182 const ViewType2 faceCoeff_;
183 const ViewType8 faceParametrization_;
184 ordinal_type faceCardinality_;
185 ordinal_type offsetBasisGrad_;
186 ordinal_type offsetTargetGrad_;
187 ordinal_type numVertexEdgeDofs_;
188 ordinal_type numFaces_;
189 ordinal_type faceDim_;
190 ordinal_type dim_;
191 ordinal_type iface_;
192 unsigned topoKey_;
193
194 ComputeBasisCoeffsOnFaces_HGRAD(const ViewType1 basisCoeffs, ViewType2 negPartialProjGrad, const ViewType2 faceBasisGradAtGradEPoints,
195 const ViewType2 basisGradAtBasisGradEPoints, const ViewType3 basisGradEWeights, const ViewType2 wBasisGradAtGradEPoints, const ViewType3 targetGradEWeights,
196 const ViewType2 basisGradAtTargetGradEPoints, const ViewType2 wBasisGradBasisAtTargetGradEPoints, const ViewType4 computedDofs, const ViewType5 tagToOrdinal,
197 const ViewType6 orts, const ViewType2 targetGradTanAtTargetGradEPoints, const ViewType7 targetGradAtTargetGradEPoints,
198 const ViewType8 faceParametrization, ordinal_type faceCardinality, ordinal_type offsetBasisGrad,
199 ordinal_type offsetTargetGrad, ordinal_type numVertexEdgeDofs, ordinal_type numFaces, ordinal_type faceDim,
200 ordinal_type dim, ordinal_type iface, unsigned topoKey) :
201 basisCoeffs_(basisCoeffs), negPartialProjGrad_(negPartialProjGrad), faceBasisGradAtGradEPoints_(faceBasisGradAtGradEPoints),
202 basisGradAtBasisGradEPoints_(basisGradAtBasisGradEPoints), basisGradEWeights_(basisGradEWeights), wBasisGradAtGradEPoints_(wBasisGradAtGradEPoints),
203 targetGradEWeights_(targetGradEWeights),
204 basisGradAtTargetGradEPoints_(basisGradAtTargetGradEPoints), wBasisGradBasisAtTargetGradEPoints_(wBasisGradBasisAtTargetGradEPoints),
205 computedDofs_(computedDofs), tagToOrdinal_(tagToOrdinal), orts_(orts), targetGradTanAtTargetGradEPoints_(targetGradTanAtTargetGradEPoints),
206 targetGradAtTargetGradEPoints_(targetGradAtTargetGradEPoints), faceParametrization_(faceParametrization),
207 faceCardinality_(faceCardinality), offsetBasisGrad_(offsetBasisGrad),
208 offsetTargetGrad_(offsetTargetGrad), numVertexEdgeDofs_(numVertexEdgeDofs), numFaces_(numFaces),
209 faceDim_(faceDim), dim_(dim), iface_(iface), topoKey_(topoKey)
210 {}
211
212 void
213 KOKKOS_INLINE_FUNCTION
214 operator()(const ordinal_type ic) const {
215
216 typename ViewType2::value_type tanData[2*3];
217 auto tangents = ViewType2(tanData, 2, 3);
218
219 ordinal_type fOrt[6];
220 orts_(ic).getFaceOrientation(fOrt, numFaces_);
221 ordinal_type ort = fOrt[iface_];
222
223 ordinal_type numBasisGradEPoints = basisGradEWeights_.extent(0);
224 ordinal_type numTargetGradEPoints = targetGradEWeights_.extent(0);
225 Impl::OrientationTools::getRefSubcellTangents(tangents, faceParametrization_,topoKey_, iface_, ort);
226
227 for(ordinal_type j=0; j <faceCardinality_; ++j) {
228 ordinal_type jdof = tagToOrdinal_(faceDim_, iface_, j);
229 for(ordinal_type itan=0; itan <faceDim_; ++itan) {
230 for(ordinal_type iq=0; iq <numBasisGradEPoints; ++iq) {
231 for(ordinal_type d=0; d <dim_; ++d)
232 faceBasisGradAtGradEPoints_(ic,j,iq,itan) += tangents(itan,d)*basisGradAtBasisGradEPoints_(ic,jdof,offsetBasisGrad_+iq,d);
233 wBasisGradAtGradEPoints_(ic,j,iq,itan) = faceBasisGradAtGradEPoints_(ic,j,iq,itan) * basisGradEWeights_(iq);
234 }
235 for(ordinal_type iq=0; iq <numTargetGradEPoints; ++iq) {
236 typename ViewType2::value_type tmp=0;
237 for(ordinal_type d=0; d <dim_; ++d) {
238 tmp += tangents(itan, d)*basisGradAtTargetGradEPoints_(ic,jdof,offsetTargetGrad_+iq,d);
239 }
240 wBasisGradBasisAtTargetGradEPoints_(ic,j,iq,itan) = tmp * targetGradEWeights_(iq);
241 }
242 }
243 }
244
245 for(ordinal_type d=0; d <dim_; ++d)
246 for(ordinal_type itan=0; itan <faceDim_; ++itan)
247 for(ordinal_type iq=0; iq <numTargetGradEPoints; ++iq)
248 targetGradTanAtTargetGradEPoints_(ic,iq,itan) += tangents(itan, d)*targetGradAtTargetGradEPoints_(ic,offsetTargetGrad_+iq,d);
249
250 for(ordinal_type j=0; j <numVertexEdgeDofs_; ++j) {
251 ordinal_type jdof = computedDofs_(j);
252 for(ordinal_type iq=0; iq <numBasisGradEPoints; ++iq)
253 for(ordinal_type d=0; d <dim_; ++d)
254 for(ordinal_type itan=0; itan <faceDim_; ++itan)
255 negPartialProjGrad_(ic,iq,itan) -= basisCoeffs_(ic,jdof)*tangents(itan, d)*basisGradAtBasisGradEPoints_(ic,jdof,offsetBasisGrad_+iq,d);
256 }
257 }
258};
259
260
261template<typename ViewType1, typename ViewType2, typename ViewType3,
262typename ViewType4, typename ViewType5>
264 const ViewType1 basisCoeffs_;
265 const ViewType2 negPartialProjGrad_;
266 const ViewType2 cellBasisGradAtGradEPoints_;
267 const ViewType2 basisGradAtBasisGradEPoints_;
268 const ViewType3 basisGradEWeights_;
269 const ViewType2 wBasisGradAtGradEPoints_;
270 const ViewType3 targetGradEWeights_;
271 const ViewType2 basisGradAtTargetGradEPoints_;
272 const ViewType2 wBasisGradBasisAtTargetGradEPoints_;
273 const ViewType4 computedDofs_;
274 const ViewType5 elemDof_;
275 ordinal_type dim_;
276 ordinal_type numElemDofs_;
277 ordinal_type offsetBasisGrad_;
278 ordinal_type offsetTargetGrad_;
279 ordinal_type numVertexEdgeFaceDofs_;
280
281 ComputeBasisCoeffsOnCells_HGRAD(const ViewType1 basisCoeffs, ViewType2 negPartialProjGrad, const ViewType2 cellBasisGradAtGradEPoints,
282 const ViewType2 basisGradAtBasisGradEPoints, const ViewType3 basisGradEWeights, const ViewType2 wBasisGradAtGradEPoints, const ViewType3 targetGradEWeights,
283 const ViewType2 basisGradAtTargetGradEPoints, const ViewType2 wBasisGradBasisAtTargetGradEPoints, const ViewType4 computedDofs, const ViewType5 elemDof,
284 ordinal_type dim, ordinal_type numElemDofs, ordinal_type offsetBasisGrad, ordinal_type offsetTargetGrad, ordinal_type numVertexEdgeFaceDofs) :
285 basisCoeffs_(basisCoeffs), negPartialProjGrad_(negPartialProjGrad), cellBasisGradAtGradEPoints_(cellBasisGradAtGradEPoints),
286 basisGradAtBasisGradEPoints_(basisGradAtBasisGradEPoints), basisGradEWeights_(basisGradEWeights), wBasisGradAtGradEPoints_(wBasisGradAtGradEPoints), targetGradEWeights_(targetGradEWeights),
287 basisGradAtTargetGradEPoints_(basisGradAtTargetGradEPoints), wBasisGradBasisAtTargetGradEPoints_(wBasisGradBasisAtTargetGradEPoints),
288 computedDofs_(computedDofs), elemDof_(elemDof), dim_(dim), numElemDofs_(numElemDofs), offsetBasisGrad_(offsetBasisGrad),
289 offsetTargetGrad_(offsetTargetGrad), numVertexEdgeFaceDofs_(numVertexEdgeFaceDofs) {}
290
291 void
292 KOKKOS_INLINE_FUNCTION
293 operator()(const ordinal_type ic) const {
294 ordinal_type numBasisGradEPoints = basisGradEWeights_.extent(0);
295 ordinal_type numTargetGradEPoints = targetGradEWeights_.extent(0);
296 for(ordinal_type j=0; j <numElemDofs_; ++j) {
297 ordinal_type idof = elemDof_(j);
298 for(ordinal_type d=0; d <dim_; ++d) {
299 for(ordinal_type iq=0; iq <numBasisGradEPoints; ++iq) {
300 cellBasisGradAtGradEPoints_(ic,j,iq,d) = basisGradAtBasisGradEPoints_(ic,idof,offsetBasisGrad_+iq,d);
301 wBasisGradAtGradEPoints_(ic,j,iq,d) = cellBasisGradAtGradEPoints_(ic,j,iq,d) * basisGradEWeights_(iq);
302 }
303 for(ordinal_type iq=0; iq <numTargetGradEPoints; ++iq) {
304 wBasisGradBasisAtTargetGradEPoints_(ic,j,iq,d )= basisGradAtTargetGradEPoints_(ic,idof,offsetTargetGrad_+iq,d) * targetGradEWeights_(iq);
305 }
306 }
307 }
308 for(ordinal_type j=0; j <numVertexEdgeFaceDofs_; ++j) {
309 ordinal_type jdof = computedDofs_(j);
310 for(ordinal_type iq=0; iq <numBasisGradEPoints; ++iq)
311 for(ordinal_type d=0; d <dim_; ++d) {
312 negPartialProjGrad_(ic,iq,d) -= basisCoeffs_(ic,jdof)*basisGradAtBasisGradEPoints_(ic,jdof,offsetBasisGrad_+iq,d);
313 }
314 }
315 }
316};
317
318
319template<typename DeviceType>
320template<typename BasisType, typename OrientationViewType>
321void
322ProjectionTools<DeviceType>::getHGradEvaluationPoints(typename BasisType::ScalarViewType ePoints,
323 typename BasisType::ScalarViewType gradEPoints,
324 const OrientationViewType orts,
325 const BasisType* cellBasis,
327 const EvalPointsType evalPointType) {
328 const auto cellTopo = cellBasis->getBaseCellTopology();
329 //const auto cellTopoKey = cellBasis->getBaseCellTopology().getKey();
330 ordinal_type dim = cellTopo.getDimension();
331 ordinal_type numCells = ePoints.extent(0);
332 const ordinal_type edgeDim = 1;
333 const ordinal_type faceDim = 2;
334
335 ordinal_type numVertices = (cellBasis->getDofCount(0, 0) > 0) ? cellTopo.getVertexCount() : 0;
336 ordinal_type numEdges = (cellBasis->getDofCount(1, 0) > 0) ? cellTopo.getEdgeCount() : 0;
337 ordinal_type numFaces = (cellBasis->getDofCount(2, 0) > 0) ? cellTopo.getFaceCount() : 0;
338
339 typename RefSubcellParametrization<DeviceType>::ConstViewType subcellParamEdge, subcellParamFace;
340 if(numEdges>0)
341 subcellParamEdge = RefSubcellParametrization<DeviceType>::get(edgeDim, cellBasis->getBaseCellTopology().getKey());
342 if(numFaces>0)
343 subcellParamFace = RefSubcellParametrization<DeviceType>::get(faceDim, cellBasis->getBaseCellTopology().getKey());
344
345 auto refTopologyKey = projStruct->getTopologyKey();
346
347 auto ePointsRange = projStruct->getPointsRange(evalPointType);
348 auto gradEPointsRange = projStruct->getDerivPointsRange(evalPointType);
349
350 if(numVertices>0) {
351 for(ordinal_type iv=0; iv<numVertices; ++iv) {
352 auto vertexEPoints = Kokkos::create_mirror_view_and_copy(MemSpaceType(),projStruct->getEvalPoints(0,iv,evalPointType));
353 RealSpaceTools<DeviceType>::clone(Kokkos::subview(ePoints, Kokkos::ALL(),
354 ePointsRange(0, iv), Kokkos::ALL()), vertexEPoints);
355 }
356 }
357
358 for(ordinal_type ie=0; ie<numEdges; ++ie) {
359
360 auto edgeGradEPointsRange = gradEPointsRange(edgeDim, ie);
361 auto edgeGradEPoints = Kokkos::create_mirror_view_and_copy(MemSpaceType(),projStruct->getDerivEvalPoints(edgeDim,ie,evalPointType));
362
363 const auto topoKey = refTopologyKey(edgeDim,ie);
364
365 Kokkos::parallel_for
366 ("Evaluate Points Edges ",
367 Kokkos::RangePolicy<ExecSpaceType, int> (0, numCells),
368 KOKKOS_LAMBDA (const size_t ic) {
369
370
371 ordinal_type eOrt[12];
372 orts(ic).getEdgeOrientation(eOrt, numEdges);
373 ordinal_type ort = eOrt[ie];
374
375 Impl::OrientationTools::mapSubcellCoordsToRefCell(Kokkos::subview(gradEPoints,ic,edgeGradEPointsRange,Kokkos::ALL()),
376 edgeGradEPoints, subcellParamEdge, topoKey, ie, ort);
377 });
378 }
379
380
381 for(ordinal_type iface=0; iface<numFaces; ++iface) {
382
383 auto faceGradEPointsRange = gradEPointsRange(faceDim, iface);
384 auto refGradEPoints = Kokkos::create_mirror_view_and_copy(MemSpaceType(),projStruct->getDerivEvalPoints(faceDim,iface,evalPointType));
385
386
387 const auto topoKey = refTopologyKey(faceDim,iface);
388 Kokkos::parallel_for
389 ("Evaluate Points Faces ",
390 Kokkos::RangePolicy<ExecSpaceType, int> (0, numCells),
391 KOKKOS_LAMBDA (const size_t ic) {
392
393 ordinal_type fOrt[6];
394 orts(ic).getFaceOrientation(fOrt, numFaces);
395 ordinal_type ort = fOrt[iface];
396
397 Impl::OrientationTools::mapSubcellCoordsToRefCell(Kokkos::subview(gradEPoints, ic, faceGradEPointsRange, Kokkos::ALL()),
398 refGradEPoints, subcellParamFace, topoKey, iface, ort);
399 });
400 }
401
402 if(cellBasis->getDofCount(dim,0)>0) {
403 auto gradPointsRange = gradEPointsRange(dim, 0);
404 //auto refGradEPointsRange = range_type(0, range_size(gradPointsRange));
405 auto refCellGradEPoints = Kokkos::create_mirror_view_and_copy(MemSpaceType(),projStruct->getDerivEvalPoints(dim,0,evalPointType));
406 RealSpaceTools<DeviceType>::clone(Kokkos::subview(gradEPoints, Kokkos::ALL(), gradPointsRange, Kokkos::ALL()), refCellGradEPoints);
407 }
408}
409
410template<typename DeviceType>
411template<class BasisCoeffsViewType, class TargetValueViewType, class TargetGradViewType, class BasisType, class OrientationViewType>
412void
414 const TargetValueViewType targetAtTargetEPoints,
415 const TargetGradViewType targetGradAtTargetGradEPoints,
416 const typename BasisType::ScalarViewType targetEPoints,
417 const typename BasisType::ScalarViewType targetGradEPoints,
418 const OrientationViewType orts,
419 const BasisType* cellBasis,
421{
422 using funValsValueType = typename TargetValueViewType::value_type;
423 static_assert(std::is_same<funValsValueType,typename TargetGradViewType::value_type>::value,
424 "targetGradAtTargetGradEPoints and targetAtTargetEPoints must agree on their value type" );
425
426 typedef typename BasisType::scalarType scalarType;
427 typedef Kokkos::DynRankView<scalarType,DeviceType> ScalarViewType;
428 typedef Kokkos::pair<ordinal_type,ordinal_type> range_type;
429 const auto cellTopo = cellBasis->getBaseCellTopology();
430 ordinal_type dim = cellTopo.getDimension();
431 ordinal_type numTotalTargetEPoints(targetAtTargetEPoints.extent(1)),
432 numTotalTargetGradEPoints(targetGradAtTargetGradEPoints.extent(1));
433 ordinal_type basisCardinality = cellBasis->getCardinality();
434 ordinal_type numCells = targetAtTargetEPoints.extent(0);
435 const ordinal_type edgeDim = 1;
436 const ordinal_type faceDim = 2;
437
438 ordinal_type numVertices = (cellBasis->getDofCount(0, 0) > 0) ? cellTopo.getVertexCount() : 0;
439 ordinal_type numEdges = (cellBasis->getDofCount(1, 0) > 0) ? cellTopo.getEdgeCount() : 0;
440 ordinal_type numFaces = (cellBasis->getDofCount(2, 0) > 0) ? cellTopo.getFaceCount() : 0;
441
442 ScalarViewType refEdgesTan("refEdgesTan", numEdges, dim);
443
444 ordinal_type numVertexDofs = numVertices;
445
446 ordinal_type numEdgeDofs(0);
447 for(ordinal_type ie=0; ie<numEdges; ++ie)
448 numEdgeDofs += cellBasis->getDofCount(edgeDim,ie);
449
450 ordinal_type numFaceDofs(0);
451 for(ordinal_type iface=0; iface<numFaces; ++iface)
452 numFaceDofs += cellBasis->getDofCount(faceDim,iface);
453
454 Kokkos::View<ordinal_type*, DeviceType> computedDofs("computedDofs",numVertexDofs+numEdgeDofs+numFaceDofs);
455
456 ordinal_type numTotalBasisEPoints = projStruct->getNumBasisEvalPoints(),
457 numTotalBasisGradEPoints = projStruct->getNumBasisDerivEvalPoints();
458 ScalarViewType basisEPoints("basisEPoints",numCells,numTotalBasisEPoints, dim);
459 ScalarViewType basisGradEPoints("basisGradEPoints",numCells,numTotalBasisGradEPoints, dim);
460 getHGradEvaluationPoints(basisEPoints, basisGradEPoints, orts, cellBasis, projStruct, EvalPointsType::BASIS);
461
462 ScalarViewType basisAtTargetEPoints("basisAtTargetEPoints",numCells,basisCardinality, numTotalTargetEPoints);
463 {
464 ScalarViewType nonOrientedBasisAtTargetEPoints("nonOrientedBasisAtTargetEPoints",numCells,basisCardinality, numTotalTargetEPoints);
465 for(ordinal_type ic=0; ic<numCells; ++ic) {
466 cellBasis->getValues(Kokkos::subview(nonOrientedBasisAtTargetEPoints,ic,Kokkos::ALL(),Kokkos::ALL()), Kokkos::subview(targetEPoints, ic, Kokkos::ALL(), Kokkos::ALL()));
467 }
468 OrientationTools<DeviceType>::modifyBasisByOrientation(basisAtTargetEPoints, nonOrientedBasisAtTargetEPoints, orts, cellBasis);
469// printView(basisAtTargetEPoints, std::cout, "basisAtTargetEPoints");
470 }
471
472 ScalarViewType basisGradAtBasisGradEPoints;
473 ScalarViewType basisGradAtTargetGradEPoints;
474 if(numTotalBasisGradEPoints>0) {
475 ScalarViewType nonOrientedBasisGradAtTargetGradEPoints, nonOrientedBasisGradAtBasisGradEPoints;
476
477 basisGradAtBasisGradEPoints = ScalarViewType ("basisGradAtBasisGradEPoints",numCells,basisCardinality, numTotalBasisGradEPoints, dim);
478 nonOrientedBasisGradAtBasisGradEPoints = ScalarViewType ("nonOrientedBasisGradAtBasisGradEPoints",numCells,basisCardinality, numTotalBasisGradEPoints, dim);
479 basisGradAtTargetGradEPoints = ScalarViewType("basisGradAtTargetGradEPoints",numCells,basisCardinality, numTotalTargetGradEPoints, dim);
480 nonOrientedBasisGradAtTargetGradEPoints = ScalarViewType("nonOrientedBasisGradAtTargetGradEPoints",numCells,basisCardinality, numTotalTargetGradEPoints, dim);
481
482 for(ordinal_type ic=0; ic<numCells; ++ic) {
483 cellBasis->getValues(Kokkos::subview(nonOrientedBasisGradAtBasisGradEPoints,ic,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL()), Kokkos::subview(basisGradEPoints, ic, Kokkos::ALL(), Kokkos::ALL()),OPERATOR_GRAD);
484 cellBasis->getValues(Kokkos::subview(nonOrientedBasisGradAtTargetGradEPoints,ic,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL()), Kokkos::subview(targetGradEPoints, ic, Kokkos::ALL(), Kokkos::ALL()),OPERATOR_GRAD);
485 }
486
487 OrientationTools<DeviceType>::modifyBasisByOrientation(basisGradAtBasisGradEPoints, nonOrientedBasisGradAtBasisGradEPoints, orts, cellBasis);
488 OrientationTools<DeviceType>::modifyBasisByOrientation(basisGradAtTargetGradEPoints, nonOrientedBasisGradAtTargetGradEPoints, orts, cellBasis);
489 }
490
491 auto targetEPointsRange = Kokkos::create_mirror_view_and_copy(MemSpaceType(), projStruct->getTargetPointsRange());
492 auto targetGradEPointsRange = projStruct->getTargetDerivPointsRange();
493 auto basisGradEPointsRange = projStruct->getBasisDerivPointsRange();
494
495 auto refTopologyKey = projStruct->getTopologyKey();
496
497 auto tagToOrdinal = Kokkos::create_mirror_view_and_copy(MemSpaceType(), cellBasis->getAllDofOrdinal());
498
499 typename RefSubcellParametrization<DeviceType>::ConstViewType subcellParamFace;
500 if(numFaces>0)
501 subcellParamFace = RefSubcellParametrization<DeviceType>::get(faceDim, cellBasis->getBaseCellTopology().getKey());
502
503
504 Kokkos::parallel_for("Compute Dofs ", Kokkos::RangePolicy<ExecSpaceType, int> (0, numVertices),
505 KOKKOS_LAMBDA (const size_t iv) {
506 computedDofs(iv) = tagToOrdinal(0, iv, 0);
507 });
508 ordinal_type computedDofsCount = numVertices;
509
510 const Kokkos::RangePolicy<ExecSpaceType> policy(0, numCells);
511 typedef ComputeBasisCoeffsOnVertices_HGRAD<decltype(basisCoeffs), decltype(tagToOrdinal), decltype(targetEPointsRange),
512 decltype(targetAtTargetEPoints), decltype(basisAtTargetEPoints)> functorType;
513 Kokkos::parallel_for(policy, functorType(basisCoeffs, tagToOrdinal, targetEPointsRange,
514 targetAtTargetEPoints, basisAtTargetEPoints, numVertices));
515
516// printView(basisCoeffs, std::cout, "after vertex evaluation, basisCoeffs");
517
518 for(ordinal_type ie=0; ie<numEdges; ++ie) {
519
520 ordinal_type edgeCardinality = cellBasis->getDofCount(edgeDim,ie);
521 ordinal_type offsetBasis = basisGradEPointsRange(edgeDim, ie).first;
522 ordinal_type offsetTarget = targetGradEPointsRange(edgeDim, ie).first;
523 ordinal_type numBasisGradEPoints = range_size(basisGradEPointsRange(edgeDim, ie));
524 ordinal_type numTargetGradEPoints = range_size(targetGradEPointsRange(edgeDim, ie));
525 auto basisGradEWeights = Kokkos::create_mirror_view_and_copy(MemSpaceType(),projStruct->getBasisDerivEvalWeights(edgeDim,ie));
526 auto targetGradEWeights = Kokkos::create_mirror_view_and_copy(MemSpaceType(),projStruct->getTargetDerivEvalWeights(edgeDim,ie));
527
528 auto edgeTan = Kokkos::subview(refEdgesTan, ie, Kokkos::ALL());
530
531 ScalarViewType basisTanAtEPoints("basisTanAtEPoints",numCells,edgeCardinality, numBasisGradEPoints);
532 ScalarViewType targetGradTanAtTargetGradEPoints("tanBasisAtTargetGradEPoints",numCells, numTargetGradEPoints);
533 ScalarViewType wBasisAtBasisGradEPoints("wTanBasisAtBasisGradEPoints",numCells,edgeCardinality, numBasisGradEPoints);
534 ScalarViewType wBasisAtTargetGradEPoints("wTanBasisAtTargetGradEPoints",numCells,edgeCardinality, numTargetGradEPoints);
535 ScalarViewType negPartialProjGrad("negPartialProjGrad", numCells, numBasisGradEPoints);
536
537 typedef ComputeBasisCoeffsOnEdges_HGRAD<decltype(basisCoeffs), ScalarViewType, decltype(basisGradEWeights),
538 decltype(computedDofs), decltype(tagToOrdinal), decltype(targetGradAtTargetGradEPoints)> functorTypeEdge;
539
540 Kokkos::parallel_for(policy, functorTypeEdge(basisCoeffs, negPartialProjGrad, basisTanAtEPoints,
541 basisGradAtBasisGradEPoints, basisGradEWeights, wBasisAtBasisGradEPoints, targetGradEWeights,
542 basisGradAtTargetGradEPoints, wBasisAtTargetGradEPoints, computedDofs, tagToOrdinal,
543 targetGradTanAtTargetGradEPoints, targetGradAtTargetGradEPoints, refEdgesTan,
544 edgeCardinality, offsetBasis,
545 offsetTarget, numVertexDofs, edgeDim, dim, ie));
546
547 ScalarViewType edgeMassMat_("edgeMassMat_", numCells, edgeCardinality, edgeCardinality),
548 edgeRhsMat_("rhsMat_", numCells, edgeCardinality);
549
550 FunctionSpaceTools<DeviceType >::integrate(edgeMassMat_, basisTanAtEPoints, wBasisAtBasisGradEPoints);
551 FunctionSpaceTools<DeviceType >::integrate(edgeRhsMat_, targetGradTanAtTargetGradEPoints, wBasisAtTargetGradEPoints);
552 FunctionSpaceTools<DeviceType >::integrate(edgeRhsMat_, negPartialProjGrad, wBasisAtBasisGradEPoints,true);
553
554 typedef Kokkos::DynRankView<scalarType, Kokkos::LayoutRight, DeviceType> WorkArrayViewType;
555 ScalarViewType t_("t",numCells, edgeCardinality);
556 WorkArrayViewType w_("w",numCells, edgeCardinality);
557
558 auto edgeDofs = Kokkos::subview(tagToOrdinal, edgeDim, ie, Kokkos::ALL());
559
560 ElemSystem edgeSystem("edgeSystem", false);
561 edgeSystem.solve(basisCoeffs, edgeMassMat_, edgeRhsMat_, t_, w_, edgeDofs, edgeCardinality);
562
563 Kokkos::parallel_for("Compute Dofs ", Kokkos::RangePolicy<ExecSpaceType, int> (0, edgeCardinality),
564 KOKKOS_LAMBDA (const size_t i) {
565 computedDofs(computedDofsCount+i) = tagToOrdinal(edgeDim, ie, i);
566 });
567 computedDofsCount += edgeCardinality;
568
569 }
570
571 for(ordinal_type iface=0; iface<numFaces; ++iface) {
572
573 const auto topoKey = refTopologyKey(faceDim,iface);
574
575 ordinal_type faceCardinality = cellBasis->getDofCount(faceDim,iface);
576
577 ordinal_type numGradEPoints = range_size(basisGradEPointsRange(faceDim, iface));
578 ordinal_type numTargetGradEPoints = range_size(targetGradEPointsRange(faceDim, iface));
579 ordinal_type offsetBasisGrad = basisGradEPointsRange(faceDim, iface).first;
580 ordinal_type offsetTargetGrad = targetGradEPointsRange(faceDim, iface).first;
581 auto basisGradEWeights = Kokkos::create_mirror_view_and_copy(MemSpaceType(),projStruct->getBasisDerivEvalWeights(faceDim,iface));
582 auto targetGradEWeights = Kokkos::create_mirror_view_and_copy(MemSpaceType(),projStruct->getTargetDerivEvalWeights(faceDim,iface));
583
584 ScalarViewType faceBasisGradAtGradEPoints("normaBasisGradAtGradEPoints",numCells,faceCardinality, numGradEPoints,faceDim);
585 ScalarViewType wBasisGradAtGradEPoints("wNormalBasisGradAtGradEPoints",numCells,faceCardinality, numGradEPoints,faceDim);
586 ScalarViewType wBasisGradBasisAtTargetGradEPoints("wNormalBasisGradAtTargetGradEPoints",numCells,faceCardinality, numTargetGradEPoints,faceDim);
587 ScalarViewType targetGradTanAtTargetGradEPoints("targetGradTanAtTargetGradEPoints",numCells, numTargetGradEPoints,faceDim);
588 ScalarViewType negPartialProjGrad("mNormalComputedProjection", numCells,numGradEPoints,faceDim);
589
590 typedef ComputeBasisCoeffsOnFaces_HGRAD<decltype(basisCoeffs), ScalarViewType, decltype(basisGradEWeights),
591 decltype(computedDofs), decltype(tagToOrdinal), decltype(orts), decltype(targetGradAtTargetGradEPoints), decltype(subcellParamFace)> functorTypeFace_HGRAD;
592
593 Kokkos::parallel_for(policy, functorTypeFace_HGRAD(basisCoeffs, negPartialProjGrad, faceBasisGradAtGradEPoints,
594 basisGradAtBasisGradEPoints, basisGradEWeights, wBasisGradAtGradEPoints, targetGradEWeights,
595 basisGradAtTargetGradEPoints,wBasisGradBasisAtTargetGradEPoints, computedDofs, tagToOrdinal,
596 orts,targetGradTanAtTargetGradEPoints,targetGradAtTargetGradEPoints,
597 subcellParamFace, faceCardinality, offsetBasisGrad,
598 offsetTargetGrad, numVertexDofs+numEdgeDofs, numFaces, faceDim,
599 dim, iface, topoKey));
600
601 ScalarViewType faceMassMat_("faceMassMat_", numCells, faceCardinality, faceCardinality),
602 faceRhsMat_("rhsMat_", numCells, faceCardinality);
603
604 FunctionSpaceTools<DeviceType >::integrate(faceMassMat_, faceBasisGradAtGradEPoints, wBasisGradAtGradEPoints);
605
606 FunctionSpaceTools<DeviceType >::integrate(faceRhsMat_, targetGradTanAtTargetGradEPoints, wBasisGradBasisAtTargetGradEPoints);
607 FunctionSpaceTools<DeviceType >::integrate(faceRhsMat_, negPartialProjGrad, wBasisGradAtGradEPoints,true);
608
609 typedef Kokkos::DynRankView<scalarType, Kokkos::LayoutRight, DeviceType> WorkArrayViewType;
610 ScalarViewType t_("t",numCells, faceCardinality);
611 WorkArrayViewType w_("w",numCells, faceCardinality);
612
613 auto faceDofs = Kokkos::subview(tagToOrdinal, faceDim, iface, Kokkos::ALL());
614
615 ElemSystem faceSystem("faceSystem", false);
616 faceSystem.solve(basisCoeffs, faceMassMat_, faceRhsMat_, t_, w_, faceDofs, faceCardinality);
617
618 Kokkos::parallel_for("Compute Face Dofs ", Kokkos::RangePolicy<ExecSpaceType, int> (0, faceCardinality),
619 KOKKOS_LAMBDA (const size_t i) {
620 computedDofs(computedDofsCount+i) = tagToOrdinal(faceDim, iface, i);
621 });
622 computedDofsCount += faceCardinality;
623 }
624
625 ordinal_type numElemDofs = cellBasis->getDofCount(dim,0);
626 if(numElemDofs>0) {
627
628 range_type cellTargetGradEPointsRange = targetGradEPointsRange(dim, 0);
629 ordinal_type numTargetGradEPoints = range_size(cellTargetGradEPointsRange);
630 ordinal_type numGradEPoints = range_size(basisGradEPointsRange(dim, 0));
631 ordinal_type offsetBasisGrad = basisGradEPointsRange(dim, 0).first;
632 ordinal_type offsetTargetGrad = cellTargetGradEPointsRange.first;
633 auto targetGradEWeights = Kokkos::create_mirror_view_and_copy(MemSpaceType(),projStruct->getTargetDerivEvalWeights(dim,0));
634 auto basisGradEWeights = Kokkos::create_mirror_view_and_copy(MemSpaceType(),projStruct->getBasisDerivEvalWeights(dim,0));
635
636 ScalarViewType cellBasisGradAtGradEPoints("internalBasisGradAtEPoints",numCells,numElemDofs, numGradEPoints, dim);
637 ScalarViewType negPartialProjGrad("negPartialProjGrad", numCells, numGradEPoints, dim);
638 ScalarViewType wBasisGradAtGradEPoints("wBasisGradAtGradEPoints",numCells,numElemDofs, numGradEPoints,dim);
639 ScalarViewType wBasisGradBasisAtTargetGradEPoints("wBasisGradAtTargetGradEPoints",numCells,numElemDofs, numTargetGradEPoints,dim);
640
641 auto elemDof = Kokkos::subview(tagToOrdinal, dim, 0, Kokkos::ALL());
642 typedef ComputeBasisCoeffsOnCells_HGRAD<decltype(basisCoeffs), ScalarViewType, decltype(basisGradEWeights), decltype(computedDofs), decltype(elemDof)> functorTypeCell_HGRAD;
643 Kokkos::parallel_for(policy, functorTypeCell_HGRAD(basisCoeffs, negPartialProjGrad, cellBasisGradAtGradEPoints,
644 basisGradAtBasisGradEPoints, basisGradEWeights, wBasisGradAtGradEPoints, targetGradEWeights,
645 basisGradAtTargetGradEPoints, wBasisGradBasisAtTargetGradEPoints, computedDofs, elemDof,
646 dim, numElemDofs, offsetBasisGrad, offsetTargetGrad, numVertexDofs+numEdgeDofs+numFaceDofs));
647 ScalarViewType cellMassMat_("cellMassMat_", numCells, numElemDofs, numElemDofs),
648 cellRhsMat_("rhsMat_", numCells, numElemDofs);
649
650 FunctionSpaceTools<DeviceType >::integrate(cellMassMat_, cellBasisGradAtGradEPoints, wBasisGradAtGradEPoints);
651 FunctionSpaceTools<DeviceType >::integrate(cellRhsMat_, Kokkos::subview(targetGradAtTargetGradEPoints,Kokkos::ALL(),cellTargetGradEPointsRange,Kokkos::ALL()), wBasisGradBasisAtTargetGradEPoints);
652 FunctionSpaceTools<DeviceType >::integrate(cellRhsMat_, negPartialProjGrad, wBasisGradAtGradEPoints, true);
653
654 typedef Kokkos::DynRankView<scalarType, Kokkos::LayoutRight, DeviceType> WorkArrayViewType;
655 ScalarViewType t_("t",numCells, numElemDofs);
656 WorkArrayViewType w_("w",numCells, numElemDofs);
657
658 auto cellDofs = Kokkos::subview(tagToOrdinal, dim, 0, Kokkos::ALL());
659 ElemSystem cellSystem("cellSystem", true);
660 cellSystem.solve(basisCoeffs, cellMassMat_, cellRhsMat_, t_, w_, cellDofs, numElemDofs);
661 }
662}
663}
664}
665
666#endif
667
Header file for Intrepid2::ArrayTools class providing utilities for array operations.
Header file for the abstract base class Intrepid2::DefaultCubatureFactory.
Header file for the Intrepid2::FunctionSpaceTools class.
Utility methods for Intrepid2 unit tests.
static void getReferenceEdgeTangent(Kokkos::DynRankView< refEdgeTangentValueType, refEdgeTangentProperties... > refEdgeTangent, const ordinal_type edgeOrd, const shards::CellTopology parentCell)
Computes constant tangent vectors to edges of 2D or 3D reference cells.
An helper class to compute the evaluation points and weights needed for performing projections.
ordinal_type getNumBasisEvalPoints()
Returns number of basis evaluation points.
view_type getDerivEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId, EvalPointsType type) const
Returns the evaluation points for basis/target derivatives on a subcell.
const range_tag getDerivPointsRange(const EvalPointsType type) const
Returns the range tag of the basis/target derivative evaluation points on subcells.
const range_tag getBasisDerivPointsRange() const
Returns the range tag of the derivative evaluation points on subcell.
const range_tag getTargetPointsRange() const
Returns the range of the target function evaluation points on subcells.
view_type getEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId, EvalPointsType type) const
Returns the basis/target evaluation points on a subcell.
const key_tag getTopologyKey() const
Returns the key tag for subcells.
view_type getTargetDerivEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the function derivatives evaluation weights on a subcell.
const range_tag getTargetDerivPointsRange() const
Returns the range tag of the target function derivative evaluation points on subcells.
ordinal_type getNumBasisDerivEvalPoints()
Returns number of evaluation points for basis derivatives.
view_type getBasisDerivEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the basis derivatives evaluation weights on a subcell.
const range_tag getPointsRange(const EvalPointsType type) const
Returns the range tag of the basis/target evaluation points in subcells.
static void getHGradEvaluationPoints(typename BasisType::ScalarViewType evaluationPoints, typename BasisType::ScalarViewType gradEvalPoints, const OrientationViewType cellOrientations, const BasisType *cellBasis, ProjectionStruct< DeviceType, typename BasisType::scalarType > *projStruct, const EvalPointsType evalPointType=EvalPointsType::TARGET)
Computes evaluation points for HGrad projection.
static void getHGradBasisCoeffs(BasisCoeffsViewType basisCoeffs, const TargetValueViewType targetAtEvalPoints, const TargetGradViewType targetGradAtGradEvalPoints, const typename BasisType::ScalarViewType evaluationPoints, const typename BasisType::ScalarViewType gradEvalPoints, const OrientationViewType cellOrientations, const BasisType *cellBasis, ProjectionStruct< DeviceType, typename BasisType::scalarType > *projStruct)
Computes the basis coefficients of the HGrad projection of the target function.
static void integrate(Kokkos::DynRankView< outputValueValueType, outputValueProperties... > outputValues, const Kokkos::DynRankView< leftValueValueType, leftValueProperties... > leftValues, const Kokkos::DynRankView< rightValueValueType, rightValueProperties... > rightValues, const bool sumInto=false)
Contracts leftValues and rightValues arrays on the point and possibly space dimensions and stores the...
static KOKKOS_INLINE_FUNCTION void getRefSubcellTangents(TanViewType tangents, const ParamViewType subCellParametrization, const unsigned subcellTopoKey, const ordinal_type subCellOrd, const ordinal_type ort)
Computes the (oriented) subCell tangents.
static KOKKOS_INLINE_FUNCTION void mapSubcellCoordsToRefCell(coordsViewType cellCoords, const subcellCoordsViewType subCellCoords, const ParamViewType subcellParametrization, const unsigned subcellTopoKey, const ordinal_type subCellOrd, const ordinal_type ort)
Maps points defined on the subCell manifold into the parent Cell.
static void modifyBasisByOrientation(Kokkos::DynRankView< outputValueType, outputProperties... > output, const Kokkos::DynRankView< inputValueType, inputProperties... > input, const OrientationViewType orts, const BasisType *basis)
Modify basis due to orientation.
static void clone(Kokkos::DynRankView< outputValueType, outputProperties... > output, const Kokkos::DynRankView< inputValueType, inputProperties... > input)
Clone input array.
static ConstViewType get(const ordinal_type subcellDim, const unsigned parentCellKey)
Returns a Kokkos view with the coefficients of the parametrization maps for the edges or faces of a r...
Class to solve a square system A x = b on each cell A is expected to be saddle a point (KKT) matrix o...
void solve(ViewType1 basisCoeffs, ViewType2 elemMat, ViewType2 elemRhs, ViewType2 tau, ViewType3 w, const ViewType4 elemDof, ordinal_type n, ordinal_type m=0)
Solve the system and returns the basis coefficients solve the system either using Kokkos Kernel QR or...