Intrepid2
Intrepid2_LagrangianInterpolationDef.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 
48 #ifndef __INTREPID2_LAGRANGIANINTERPOLATIONDEF_HPP__
49 #define __INTREPID2_LAGRANGIANINTERPOLATIONDEF_HPP__
50 
52 #include "Intrepid2_ArrayTools.hpp"
54 
55 
56 namespace Intrepid2 {
57 namespace Experimental {
58 
59 
60 
61 template<typename CoordsViewType,
62 typename CoeffsViewType,
63 typename ortViewType,
64 typename t2oViewType,
65 typename subcellParamViewType,
66 typename intViewType,
67 typename ScalarViewType>
69  typedef typename ScalarViewType::value_type value_type;
70 
71  CoordsViewType dofCoords_;
72  CoeffsViewType dofCoeffs_;
73  const ortViewType orts_;
74  const t2oViewType tagToOrdinal_;
75  const subcellParamViewType edgeParam_, faceParam_;
76  const intViewType edgesInternalDofOrdinals_, facesInternalDofOrdinals_;
77  const ScalarViewType edgesInternalDofCoords_, edgeDofCoeffs_;
78  const ScalarViewType facesInternalDofCoords_, faceDofCoeffs_;
79  ScalarViewType edgeWorkView_, faceWorkView_;
80  const ordinal_type cellDim_, numEdges_, numFaces_;
81  const intViewType edgeTopoKey_, numEdgesInternalDofs_;
82  const intViewType faceTopoKey_, numFacesInternalDofs_;
83  const bool isBasisHCURL_, isBasisHDIV_;
84 
85  computeDofCoordsAndCoeffs( CoordsViewType dofCoords,
86  CoeffsViewType dofCoeffs,
87  const ortViewType orts,
88  const t2oViewType tagToOrdinal,
89  const subcellParamViewType edgeParam,
90  const subcellParamViewType faceParam,
91  const intViewType edgesInternalDofOrdinals,
92  const intViewType facesInternalDofOrdinals,
93  const ScalarViewType edgesInternalDofCoords,
94  const ScalarViewType edgeDofCoeffs,
95  const ScalarViewType facesInternalDofCoords,
96  const ScalarViewType faceDofCoeffs,
97  const ordinal_type cellDim,
98  const ordinal_type numEdges,
99  const ordinal_type numFaces,
100  const intViewType edgeTopoKey,
101  const intViewType numEdgesInternalDofs,
102  const intViewType faceTopoKey,
103  const intViewType numFacesInternalDofs,
104  const bool isBasisHCURL,
105  const bool isBasisHDIV
106  )
107  : dofCoords_(dofCoords),
108  dofCoeffs_(dofCoeffs),
109  orts_(orts),
110  tagToOrdinal_(tagToOrdinal),
111  edgeParam_(edgeParam),
112  faceParam_(faceParam),
113  edgesInternalDofOrdinals_(edgesInternalDofOrdinals),
114  facesInternalDofOrdinals_(facesInternalDofOrdinals),
115  edgesInternalDofCoords_(edgesInternalDofCoords),
116  edgeDofCoeffs_(edgeDofCoeffs),
117  facesInternalDofCoords_(facesInternalDofCoords),
118  faceDofCoeffs_(faceDofCoeffs),
119  cellDim_(cellDim),
120  numEdges_(numEdges),
121  numFaces_(numFaces),
122  edgeTopoKey_(edgeTopoKey),
123  numEdgesInternalDofs_(numEdgesInternalDofs),
124  faceTopoKey_(faceTopoKey),
125  numFacesInternalDofs_(numFacesInternalDofs),
126  isBasisHCURL_(isBasisHCURL),
127  isBasisHDIV_(isBasisHDIV)
128  {
129  if(numEdges > 0)
130  edgeWorkView_ = ScalarViewType("edgeWorkView", dofCoords.extent(0), edgesInternalDofCoords.extent(1), cellDim);
131  if(numFaces > 0)
132  faceWorkView_ = ScalarViewType("faceWorkView", dofCoords.extent(0), facesInternalDofCoords.extent(1), cellDim);
133  }
134 
135  KOKKOS_INLINE_FUNCTION
136  void operator()(const ordinal_type cell) const {
137  typedef Kokkos::pair<ordinal_type,ordinal_type> range_type;
138 
139 
140  if(numEdges_ > 0) {
141  //compute coordinates associated to edge DoFs
142  ordinal_type eOrt[12];
143  orts_(cell).getEdgeOrientation(eOrt, numEdges_);
144  for (ordinal_type iedge=0; iedge < numEdges_; ++iedge) {
145  ordinal_type numInternalDofs = numEdgesInternalDofs_(iedge);
146  auto dofRange = range_type(0, numInternalDofs);
147  auto edgeInternalDofCoords = Kokkos::subview(edgesInternalDofCoords_, iedge, dofRange, Kokkos::ALL());
148  auto cellDofCoordsOriented = Kokkos::subview(edgeWorkView_,cell, dofRange, range_type(0,cellDim_));
149 
150  //map edge DoFs coords into parent element coords
151  Impl::OrientationTools::mapSubcellCoordsToRefCell(cellDofCoordsOriented, edgeInternalDofCoords, edgeParam_, edgeTopoKey_(iedge), iedge, eOrt[iedge]);
152 
153  for (ordinal_type j=0;j<numInternalDofs;++j) {
154  auto idof = tagToOrdinal_(1, iedge, j);
155  for (ordinal_type d=0;d<cellDim_;++d)
156  dofCoords_(cell,idof,d) = cellDofCoordsOriented(j,d);
157  }
158  }
159 
160  //compute coefficients associated to edge DoFs
161  if(isBasisHCURL_) {
162  value_type tmp[3];
163  ScalarViewType tangents(tmp,1,cellDim_);
164  for (ordinal_type iedge=0; iedge < numEdges_; ++iedge) {
165  Impl::OrientationTools::getRefSubcellTangents(tangents, edgeParam_,edgeTopoKey_(iedge), iedge, eOrt[iedge]);
166  for(ordinal_type j=0; j<numEdgesInternalDofs_(iedge); ++j) {
167  auto idof = tagToOrdinal_(1, iedge, j);
168  auto jdof = edgesInternalDofOrdinals_(iedge, j);
169  for(ordinal_type d=0; d <cellDim_; ++d) {
170  dofCoeffs_(cell,idof,d) = 0;
171  dofCoeffs_(cell,idof,d) += tangents(0,d)*edgeDofCoeffs_(iedge,jdof);
172  }
173  }
174  }
175  } else if(isBasisHDIV_) {
176  value_type tmp[9];
177  ScalarViewType tangentsAndNormal(tmp,cellDim_,cellDim_);
178  for (ordinal_type iedge=0; iedge < numEdges_; ++iedge) {
179  Impl::OrientationTools::getRefSideTangentsAndNormal(tangentsAndNormal, edgeParam_,edgeTopoKey_(iedge), iedge, eOrt[iedge]);
180  for(ordinal_type j=0; j<numEdgesInternalDofs_(iedge); ++j) {
181  auto idof = tagToOrdinal_(1, iedge, j);
182  auto jdof = edgesInternalDofOrdinals_(iedge, j);
183  for(ordinal_type d=0; d <cellDim_; ++d)
184  dofCoeffs_(cell,idof,d) = tangentsAndNormal(cellDim_-1, d)*edgeDofCoeffs_(iedge,jdof);
185  }
186  }
187  } else {
188  for (ordinal_type iedge=0; iedge < numEdges_; ++iedge) {
189  for(ordinal_type j=0; j<numEdgesInternalDofs_(iedge); ++j) {
190  auto idof = tagToOrdinal_(1, iedge, j);
191  auto jdof = edgesInternalDofOrdinals_(iedge, j);
192  dofCoeffs_(cell,idof,0) = edgeDofCoeffs_(iedge,jdof);
193  }
194  }
195 
196  }
197  }
198 
199  if(numFaces_ > 0) {
200  //compute coordinates associated to face DoFs
201  ordinal_type fOrt[12];
202  orts_(cell).getFaceOrientation(fOrt, numFaces_);
203  //map face dofs coords into parent element coords
204  for (ordinal_type iface=0; iface < numFaces_; ++iface) {
205  ordinal_type ort = fOrt[iface];
206  ordinal_type numInternalDofs = numFacesInternalDofs_(iface);
207  auto dofRange = range_type(0, numInternalDofs);
208  auto faceInternalDofCoords = Kokkos::subview(facesInternalDofCoords_, iface, dofRange, Kokkos::ALL());
209  auto cellDofCoordsOriented = Kokkos::subview(faceWorkView_,cell, dofRange, range_type(0,cellDim_));
210 
211  Impl::OrientationTools::mapSubcellCoordsToRefCell(cellDofCoordsOriented, faceInternalDofCoords, faceParam_, faceTopoKey_(iface), iface, ort);
212  for (ordinal_type j=0;j<numInternalDofs;++j) {
213  auto idof = tagToOrdinal_(2, iface, j);
214  for (ordinal_type d=0;d<cellDim_;++d)
215  dofCoords_(cell,idof,d) = cellDofCoordsOriented(j,d);
216  }
217  }
218  //compute coefficients associated to face DoFs
219  if(isBasisHCURL_) {
220  value_type tmp[6];
221  ScalarViewType tangents(tmp,2,cellDim_);
222  for (ordinal_type iface=0; iface < numFaces_; ++iface) {
223  Impl::OrientationTools::getRefSubcellTangents(tangents, faceParam_,faceTopoKey_(iface), iface, fOrt[iface]);
224  for(ordinal_type j=0; j<numFacesInternalDofs_(iface); ++j) {
225  auto idof = tagToOrdinal_(2, iface, j);
226  auto jdof = facesInternalDofOrdinals_(iface, j);
227  for(ordinal_type d=0; d <cellDim_; ++d) {
228  dofCoeffs_(cell,idof,d) = 0;
229  for(ordinal_type k=0; k <2; ++k)
230  dofCoeffs_(cell,idof,d) += tangents(k,d)*faceDofCoeffs_(iface,jdof,k);
231  }
232  }
233  }
234  } else if(isBasisHDIV_) {
235  value_type tmp[9];
236  ScalarViewType tangentsAndNormal(tmp,cellDim_,cellDim_);
237  for (ordinal_type iface=0; iface < numFaces_; ++iface) {
238  Impl::OrientationTools::getRefSideTangentsAndNormal(tangentsAndNormal, faceParam_,faceTopoKey_(iface), iface, fOrt[iface]);
239  for(ordinal_type j=0; j<numFacesInternalDofs_(iface); ++j) {
240  auto idof = tagToOrdinal_(2, iface, j);
241  auto jdof = facesInternalDofOrdinals_(iface, j);
242  for(ordinal_type d=0; d <cellDim_; ++d)
243  dofCoeffs_(cell,idof,d) = tangentsAndNormal(cellDim_-1,d)*faceDofCoeffs_(iface,jdof);
244  }
245  }
246  } else {
247 
248  for (ordinal_type iface=0; iface < numFaces_; ++iface) {
249  for(ordinal_type j=0; j<numFacesInternalDofs_(iface); ++j) {
250  auto idof = tagToOrdinal_(2, iface, j);
251  auto jdof = facesInternalDofOrdinals_(iface, j);
252  dofCoeffs_(cell,idof,0) = faceDofCoeffs_(iface,jdof);
253  }
254  }
255  }
256  }
257  }
258 };
259 
260 template<typename DeviceType>
261 template<typename BasisType,
262 class ...coordsProperties, class ...coeffsProperties,
263 typename ortValueType, class ...ortProperties>
264 void
266  Kokkos::DynRankView<typename BasisType::scalarType, coordsProperties...> dofCoords,
267  Kokkos::DynRankView<typename BasisType::scalarType, coeffsProperties...> dofCoeffs,
268  const BasisType* basis,
269  const Kokkos::DynRankView<ortValueType, ortProperties...> orts) {
270 
271  using HostSpaceType = typename Kokkos::Impl::is_space<DeviceType>::host_mirror_space::execution_space;
272  using scalarType = typename BasisType::scalarType;
273  using ScalarViewType = Kokkos::DynRankView<scalarType, DeviceType>;
274  using ScalarViewTypeHost = Kokkos::DynRankView<scalarType, HostSpaceType>;
275  using intViewType = Kokkos::DynRankView<ordinal_type, DeviceType>;
276  using range_type = Kokkos::pair<ordinal_type,ordinal_type>;
277 
278  const auto topo = basis->getBaseCellTopology();
279  const std::string name(basis->getName());
280 
281  bool isBasisHCURL = (basis->getFunctionSpace()==FUNCTION_SPACE_HCURL);
282  bool isBasisHDIV = (basis->getFunctionSpace()==FUNCTION_SPACE_HDIV);
283 
284  ordinal_type numEdges = (basis->getDofCount(1, 0) > 0) ? topo.getEdgeCount() : 0;
285  ordinal_type numFaces = (basis->getDofCount(2, 0) > 0) ? topo.getFaceCount() : 0;
286 
287  std::vector<Teuchos::RCP<Basis<DeviceType,scalarType,scalarType> > > edgeBases, faceBases;
288 
289  for(int i=0;i<numEdges;++i)
290  edgeBases.push_back(basis->getSubCellRefBasis(1,i));
291  for(int i=0;i<numFaces;++i)
292  faceBases.push_back(basis->getSubCellRefBasis(2,i));
293 
294  auto tagToOrdinal = Kokkos::create_mirror_view_and_copy(typename DeviceType::memory_space(), basis->getAllDofOrdinal());
295 
296  const ordinal_type dim = topo.getDimension();
297 
298  const ordinal_type numCells = dofCoeffs.extent(0);
299 
300  ScalarViewType refDofCoords("refDofCoords", dofCoords.extent(1), dofCoords.extent(2)), refDofCoeffs;
301  basis->getDofCoords(refDofCoords);
302  RealSpaceTools<DeviceType>::clone(dofCoords,refDofCoords);
303 
304  if(dofCoeffs.rank() == 3) //vector basis
305  refDofCoeffs = ScalarViewType("refDofCoeffs", dofCoeffs.extent(1), dofCoeffs.extent(2));
306  else //scalar basis
307  refDofCoeffs = ScalarViewType("refDofCoeffs",dofCoeffs.extent(1));
308  basis->getDofCoeffs(refDofCoeffs);
309  RealSpaceTools<DeviceType>::clone(dofCoeffs,refDofCoeffs);
310 
311  if((numFaces == 0) && (numEdges == 0))
312  return;
313 
314  //*** Pre-compute needed quantities related to edge DoFs that do not depend on the cell ***
315  intViewType edgeTopoKey("edgeTopoKey",numEdges);
316  intViewType sOrt("eOrt", numEdges);
317  intViewType numEdgesInternalDofs("numEdgesInternalDofs", numEdges);
318  ScalarViewType edgesInternalDofCoords;
319  intViewType edgesInternalDofOrdinals;
320  ScalarViewType edgeDofCoeffs;
321 
322  ordinal_type maxNumEdgesInternalDofs=0;
323  ordinal_type edgeBasisMaxCardinality=0;
324 
325  auto hostNumEdgesInternalDofs = Kokkos::create_mirror_view(numEdgesInternalDofs);
326  for (ordinal_type iedge=0; iedge < numEdges; ++iedge) {
327  ordinal_type numInternalDofs = edgeBases[iedge]->getDofCount(1,0);
328  hostNumEdgesInternalDofs(iedge) = numInternalDofs;
329  maxNumEdgesInternalDofs = std::max(maxNumEdgesInternalDofs,numInternalDofs);
330  ordinal_type edgeBasisCardinality = edgeBases[iedge]->getCardinality();
331  edgeBasisMaxCardinality = std::max(edgeBasisMaxCardinality, edgeBasisCardinality);
332  }
333  Kokkos::deep_copy(numEdgesInternalDofs,hostNumEdgesInternalDofs);
334 
335  edgeDofCoeffs = ScalarViewType("edgeDofCoeffs", numEdges, edgeBasisMaxCardinality);
336  edgesInternalDofCoords = ScalarViewType("edgeInternalDofCoords", numEdges, maxNumEdgesInternalDofs,1);
337  edgesInternalDofOrdinals = intViewType("edgeInternalDofCoords", numEdges, maxNumEdgesInternalDofs);
338  auto hostEdgesInternalDofCoords = Kokkos::create_mirror_view(edgesInternalDofCoords);
339  auto hostEdgesInternalDofOrdinals = Kokkos::create_mirror_view(edgesInternalDofOrdinals);
340  auto hostEdgeTopoKey = Kokkos::create_mirror_view(edgeTopoKey);
341  for (ordinal_type iedge=0; iedge < numEdges; ++iedge) {
342  auto hostEdgeBasisPtr = edgeBases[iedge]->getHostBasis();
343  hostEdgeTopoKey(iedge) = hostEdgeBasisPtr->getBaseCellTopology().getBaseKey();
344  ordinal_type edgeBasisCardinality = hostEdgeBasisPtr->getCardinality();
345  ScalarViewTypeHost edgeDofCoords("edgeDofCoords", edgeBasisCardinality, 1);
346  hostEdgeBasisPtr->getDofCoords(edgeDofCoords);
347  for(ordinal_type i=0; i<hostNumEdgesInternalDofs(iedge); ++i) {
348  hostEdgesInternalDofOrdinals(iedge, i) = hostEdgeBasisPtr->getDofOrdinal(1, 0, i);
349  hostEdgesInternalDofCoords(iedge, i,0) = edgeDofCoords(hostEdgesInternalDofOrdinals(iedge, i),0);
350  }
351  auto edgeBasisPtr = edgeBases[iedge];
352  auto dofRange = range_type(0, edgeBasisPtr->getCardinality());
353  edgeBasisPtr->getDofCoeffs(Kokkos::subview(edgeDofCoeffs, iedge, dofRange));
354  }
355  Kokkos::deep_copy(edgesInternalDofCoords,hostEdgesInternalDofCoords);
356  Kokkos::deep_copy(edgesInternalDofOrdinals,hostEdgesInternalDofOrdinals);
357  Kokkos::deep_copy(edgeTopoKey,hostEdgeTopoKey);
358 
359  auto edgeParam = RefSubcellParametrization<DeviceType>::get(1, topo.getKey());
360 
361  //*** Pre-compute needed quantities related to face DoFs that do not depend on the cell ***
362  intViewType faceTopoKey("faceTopoKey",numFaces);
363  intViewType fOrt("fOrt", numFaces);
364  intViewType numFacesInternalDofs("numFacesInternalDofs", numFaces);
365  ScalarViewType facesInternalDofCoords;
366  intViewType facesInternalDofOrdinals;
367  ScalarViewType faceDofCoeffs;
368 
369  ordinal_type maxNumFacesInternalDofs=0;
370  ordinal_type faceBasisMaxCardinality=0;
371 
372  auto hostNumFacesInternalDofs = Kokkos::create_mirror_view(numFacesInternalDofs);
373  for (ordinal_type iface=0; iface < numFaces; ++iface) {
374  ordinal_type numInternalDofs = faceBases[iface]->getDofCount(2,0);
375  hostNumFacesInternalDofs(iface) = numInternalDofs;
376  maxNumFacesInternalDofs = std::max(maxNumFacesInternalDofs,numInternalDofs);
377  ordinal_type faceBasisCardinality = faceBases[iface]->getCardinality();
378  faceBasisMaxCardinality = std::max(faceBasisMaxCardinality, faceBasisCardinality);
379  }
380  Kokkos::deep_copy(numFacesInternalDofs,hostNumFacesInternalDofs);
381 
382  facesInternalDofCoords = ScalarViewType("faceInternalDofCoords", numFaces, maxNumFacesInternalDofs, 2);
383  facesInternalDofOrdinals = intViewType("faceInternalDofCoords", numFaces, maxNumFacesInternalDofs);
384 
385  if(isBasisHCURL)
386  faceDofCoeffs = ScalarViewType("faceDofCoeffs", numFaces, faceBasisMaxCardinality,2);
387  else
388  faceDofCoeffs = ScalarViewType("faceDofCoeffs", numFaces, faceBasisMaxCardinality);
389 
390  auto hostFacesInternalDofCoords = Kokkos::create_mirror_view(facesInternalDofCoords);
391  auto hostFacesInternalDofOrdinals = Kokkos::create_mirror_view(facesInternalDofOrdinals);
392  auto hostFaceTopoKey = Kokkos::create_mirror_view(faceTopoKey);
393  for (ordinal_type iface=0; iface < numFaces; ++iface) {
394  auto hostFaceBasisPtr = faceBases[iface]->getHostBasis();
395  hostFaceTopoKey(iface) = hostFaceBasisPtr->getBaseCellTopology().getBaseKey();
396  ordinal_type faceBasisCardinality = hostFaceBasisPtr->getCardinality();
397  ScalarViewTypeHost faceDofCoords("faceDofCoords", faceBasisCardinality, 2);
398  hostFaceBasisPtr->getDofCoords(faceDofCoords);
399  for(ordinal_type i=0; i<hostNumFacesInternalDofs(iface); ++i) {
400  hostFacesInternalDofOrdinals(iface, i) = hostFaceBasisPtr->getDofOrdinal(2, 0, i);
401  for(ordinal_type d=0; d <2; ++d)
402  hostFacesInternalDofCoords(iface, i,d) = faceDofCoords(hostFacesInternalDofOrdinals(iface, i),d);
403  }
404  auto faceBasisPtr = faceBases[iface];
405  auto dofRange = range_type(0, faceBasisPtr->getCardinality());
406  faceBasisPtr->getDofCoeffs(Kokkos::subview(faceDofCoeffs, iface, dofRange, Kokkos::ALL()));
407  }
408  Kokkos::deep_copy(facesInternalDofCoords,hostFacesInternalDofCoords);
409  Kokkos::deep_copy(facesInternalDofOrdinals,hostFacesInternalDofOrdinals);
410  Kokkos::deep_copy(faceTopoKey,hostFaceTopoKey);
411 
412  typename RefSubcellParametrization<DeviceType>::ConstViewType faceParam;
413  if(dim > 2)
414  faceParam = RefSubcellParametrization<DeviceType>::get(2, topo.getKey());
415 
416 
417  //*** Loop over cells ***
418 
419  const Kokkos::RangePolicy<typename DeviceType::execution_space> policy(0, numCells);
421  <decltype(dofCoords),
422  decltype(dofCoeffs),
423  decltype(orts),
424  decltype(tagToOrdinal),
425  decltype(edgeParam),
426  intViewType,
427  ScalarViewType> FunctorType;
428  Kokkos::parallel_for(policy,
429  FunctorType(dofCoords, dofCoeffs,
430  orts, tagToOrdinal, edgeParam, faceParam,
431  edgesInternalDofOrdinals, facesInternalDofOrdinals,
432  edgesInternalDofCoords, edgeDofCoeffs,
433  facesInternalDofCoords, faceDofCoeffs,
434  dim, numEdges, numFaces,
435  edgeTopoKey, numEdgesInternalDofs,
436  faceTopoKey, numFacesInternalDofs,
437  isBasisHCURL, isBasisHDIV));
438 }
439 
440 
441 template<typename DeviceType>
442 template<typename basisCoeffsViewType,
443 typename funcViewType,
444 typename dofCoeffViewType>
445 void
447  const funcViewType functionValsAtDofCoords,
448  const dofCoeffViewType dofCoeffs){
449  ArrayTools<DeviceType>::dotMultiplyDataData(basisCoeffs,functionValsAtDofCoords,dofCoeffs);
450 }
451 }
452 }
453 
454 #endif
455 
Header file for the abstract base class Intrepid2::DefaultCubatureFactory.
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 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...
static void dotMultiplyDataData(Kokkos::DynRankView< outputDataValueType, outputDataProperties... > outputData, const Kokkos::DynRankView< inputDataLeftValueType, inputDataLeftProperties... > inputDataLeft, const Kokkos::DynRankView< inputDataRightValueType, inputDataRightProperties... > inputDataRight)
There are two use cases: (1) dot product of a rank-2, 3 or 4 container inputDataRight with dimensions...
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.
Header file for the Intrepid2::FunctionSpaceTools class.
Header file for Intrepid2::ArrayTools class providing utilities for array operations.
static void getDofCoordsAndCoeffs(Kokkos::DynRankView< typename BasisType::scalarType, coordsProperties... > dofCoords, Kokkos::DynRankView< typename BasisType::scalarType, coeffsProperties... > dofCoeffs, const BasisType *cellBasis, const Kokkos::DynRankView< ortValueType, ortProperties... > cellOrientations)
Computes the points and coefficients associated with the basis DOFs for the reference oriented elemen...
static KOKKOS_INLINE_FUNCTION void getRefSideTangentsAndNormal(TanNormViewType tangentsAndNormal, const ParamViewType subCellParametrization, const unsigned subcellTopoKey, const ordinal_type subCellOrd, const ordinal_type ort)
Computes the (oriented) tangents and normal of the side subCell The normals are only defined for side...
static void clone(Kokkos::DynRankView< outputValueType, outputProperties... > output, const Kokkos::DynRankView< inputValueType, inputProperties... > input)
Clone input array.
static void getBasisCoeffs(basisCoeffsViewType basisCoeffs, const funcViewType functionAtDofCoords, const dofCoeffViewType dofCoeffs)
Computes the basis weights of the function interpolation.