Intrepid2
Intrepid2_ProjectionToolsDefL2.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_PROJECTIONTOOLSDEFL2_HPP__
50 #define __INTREPID2_PROJECTIONTOOLSDEFL2_HPP__
51 
53 #include "Intrepid2_ArrayTools.hpp"
55 
56 
57 namespace Intrepid2 {
58 namespace Experimental {
59 
60 
61 template<typename ViewType1, typename ViewType2, typename ViewType3,
62 typename 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_L2(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  for(ordinal_type iv=0; iv<numVertices_; ++iv) {
81  ordinal_type idof = tagToOrdinal_(0, iv, 0);
82  ordinal_type pt = targetEPointsRange_(0,iv).first;
83  //the value of the basis at the vertex might be different than 1; HGrad basis, so the function is scalar
84  basisCoeffs_(ic,idof) = targetAtTargetEPoints_(ic,pt)/basisAtTargetEPoints_(ic,idof,pt,0);
85  }
86  }
87 };
88 
89 
90 template<typename ViewType1, typename ViewType2, typename ViewType3,
91 typename ViewType4, typename ViewType5, typename ViewType6>
93  const ViewType1 basisCoeffs_;
94  const ViewType2 negPartialProj_;
95  const ViewType2 basisDofDofAtBasisEPoints_;
96  const ViewType2 basisAtBasisEPoints_;
97  const ViewType3 basisEWeights_;
98  const ViewType2 wBasisDofAtBasisEPoints_;
99  const ViewType3 targetEWeights_;
100  const ViewType2 basisAtTargetEPoints_;
101  const ViewType2 wBasisDofAtTargetEPoints_;
102  const ViewType4 computedDofs_;
103  const ViewType5 tagToOrdinal_;
104  const ViewType6 targetAtTargetEPoints_;
105  const ViewType2 targetTanAtTargetEPoints_;
106  const ViewType2 refEdgesVec_;
107  ordinal_type fieldDim_;
108  ordinal_type edgeCardinality_;
109  ordinal_type offsetBasis_;
110  ordinal_type offsetTarget_;
111  ordinal_type numVertexDofs_;
112  ordinal_type edgeDim_;
113  ordinal_type iedge_;
114 
115  ComputeBasisCoeffsOnEdges_L2(const ViewType1 basisCoeffs, ViewType2 negPartialProj, const ViewType2 basisDofDofAtBasisEPoints,
116  const ViewType2 basisAtBasisEPoints, const ViewType3 basisEWeights, const ViewType2 wBasisDofAtBasisEPoints, const ViewType3 targetEWeights,
117  const ViewType2 basisAtTargetEPoints, const ViewType2 wBasisDofAtTargetEPoints, const ViewType4 computedDofs, const ViewType5 tagToOrdinal,
118  const ViewType6 targetAtTargetEPoints, const ViewType2 targetTanAtTargetEPoints, const ViewType2 refEdgesVec,
119  ordinal_type fieldDim, ordinal_type edgeCardinality, ordinal_type offsetBasis,
120  ordinal_type offsetTarget, ordinal_type numVertexDofs, ordinal_type edgeDim, ordinal_type iedge) :
121  basisCoeffs_(basisCoeffs), negPartialProj_(negPartialProj), basisDofDofAtBasisEPoints_(basisDofDofAtBasisEPoints),
122  basisAtBasisEPoints_(basisAtBasisEPoints), basisEWeights_(basisEWeights), wBasisDofAtBasisEPoints_(wBasisDofAtBasisEPoints), targetEWeights_(targetEWeights),
123  basisAtTargetEPoints_(basisAtTargetEPoints), wBasisDofAtTargetEPoints_(wBasisDofAtTargetEPoints),
124  computedDofs_(computedDofs), tagToOrdinal_(tagToOrdinal), targetAtTargetEPoints_(targetAtTargetEPoints),
125  targetTanAtTargetEPoints_(targetTanAtTargetEPoints), refEdgesVec_(refEdgesVec),
126  fieldDim_(fieldDim), edgeCardinality_(edgeCardinality), offsetBasis_(offsetBasis),
127  offsetTarget_(offsetTarget), numVertexDofs_(numVertexDofs), edgeDim_(edgeDim), iedge_(iedge)
128  {}
129 
130  void
131  KOKKOS_INLINE_FUNCTION
132  operator()(const ordinal_type ic) const {
133  for(ordinal_type j=0; j <edgeCardinality_; ++j) {
134  ordinal_type jdof =tagToOrdinal_(edgeDim_, iedge_, j);
135  for(ordinal_type iq=0; iq <ordinal_type(basisEWeights_.extent(0)); ++iq) {
136  for(ordinal_type d=0; d <fieldDim_; ++d)
137  basisDofDofAtBasisEPoints_(ic,j,iq) += basisAtBasisEPoints_(ic,jdof,offsetBasis_+iq,d)*refEdgesVec_(iedge_,d);
138  wBasisDofAtBasisEPoints_(ic,j,iq) = basisDofDofAtBasisEPoints_(ic,j,iq)*basisEWeights_(iq);
139  }
140  for(ordinal_type iq=0; iq <ordinal_type(targetEWeights_.extent(0)); ++iq) {
141  for(ordinal_type d=0; d <fieldDim_; ++d)
142  wBasisDofAtTargetEPoints_(ic,j,iq) += basisAtTargetEPoints_(ic,jdof,offsetTarget_+iq,d)*refEdgesVec_(iedge_,d)*targetEWeights_(iq);
143  }
144  }
145 
146  for(ordinal_type iq=0; iq <ordinal_type(targetEWeights_.extent(0)); ++iq)
147  for(ordinal_type d=0; d <fieldDim_; ++d)
148  targetTanAtTargetEPoints_(ic,iq) += targetAtTargetEPoints_(ic,offsetTarget_+iq,d)*refEdgesVec_(iedge_,d);
149 
150  for(ordinal_type j=0; j <numVertexDofs_; ++j) {
151  ordinal_type jdof = computedDofs_(j);
152  for(ordinal_type iq=0; iq <ordinal_type(basisEWeights_.extent(0)); ++iq)
153  for(ordinal_type d=0; d <fieldDim_; ++d)
154  negPartialProj_(ic,iq) -= basisCoeffs_(ic,jdof)*basisAtBasisEPoints_(ic,jdof,offsetBasis_+iq,d)*refEdgesVec_(iedge_,d);
155  }
156  }
157 };
158 
159 template<typename ViewType1, typename ViewType2, typename ViewType3,
160 typename ViewType4, typename ViewType5, typename ViewType6, typename ViewType7>
162  const ViewType1 basisCoeffs_;
163  const ViewType2 negPartialProj_;
164  const ViewType2 faceBasisDofAtBasisEPoints_;
165  const ViewType2 basisAtBasisEPoints_;
166  const ViewType3 basisEWeights_;
167  const ViewType2 wBasisDofAtBasisEPoints_;
168  const ViewType3 targetEWeights_;
169  const ViewType2 basisAtTargetEPoints_;
170  const ViewType2 wBasisDofAtTargetEPoints_;
171  const ViewType4 computedDofs_;
172  const ViewType5 tagToOrdinal_;
173  const ViewType6 orts_;
174  const ViewType7 targetAtTargetEPoints_;
175  const ViewType2 targetDofAtTargetEPoints_;
176  const ViewType2 ortJacobian_;
177  const ViewType2 faceCoeff_;
178  const ViewType2 refFacesTangents_;
179  const ViewType2 refFacesNormal_;
180  ordinal_type fieldDim_;
181  ordinal_type faceCardinality_;
182  ordinal_type offsetBasis_;
183  ordinal_type offsetTarget_;
184  ordinal_type numVertexEdgeDofs_;
185  ordinal_type numFaces_;
186  ordinal_type faceDim_;
187  ordinal_type faceDofDim_;
188  ordinal_type dim_;
189  ordinal_type iface_;
190  unsigned topoKey_;
191  bool isHCurlBasis_, isHDivBasis_;
192 
193  ComputeBasisCoeffsOnFaces_L2(const ViewType1 basisCoeffs, ViewType2 negPartialProj, const ViewType2 faceBasisDofAtBasisEPoints,
194  const ViewType2 basisAtBasisEPoints, const ViewType3 basisEWeights, const ViewType2 wBasisDofAtBasisEPoints, const ViewType3 targetEWeights,
195  const ViewType2 basisAtTargetEPoints, const ViewType2 wBasisDofAtTargetEPoints, const ViewType4 computedDofs, const ViewType5 tagToOrdinal,
196  const ViewType6 orts, const ViewType7 targetAtTargetEPoints, const ViewType2 targetDofAtTargetEPoints, const ViewType2 ortJacobian, const ViewType2 faceCoeff,
197  const ViewType2 refFacesTangents, const ViewType2 refFacesNormal, ordinal_type fieldDim, ordinal_type faceCardinality, ordinal_type offsetBasis,
198  ordinal_type offsetTarget, ordinal_type numVertexEdgeDofs, ordinal_type numFaces, ordinal_type faceDim, ordinal_type faceDofDim,
199  ordinal_type dim, ordinal_type iface, unsigned topoKey, bool isHCurlBasis, bool isHDivBasis) :
200  basisCoeffs_(basisCoeffs), negPartialProj_(negPartialProj), faceBasisDofAtBasisEPoints_(faceBasisDofAtBasisEPoints),
201  basisAtBasisEPoints_(basisAtBasisEPoints), basisEWeights_(basisEWeights), wBasisDofAtBasisEPoints_(wBasisDofAtBasisEPoints), targetEWeights_(targetEWeights),
202  basisAtTargetEPoints_(basisAtTargetEPoints), wBasisDofAtTargetEPoints_(wBasisDofAtTargetEPoints),
203  computedDofs_(computedDofs), tagToOrdinal_(tagToOrdinal), orts_(orts), targetAtTargetEPoints_(targetAtTargetEPoints),
204  targetDofAtTargetEPoints_(targetDofAtTargetEPoints), ortJacobian_(ortJacobian), faceCoeff_(faceCoeff),
205  refFacesTangents_(refFacesTangents), refFacesNormal_(refFacesNormal),
206  fieldDim_(fieldDim), faceCardinality_(faceCardinality), offsetBasis_(offsetBasis),
207  offsetTarget_(offsetTarget), numVertexEdgeDofs_(numVertexEdgeDofs), numFaces_(numFaces),
208  faceDim_(faceDim), faceDofDim_(faceDofDim), dim_(dim), iface_(iface), topoKey_(topoKey),
209  isHCurlBasis_(isHCurlBasis), isHDivBasis_(isHDivBasis)
210  {}
211 
212  void
213  KOKKOS_INLINE_FUNCTION
214  operator()(const ordinal_type ic) const {
215 
216  ordinal_type fOrt[6];
217  orts_(ic).getFaceOrientation(fOrt, numFaces_);
218  ordinal_type ort = fOrt[iface_];
219  //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
220 
221  auto ortJacobian = Kokkos::subview(ortJacobian_, ic, Kokkos::ALL(), Kokkos::ALL());
222  if(isHCurlBasis_) {
223  Impl::OrientationTools::getJacobianOfOrientationMap(ortJacobian, topoKey_, ort);
224  for(ordinal_type d=0; d <dim_; ++d)
225  for(ordinal_type itan=0; itan <faceDim_; ++itan) {
226  faceCoeff_(ic,d,itan) = 0;
227  for(ordinal_type jtan=0; jtan <faceDim_; ++jtan)
228  faceCoeff_(ic,d,itan) += refFacesTangents_(iface_,d, jtan)*ortJacobian(jtan,itan);
229  }
230  } else if (isHDivBasis_) {
231  for(ordinal_type d=0; d <dim_; ++d)
232  faceCoeff_(ic,d,0) = refFacesNormal_(iface_,d);
233  } else
234  faceCoeff_(ic,0,0) = 1;
235  for(ordinal_type j=0; j <faceCardinality_; ++j) {
236  ordinal_type jdof = tagToOrdinal_(faceDim_, iface_, j);
237  for(ordinal_type itan=0; itan <faceDofDim_; ++itan) {
238  for(ordinal_type iq=0; iq <ordinal_type(basisEWeights_.extent(0)); ++iq) {
239  for(ordinal_type d=0; d <fieldDim_; ++d)
240  faceBasisDofAtBasisEPoints_(ic,j,iq,itan) += faceCoeff_(ic,d, itan)*basisAtBasisEPoints_(ic,jdof,offsetBasis_+iq,d);
241  wBasisDofAtBasisEPoints_(ic,j,iq,itan) = faceBasisDofAtBasisEPoints_(ic,j,iq,itan) * basisEWeights_(iq);
242  }
243  for(ordinal_type iq=0; iq <ordinal_type(targetEWeights_.extent(0)); ++iq) {
244  typename ViewType2::value_type sum=0;
245  for(ordinal_type d=0; d <fieldDim_; ++d)
246  sum += faceCoeff_(ic, d, itan)*basisAtTargetEPoints_(ic,jdof,offsetTarget_+iq,d);
247  wBasisDofAtTargetEPoints_(ic,j,iq,itan) = sum * targetEWeights_(iq);
248  }
249  }
250  }
251 
252  for(ordinal_type d=0; d <fieldDim_; ++d)
253  for(ordinal_type itan=0; itan <faceDofDim_; ++itan) {
254  for(ordinal_type iq=0; iq <ordinal_type(targetEWeights_.extent(0)); ++iq)
255  targetDofAtTargetEPoints_(ic,iq,itan) += faceCoeff_(ic, d, itan)*targetAtTargetEPoints_(ic,offsetTarget_+iq,d);
256  }
257 
258  for(ordinal_type j=0; j <numVertexEdgeDofs_; ++j) {
259  ordinal_type jdof = computedDofs_(j);
260  for(ordinal_type iq=0; iq <ordinal_type(basisEWeights_.extent(0)); ++iq)
261  for(ordinal_type d=0; d <fieldDim_; ++d)
262  for(ordinal_type itan=0; itan <faceDofDim_; ++itan)
263  negPartialProj_(ic,iq,itan) -= basisCoeffs_(ic,jdof)*faceCoeff_(ic, d, itan)*basisAtBasisEPoints_(ic,jdof,offsetBasis_+iq,d);
264  }
265  }
266 };
267 
268 
269 template<typename ViewType1, typename ViewType2, typename ViewType3,
270 typename ViewType4, typename ViewType5>
272  const ViewType1 basisCoeffs_;
273  const ViewType2 negPartialProj_;
274  const ViewType2 internalBasisAtBasisEPoints_;
275  const ViewType2 basisAtBasisEPoints_;
276  const ViewType3 basisEWeights_;
277  const ViewType2 wBasisAtBasisEPoints_;
278  const ViewType3 targetEWeights_;
279  const ViewType2 basisAtTargetEPoints_;
280  const ViewType2 wBasisDofAtTargetEPoints_;
281  const ViewType4 computedDofs_;
282  const ViewType5 elemDof_;
283  ordinal_type fieldDim_;
284  ordinal_type numElemDofs_;
285  ordinal_type offsetBasis_;
286  ordinal_type offsetTarget_;
287  ordinal_type numVertexEdgeFaceDofs_;
288 
289  ComputeBasisCoeffsOnCells_L2(const ViewType1 basisCoeffs, ViewType2 negPartialProj, const ViewType2 internalBasisAtBasisEPoints,
290  const ViewType2 basisAtBasisEPoints, const ViewType3 basisEWeights, const ViewType2 wBasisAtBasisEPoints, const ViewType3 targetEWeights,
291  const ViewType2 basisAtTargetEPoints, const ViewType2 wBasisDofAtTargetEPoints, const ViewType4 computedDofs, const ViewType5 elemDof,
292  ordinal_type fieldDim, ordinal_type numElemDofs, ordinal_type offsetBasis, ordinal_type offsetTarget, ordinal_type numVertexEdgeFaceDofs) :
293  basisCoeffs_(basisCoeffs), negPartialProj_(negPartialProj), internalBasisAtBasisEPoints_(internalBasisAtBasisEPoints),
294  basisAtBasisEPoints_(basisAtBasisEPoints), basisEWeights_(basisEWeights), wBasisAtBasisEPoints_(wBasisAtBasisEPoints), targetEWeights_(targetEWeights),
295  basisAtTargetEPoints_(basisAtTargetEPoints), wBasisDofAtTargetEPoints_(wBasisDofAtTargetEPoints),
296  computedDofs_(computedDofs), elemDof_(elemDof), fieldDim_(fieldDim), numElemDofs_(numElemDofs), offsetBasis_(offsetBasis),
297  offsetTarget_(offsetTarget), numVertexEdgeFaceDofs_(numVertexEdgeFaceDofs) {}
298 
299  void
300  KOKKOS_INLINE_FUNCTION
301  operator()(const ordinal_type ic) const {
302 
303  for(ordinal_type j=0; j <numElemDofs_; ++j) {
304  ordinal_type idof = elemDof_(j);
305  for(ordinal_type d=0; d <fieldDim_; ++d) {
306  for(ordinal_type iq=0; iq <ordinal_type(basisEWeights_.extent(0)); ++iq) {
307  internalBasisAtBasisEPoints_(ic,j,iq,d) = basisAtBasisEPoints_(ic,idof,offsetBasis_+iq,d);
308  wBasisAtBasisEPoints_(ic,j,iq,d) = internalBasisAtBasisEPoints_(ic,j,iq,d) * basisEWeights_(iq);
309  }
310  for(ordinal_type iq=0; iq <ordinal_type(targetEWeights_.extent(0)); ++iq) {
311  wBasisDofAtTargetEPoints_(ic,j,iq,d) = basisAtTargetEPoints_(ic,idof,offsetTarget_+iq,d)* targetEWeights_(iq);
312  }
313  }
314  }
315  for(ordinal_type j=0; j < numVertexEdgeFaceDofs_; ++j) {
316  ordinal_type jdof = computedDofs_(j);
317  for(ordinal_type iq=0; iq <ordinal_type(basisEWeights_.extent(0)); ++iq)
318  for(ordinal_type d=0; d <fieldDim_; ++d) {
319  negPartialProj_(ic,iq,d) -= basisCoeffs_(ic,jdof)*basisAtBasisEPoints_(ic,jdof,offsetBasis_+iq,d);
320  }
321  }
322  }
323 };
324 
325 
326 template<typename SpT>
327 template<typename BasisType,
328 typename ortValueType, class ...ortProperties>
329 void
330 ProjectionTools<SpT>::getL2EvaluationPoints(typename BasisType::ScalarViewType ePoints,
331  const Kokkos::DynRankView<ortValueType, ortProperties...> orts,
332  const BasisType* cellBasis,
334  const EvalPointsType ePointType) {
335  typedef typename BasisType::scalarType scalarType;
336  typedef Kokkos::DynRankView<scalarType,ortProperties...> ScalarViewType;
337  typedef Kokkos::pair<ordinal_type,ordinal_type> range_type;
338  const auto cellTopo = cellBasis->getBaseCellTopology();
339  //const auto cellTopoKey = cellBasis->getBaseCellTopology().getKey();
340  ordinal_type dim = cellTopo.getDimension();
341  ordinal_type numCells = ePoints.extent(0);
342  const ordinal_type edgeDim = 1;
343  const ordinal_type faceDim = 2;
344 
345  ordinal_type numVertices = (cellBasis->getDofCount(0, 0) > 0) ? cellTopo.getVertexCount() : 0;
346  ordinal_type numEdges = (cellBasis->getDofCount(edgeDim, 0) > 0) ? cellTopo.getEdgeCount() : 0;
347  ordinal_type numFaces = (cellBasis->getDofCount(faceDim, 0) > 0) ? cellTopo.getFaceCount() : 0;
348  ordinal_type numVols = (cellBasis->getDofCount(dim, 0) > 0);
349 
351 
352  auto ePointsRange = Kokkos::create_mirror_view_and_copy(typename SpT::memory_space(),projStruct->getPointsRange(ePointType));
353 
354  typename CellTools<SpT>::subcellParamViewType subcellParamEdge, subcellParamFace;
355  if(numEdges>0)
356  CellTools<SpT>::getSubcellParametrization(subcellParamEdge, edgeDim, cellTopo);
357  if(numFaces>0)
358  CellTools<SpT>::getSubcellParametrization(subcellParamFace, faceDim, cellTopo);
359 
360  auto refTopologyKey = Kokkos::create_mirror_view_and_copy(typename SpT::memory_space(),projStruct->getTopologyKey());
361 
362  ScalarViewType workView("workView", numCells, projStruct->getMaxNumEvalPoints(ePointType), dim-1);
363 
364  if(numVertices>0) {
365  for(ordinal_type iv=0; iv<numVertices; ++iv) {
366  auto vertexEPoints = Kokkos::create_mirror_view_and_copy(typename SpT::memory_space(),projStruct->getEvalPoints(0,iv,ePointType));
367  RealSpaceTools<SpT>::clone(Kokkos::subview(ePoints, Kokkos::ALL(),
368  ePointsRange(0, iv), Kokkos::ALL()), vertexEPoints);
369  }
370  }
371 
372  for(ordinal_type ie=0; ie<numEdges; ++ie) {
373  auto edgePointsRange = ePointsRange(edgeDim, ie);
374  auto edgeRefPointsRange = range_type(0, range_size(edgePointsRange));
375  auto edgeEPoints = Kokkos::create_mirror_view_and_copy(typename SpT::memory_space(),projStruct->getEvalPoints(edgeDim,ie,ePointType));
376 
377  Kokkos::parallel_for
378  ("Evaluate Points",
379  Kokkos::RangePolicy<SpT, int> (0, numCells),
380  KOKKOS_LAMBDA (const size_t ic) {
381 
382  ordinal_type eOrt[12];
383  orts(ic).getEdgeOrientation(eOrt, numEdges);
384  ordinal_type ort = eOrt[ie];
385 
386  auto orientedEdgeEPoints = Kokkos::subview(workView, ic, edgeRefPointsRange, range_type(0,edgeDim));
387 
388  Impl::OrientationTools::mapToModifiedReference(orientedEdgeEPoints,edgeEPoints,refTopologyKey(edgeDim,ie),ort);
389  CellTools<SpT>::mapToReferenceSubcell(Kokkos::subview(ePoints,ic,edgePointsRange,Kokkos::ALL()), orientedEdgeEPoints, subcellParamEdge, edgeDim, ie, dim);
390  });
391  }
392 
393  for(ordinal_type iface=0; iface<numFaces; ++iface) {
394  auto facePointsRange = ePointsRange(faceDim, iface);
395  auto faceRefPointsRange = range_type(0, range_size(facePointsRange));
396  auto faceEPoints = Kokkos::create_mirror_view_and_copy(typename SpT::memory_space(),projStruct->getEvalPoints(faceDim,iface,ePointType));
397 
398  Kokkos::parallel_for
399  ("Evaluate Points",
400  Kokkos::RangePolicy<SpT, int> (0, numCells),
401  KOKKOS_LAMBDA (const size_t ic) {
402  ordinal_type fOrt[6];
403  orts(ic).getFaceOrientation(fOrt, numFaces);
404  ordinal_type ort = fOrt[iface];
405 
406  auto orientedFaceEPoints = Kokkos::subview(workView, ic, faceRefPointsRange, Kokkos::ALL());
407 
408  Impl::OrientationTools::mapToModifiedReference(orientedFaceEPoints,faceEPoints,refTopologyKey(faceDim,iface),ort);
409  CellTools<SpT>::mapToReferenceSubcell(Kokkos::subview(ePoints, ic, facePointsRange, Kokkos::ALL()), orientedFaceEPoints, subcellParamFace, faceDim, iface, dim);
410  });
411  }
412 
413 
414  if(numVols > 0) {
415  auto pointsRange = ePointsRange(dim, 0);
416  auto cellEPoints = Kokkos::create_mirror_view_and_copy(typename SpT::memory_space(),projStruct->getEvalPoints(dim,0,ePointType));
417  RealSpaceTools<SpT>::clone(Kokkos::subview(ePoints, Kokkos::ALL(), pointsRange, Kokkos::ALL()), cellEPoints);
418  }
419 }
420 
421 template<typename SpT>
422 template<typename basisCoeffsValueType, class ...basisCoeffsProperties,
423 typename funValsValueType, class ...funValsProperties,
424 typename BasisType,
425 typename ortValueType,class ...ortProperties>
426 void
427 ProjectionTools<SpT>::getL2BasisCoeffs(Kokkos::DynRankView<basisCoeffsValueType,basisCoeffsProperties...> basisCoeffs,
428  const Kokkos::DynRankView<funValsValueType,funValsProperties...> targetAtTargetEPoints,
429  const typename BasisType::ScalarViewType targetEPoints,
430  const Kokkos::DynRankView<ortValueType, ortProperties...> orts,
431  const BasisType* cellBasis,
432  ProjectionStruct<SpT, typename BasisType::scalarType> * projStruct){
433 
434  typedef typename BasisType::scalarType scalarType;
435  typedef Kokkos::DynRankView<scalarType,SpT> ScalarViewType;
436  typedef Kokkos::pair<ordinal_type,ordinal_type> range_type;
437  const auto cellTopo = cellBasis->getBaseCellTopology();
438  ordinal_type dim = cellTopo.getDimension();
439  ordinal_type numTotalTargetEPoints(targetAtTargetEPoints.extent(1));
440  ordinal_type basisCardinality = cellBasis->getCardinality();
441  ordinal_type numCells = targetAtTargetEPoints.extent(0);
442  const ordinal_type edgeDim = 1;
443  const ordinal_type faceDim = 2;
444  const ordinal_type fieldDim = (targetAtTargetEPoints.rank()==2) ? 1 : targetAtTargetEPoints.extent(2);
445 
446  ordinal_type numVertices = (cellBasis->getDofCount(0, 0) > 0) ? cellTopo.getVertexCount() : 0;
447  ordinal_type numEdges = (cellBasis->getDofCount(1, 0) > 0) ? cellTopo.getEdgeCount() : 0;
448  ordinal_type numFaces = (cellBasis->getDofCount(2, 0) > 0) ? cellTopo.getFaceCount() : 0;
449 
450  ScalarViewType refEdgesVec("refEdgesVec", numEdges, dim);
451  ScalarViewType refFacesTangents("refFaceTangents", numFaces, dim, 2);
452  ScalarViewType refFacesNormal("refFaceNormal", numFaces, dim);
453 
454  ordinal_type numVertexDofs = numVertices;
455 
456  ordinal_type numEdgeDofs(0);
457  for(ordinal_type ie=0; ie<numEdges; ++ie)
458  numEdgeDofs += cellBasis->getDofCount(edgeDim,ie);
459 
460  ordinal_type numFaceDofs(0);
461  for(ordinal_type iface=0; iface<numFaces; ++iface)
462  numFaceDofs += cellBasis->getDofCount(faceDim,iface);
463 
464  Kokkos::View<ordinal_type*, SpT> computedDofs("computedDofs", numVertexDofs+numEdgeDofs+numFaceDofs);
465 
466  auto targetEPointsRange = Kokkos::create_mirror_view_and_copy(typename SpT::memory_space(),projStruct->getTargetPointsRange());
467  auto basisEPointsRange = Kokkos::create_mirror_view_and_copy(typename SpT::memory_space(),projStruct->getBasisPointsRange());
468 
469  auto refTopologyKey = Kokkos::create_mirror_view_and_copy(typename SpT::memory_space(),projStruct->getTopologyKey());
470 
471  ordinal_type numTotalBasisEPoints = projStruct->getNumBasisEvalPoints();
472  ScalarViewType basisEPoints("basisEPoints",numCells,numTotalBasisEPoints, dim);
473  getL2EvaluationPoints(basisEPoints, orts, cellBasis, projStruct, EvalPointsType::BASIS);
474 
475  auto tagToOrdinal = Kokkos::create_mirror_view_and_copy(typename SpT::memory_space(), cellBasis->getAllDofOrdinal());
476 
477  ScalarViewType basisAtBasisEPoints("basisAtBasisEPoints",numCells,basisCardinality, numTotalBasisEPoints, fieldDim);
478  ScalarViewType basisAtTargetEPoints("basisAtTargetEPoints",numCells,basisCardinality, numTotalTargetEPoints, fieldDim);
479  {
480  if(fieldDim == 1) {
481  ScalarViewType nonOrientedBasisAtBasisEPoints("nonOrientedBasisAtBasisEPoints",numCells,basisCardinality, numTotalBasisEPoints);
482  ScalarViewType nonOrientedBasisAtTargetEPoints("nonOrientedBasisAtTargetEPoints",numCells,basisCardinality, numTotalTargetEPoints);
483  for(ordinal_type ic=0; ic<numCells; ++ic) {
484  cellBasis->getValues(Kokkos::subview(nonOrientedBasisAtTargetEPoints,ic,Kokkos::ALL(),Kokkos::ALL()), Kokkos::subview(targetEPoints, ic, Kokkos::ALL(), Kokkos::ALL()));
485  cellBasis->getValues(Kokkos::subview(nonOrientedBasisAtBasisEPoints,ic,Kokkos::ALL(),Kokkos::ALL()), Kokkos::subview(basisEPoints, ic, Kokkos::ALL(), Kokkos::ALL()));
486  }
487  OrientationTools<SpT>::modifyBasisByOrientation(Kokkos::subview(basisAtBasisEPoints, Kokkos::ALL(), Kokkos::ALL(),
488  Kokkos::ALL(),0), nonOrientedBasisAtBasisEPoints, orts, cellBasis);
489  OrientationTools<SpT>::modifyBasisByOrientation(Kokkos::subview(basisAtTargetEPoints, Kokkos::ALL(),
490  Kokkos::ALL(), Kokkos::ALL(),0), nonOrientedBasisAtTargetEPoints, orts, cellBasis);
491  }
492  else {
493  ScalarViewType nonOrientedBasisAtBasisEPoints("nonOrientedBasisAtBasisEPoints",numCells,basisCardinality, numTotalBasisEPoints,fieldDim);
494  ScalarViewType nonOrientedBasisAtTargetEPoints("nonOrientedBasisAtTargetEPoints",numCells,basisCardinality, numTotalTargetEPoints,fieldDim);
495  for(ordinal_type ic=0; ic<numCells; ++ic) {
496  cellBasis->getValues(Kokkos::subview(nonOrientedBasisAtTargetEPoints,ic,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL()), Kokkos::subview(targetEPoints, ic, Kokkos::ALL(), Kokkos::ALL()));
497  cellBasis->getValues(Kokkos::subview(nonOrientedBasisAtBasisEPoints,ic,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL()), Kokkos::subview(basisEPoints, ic, Kokkos::ALL(), Kokkos::ALL()));
498  }
499  OrientationTools<SpT>::modifyBasisByOrientation(basisAtBasisEPoints, nonOrientedBasisAtBasisEPoints, orts, cellBasis);
500  OrientationTools<SpT>::modifyBasisByOrientation(basisAtTargetEPoints, nonOrientedBasisAtTargetEPoints, orts, cellBasis);
501  }
502  }
503 
504  {
505  ordinal_type computedDofsCount = 0;
506  for(ordinal_type iv=0; iv<numVertices; ++iv)
507  computedDofs(computedDofsCount++) = tagToOrdinal(0, iv, 0);
508 
509  for(ordinal_type ie=0; ie<numEdges; ++ie) {
510  ordinal_type edgeCardinality = cellBasis->getDofCount(edgeDim,ie);
511  for(ordinal_type i=0; i<edgeCardinality; ++i)
512  computedDofs(computedDofsCount++) = tagToOrdinal(edgeDim, ie, i);
513  }
514 
515  for(ordinal_type iface=0; iface<numFaces; ++iface) {
516  ordinal_type faceCardinality = cellBasis->getDofCount(faceDim,iface);
517  for(ordinal_type i=0; i<faceCardinality; ++i)
518  computedDofs(computedDofsCount++) = tagToOrdinal(faceDim, iface, i);
519  }
520  }
521 
522  bool isHGradBasis = (cellBasis->getFunctionSpace() == FUNCTION_SPACE_HGRAD);
523  bool isHCurlBasis = (cellBasis->getFunctionSpace() == FUNCTION_SPACE_HCURL);
524  bool isHDivBasis = (cellBasis->getFunctionSpace() == FUNCTION_SPACE_HDIV);
525  ordinal_type faceDofDim = isHCurlBasis ? 2 : 1;
526  ScalarViewType edgeCoeff("edgeCoeff", fieldDim);
527 
528 
529  const Kokkos::RangePolicy<SpT> policy(0, numCells);
530 
531  if(isHGradBasis) {
532 
533  typedef ComputeBasisCoeffsOnVertices_L2<decltype(basisCoeffs), decltype(tagToOrdinal), decltype(targetEPointsRange),
534  decltype(targetAtTargetEPoints), decltype(basisAtTargetEPoints)> functorType;
535  Kokkos::parallel_for(policy, functorType(basisCoeffs, tagToOrdinal, targetEPointsRange,
536  targetAtTargetEPoints, basisAtTargetEPoints, numVertices));
537  }
538 
539  for(ordinal_type ie=0; ie<numEdges; ++ie) {
540  auto edgeVec = Kokkos::subview(refEdgesVec, ie, Kokkos::ALL());
541  auto edgeVecHost = Kokkos::create_mirror_view(edgeVec);
542 
543  if(isHCurlBasis) {
544  CellTools<SpT>::getReferenceEdgeTangent(edgeVecHost,ie, cellTopo);
545  } else if(isHDivBasis) {
546  CellTools<SpT>::getReferenceSideNormal(edgeVecHost, ie, cellTopo);
547  } else {
548  edgeVecHost(0) = 1;
549  }
550  Kokkos::deep_copy(edgeVec,edgeVecHost);
551 
552  ordinal_type edgeCardinality = cellBasis->getDofCount(edgeDim,ie);
553  ordinal_type numBasisEPoints = range_size(basisEPointsRange(edgeDim, ie));
554  ordinal_type numTargetEPoints = range_size(targetEPointsRange(edgeDim, ie));
555 
556  ScalarViewType basisDofAtBasisEPoints("BasisDofAtBasisEPoints",numCells,edgeCardinality, numBasisEPoints);
557  ScalarViewType tragetDofAtTargetEPoints("TargetDofAtTargetEPoints",numCells, numTargetEPoints);
558  ScalarViewType weightedBasisAtBasisEPoints("weightedTanBasisAtBasisEPoints",numCells,edgeCardinality, numBasisEPoints);
559  ScalarViewType weightedBasisAtTargetEPoints("weightedTanBasisAtTargetEPoints",numCells,edgeCardinality, numTargetEPoints);
560  ScalarViewType negPartialProj("negPartialProj", numCells, numBasisEPoints);
561 
562  auto targetEWeights = Kokkos::create_mirror_view_and_copy(typename SpT::memory_space(),projStruct->getTargetEvalWeights(edgeDim,ie));
563  auto basisEWeights = Kokkos::create_mirror_view_and_copy(typename SpT::memory_space(),projStruct->getBasisEvalWeights(edgeDim,ie));
564 
565  //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
566  ordinal_type offsetBasis = basisEPointsRange(edgeDim, ie).first;
567  ordinal_type offsetTarget = targetEPointsRange(edgeDim, ie).first;
568 
569 
570  typedef ComputeBasisCoeffsOnEdges_L2<decltype(basisCoeffs), ScalarViewType, decltype(basisEWeights),
571  decltype(computedDofs), decltype(tagToOrdinal), decltype(targetAtTargetEPoints)> functorTypeEdge;
572 
573  Kokkos::parallel_for(policy, functorTypeEdge(basisCoeffs, negPartialProj, basisDofAtBasisEPoints,
574  basisAtBasisEPoints, basisEWeights, weightedBasisAtBasisEPoints, targetEWeights,
575  basisAtTargetEPoints, weightedBasisAtTargetEPoints, computedDofs, tagToOrdinal,
576  targetAtTargetEPoints,tragetDofAtTargetEPoints, refEdgesVec, fieldDim,
577  edgeCardinality, offsetBasis, offsetTarget, numVertexDofs, edgeDim, ie));
578 
579 
580  ScalarViewType edgeMassMat_("edgeMassMat_", numCells, edgeCardinality, edgeCardinality),
581  edgeRhsMat_("rhsMat_", numCells, edgeCardinality);
582 
583  FunctionSpaceTools<SpT >::integrate(edgeMassMat_, basisDofAtBasisEPoints, weightedBasisAtBasisEPoints);
584  FunctionSpaceTools<SpT >::integrate(edgeRhsMat_, tragetDofAtTargetEPoints, weightedBasisAtTargetEPoints);
585  FunctionSpaceTools<SpT >::integrate(edgeRhsMat_, negPartialProj, weightedBasisAtBasisEPoints,true);
586 
587 
588  typedef Kokkos::DynRankView<scalarType, Kokkos::LayoutRight, SpT> WorkArrayViewType;
589  ScalarViewType t_("t",numCells, edgeCardinality);
590  WorkArrayViewType w_("w",numCells, edgeCardinality);
591 
592  auto edgeDof = Kokkos::subview(tagToOrdinal, edgeDim, ie, Kokkos::ALL());
593 
594  ElemSystem edgeSystem("edgeSystem", false);
595  edgeSystem.solve(basisCoeffs, edgeMassMat_, edgeRhsMat_, t_, w_, edgeDof, edgeCardinality);
596  }
597 
598  ScalarViewType ortJacobian_("ortJacobian", numCells, faceDim, faceDim);
599 
600  ScalarViewType faceCoeff("faceCoeff", numCells, fieldDim, faceDofDim);
601  for(ordinal_type iface=0; iface<numFaces; ++iface) {
602 
603 
604  const auto topoKey = refTopologyKey(faceDim,iface);
605 
606 
607  ordinal_type faceCardinality = cellBasis->getDofCount(faceDim,iface);
608 
609  ordinal_type numTargetEPoints = range_size(targetEPointsRange(faceDim, iface));
610  ordinal_type numBasisEPoints = range_size(basisEPointsRange(faceDim, iface));
611 
612  if(isHCurlBasis) {
613  auto refFaceTanU = Kokkos::subview(refFacesTangents, iface, Kokkos::ALL, 0);
614  auto refFaceTanV = Kokkos::subview(refFacesTangents, iface, Kokkos::ALL,1);
615  auto refFaceTanUHost = Kokkos::create_mirror_view(refFaceTanU);
616  auto refFaceTanVHost = Kokkos::create_mirror_view(refFaceTanV);
617  CellTools<SpT>::getReferenceFaceTangents(refFaceTanUHost, refFaceTanVHost, iface, cellTopo);
618  Kokkos::deep_copy(refFaceTanU, refFaceTanUHost);
619  Kokkos::deep_copy(refFaceTanV, refFaceTanVHost);
620  } else if(isHDivBasis) {
621  auto faceNormal = Kokkos::subview(refFacesNormal,iface,Kokkos::ALL());
622  auto faceNormalHost = Kokkos::create_mirror_view(faceNormal);
623  CellTools<SpT>::getReferenceFaceNormal(faceNormalHost, iface, cellTopo);
624  Kokkos::deep_copy(faceNormal, faceNormalHost);
625  }
626 
627  ScalarViewType faceBasisDofAtBasisEPoints("normaBasisAtBasisEPoints",numCells,faceCardinality, numBasisEPoints,faceDofDim);
628  ScalarViewType wBasisDofAtBasisEPoints("weightedNormalBasisAtBasisEPoints",numCells,faceCardinality, numBasisEPoints,faceDofDim);
629 
630  ScalarViewType faceBasisAtTargetEPoints("normalBasisAtTargetEPoints",numCells,faceCardinality, numTargetEPoints,faceDofDim);
631  ScalarViewType wBasisDofAtTargetEPoints("weightedNormalBasisAtTargetEPoints",numCells,faceCardinality, numTargetEPoints,faceDofDim);
632 
633  ScalarViewType targetDofAtTargetEPoints("targetDofAtTargetEPoints",numCells, numTargetEPoints,faceDofDim);
634  ScalarViewType negPartialProj("mNormalComputedProjection", numCells,numBasisEPoints,faceDofDim);
635 
636  ordinal_type offsetBasis = basisEPointsRange(faceDim, iface).first;
637  ordinal_type offsetTarget = targetEPointsRange(faceDim, iface).first;
638  auto targetEWeights = Kokkos::create_mirror_view_and_copy(typename SpT::memory_space(),projStruct->getTargetEvalWeights(faceDim,iface));
639  auto basisEWeights = Kokkos::create_mirror_view_and_copy(typename SpT::memory_space(),projStruct->getBasisEvalWeights(faceDim,iface));
640 
641 
642  typedef ComputeBasisCoeffsOnFaces_L2<decltype(basisCoeffs), ScalarViewType, decltype(basisEWeights),
643  decltype(computedDofs), decltype(tagToOrdinal), decltype(orts), decltype(targetAtTargetEPoints)> functorTypeFace;
644 
645  Kokkos::parallel_for(policy, functorTypeFace(basisCoeffs, negPartialProj,faceBasisDofAtBasisEPoints,
646  basisAtBasisEPoints, basisEWeights, wBasisDofAtBasisEPoints, targetEWeights,
647  basisAtTargetEPoints, wBasisDofAtTargetEPoints, computedDofs, tagToOrdinal,
648  orts, targetAtTargetEPoints,targetDofAtTargetEPoints, ortJacobian_, faceCoeff,
649  refFacesTangents, refFacesNormal, fieldDim, faceCardinality, offsetBasis,
650  offsetTarget, numVertexDofs+numEdgeDofs, numFaces, faceDim,faceDofDim,
651  dim, iface, topoKey, isHCurlBasis, isHDivBasis));
652 
653  typedef Kokkos::DynRankView<scalarType, Kokkos::LayoutRight, SpT> WorkArrayViewType;
654  ScalarViewType faceMassMat_("faceMassMat_", numCells, faceCardinality, faceCardinality),
655  faceRhsMat_("rhsMat_", numCells, faceCardinality);
656 
657  FunctionSpaceTools<SpT >::integrate(faceMassMat_, faceBasisDofAtBasisEPoints, wBasisDofAtBasisEPoints);
658  FunctionSpaceTools<SpT >::integrate(faceRhsMat_, targetDofAtTargetEPoints, wBasisDofAtTargetEPoints);
659  FunctionSpaceTools<SpT >::integrate(faceRhsMat_, negPartialProj, wBasisDofAtBasisEPoints,true);
660 
661  ScalarViewType t_("t",numCells, faceCardinality);
662  WorkArrayViewType w_("w",numCells,faceCardinality);
663 
664  auto faceDof = Kokkos::subview(tagToOrdinal, faceDim, iface, Kokkos::ALL());
665 
666  ElemSystem faceSystem("faceSystem", false);
667  faceSystem.solve(basisCoeffs, faceMassMat_, faceRhsMat_, t_, w_, faceDof, faceCardinality);
668  }
669 
670  ordinal_type numElemDofs = cellBasis->getDofCount(dim,0);
671 
672 
673  if(numElemDofs>0) {
674 
675  auto cellDofs = Kokkos::subview(tagToOrdinal, dim, 0, Kokkos::ALL());
676 
677  range_type cellPointsRange = targetEPointsRange(dim, 0);
678 
679  ordinal_type numTargetEPoints = range_size(targetEPointsRange(dim,0));
680  ordinal_type numBasisEPoints = range_size(basisEPointsRange(dim,0));
681 
682  ScalarViewType internalBasisAtBasisEPoints("internalBasisAtBasisEPoints",numCells,numElemDofs, numBasisEPoints, fieldDim);
683  ScalarViewType negPartialProj("negPartialProj", numCells, numBasisEPoints, fieldDim);
684 
685  auto targetEWeights = Kokkos::create_mirror_view_and_copy(typename SpT::memory_space(),projStruct->getTargetEvalWeights(dim,0));
686  auto basisEWeights = Kokkos::create_mirror_view_and_copy(typename SpT::memory_space(),projStruct->getBasisEvalWeights(dim,0));
687  ordinal_type offsetBasis = basisEPointsRange(dim, 0).first;
688  ordinal_type offsetTarget = targetEPointsRange(dim, 0).first;
689 
690 
691  ScalarViewType wBasisAtBasisEPoints("weightedBasisAtBasisEPoints",numCells,numElemDofs, numBasisEPoints,fieldDim);
692  ScalarViewType wBasisDofAtTargetEPoints("weightedBasisAtTargetEPoints",numCells,numElemDofs, numTargetEPoints,fieldDim);
693 
694  typedef ComputeBasisCoeffsOnCells_L2<decltype(basisCoeffs), ScalarViewType, decltype(basisEWeights), decltype(computedDofs), decltype(cellDofs)> functorType;
695  Kokkos::parallel_for(policy, functorType( basisCoeffs, negPartialProj, internalBasisAtBasisEPoints,
696  basisAtBasisEPoints, basisEWeights, wBasisAtBasisEPoints, targetEWeights, basisAtTargetEPoints, wBasisDofAtTargetEPoints,
697  computedDofs, cellDofs, fieldDim, numElemDofs, offsetBasis, offsetTarget, numVertexDofs+numEdgeDofs+numFaceDofs));
698 
699  typedef Kokkos::DynRankView<scalarType, Kokkos::LayoutRight, SpT> WorkArrayViewType;
700  ScalarViewType cellMassMat_("cellMassMat_", numCells, numElemDofs, numElemDofs),
701  cellRhsMat_("rhsMat_", numCells, numElemDofs);
702 
703  FunctionSpaceTools<SpT >::integrate(cellMassMat_, internalBasisAtBasisEPoints, wBasisAtBasisEPoints);
704  if(fieldDim==1)
705  FunctionSpaceTools<SpT >::integrate(cellRhsMat_, Kokkos::subview(targetAtTargetEPoints,Kokkos::ALL(),cellPointsRange,Kokkos::ALL()),
706  Kokkos::subview(wBasisDofAtTargetEPoints,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL(),0));
707  else
708  FunctionSpaceTools<SpT >::integrate(cellRhsMat_, Kokkos::subview(targetAtTargetEPoints,Kokkos::ALL(),cellPointsRange,Kokkos::ALL()), wBasisDofAtTargetEPoints);
709  FunctionSpaceTools<SpT >::integrate(cellRhsMat_, negPartialProj, wBasisAtBasisEPoints, true);
710 
711  ScalarViewType t_("t",numCells, numElemDofs);
712  WorkArrayViewType w_("w",numCells,numElemDofs);
713  ElemSystem cellSystem("cellSystem", true);
714  cellSystem.solve(basisCoeffs, cellMassMat_, cellRhsMat_, t_, w_, cellDofs, numElemDofs);
715  }
716 }
717 }
718 }
719 
720 #endif
721 
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.
Header file for the abstract base class Intrepid2::DefaultCubatureFactory.
const range_tag getPointsRange(const EvalPointsType type) const
Returns the range tag of the basis/target evaluation points in subcells.
static void getReferenceSideNormal(Kokkos::DynRankView< refSideNormalValueType, refSideNormalProperties...> refSideNormal, const ordinal_type sideOrd, const shards::CellTopology parentCell)
Computes constant normal vectors to sides of 2D or 3D reference cells.
static void getJacobianOfOrientationMap(JacobianViewType jacobian, const shards::CellTopology cellTopo, const ordinal_type cellOrt)
Computes jacobian of the parameterization maps of 1- and 2-subcells with orientation.
static void modifyBasisByOrientation(Kokkos::DynRankView< outputValueType, outputProperties...> output, const Kokkos::DynRankView< inputValueType, inputProperties...> input, const Kokkos::DynRankView< ortValueType, ortProperties...> orts, const BasisType *basis)
Modify basis due to orientation.
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 void getL2BasisCoeffs(Kokkos::DynRankView< basisCoeffsValueType, basisCoeffsProperties...> basisCoeffs, const Kokkos::DynRankView< funValsValueType, funValsProperties...> targetAtEvalPoints, const typename BasisType::ScalarViewType evaluationPoints, const Kokkos::DynRankView< ortValueType, ortProperties...> cellOrientations, const BasisType *cellBasis, ProjectionStruct< ExecSpaceType, typename BasisType::scalarType > *projStruct)
Computes the basis coefficients of the L2 projection of the target function.
static void mapToReferenceSubcell(Kokkos::DynRankView< refSubcellPointValueType, refSubcellPointProperties...> refSubcellPoints, const Kokkos::DynRankView< paramPointValueType, paramPointProperties...> paramPoints, const ordinal_type subcellDim, const ordinal_type subcellOrd, const shards::CellTopology parentCell)
Computes parameterization maps of 1- and 2-subcells of reference cells.
ordinal_type getMaxNumEvalPoints(const EvalPointsType type) const
Returns the maximum number of evaluation points across all the subcells.
Header file for the Intrepid2::FunctionSpaceTools class.
static void clone(Kokkos::DynRankView< outputValueType, outputProperties...> output, const Kokkos::DynRankView< inputValueType, inputProperties...> input)
Clone input array.
Header file for Intrepid2::ArrayTools class providing utilities for array operations.
static void getL2EvaluationPoints(typename BasisType::ScalarViewType evaluationPoints, const Kokkos::DynRankView< ortValueType, ortProperties...> cellOrientations, const BasisType *cellBasis, ProjectionStruct< ExecSpaceType, typename BasisType::scalarType > *projStruct, const EvalPointsType evalPointType=EvalPointsType::TARGET)
Computes evaluation points for L2 projection.
static void getReferenceFaceTangents(Kokkos::DynRankView< refFaceTanUValueType, refFaceTanUProperties...> refFaceTanU, Kokkos::DynRankView< refFaceTanVValueType, refFaceTanVProperties...> refFaceTanV, const ordinal_type faceOrd, const shards::CellTopology parentCell)
Computes pairs of constant tangent vectors to faces of a 3D reference cells.
static void mapToModifiedReference(outPointViewType outPoints, const refPointViewType refPoints, const shards::CellTopology cellTopo, const ordinal_type cellOrt=0)
Computes modified parameterization maps of 1- and 2-subcells with orientation.
static void setSubcellParametrization()
Defines orientation-preserving parametrizations of reference edges and faces of cell topologies with ...
An helper class to compute the evaluation points and weights needed for performing projections...
static void getSubcellParametrization(subcellParamViewType &subcellParam, const ordinal_type subcellDim, const shards::CellTopology parentCell)
Returns array with the coefficients of the parametrization maps for the edges or faces of a reference...
const key_tag getTopologyKey() const
Returns the key tag for subcells.
static void getReferenceFaceNormal(Kokkos::DynRankView< refFaceNormalValueType, refFaceNormalProperties...> refFaceNormal, const ordinal_type faceOrd, const shards::CellTopology parentCell)
Computes constant normal vectors to faces of 3D reference cell.
view_type getEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId, EvalPointsType type) const
Returns the basis/target evaluation points on a subcell.