Intrepid2
Intrepid2_ProjectionToolsDefL2.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Intrepid2 Package
4 //
5 // Copyright 2007 NTESS and the Intrepid2 contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
16 #ifndef __INTREPID2_PROJECTIONTOOLSDEFL2_HPP__
17 #define __INTREPID2_PROJECTIONTOOLSDEFL2_HPP__
18 
20 #include "Intrepid2_ArrayTools.hpp"
22 
23 
24 namespace Intrepid2 {
25 
26 namespace FunctorsProjectionTools {
27 
28 template<typename ViewType1, typename ViewType2, typename ViewType3,
29 typename ViewType4>
31  ViewType1 basisCoeffs_;
32  const ViewType2 tagToOrdinal_;
33  const ViewType3 targetEPointsRange_;
34  const ViewType4 targetAtTargetEPoints_;
35  const ViewType1 basisAtTargetEPoints_;
36  ordinal_type numVertices_;
37 
38 
39  ComputeBasisCoeffsOnVertices_L2(ViewType1 basisCoeffs, ViewType2 tagToOrdinal, ViewType3 targetEPointsRange,
40  ViewType4 targetAtTargetEPoints, ViewType1 basisAtTargetEPoints, ordinal_type numVertices) :
41  basisCoeffs_(basisCoeffs), tagToOrdinal_(tagToOrdinal), targetEPointsRange_(targetEPointsRange),
42  targetAtTargetEPoints_(targetAtTargetEPoints), basisAtTargetEPoints_(basisAtTargetEPoints), numVertices_(numVertices) {}
43 
44  void
45  KOKKOS_INLINE_FUNCTION
46  operator()(const ordinal_type ic) const {
47  for(ordinal_type iv=0; iv<numVertices_; ++iv) {
48  ordinal_type idof = tagToOrdinal_(0, iv, 0);
49  ordinal_type pt = targetEPointsRange_(0,iv).first;
50  //the value of the basis at the vertex might be different than 1; HGrad basis, so the function is scalar
51  basisCoeffs_(ic,idof) = targetAtTargetEPoints_(ic,pt)/basisAtTargetEPoints_(idof,pt,0);
52  }
53  }
54 };
55 
56 
57 template<typename ViewType1, typename ViewType2, typename ViewType3,
58 typename ViewType4, typename ViewType5>
60  const ViewType1 basisCoeffs_;
61  const ViewType1 negPartialProj_;
62  const ViewType1 basisDofDofAtBasisEPoints_;
63  const ViewType1 basisAtBasisEPoints_;
64  const ViewType2 basisEWeights_;
65  const ViewType1 wBasisDofAtBasisEPoints_;
66  const ViewType2 targetEWeights_;
67  const ViewType1 basisAtTargetEPoints_;
68  const ViewType1 wBasisDofAtTargetEPoints_;
69  const ViewType3 computedDofs_;
70  const ViewType4 tagToOrdinal_;
71  const ViewType5 targetAtTargetEPoints_;
72  const ViewType1 targetTanAtTargetEPoints_;
73  const ViewType1 refEdgesVec_;
74  ordinal_type fieldDim_;
75  ordinal_type edgeCardinality_;
76  ordinal_type offsetBasis_;
77  ordinal_type offsetTarget_;
78  ordinal_type numVertexDofs_;
79  ordinal_type edgeDim_;
80  ordinal_type iedge_;
81 
82  ComputeBasisCoeffsOnEdges_L2(const ViewType1 basisCoeffs, ViewType1 negPartialProj, const ViewType1 basisDofDofAtBasisEPoints,
83  const ViewType1 basisAtBasisEPoints, const ViewType2 basisEWeights, const ViewType1 wBasisDofAtBasisEPoints, const ViewType2 targetEWeights,
84  const ViewType1 basisAtTargetEPoints, const ViewType1 wBasisDofAtTargetEPoints, const ViewType3 computedDofs, const ViewType4 tagToOrdinal,
85  const ViewType5 targetAtTargetEPoints, const ViewType1 targetTanAtTargetEPoints, const ViewType1 refEdgesVec,
86  ordinal_type fieldDim, ordinal_type edgeCardinality, ordinal_type offsetBasis,
87  ordinal_type offsetTarget, ordinal_type numVertexDofs, ordinal_type edgeDim, ordinal_type iedge) :
88  basisCoeffs_(basisCoeffs), negPartialProj_(negPartialProj), basisDofDofAtBasisEPoints_(basisDofDofAtBasisEPoints),
89  basisAtBasisEPoints_(basisAtBasisEPoints), basisEWeights_(basisEWeights), wBasisDofAtBasisEPoints_(wBasisDofAtBasisEPoints), targetEWeights_(targetEWeights),
90  basisAtTargetEPoints_(basisAtTargetEPoints), wBasisDofAtTargetEPoints_(wBasisDofAtTargetEPoints),
91  computedDofs_(computedDofs), tagToOrdinal_(tagToOrdinal), targetAtTargetEPoints_(targetAtTargetEPoints),
92  targetTanAtTargetEPoints_(targetTanAtTargetEPoints), refEdgesVec_(refEdgesVec),
93  fieldDim_(fieldDim), edgeCardinality_(edgeCardinality), offsetBasis_(offsetBasis),
94  offsetTarget_(offsetTarget), numVertexDofs_(numVertexDofs), edgeDim_(edgeDim), iedge_(iedge)
95  {}
96 
97  void
98  KOKKOS_INLINE_FUNCTION
99  operator()(const ordinal_type ic) const {
100  for(ordinal_type j=0; j <edgeCardinality_; ++j) {
101  ordinal_type jdof =tagToOrdinal_(edgeDim_, iedge_, j);
102  for(ordinal_type iq=0; iq <ordinal_type(basisEWeights_.extent(0)); ++iq) {
103  typename ViewType1::value_type tmp =0;
104  for(ordinal_type d=0; d <fieldDim_; ++d)
105  tmp += basisAtBasisEPoints_(jdof,offsetBasis_+iq,d)*refEdgesVec_(iedge_,d);
106  basisDofDofAtBasisEPoints_(0,j,iq) = tmp;
107  wBasisDofAtBasisEPoints_(ic,j,iq) = tmp*basisEWeights_(iq);
108  }
109  for(ordinal_type iq=0; iq <ordinal_type(targetEWeights_.extent(0)); ++iq) {
110  for(ordinal_type d=0; d <fieldDim_; ++d)
111  wBasisDofAtTargetEPoints_(ic,j,iq) += basisAtTargetEPoints_(jdof,offsetTarget_+iq,d)*refEdgesVec_(iedge_,d)*targetEWeights_(iq);
112  }
113  }
114 
115  for(ordinal_type iq=0; iq <ordinal_type(targetEWeights_.extent(0)); ++iq)
116  for(ordinal_type d=0; d <fieldDim_; ++d)
117  targetTanAtTargetEPoints_(ic,iq) += targetAtTargetEPoints_(ic,offsetTarget_+iq,d)*refEdgesVec_(iedge_,d);
118 
119  for(ordinal_type j=0; j <numVertexDofs_; ++j) {
120  ordinal_type jdof = computedDofs_(j);
121  for(ordinal_type iq=0; iq <ordinal_type(basisEWeights_.extent(0)); ++iq)
122  for(ordinal_type d=0; d <fieldDim_; ++d)
123  negPartialProj_(ic,iq) -= basisCoeffs_(ic,jdof)*basisAtBasisEPoints_(jdof,offsetBasis_+iq,d)*refEdgesVec_(iedge_,d);
124  }
125  }
126 };
127 
128 template<typename ViewType1, typename ViewType2, typename ViewType3,
129 typename ViewType4, typename ViewType5>
131  const ViewType1 basisCoeffs_;
132  const ViewType1 negPartialProj_;
133  const ViewType1 faceBasisDofAtBasisEPoints_;
134  const ViewType1 basisAtBasisEPoints_;
135  const ViewType2 basisEWeights_;
136  const ViewType1 wBasisDofAtBasisEPoints_;
137  const ViewType2 targetEWeights_;
138  const ViewType1 basisAtTargetEPoints_;
139  const ViewType1 wBasisDofAtTargetEPoints_;
140  const ViewType3 computedDofs_;
141  const ViewType4 tagToOrdinal_;
142  const ViewType5 targetAtTargetEPoints_;
143  const ViewType1 targetDofAtTargetEPoints_;
144  const ViewType1 refSideNormal_;
145  ordinal_type fieldDim_;
146  ordinal_type faceCardinality_;
147  ordinal_type offsetBasis_;
148  ordinal_type offsetTarget_;
149  ordinal_type numVertexEdgeDofs_;
150  ordinal_type numFaces_;
151  ordinal_type faceDim_;
152  ordinal_type dim_;
153  ordinal_type iface_;
154  bool isHCurlBasis_, isHDivBasis_;
155 
156  ComputeBasisCoeffsOnFaces_L2(const ViewType1 basisCoeffs, ViewType1 negPartialProj, const ViewType1 faceBasisDofAtBasisEPoints,
157  const ViewType1 basisAtBasisEPoints, const ViewType2 basisEWeights, const ViewType1 wBasisDofAtBasisEPoints, const ViewType2 targetEWeights,
158  const ViewType1 basisAtTargetEPoints, const ViewType1 wBasisDofAtTargetEPoints, const ViewType3 computedDofs, const ViewType4 tagToOrdinal,
159  const ViewType5 targetAtTargetEPoints, const ViewType1 targetDofAtTargetEPoints,
160  const ViewType1 refSideNormal, ordinal_type fieldDim, ordinal_type faceCardinality, ordinal_type offsetBasis,
161  ordinal_type offsetTarget, ordinal_type numVertexEdgeDofs, ordinal_type numFaces, ordinal_type faceDim,
162  ordinal_type dim, ordinal_type iface, bool isHCurlBasis, bool isHDivBasis) :
163  basisCoeffs_(basisCoeffs), negPartialProj_(negPartialProj), faceBasisDofAtBasisEPoints_(faceBasisDofAtBasisEPoints),
164  basisAtBasisEPoints_(basisAtBasisEPoints), basisEWeights_(basisEWeights), wBasisDofAtBasisEPoints_(wBasisDofAtBasisEPoints), targetEWeights_(targetEWeights),
165  basisAtTargetEPoints_(basisAtTargetEPoints), wBasisDofAtTargetEPoints_(wBasisDofAtTargetEPoints),
166  computedDofs_(computedDofs), tagToOrdinal_(tagToOrdinal), targetAtTargetEPoints_(targetAtTargetEPoints),
167  targetDofAtTargetEPoints_(targetDofAtTargetEPoints), refSideNormal_(refSideNormal),
168  fieldDim_(fieldDim), faceCardinality_(faceCardinality), offsetBasis_(offsetBasis),
169  offsetTarget_(offsetTarget), numVertexEdgeDofs_(numVertexEdgeDofs), numFaces_(numFaces),
170  faceDim_(faceDim), dim_(dim), iface_(iface),
171  isHCurlBasis_(isHCurlBasis), isHDivBasis_(isHDivBasis)
172  {}
173 
174  void
175  KOKKOS_INLINE_FUNCTION
176  operator()(const ordinal_type ic) const {
177 
178  if(isHCurlBasis_) {
179  //normal
180  typename ViewType1::value_type n[3] = {refSideNormal_(0), refSideNormal_(1), refSideNormal_(2)};
181 
182  for(ordinal_type j=0; j <faceCardinality_; ++j) {
183  ordinal_type jdof = tagToOrdinal_(faceDim_, iface_, j);
184  for(ordinal_type d=0; d <fieldDim_; ++d) {
185  ordinal_type dp1 = (d+1) % dim_;
186  ordinal_type dp2 = (d+2) % dim_;
187  for(ordinal_type iq=0; iq <ordinal_type(basisEWeights_.extent(0)); ++iq) {
188 
189  faceBasisDofAtBasisEPoints_(0,j,iq,d) = basisAtBasisEPoints_(jdof,offsetBasis_+iq,dp1)*n[dp2] - basisAtBasisEPoints_(jdof,offsetBasis_+iq,dp2)*n[dp1];
190  // basis \times n
191  wBasisDofAtBasisEPoints_(ic,j,iq,d) = faceBasisDofAtBasisEPoints_(0,j,iq,d) * basisEWeights_(iq);
192  }
193  for(ordinal_type iq=0; iq <ordinal_type(targetEWeights_.extent(0)); ++iq) {
194  // basis \times n
195  wBasisDofAtTargetEPoints_(ic,j,iq,d) = (basisAtTargetEPoints_(jdof,offsetTarget_+iq,dp1)*n[dp2] - basisAtTargetEPoints_(jdof,offsetTarget_+iq,dp2)*n[dp1]) * targetEWeights_(iq);
196  }
197  }
198  }
199 
200  for(ordinal_type d=0; d <fieldDim_; ++d) {
201  ordinal_type dp1 = (d+1) % dim_;
202  ordinal_type dp2 = (d+2) % dim_;
203  for(ordinal_type iq=0; iq <ordinal_type(targetEWeights_.extent(0)); ++iq) {
204  // target \times n
205  targetDofAtTargetEPoints_(ic,iq,d) = targetAtTargetEPoints_(ic,offsetTarget_+iq,dp1)*n[dp2] - targetAtTargetEPoints_(ic,offsetTarget_+iq,dp2)*n[dp1];
206  }
207  }
208 
209  for(ordinal_type j=0; j <numVertexEdgeDofs_; ++j) {
210  ordinal_type jdof = computedDofs_(j);
211  for(ordinal_type d=0; d <fieldDim_; ++d) {
212  ordinal_type dp1 = (d+1) % dim_;
213  ordinal_type dp2 = (d+2) % dim_;
214  for(ordinal_type iq=0; iq <ordinal_type(basisEWeights_.extent(0)); ++iq) {
215  // basis \times n
216  negPartialProj_(ic,iq,d) -= (basisAtBasisEPoints_(jdof,offsetBasis_+iq,dp1)*n[dp2] - basisAtBasisEPoints_(jdof,offsetBasis_+iq,dp2)*n[dp1])*basisCoeffs_(ic,jdof);
217  }
218  }
219  }
220  } else { // isHDivBasis_ || isHGradBasis_
221  typename ViewType1::value_type coeff[3] = {1,0,0}; //only need first component for HGrad basis
222  if (isHDivBasis_) {
223  for (ordinal_type d=0; d<3; d++)
224  coeff[d] = refSideNormal_(d);
225  }
226 
227  for(ordinal_type j=0; j <faceCardinality_; ++j) {
228  ordinal_type jdof = tagToOrdinal_(faceDim_, iface_, j);
229  for(ordinal_type iq=0; iq <ordinal_type(basisEWeights_.extent(0)); ++iq) {
230  typename ViewType1::value_type tmp =0;
231  for(ordinal_type d=0; d <fieldDim_; ++d)
232  tmp += coeff[d]*basisAtBasisEPoints_(jdof,offsetBasis_+iq,d);
233  faceBasisDofAtBasisEPoints_(0,j,iq,0) = tmp;
234  wBasisDofAtBasisEPoints_(ic,j,iq,0) = tmp * basisEWeights_(iq);
235  }
236  for(ordinal_type iq=0; iq <ordinal_type(targetEWeights_.extent(0)); ++iq) {
237  typename ViewType2::value_type sum=0;
238  for(ordinal_type d=0; d <fieldDim_; ++d)
239  sum += coeff[d]*basisAtTargetEPoints_(jdof,offsetTarget_+iq,d);
240  wBasisDofAtTargetEPoints_(ic,j,iq,0) = sum * targetEWeights_(iq);
241  }
242  }
243 
244  for(ordinal_type d=0; d <fieldDim_; ++d)
245  for(ordinal_type iq=0; iq <ordinal_type(targetEWeights_.extent(0)); ++iq)
246  targetDofAtTargetEPoints_(ic,iq,0) += coeff[d]*targetAtTargetEPoints_(ic,offsetTarget_+iq,d);
247 
248  for(ordinal_type j=0; j <numVertexEdgeDofs_; ++j) {
249  ordinal_type jdof = computedDofs_(j);
250  for(ordinal_type iq=0; iq <ordinal_type(basisEWeights_.extent(0)); ++iq)
251  for(ordinal_type d=0; d <fieldDim_; ++d)
252  negPartialProj_(ic,iq,0) -= basisCoeffs_(ic,jdof)*coeff[d]*basisAtBasisEPoints_(jdof,offsetBasis_+iq,d);
253  }
254  }
255  }
256 };
257 
258 
259 template<typename ViewType1, typename ViewType2, typename ViewType3, typename ViewType4>
261  const ViewType1 basisCoeffs_;
262  const ViewType1 negPartialProj_;
263  const ViewType1 internalBasisAtBasisEPoints_;
264  const ViewType1 basisAtBasisEPoints_;
265  const ViewType2 basisEWeights_;
266  const ViewType1 wBasisAtBasisEPoints_;
267  const ViewType2 targetEWeights_;
268  const ViewType1 basisAtTargetEPoints_;
269  const ViewType1 wBasisDofAtTargetEPoints_;
270  const ViewType3 computedDofs_;
271  const ViewType4 elemDof_;
272  ordinal_type fieldDim_;
273  ordinal_type numElemDofs_;
274  ordinal_type offsetBasis_;
275  ordinal_type offsetTarget_;
276  ordinal_type numVertexEdgeFaceDofs_;
277 
278  ComputeBasisCoeffsOnCells_L2(const ViewType1 basisCoeffs, ViewType1 negPartialProj, const ViewType1 internalBasisAtBasisEPoints,
279  const ViewType1 basisAtBasisEPoints, const ViewType2 basisEWeights, const ViewType1 wBasisAtBasisEPoints, const ViewType2 targetEWeights,
280  const ViewType1 basisAtTargetEPoints, const ViewType1 wBasisDofAtTargetEPoints, const ViewType3 computedDofs, const ViewType4 elemDof,
281  ordinal_type fieldDim, ordinal_type numElemDofs, ordinal_type offsetBasis, ordinal_type offsetTarget, ordinal_type numVertexEdgeFaceDofs) :
282  basisCoeffs_(basisCoeffs), negPartialProj_(negPartialProj), internalBasisAtBasisEPoints_(internalBasisAtBasisEPoints),
283  basisAtBasisEPoints_(basisAtBasisEPoints), basisEWeights_(basisEWeights), wBasisAtBasisEPoints_(wBasisAtBasisEPoints), targetEWeights_(targetEWeights),
284  basisAtTargetEPoints_(basisAtTargetEPoints), wBasisDofAtTargetEPoints_(wBasisDofAtTargetEPoints),
285  computedDofs_(computedDofs), elemDof_(elemDof), fieldDim_(fieldDim), numElemDofs_(numElemDofs), offsetBasis_(offsetBasis),
286  offsetTarget_(offsetTarget), numVertexEdgeFaceDofs_(numVertexEdgeFaceDofs) {}
287 
288  void
289  KOKKOS_INLINE_FUNCTION
290  operator()(const ordinal_type ic) const {
291 
292  for(ordinal_type j=0; j <numElemDofs_; ++j) {
293  ordinal_type idof = elemDof_(j);
294  for(ordinal_type d=0; d <fieldDim_; ++d) {
295  for(ordinal_type iq=0; iq <ordinal_type(basisEWeights_.extent(0)); ++iq) {
296  internalBasisAtBasisEPoints_(0,j,iq,d) = basisAtBasisEPoints_(idof,offsetBasis_+iq,d);
297  wBasisAtBasisEPoints_(ic,j,iq,d) = internalBasisAtBasisEPoints_(0,j,iq,d) * basisEWeights_(iq);
298  }
299  for(ordinal_type iq=0; iq <ordinal_type(targetEWeights_.extent(0)); ++iq) {
300  wBasisDofAtTargetEPoints_(ic,j,iq,d) = basisAtTargetEPoints_(idof,offsetTarget_+iq,d)* targetEWeights_(iq);
301  }
302  }
303  }
304  for(ordinal_type j=0; j < numVertexEdgeFaceDofs_; ++j) {
305  ordinal_type jdof = computedDofs_(j);
306  for(ordinal_type iq=0; iq <ordinal_type(basisEWeights_.extent(0)); ++iq)
307  for(ordinal_type d=0; d <fieldDim_; ++d) {
308  negPartialProj_(ic,iq,d) -= basisCoeffs_(ic,jdof)*basisAtBasisEPoints_(jdof,offsetBasis_+iq,d);
309  }
310  }
311  }
312 };
313 
314 template<typename ViewType1, typename ViewType2>
316  const ViewType1 basisAtBasisEPoints_;
317  const ViewType2 basisEWeights_;
318  const ViewType1 wBasisAtBasisEPoints_;
319  const ViewType2 targetEWeights_;
320  const ViewType1 basisAtTargetEPoints_;
321  const ViewType1 wBasisDofAtTargetEPoints_;
322  ordinal_type fieldDim_;
323  ordinal_type numElemDofs_;
324 
325  MultiplyBasisByWeights(const ViewType1 basisAtBasisEPoints, const ViewType2 basisEWeights, const ViewType1 wBasisAtBasisEPoints, const ViewType2 targetEWeights,
326  const ViewType1 basisAtTargetEPoints, const ViewType1 wBasisDofAtTargetEPoints,
327  ordinal_type fieldDim, ordinal_type numElemDofs) :
328  basisAtBasisEPoints_(basisAtBasisEPoints), basisEWeights_(basisEWeights), wBasisAtBasisEPoints_(wBasisAtBasisEPoints), targetEWeights_(targetEWeights),
329  basisAtTargetEPoints_(basisAtTargetEPoints), wBasisDofAtTargetEPoints_(wBasisDofAtTargetEPoints),
330  fieldDim_(fieldDim), numElemDofs_(numElemDofs) {}
331 
332  void
333  KOKKOS_INLINE_FUNCTION
334  operator()(const ordinal_type ic) const {
335 
336  for(ordinal_type j=0; j <numElemDofs_; ++j) {
337  for(ordinal_type d=0; d <fieldDim_; ++d) {
338  for(ordinal_type iq=0; iq <ordinal_type(basisEWeights_.extent(0)); ++iq) {
339  wBasisAtBasisEPoints_(ic,j,iq,d) = basisAtBasisEPoints_(j,iq,d) * basisEWeights_(iq);
340  }
341  for(ordinal_type iq=0; iq <ordinal_type(targetEWeights_.extent(0)); ++iq) {
342  wBasisDofAtTargetEPoints_(ic,j,iq,d) = basisAtTargetEPoints_(j,iq,d)* targetEWeights_(iq);
343  }
344  }
345  }
346  }
347 };
348 
349 } // FunctorsProjectionTools namespace
350 
351 
352 template<typename DeviceType>
353 template<typename basisCoeffsValueType, class ...basisCoeffsProperties,
354 typename funValsValueType, class ...funValsProperties,
355 typename BasisType,
356 typename ortValueType,class ...ortProperties>
357 void
358 ProjectionTools<DeviceType>::getL2BasisCoeffs(Kokkos::DynRankView<basisCoeffsValueType,basisCoeffsProperties...> basisCoeffs,
359  const Kokkos::DynRankView<funValsValueType,funValsProperties...> targetAtTargetEPoints,
360  const Kokkos::DynRankView<ortValueType, ortProperties...> orts,
361  const BasisType* cellBasis,
363 
364  typedef typename BasisType::scalarType scalarType;
365  typedef Kokkos::DynRankView<scalarType,DeviceType> ScalarViewType;
366  typedef Kokkos::pair<ordinal_type,ordinal_type> range_type;
367  const auto cellTopo = cellBasis->getBaseCellTopology();
368  ordinal_type dim = cellTopo.getDimension();
369  ordinal_type basisCardinality = cellBasis->getCardinality();
370  ordinal_type numCells = targetAtTargetEPoints.extent(0);
371  const ordinal_type edgeDim = 1;
372  const ordinal_type faceDim = 2;
373  const ordinal_type fieldDim = (targetAtTargetEPoints.rank()==2) ? 1 : targetAtTargetEPoints.extent(2);
374 
375  ordinal_type numVertices = (cellBasis->getDofCount(0, 0) > 0) ? cellTopo.getVertexCount() : 0;
376  ordinal_type numEdges = (cellBasis->getDofCount(1, 0) > 0) ? cellTopo.getEdgeCount() : 0;
377  ordinal_type numFaces = (cellBasis->getDofCount(2, 0) > 0) ? cellTopo.getFaceCount() : 0;
378 
379  ScalarViewType refEdgesVec("refEdgesVec", numEdges, dim);
380  ScalarViewType refFacesTangents("refFaceTangents", numFaces, dim, 2);
381  ScalarViewType refFacesNormal("refFaceNormal", numFaces, dim);
382 
383  ordinal_type numVertexDofs = numVertices;
384 
385  ordinal_type numEdgeDofs(0);
386  for(ordinal_type ie=0; ie<numEdges; ++ie)
387  numEdgeDofs += cellBasis->getDofCount(edgeDim,ie);
388 
389  ordinal_type numFaceDofs(0);
390  for(ordinal_type iface=0; iface<numFaces; ++iface)
391  numFaceDofs += cellBasis->getDofCount(faceDim,iface);
392 
393  Kokkos::View<ordinal_type*, DeviceType> computedDofs("computedDofs", numVertexDofs+numEdgeDofs+numFaceDofs);
394 
395  auto basisEPointsRange = projStruct->getBasisPointsRange();
396 
397  ordinal_type numTotalBasisEPoints = projStruct->getNumBasisEvalPoints();
398  auto basisEPoints = projStruct->getAllEvalPoints(EvalPointsType::BASIS);
399 
400  ordinal_type numTotalTargetEPoints = projStruct->getNumTargetEvalPoints();
401  auto targetEPoints = projStruct->getAllEvalPoints(EvalPointsType::TARGET);
402 
403  auto tagToOrdinal = Kokkos::create_mirror_view_and_copy(MemSpaceType(), cellBasis->getAllDofOrdinal());
404 
405  ScalarViewType basisAtBasisEPoints("basisAtBasisEPoints",basisCardinality, numTotalBasisEPoints, fieldDim);
406  ScalarViewType basisAtTargetEPoints("basisAtTargetEPoints",basisCardinality, numTotalTargetEPoints, fieldDim);
407  {
408  if(fieldDim == 1) {
409  cellBasis->getValues(Kokkos::subview(basisAtTargetEPoints, Kokkos::ALL(), Kokkos::ALL(), 0), targetEPoints);
410  cellBasis->getValues(Kokkos::subview(basisAtBasisEPoints, Kokkos::ALL(), Kokkos::ALL(), 0), basisEPoints);
411  }
412  else {
413  cellBasis->getValues(basisAtTargetEPoints, targetEPoints);
414  cellBasis->getValues(basisAtBasisEPoints, basisEPoints);
415  }
416  }
417 
418  {
419  auto hostComputedDofs = Kokkos::create_mirror_view(computedDofs);
420  ordinal_type computedDofsCount = 0;
421  for(ordinal_type iv=0; iv<numVertices; ++iv)
422  hostComputedDofs(computedDofsCount++) = cellBasis->getDofOrdinal(0, iv, 0);
423 
424  for(ordinal_type ie=0; ie<numEdges; ++ie) {
425  ordinal_type edgeCardinality = cellBasis->getDofCount(edgeDim,ie);
426  for(ordinal_type i=0; i<edgeCardinality; ++i)
427  hostComputedDofs(computedDofsCount++) = cellBasis->getDofOrdinal(edgeDim, ie, i);
428  }
429 
430  for(ordinal_type iface=0; iface<numFaces; ++iface) {
431  ordinal_type faceCardinality = cellBasis->getDofCount(faceDim,iface);
432  for(ordinal_type i=0; i<faceCardinality; ++i)
433  hostComputedDofs(computedDofsCount++) = cellBasis->getDofOrdinal(faceDim, iface, i);
434  }
435  Kokkos::deep_copy(computedDofs,hostComputedDofs);
436  }
437 
438  bool isHGradBasis = (cellBasis->getFunctionSpace() == FUNCTION_SPACE_HGRAD);
439  bool isHCurlBasis = (cellBasis->getFunctionSpace() == FUNCTION_SPACE_HCURL);
440  bool isHDivBasis = (cellBasis->getFunctionSpace() == FUNCTION_SPACE_HDIV);
441  ordinal_type faceDofDim = isHCurlBasis ? 3 : 1;
442  ScalarViewType edgeCoeff("edgeCoeff", fieldDim);
443 
444 
445  const Kokkos::RangePolicy<ExecSpaceType> policy(0, numCells);
446  ScalarViewType refBasisCoeffs("refBasisCoeffs", basisCoeffs.extent(0), basisCoeffs.extent(1));
447 
448  if(isHGradBasis) {
449 
450  auto targetEPointsRange = Kokkos::create_mirror_view_and_copy(MemSpaceType(), projStruct->getTargetPointsRange());
451  using functorType = FunctorsProjectionTools::ComputeBasisCoeffsOnVertices_L2<ScalarViewType, decltype(tagToOrdinal), decltype(targetEPointsRange),
452  decltype(targetAtTargetEPoints)>;
453  Kokkos::parallel_for(policy, functorType(refBasisCoeffs, tagToOrdinal, targetEPointsRange,
454  targetAtTargetEPoints, basisAtTargetEPoints, numVertices));
455  }
456 
457  auto targetEPointsRange = projStruct->getTargetPointsRange();
458  for(ordinal_type ie=0; ie<numEdges; ++ie) {
459  auto edgeVec = Kokkos::subview(refEdgesVec, ie, Kokkos::ALL());
460  //auto edgeVecHost = Kokkos::create_mirror_view(edgeVec);
461 
462  if(isHCurlBasis) {
463  CellTools<DeviceType>::getReferenceEdgeTangent(edgeVec, ie, cellTopo);
464  } else if(isHDivBasis) {
465  CellTools<DeviceType>::getReferenceSideNormal(edgeVec, ie, cellTopo);
466  } else {
467  deep_copy(edgeVec, 1.0);
468  }
469 
470  ordinal_type edgeCardinality = cellBasis->getDofCount(edgeDim,ie);
471  ordinal_type numBasisEPoints = range_size(basisEPointsRange(edgeDim, ie));
472  ordinal_type numTargetEPoints = range_size(targetEPointsRange(edgeDim, ie));
473 
474  ScalarViewType basisDofAtBasisEPoints("BasisDofAtBasisEPoints",1,edgeCardinality, numBasisEPoints);
475  ScalarViewType tragetDofAtTargetEPoints("TargetDofAtTargetEPoints",numCells, numTargetEPoints);
476  ScalarViewType weightedBasisAtBasisEPoints("weightedTanBasisAtBasisEPoints",numCells,edgeCardinality, numBasisEPoints);
477  ScalarViewType weightedBasisAtTargetEPoints("weightedTanBasisAtTargetEPoints",numCells,edgeCardinality, numTargetEPoints);
478  ScalarViewType negPartialProj("negPartialProj", numCells, numBasisEPoints);
479 
480  auto targetEWeights = Kokkos::create_mirror_view_and_copy(MemSpaceType(),projStruct->getTargetEvalWeights(edgeDim,ie));
481  auto basisEWeights = Kokkos::create_mirror_view_and_copy(MemSpaceType(),projStruct->getBasisEvalWeights(edgeDim,ie));
482 
483  //Note: we are not considering the jacobian of the orientation map since it is simply a scalar term for the integrals and it does not affect the projection
484  ordinal_type offsetBasis = basisEPointsRange(edgeDim, ie).first;
485  ordinal_type offsetTarget = targetEPointsRange(edgeDim, ie).first;
486 
487 
488  using functorTypeEdge = FunctorsProjectionTools::ComputeBasisCoeffsOnEdges_L2<ScalarViewType, decltype(basisEWeights),
489  decltype(computedDofs), decltype(tagToOrdinal), decltype(targetAtTargetEPoints)>;
490 
491  Kokkos::parallel_for(policy, functorTypeEdge(refBasisCoeffs, negPartialProj, basisDofAtBasisEPoints,
492  basisAtBasisEPoints, basisEWeights, weightedBasisAtBasisEPoints, targetEWeights,
493  basisAtTargetEPoints, weightedBasisAtTargetEPoints, computedDofs, tagToOrdinal,
494  targetAtTargetEPoints,tragetDofAtTargetEPoints, refEdgesVec, fieldDim,
495  edgeCardinality, offsetBasis, offsetTarget, numVertexDofs, edgeDim, ie));
496 
497 
498  ScalarViewType edgeMassMat_("edgeMassMat_", 1, edgeCardinality, edgeCardinality),
499  edgeRhsMat_("rhsMat_", numCells, edgeCardinality);
500 
501  FunctionSpaceTools<DeviceType >::integrate(edgeMassMat_, basisDofAtBasisEPoints, Kokkos::subview(weightedBasisAtBasisEPoints, std::make_pair(0,1), Kokkos::ALL(),Kokkos::ALL()) );
502  FunctionSpaceTools<DeviceType >::integrate(edgeRhsMat_, tragetDofAtTargetEPoints, weightedBasisAtTargetEPoints);
503  FunctionSpaceTools<DeviceType >::integrate(edgeRhsMat_, negPartialProj, weightedBasisAtBasisEPoints,true);
504 
505 
506  typedef Kokkos::DynRankView<scalarType, Kokkos::LayoutRight, DeviceType> WorkArrayViewType;
507  ScalarViewType t_("t",numCells, edgeCardinality);
508  WorkArrayViewType w_("w",numCells, edgeCardinality);
509 
510  auto edgeDof = Kokkos::subview(tagToOrdinal, edgeDim, ie, Kokkos::ALL());
511 
512  ElemSystem edgeSystem("edgeSystem", true);
513  edgeSystem.solve(refBasisCoeffs, edgeMassMat_, edgeRhsMat_, t_, w_, edgeDof, edgeCardinality);
514  }
515 
516  for(ordinal_type iface=0; iface<numFaces; ++iface) {
517  ordinal_type faceCardinality = cellBasis->getDofCount(faceDim,iface);
518 
519  ordinal_type numTargetEPoints = range_size(targetEPointsRange(faceDim, iface));
520  ordinal_type numBasisEPoints = range_size(basisEPointsRange(faceDim, iface));
521 
522  ScalarViewType faceBasisDofAtBasisEPoints("faceBasisDofAtBasisEPoints",1,faceCardinality, numBasisEPoints,faceDofDim);
523  ScalarViewType wBasisDofAtBasisEPoints("weightedBasisDofAtBasisEPoints",numCells,faceCardinality, numBasisEPoints,faceDofDim);
524 
525  ScalarViewType faceBasisAtTargetEPoints("faceBasisDofAtTargetEPoints",numCells,faceCardinality, numTargetEPoints,faceDofDim);
526  ScalarViewType wBasisDofAtTargetEPoints("weightedBasisDofAtTargetEPoints",numCells,faceCardinality, numTargetEPoints,faceDofDim);
527 
528  ScalarViewType targetDofAtTargetEPoints("targetDofAtTargetEPoints",numCells, numTargetEPoints,faceDofDim);
529  ScalarViewType negPartialProj("negComputedProjection", numCells,numBasisEPoints,faceDofDim);
530 
531  ordinal_type offsetBasis = basisEPointsRange(faceDim, iface).first;
532  ordinal_type offsetTarget = targetEPointsRange(faceDim, iface).first;
533  auto targetEWeights = Kokkos::create_mirror_view_and_copy(MemSpaceType(),projStruct->getTargetEvalWeights(faceDim,iface));
534  auto basisEWeights = Kokkos::create_mirror_view_and_copy(MemSpaceType(),projStruct->getBasisEvalWeights(faceDim,iface));
535 
536  ScalarViewType refSideNormal("refSideNormal", dim);
537  CellTools<DeviceType>::getReferenceSideNormal(refSideNormal, iface, cellTopo);
538 
539  using functorTypeFace = FunctorsProjectionTools::ComputeBasisCoeffsOnFaces_L2<ScalarViewType, decltype(basisEWeights),
540  decltype(computedDofs), decltype(tagToOrdinal), decltype(targetAtTargetEPoints)>;
541 
542  Kokkos::parallel_for(policy, functorTypeFace(refBasisCoeffs, negPartialProj,faceBasisDofAtBasisEPoints,
543  basisAtBasisEPoints, basisEWeights, wBasisDofAtBasisEPoints, targetEWeights,
544  basisAtTargetEPoints, wBasisDofAtTargetEPoints, computedDofs, tagToOrdinal,
545  targetAtTargetEPoints,targetDofAtTargetEPoints,
546  refSideNormal, fieldDim, faceCardinality, offsetBasis,
547  offsetTarget, numVertexDofs+numEdgeDofs, numFaces, faceDim,
548  dim, iface, isHCurlBasis, isHDivBasis));
549 
550  typedef Kokkos::DynRankView<scalarType, Kokkos::LayoutRight, DeviceType> WorkArrayViewType;
551  ScalarViewType faceMassMat_("faceMassMat_", 1, faceCardinality, faceCardinality),
552  faceRhsMat_("rhsMat_", numCells, faceCardinality);
553 
554  FunctionSpaceTools<DeviceType >::integrate(faceMassMat_, faceBasisDofAtBasisEPoints, Kokkos::subview(wBasisDofAtBasisEPoints, std::make_pair(0,1), Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL()) );
555  FunctionSpaceTools<DeviceType >::integrate(faceRhsMat_, targetDofAtTargetEPoints, wBasisDofAtTargetEPoints);
556  FunctionSpaceTools<DeviceType >::integrate(faceRhsMat_, negPartialProj, wBasisDofAtBasisEPoints,true);
557 
558  ScalarViewType t_("t",numCells, faceCardinality);
559  WorkArrayViewType w_("w",numCells,faceCardinality);
560 
561  auto faceDof = Kokkos::subview(tagToOrdinal, faceDim, iface, Kokkos::ALL());
562 
563  ElemSystem faceSystem("faceSystem", true);
564  faceSystem.solve(refBasisCoeffs, faceMassMat_, faceRhsMat_, t_, w_, faceDof, faceCardinality);
565  }
566 
567  ordinal_type numElemDofs = cellBasis->getDofCount(dim,0);
568 
569 
570  if(numElemDofs>0) {
571 
572  auto cellDofs = Kokkos::subview(tagToOrdinal, dim, 0, Kokkos::ALL());
573 
574  range_type cellPointsRange = targetEPointsRange(dim, 0);
575 
576  ordinal_type numTargetEPoints = range_size(targetEPointsRange(dim,0));
577  ordinal_type numBasisEPoints = range_size(basisEPointsRange(dim,0));
578 
579  ScalarViewType internalBasisAtBasisEPoints("internalBasisAtBasisEPoints",1,numElemDofs, numBasisEPoints, fieldDim);
580  ScalarViewType negPartialProj("negPartialProj", numCells, numBasisEPoints, fieldDim);
581 
582  auto targetEWeights = Kokkos::create_mirror_view_and_copy(MemSpaceType(),projStruct->getTargetEvalWeights(dim,0));
583  auto basisEWeights = Kokkos::create_mirror_view_and_copy(MemSpaceType(),projStruct->getBasisEvalWeights(dim,0));
584  ordinal_type offsetBasis = basisEPointsRange(dim, 0).first;
585  ordinal_type offsetTarget = targetEPointsRange(dim, 0).first;
586 
587  ScalarViewType wBasisAtBasisEPoints("weightedBasisAtBasisEPoints",numCells,numElemDofs, numBasisEPoints,fieldDim);
588  ScalarViewType wBasisDofAtTargetEPoints("weightedBasisAtTargetEPoints",numCells,numElemDofs, numTargetEPoints,fieldDim);
589 
591  Kokkos::parallel_for(policy, functorType( refBasisCoeffs, negPartialProj, internalBasisAtBasisEPoints,
592  basisAtBasisEPoints, basisEWeights, wBasisAtBasisEPoints, targetEWeights, basisAtTargetEPoints, wBasisDofAtTargetEPoints,
593  computedDofs, cellDofs, fieldDim, numElemDofs, offsetBasis, offsetTarget, numVertexDofs+numEdgeDofs+numFaceDofs));
594 
595  typedef Kokkos::DynRankView<scalarType, Kokkos::LayoutRight, DeviceType> WorkArrayViewType;
596  ScalarViewType cellMassMat_("cellMassMat_", 1, numElemDofs, numElemDofs),
597  cellRhsMat_("rhsMat_", numCells, numElemDofs);
598 
599  FunctionSpaceTools<DeviceType >::integrate(cellMassMat_, internalBasisAtBasisEPoints, Kokkos::subview(wBasisAtBasisEPoints, std::make_pair(0,1), Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL()) );
600  if(fieldDim==1)
601  FunctionSpaceTools<DeviceType >::integrate(cellRhsMat_, Kokkos::subview(targetAtTargetEPoints,Kokkos::ALL(),cellPointsRange,Kokkos::ALL()),
602  Kokkos::subview(wBasisDofAtTargetEPoints,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL(),0));
603  else
604  FunctionSpaceTools<DeviceType >::integrate(cellRhsMat_, Kokkos::subview(targetAtTargetEPoints,Kokkos::ALL(),cellPointsRange,Kokkos::ALL()), wBasisDofAtTargetEPoints);
605  FunctionSpaceTools<DeviceType >::integrate(cellRhsMat_, negPartialProj, wBasisAtBasisEPoints, true);
606 
607  ScalarViewType t_("t",numCells, numElemDofs);
608  WorkArrayViewType w_("w",numCells,numElemDofs);
609  ElemSystem cellSystem("cellSystem", true);
610  cellSystem.solve(refBasisCoeffs, cellMassMat_, cellRhsMat_, t_, w_, cellDofs, numElemDofs);
611  }
612 
613  OrientationTools<DeviceType>::modifyBasisByOrientationInverse(basisCoeffs, refBasisCoeffs, orts, cellBasis, true);
614 }
615 
616 
617 template<typename DeviceType>
618 template<typename basisCoeffsValueType, class ...basisCoeffsProperties,
619 typename funValsValueType, class ...funValsProperties,
620 typename BasisType,
621 typename ortValueType,class ...ortProperties>
622 void
623 ProjectionTools<DeviceType>::getL2DGBasisCoeffs(Kokkos::DynRankView<basisCoeffsValueType,basisCoeffsProperties...> basisCoeffs,
624  const Kokkos::DynRankView<funValsValueType,funValsProperties...> targetAtTargetEPoints,
625  const Kokkos::DynRankView<ortValueType, ortProperties...> orts,
626  const BasisType* cellBasis,
628 
629  Kokkos::DynRankView<typename BasisType::scalarType,DeviceType> refBasisCoeffs("refBasisCoeffs", basisCoeffs.extent(0), basisCoeffs.extent(1));
630  getL2DGBasisCoeffs(refBasisCoeffs, targetAtTargetEPoints, cellBasis, projStruct);
631 
632  OrientationTools<DeviceType>::modifyBasisByOrientationInverse(basisCoeffs, refBasisCoeffs, orts, cellBasis, true);
633 }
634 
635 
636 template<typename DeviceType>
637 template<typename basisViewType, typename targetViewType, typename BasisType>
638 void
640  const targetViewType targetAtTargetEPoints,
641  const BasisType* cellBasis,
643 
644  typedef typename BasisType::scalarType scalarType;
645  typedef Kokkos::DynRankView<scalarType,DeviceType> ScalarViewType;
646  const auto cellTopo = cellBasis->getBaseCellTopology();
647 
648  ordinal_type dim = cellTopo.getDimension();
649 
650  auto basisEPoints = Kokkos::create_mirror_view_and_copy(MemSpaceType(),
651  projStruct->getEvalPoints(dim,0,EvalPointsType::BASIS));
652  auto targetEPoints = Kokkos::create_mirror_view_and_copy(MemSpaceType(),
653  projStruct->getEvalPoints(dim,0,EvalPointsType::TARGET));
654 
655  ordinal_type numTotalTargetEPoints(targetAtTargetEPoints.extent(1));
656  ordinal_type basisCardinality = cellBasis->getCardinality();
657  ordinal_type numCells = targetAtTargetEPoints.extent(0);
658  const ordinal_type fieldDim = (targetAtTargetEPoints.rank()==2) ? 1 : targetAtTargetEPoints.extent(2);
659 
660  ordinal_type numTotalBasisEPoints = projStruct->getNumBasisEvalPoints();
661  ScalarViewType basisAtBasisEPoints("basisAtBasisEPoints",1,basisCardinality, numTotalBasisEPoints, fieldDim);
662  ScalarViewType basisAtTargetEPoints("basisAtTargetEPoints",basisCardinality, numTotalTargetEPoints, fieldDim);
663  {
664  if(fieldDim == 1) {
665  cellBasis->getValues(Kokkos::subview(basisAtTargetEPoints,Kokkos::ALL(),Kokkos::ALL(),0), targetEPoints);
666  cellBasis->getValues(Kokkos::subview(basisAtBasisEPoints,0,Kokkos::ALL(),Kokkos::ALL(),0), basisEPoints);
667  }
668  else {
669  cellBasis->getValues(basisAtTargetEPoints, targetEPoints);
670  cellBasis->getValues(Kokkos::subview(basisAtBasisEPoints,0,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL()), basisEPoints);
671  }
672  }
673 
674  const Kokkos::RangePolicy<ExecSpaceType> policy(0, numCells);
675  ordinal_type numElemDofs = cellBasis->getCardinality();
676 
677  auto targetEWeights = Kokkos::create_mirror_view_and_copy(MemSpaceType(),projStruct->getTargetEvalWeights(dim,0));
678  auto basisEWeights = Kokkos::create_mirror_view_and_copy(MemSpaceType(),projStruct->getBasisEvalWeights(dim,0));
679 
680  ScalarViewType wBasisAtBasisEPoints("weightedBasisAtBasisEPoints",1,numElemDofs, numTotalBasisEPoints,fieldDim);
681  ScalarViewType wBasisDofAtTargetEPoints("weightedBasisAtTargetEPoints",numCells,numElemDofs, numTotalTargetEPoints,fieldDim);
682  Kokkos::DynRankView<ordinal_type, DeviceType> cellDofs("cellDoFs", numElemDofs);
683 
684  Kokkos::parallel_for(Kokkos::RangePolicy<ExecSpaceType>(0,numElemDofs),
685  KOKKOS_LAMBDA (const int &j) {
686  for(ordinal_type d=0; d <fieldDim; ++d) {
687  for(ordinal_type iq=0; iq < numTotalBasisEPoints; ++iq)
688  wBasisAtBasisEPoints(0,j,iq,d) = basisAtBasisEPoints(0,j,iq,d) * basisEWeights(iq);
689  for(ordinal_type iq=0; iq <numTotalTargetEPoints; ++iq) {
690  wBasisDofAtTargetEPoints(0,j,iq,d) = basisAtTargetEPoints(j,iq,d)* targetEWeights(iq);
691  }
692  }
693  cellDofs(j) = j;
694  });
695  RealSpaceTools<DeviceType>::clone(wBasisDofAtTargetEPoints, Kokkos::subview(wBasisDofAtTargetEPoints,0,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL()));
696 
697  typedef Kokkos::DynRankView<scalarType, Kokkos::LayoutRight, DeviceType> WorkArrayViewType;
698  ScalarViewType cellMassMat_("cellMassMat_", 1, numElemDofs, numElemDofs),
699  cellRhsMat_("rhsMat_", numCells, numElemDofs);
700 
701  FunctionSpaceTools<DeviceType >::integrate(cellMassMat_, basisAtBasisEPoints, wBasisAtBasisEPoints);
702  if(fieldDim==1)
703  FunctionSpaceTools<DeviceType >::integrate(cellRhsMat_, targetAtTargetEPoints,
704  Kokkos::subview(wBasisDofAtTargetEPoints,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL(),0));
705  else
706  FunctionSpaceTools<DeviceType >::integrate(cellRhsMat_, targetAtTargetEPoints, wBasisDofAtTargetEPoints);
707 
708  ScalarViewType t_("t",1, numElemDofs);
709  WorkArrayViewType w_("w",numCells,numElemDofs);
710  ElemSystem cellSystem("cellSystem", true);
711  cellSystem.solve(basisCoeffs, cellMassMat_, cellRhsMat_, t_, w_, cellDofs, numElemDofs);
712 }
713 
714 } //Intrepid2 namespace
715 
716 #endif
717 
Header file for the abstract base class Intrepid2::DefaultCubatureFactory.
const range_tag getBasisPointsRange() const
Returns the range tag of the basis evaluation points subcells.
host_view_type getEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId, EvalPointsType type) const
Returns the basis/target evaluation points on a subcell.
ordinal_type getNumBasisEvalPoints()
Returns number of basis evaluation points.
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...
static void clone(Kokkos::DynRankView< outputValueType, outputProperties...> output, const Kokkos::DynRankView< inputValueType, inputProperties...> input)
Clone input array.
static void getL2DGBasisCoeffs(Kokkos::DynRankView< basisCoeffsValueType, basisCoeffsProperties...> basisCoeffs, const Kokkos::DynRankView< funValsValueType, funValsProperties...> targetAtEvalPoints, const Kokkos::DynRankView< ortValueType, ortProperties...> cellOrientations, const BasisType *cellBasis, ProjectionStruct< DeviceType, typename BasisType::scalarType > *projStruct)
Computes evaluation points for local L2 projection for broken HGRAD HCURL HDIV and HVOL spaces...
static void getReferenceEdgeTangent(RefEdgeTangentViewType refEdgeTangent, const ordinal_type edgeOrd, const shards::CellTopology parentCell)
Computes constant tangent vectors to edges of 2D or 3D reference cells.
Header file for the Intrepid2::FunctionSpaceTools class.
static void getReferenceSideNormal(RefSideNormalViewType refSideNormal, const ordinal_type sideOrd, const shards::CellTopology parentCell)
Computes constant normal vectors to sides of 2D or 3D reference cells.
view_type getAllEvalPoints(EvalPointsType type=TARGET) const
Returns the basis/target evaluation points in the cell.
host_view_type getBasisEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the basis evaluation weights on a subcell.
ordinal_type getNumTargetEvalPoints()
Returns number of points where to evaluate the target function.
Header file for Intrepid2::ArrayTools class providing utilities for array operations.
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...
const range_tag getTargetPointsRange() const
Returns the range of the target function evaluation points on subcells.
host_view_type getTargetEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the function evaluation weights on a subcell.
static void getL2BasisCoeffs(Kokkos::DynRankView< basisCoeffsValueType, basisCoeffsProperties...> basisCoeffs, const Kokkos::DynRankView< funValsValueType, funValsProperties...> targetAtEvalPoints, const Kokkos::DynRankView< ortValueType, ortProperties...> cellOrientations, const BasisType *cellBasis, ProjectionStruct< DeviceType, typename BasisType::scalarType > *projStruct)
Computes the basis coefficients of the L2 projection of the target function.
Class to solve a square system A x = b on each cell A is expected to be saddle a point (KKT) matrix o...
An helper class to compute the evaluation points and weights needed for performing projections...
static void modifyBasisByOrientationInverse(Kokkos::DynRankView< outputValueType, outputProperties...> output, const Kokkos::DynRankView< inputValueType, inputProperties...> input, const OrientationViewType orts, const BasisType *basis, const bool transpose=false)
Modify basis due to orientation, applying the inverse of the operator applied in modifyBasisByOrienta...