49 #ifndef __INTREPID2_PROJECTIONTOOLSDEFHDIV_HPP__
50 #define __INTREPID2_PROJECTIONTOOLSDEFHDIV_HPP__
58 namespace Experimental {
61 template<
typename SpT>
62 template<
typename BasisType,
63 typename ortValueType,
class ...ortProperties>
66 typename BasisType::scalarViewType extDerivEvaluationPoints,
67 const Kokkos::DynRankView<ortValueType, ortProperties...> orts,
68 const BasisType* cellBasis,
69 ProjectionStruct<SpT, typename BasisType::scalarType> * projStruct,
70 const EvalPointsType evalPointType){
71 typedef typename BasisType::scalarType scalarType;
72 typedef Kokkos::DynRankView<scalarType,SpT> scalarViewType;
73 typedef Kokkos::pair<ordinal_type,ordinal_type> range_type;
74 ordinal_type dim = cellBasis->getBaseCellTopology().getDimension();
75 ordinal_type sideDim = dim-1;
77 ordinal_type numSides = cellBasis->getBaseCellTopology().getSideCount();
79 ordinal_type numCells = orts.extent(0);
80 Kokkos::DynRankView<ordinal_type> sOrt(
"sOrt", numSides);
82 for(ordinal_type is=0; is<numSides; ++is) {
83 range_type sidePointsRange;
84 scalarViewType sideCubPoints;
85 if(evalPointType == TARGET) {
86 sidePointsRange = projStruct->getTargetPointsRange(sideDim, is);
87 sideCubPoints = projStruct->getTargetEvalPoints(sideDim, is);
90 sidePointsRange = projStruct->getBasisPointsRange(sideDim, is);
91 sideCubPoints = projStruct->getBasisEvalPoints(sideDim, is);
94 scalarViewType orientedTargetCubPoints(
"orientedTargetCubPoints", sideCubPoints.extent(0),sideDim);
96 const auto topoKey = projStruct->getTopologyKey(sideDim,is);
98 for(ordinal_type ic=0; ic<numCells; ++ic) {
100 orts(ic).getFaceOrientation(sOrt.data(), numSides);
102 orts(ic).getEdgeOrientation(sOrt.data(), numSides);
103 ordinal_type ort = sOrt(is);
109 if(cellBasis->getDofCount(dim,0) <= 0)
112 range_type cellDivPointsRange;
113 scalarViewType divCubPoints;
114 if(evalPointType == TARGET) {
115 divCubPoints = projStruct->getTargetDerivEvalPoints(dim, 0);
116 cellDivPointsRange = projStruct->getTargetDerivPointsRange(dim, 0);
118 divCubPoints = projStruct->getBasisDerivEvalPoints(dim, 0);
119 cellDivPointsRange = projStruct->getBasisDerivPointsRange(dim, 0);
121 RealSpaceTools<SpT>::clone(Kokkos::subview(extDerivEvaluationPoints, Kokkos::ALL(), cellDivPointsRange, Kokkos::ALL()), divCubPoints);
123 if(projStruct->getTargetEvalPoints(dim, 0).data() != NULL)
125 range_type cellPointsRange;
126 scalarViewType cubPoints;
127 if(evalPointType == TARGET) {
128 cubPoints = projStruct->getTargetEvalPoints(dim, 0);
129 cellPointsRange = projStruct->getTargetPointsRange(dim, 0);
131 cubPoints = projStruct->getBasisEvalPoints(dim, 0);
132 cellPointsRange = projStruct->getBasisPointsRange(dim, 0);
139 template<
typename SpT>
140 template<
typename basisCoeffsValueType,
class ...basisCoeffsProperties,
141 typename funValsValueType,
class ...funValsProperties,
143 typename ortValueType,
class ...ortProperties>
146 const Kokkos::DynRankView<funValsValueType,funValsProperties...> targetAtEvalPoints,
147 const Kokkos::DynRankView<funValsValueType,funValsProperties...> targetDivAtDivEvalPoints,
148 const typename BasisType::scalarViewType evaluationPoints,
149 const typename BasisType::scalarViewType extDerivEvaluationPoints,
150 const Kokkos::DynRankView<ortValueType, ortProperties...> orts,
151 const BasisType* cellBasis,
152 ProjectionStruct<SpT, typename BasisType::scalarType> * projStruct){
153 typedef typename Kokkos::Impl::is_space<SpT>::host_mirror_space::execution_space host_space_type;
154 typedef typename BasisType::scalarType scalarType;
155 typedef Kokkos::DynRankView<scalarType,SpT> scalarViewType;
156 typedef Kokkos::pair<ordinal_type,ordinal_type> range_type;
157 const auto cellTopo = cellBasis->getBaseCellTopology();
158 ordinal_type dim = cellTopo.getDimension();
159 ordinal_type numTotalEvaluationPoints(targetAtEvalPoints.extent(1)),
160 numTotalDivEvaluationPoints(targetDivAtDivEvalPoints.extent(1));
161 ordinal_type basisCardinality = cellBasis->getCardinality();
162 ordinal_type numCells = targetAtEvalPoints.extent(0);
163 const ordinal_type sideDim = dim-1;
165 const std::string& name = cellBasis->getName();
167 ordinal_type numSides = cellBasis->getBaseCellTopology().getSideCount();
168 scalarViewType refSideNormal(
"refSideNormal", dim);
170 ordinal_type numSideDofs(0);
171 for(ordinal_type is=0; is<numSides; ++is)
172 numSideDofs += cellBasis->getDofCount(sideDim,is);
174 Kokkos::View<ordinal_type*> computedDofs(
"computedDofs",numSideDofs);
176 ordinal_type computedDofsCount = 0;
178 ordinal_type numTotalCubPoints = projStruct->getNumBasisEvalPoints(), numTotalDivCubPoints = projStruct->getNumBasisDerivEvalPoints();
179 scalarViewType cubPoints_(
"cubPoints",numCells,numTotalCubPoints, dim);
180 scalarViewType divCubPoints(
"divCubPoints",numCells,numTotalDivCubPoints, dim);
181 getHDivEvaluationPoints(cubPoints_, divCubPoints, orts, cellBasis, projStruct, BASIS);
183 scalarViewType basisAtCubPoints(
"basisAtCubPoints",numCells,basisCardinality, numTotalCubPoints, dim);
184 scalarViewType basisAtTargetCubPoints(
"basisAtTargetCubPoints",numCells,basisCardinality, numTotalEvaluationPoints, dim);
186 scalarViewType nonOrientedBasisAtCubPoints(
"nonOrientedBasisAtCubPoints",numCells,basisCardinality, numTotalCubPoints, dim);
187 scalarViewType nonOrientedBasisAtTargetCubPoints(
"nonOrientedBasisAtTargetCubPoints",numCells,basisCardinality, numTotalEvaluationPoints, dim);
188 for(ordinal_type ic=0; ic<numCells; ++ic) {
189 cellBasis->getValues(Kokkos::subview(nonOrientedBasisAtTargetCubPoints,ic,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL()), Kokkos::subview(evaluationPoints, ic, Kokkos::ALL(), Kokkos::ALL()));
190 cellBasis->getValues(Kokkos::subview(nonOrientedBasisAtCubPoints,ic,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL()), Kokkos::subview(cubPoints_, ic, Kokkos::ALL(), Kokkos::ALL()));
197 scalarViewType basisDivAtDivCubPoints;
198 scalarViewType basisDivAtTargetDivCubPoints;
199 if(numTotalDivEvaluationPoints>0) {
200 scalarViewType nonOrientedBasisDivAtTargetDivCubPoints, nonOrientedBasisDivAtDivCubPoints;
201 basisDivAtDivCubPoints = scalarViewType (
"basisDivAtDivCubPoints",numCells,basisCardinality, numTotalDivCubPoints);
202 nonOrientedBasisDivAtDivCubPoints = scalarViewType (
"nonOrientedBasisDivAtDivCubPoints",numCells,basisCardinality, numTotalDivCubPoints);
203 basisDivAtTargetDivCubPoints = scalarViewType(
"basisDivAtTargetDivCubPoints",numCells,basisCardinality, numTotalDivEvaluationPoints);
204 nonOrientedBasisDivAtTargetDivCubPoints = scalarViewType(
"nonOrientedBasisDivAtTargetDivCubPoints",numCells,basisCardinality, numTotalDivEvaluationPoints);
206 for(ordinal_type ic=0; ic<numCells; ++ic) {
207 cellBasis->getValues(Kokkos::subview(nonOrientedBasisDivAtDivCubPoints,ic,Kokkos::ALL(),Kokkos::ALL()), Kokkos::subview(divCubPoints, ic, Kokkos::ALL(), Kokkos::ALL()),OPERATOR_DIV);
208 cellBasis->getValues(Kokkos::subview(nonOrientedBasisDivAtTargetDivCubPoints,ic,Kokkos::ALL(),Kokkos::ALL()), Kokkos::subview(extDerivEvaluationPoints, ic, Kokkos::ALL(), Kokkos::ALL()),OPERATOR_DIV);
215 for(ordinal_type is=0; is<numSides; ++is) {
217 ordinal_type sideCardinality = cellBasis->getDofCount(sideDim,is);
218 ordinal_type numCubPoints = projStruct->getNumBasisEvalPoints(sideDim,is);
219 ordinal_type numTargetCubPoints = projStruct->getNumTargetEvalPoints(sideDim,is);
221 for(ordinal_type i=0; i<sideCardinality; ++i)
222 computedDofs(computedDofsCount++) = cellBasis->getDofOrdinal(sideDim, is, i);
226 scalarViewType normalBasisAtElemcubPoints(
"normalBasisAtElemcubPoints",numCells,sideCardinality, numCubPoints);
227 scalarViewType normalBasisAtTargetcubPoints(
"normalBasisAtTargetcubPoints",numCells,sideCardinality, numTargetCubPoints);
228 scalarViewType weightedNormalBasisAtElemcubPoints(
"weightedNormalBasisAtElemcubPoints",numCells,sideCardinality, numCubPoints);
229 scalarViewType weightedNormalBasisAtTargetcubPoints(
"weightedNormalBasisAtTargetcubPoints",numCells,sideCardinality, numTargetCubPoints);
230 scalarViewType normalTargetAtTargetcubPoints(
"normalTargetAtTargetcubPoints",numCells, numTargetCubPoints);
232 scalarViewType targetEvalWeights = projStruct->getTargetEvalWeights(sideDim, is);
233 scalarViewType basisEvalWeights = projStruct->getBasisEvalWeights(sideDim, is);
236 ordinal_type offsetBasis = projStruct->getBasisPointsRange(sideDim, is).first;
237 ordinal_type offsetTarget = projStruct->getTargetPointsRange(sideDim, is).first;
238 for(ordinal_type ic=0; ic<numCells; ++ic) {
239 for(ordinal_type j=0; j <sideCardinality; ++j) {
240 ordinal_type side_dof = cellBasis->getDofOrdinal(sideDim, is, j);
241 for(ordinal_type iq=0; iq <numCubPoints; ++iq) {
242 for(ordinal_type d=0; d <dim; ++d)
243 normalBasisAtElemcubPoints(ic,j,iq) += refSideNormal(d)*basisAtCubPoints(ic,side_dof,offsetBasis+iq,d);
244 weightedNormalBasisAtElemcubPoints(ic,j,iq) = normalBasisAtElemcubPoints(ic,j,iq)*basisEvalWeights(iq);
246 for(ordinal_type iq=0; iq <numTargetCubPoints; ++iq) {
247 for(ordinal_type d=0; d <dim; ++d)
248 normalBasisAtTargetcubPoints(ic,j,iq) += refSideNormal(d)*basisAtTargetCubPoints(ic,side_dof,offsetTarget+iq,d);
249 weightedNormalBasisAtTargetcubPoints(ic,j,iq) = normalBasisAtTargetcubPoints(ic,j,iq)*targetEvalWeights(iq);
252 for(ordinal_type iq=0; iq <numTargetCubPoints; ++iq)
253 for(ordinal_type d=0; d <dim; ++d)
254 normalTargetAtTargetcubPoints(ic,iq) += refSideNormal(d)*targetAtEvalPoints(ic,offsetTarget+iq,d);
258 scalarViewType sideMassMat_(
"sideMassMat_", numCells, sideCardinality+1, sideCardinality+1),
259 sideRhsMat_(
"rhsMat_", numCells, sideCardinality+1);
261 scalarViewType targetEvalWeights_(
"targetEvalWeights", numCells, 1, targetEvalWeights.extent(0));
264 range_type range_H(0, sideCardinality);
265 range_type range_B(sideCardinality, sideCardinality+1);
266 scalarViewType ones(
"ones",numCells,1,numCubPoints);
267 Kokkos::deep_copy(ones,1);
275 Kokkos::View<funValsValueType**,Kokkos::LayoutLeft,host_space_type> sideMassMat(
"sideMassMat", sideCardinality+1,sideCardinality+1);
276 Kokkos::View<funValsValueType**,Kokkos::LayoutLeft,host_space_type> sideRhsMat(
"sideRhsMat",sideCardinality+1, 1);
278 Teuchos::LAPACK<ordinal_type,funValsValueType> lapack;
279 ordinal_type info = 0;
280 Kokkos::View<funValsValueType**,Kokkos::LayoutLeft,host_space_type> pivVec(
"pivVec", sideCardinality+1, 1);
282 for(ordinal_type ic=0; ic<numCells; ++ic) {
283 Kokkos::deep_copy(sideMassMat,funValsValueType(0));
284 for(ordinal_type i=0; i<sideCardinality; ++i) {
285 sideRhsMat(i,0) = sideRhsMat_(ic,i);
286 for(ordinal_type j=0; j<sideCardinality+1; ++j){
287 sideMassMat(i,j) = sideMassMat_(ic,i,j);
289 sideMassMat(sideCardinality,i) = sideMassMat_(ic,i,sideCardinality);
291 sideRhsMat(sideCardinality,0) = sideRhsMat_(ic,sideCardinality);
294 lapack.GESV(sideCardinality+1, 1,
296 sideMassMat.stride_1(),
297 (ordinal_type*)pivVec.data(),
299 sideRhsMat.stride_1(),
302 for(ordinal_type i=0; i<sideCardinality; ++i){
303 ordinal_type facet_dof = cellBasis->getDofOrdinal(dim-1, is, i);
304 basisCoeffs(ic,facet_dof) = sideRhsMat(i,0);
309 std::stringstream ss;
310 ss <<
">>> ERROR (Intrepid::ProjectionTools::getBasisCoeffs): "
311 <<
"LAPACK return with error code: "
313 INTREPID2_TEST_FOR_EXCEPTION(
true, std::runtime_error, ss.str().c_str() );
320 ordinal_type numElemDofs = cellBasis->getDofCount(dim,0);
324 Basis<host_space_type,scalarType,scalarType> *hcurlBasis = NULL;
325 if(name.find(
"HEX")!=std::string::npos)
326 hcurlBasis =
new Basis_HCURL_HEX_In_FEM<host_space_type,scalarType,scalarType>(cellBasis->getDegree());
327 else if(name.find(
"TET")!=std::string::npos)
328 hcurlBasis =
new Basis_HCURL_TET_In_FEM<host_space_type,scalarType,scalarType>(cellBasis->getDegree());
329 else if(name.find(
"QUAD")!=std::string::npos)
330 hcurlBasis =
new Basis_HGRAD_QUAD_Cn_FEM<host_space_type,scalarType,scalarType>(cellBasis->getDegree());
331 else if(name.find(
"TRI")!=std::string::npos)
332 hcurlBasis =
new Basis_HGRAD_TRI_Cn_FEM<host_space_type,scalarType,scalarType>(cellBasis->getDegree());
334 std::stringstream ss;
335 ss <<
">>> ERROR (Intrepid2::ProjectionTools::getHDivEvaluationPoints): "
336 <<
"Method not implemented for basis " << name;
337 INTREPID2_TEST_FOR_EXCEPTION(
true, std::runtime_error, ss.str().c_str() );
339 if(hcurlBasis == NULL)
return;
342 ordinal_type numTargetDivCubPoints = projStruct->getNumTargetDerivEvalPoints(dim,0);
343 ordinal_type numDivCubPoints = projStruct->getNumBasisDerivEvalPoints(dim,0);
345 scalarViewType weightedBasisDivAtcubPoints(
"weightedBasisDivAtcubPoints",numCells,numElemDofs, numDivCubPoints);
346 scalarViewType weightedBasisDivAtcubTargetPoints(
"weightedBasisDivAtcubTargetPoints",numCells, numElemDofs, numTargetDivCubPoints);
348 scalarViewType internalBasisDivAtcubPoints(
"basisDivAtcubPoints",numCells,numElemDofs, numDivCubPoints);
350 scalarViewType targetDivEvalWeights = projStruct->getTargetDerivEvalWeights(dim, 0);
351 scalarViewType divEvalWeights = projStruct->getBasisDerivEvalWeights(dim, 0);
352 ordinal_type offsetBasisDiv = projStruct->getBasisDerivPointsRange(dim, 0).first;
353 ordinal_type offsetTargetDiv = projStruct->getTargetDerivPointsRange(dim, 0).first;
355 for(ordinal_type ic=0; ic<numCells; ++ic) {
356 for(ordinal_type i=0; i<numElemDofs; ++i) {
357 ordinal_type idof = cellBasis->getDofOrdinal(dim, 0, i);
358 for(ordinal_type iq=0; iq<numDivCubPoints; ++iq) {
359 internalBasisDivAtcubPoints(ic,i,iq) = basisDivAtDivCubPoints(ic,idof,offsetBasisDiv+iq);
360 weightedBasisDivAtcubPoints(ic,i,iq) = internalBasisDivAtcubPoints(ic,i,iq) * divEvalWeights(iq);
363 for(ordinal_type i=0; i<numElemDofs; ++i) {
364 ordinal_type idof = cellBasis->getDofOrdinal(dim, 0, i);
365 for(ordinal_type iq=0; iq<numTargetDivCubPoints; ++iq)
366 weightedBasisDivAtcubTargetPoints(ic,i,iq) = targetDivEvalWeights(iq)*basisDivAtTargetDivCubPoints(ic,idof,offsetTargetDiv+iq);
370 ordinal_type hcurlBasisCardinality = hcurlBasis->getCardinality();
371 ordinal_type numCurlInteriorDOFs = hcurlBasis->getDofCount(dim,0);
373 range_type range_H(0, numElemDofs);
374 range_type range_B(numElemDofs, numElemDofs+numCurlInteriorDOFs);
376 Kokkos::DynRankView<funValsValueType,Kokkos::LayoutLeft,host_space_type> massMat_(
"massMat_",numCells,numElemDofs+numCurlInteriorDOFs,numElemDofs+numCurlInteriorDOFs);
377 Kokkos::DynRankView<funValsValueType,Kokkos::LayoutLeft,host_space_type> rhsMatTrans(
"rhsMatTrans",numCells,numElemDofs+numCurlInteriorDOFs);
379 scalarViewType targetSideDivAtcubPoints(
"targetSideDivAtcubPoints",numCells, numDivCubPoints);
380 for(ordinal_type i=0; i<numSideDofs; ++i) {
381 ordinal_type idof = computedDofs(i);
382 for(ordinal_type ic=0; ic<numCells; ++ic)
383 for(ordinal_type iq=0; iq<numDivCubPoints; ++iq){
384 targetSideDivAtcubPoints(ic,iq) -= basisCoeffs(ic,idof)*basisDivAtDivCubPoints(ic,idof,offsetBasisDiv+iq);
392 if(numCurlInteriorDOFs>0){
393 scalarViewType cubPoints = projStruct->getBasisEvalPoints(dim,0);
394 ordinal_type numCubPoints = projStruct->getNumBasisEvalPoints(dim,0);
395 ordinal_type numTargetCubPoints = projStruct->getNumTargetEvalPoints(dim,0);
397 scalarViewType targetSideApproxAtcubPoints(
"targetSideAtcubPoints",numCells, numCubPoints, dim);
398 scalarViewType internalBasisAtcubPoints(
"basisAtcubPoints",numCells,numElemDofs, numCubPoints, dim);
399 scalarViewType hcurlBasisCurlAtcubPoints(
"hcurlBasisCurlAtcubPoints",hcurlBasisCardinality, numCubPoints,dim);
400 scalarViewType internalHcurlBasisCurlAtcubPoints(
"internalHcurlBasisCurlAtcubPoints",numCells,numCurlInteriorDOFs, numCubPoints,dim);
401 scalarViewType hcurlBasisCurlAtcubTargetPoints(
"hcurlBasisCurlAtcubTargetPoints", hcurlBasisCardinality,numTargetCubPoints, dim);
402 scalarViewType internalHcurlBasisCurlAtcubTargetPoints(
"internalHcurlBasisCurlAtcubTargetPoints",numCells, numCurlInteriorDOFs, numTargetCubPoints, dim);
403 scalarViewType weightedHcurlBasisCurlAtcubPoints(
"weightedHcurlBasisHcurlAtcubPoints", numCells, numCurlInteriorDOFs, numCubPoints,dim);
404 scalarViewType weightedHcurlBasisCurlAtcubTargetPoints(
"weightedHcurlBasisHcurlAtcubTargetPoints",numCells, numCurlInteriorDOFs, numTargetCubPoints,dim);
406 hcurlBasis->getValues(hcurlBasisCurlAtcubPoints, cubPoints, OPERATOR_CURL);
408 ordinal_type offsetBasis = projStruct->getBasisPointsRange(dim, 0).first;
409 range_type targetPointsRange = projStruct->getTargetPointsRange(dim, 0);
411 scalarViewType targetEvalWeights = projStruct->getTargetEvalWeights(dim, 0);
412 scalarViewType basisEvalWeights = projStruct->getBasisEvalWeights(dim, 0);
415 for(ordinal_type ic=0; ic<numCells; ++ic) {
417 for(ordinal_type i=0; i<numSideDofs; ++i) {
418 ordinal_type idof = computedDofs(i);
419 for(ordinal_type iq=0; iq<numCubPoints; ++iq){
420 for(ordinal_type d=0; d <dim; ++d)
421 targetSideApproxAtcubPoints(ic,iq,d) -= basisCoeffs(ic,idof)*basisAtCubPoints(ic,idof,offsetBasis+iq,d);
425 for(ordinal_type i=0; i<numElemDofs; ++i) {
426 ordinal_type idof = cellBasis->getDofOrdinal(dim, 0, i);
427 for(ordinal_type iq=0; iq<numCubPoints; ++iq) {
428 for(ordinal_type d=0; d<dim; ++d)
429 internalBasisAtcubPoints(ic,i,iq,d) = basisAtCubPoints(ic,idof,offsetBasis+iq,d);
433 for(ordinal_type i=0; i<numCurlInteriorDOFs; ++i) {
434 ordinal_type idof = hcurlBasis->getDofOrdinal(dim, 0, i);
435 for(ordinal_type d=0; d<dim; ++d)
436 for(ordinal_type iq=0; iq<numCubPoints; ++iq) {
437 internalHcurlBasisCurlAtcubPoints(ic,i,iq,d) = hcurlBasisCurlAtcubPoints(idof,iq,d);
438 weightedHcurlBasisCurlAtcubPoints(ic,i,iq,d) = internalHcurlBasisCurlAtcubPoints(ic,i,iq,d)*basisEvalWeights(iq);
442 hcurlBasis->getValues(hcurlBasisCurlAtcubTargetPoints, Kokkos::subview(evaluationPoints,ic,targetPointsRange,Kokkos::ALL()), OPERATOR_CURL);
443 for(ordinal_type i=0; i<numCurlInteriorDOFs; ++i) {
444 ordinal_type idof = hcurlBasis->getDofOrdinal(dim, 0, i);
445 for(ordinal_type d=0; d<dim; ++d)
446 for(ordinal_type iq=0; iq<numTargetCubPoints; ++iq) {
447 internalHcurlBasisCurlAtcubTargetPoints(ic,i,iq,d) = hcurlBasisCurlAtcubTargetPoints(idof,iq,d);
448 weightedHcurlBasisCurlAtcubTargetPoints(ic,i,iq,d) = internalHcurlBasisCurlAtcubTargetPoints(ic,i,iq,d)*targetEvalWeights(iq);
454 FunctionSpaceTools<SpT >::integrate(Kokkos::subview(rhsMatTrans, Kokkos::ALL(), range_B), Kokkos::subview(targetAtEvalPoints, Kokkos::ALL(), targetPointsRange, Kokkos::ALL()), weightedHcurlBasisCurlAtcubTargetPoints);
461 Kokkos::View<funValsValueType**,Kokkos::LayoutLeft,host_space_type>
462 massMat(
"massMat", numElemDofs+numCurlInteriorDOFs, numElemDofs+numCurlInteriorDOFs),
463 rhsMat(
"rhsMat", numElemDofs+numCurlInteriorDOFs, 1 );
465 Teuchos::LAPACK<ordinal_type,funValsValueType> lapack;
466 ordinal_type info = 0;
467 Kokkos::View<funValsValueType**,Kokkos::LayoutLeft,host_space_type> pivVec(
"pivVec", 2*(numElemDofs+numCurlInteriorDOFs), 1);
469 for(ordinal_type ic=0; ic<numCells; ++ic) {
470 Kokkos::deep_copy(massMat,funValsValueType(0));
472 for(ordinal_type i=0; i<numElemDofs+numCurlInteriorDOFs; ++i) {
473 rhsMat(i,0) = rhsMatTrans(ic,i);
474 for(ordinal_type j=0; j<numElemDofs; ++j)
475 massMat(j,i) = massMat_(ic,j,i);
478 for(ordinal_type i=numElemDofs; i<numElemDofs+numCurlInteriorDOFs; ++i)
479 for(ordinal_type j=0; j<numElemDofs; ++j)
480 massMat(i,j) = massMat(j,i);
493 lapack.GELS(
'N', numElemDofs+numCurlInteriorDOFs, numElemDofs+numCurlInteriorDOFs, 1,
494 massMat.data(), massMat.stride_1(),
495 rhsMat.data(), rhsMat.stride_1(),
496 pivVec.data(), pivVec.extent(0),
500 std::stringstream ss;
501 ss <<
">>> ERROR (Intrepid::ProjectionTools::getBasisCoeffs): "
502 <<
"LAPACK return with error code: "
504 INTREPID2_TEST_FOR_EXCEPTION(
true, std::runtime_error, ss.str().c_str() );
507 for(ordinal_type i=0; i<numElemDofs; ++i) {
508 ordinal_type idof = cellBasis->getDofOrdinal(dim, 0, i);
509 basisCoeffs(ic,idof) = rhsMat(i,0);
Header file for the abstract base class Intrepid2::DefaultCubatureFactory.