98template <
typename ExecSpace,
typename TData>
105 const std::vector<std::string> &components)
116 static std::unique_ptr<MultiRegions::Operator<TData>>
Instantiate(
118 const std::vector<std::string> &components)
120 return std::make_unique<HOPressureBndCondOpImpl<ExecSpace, TData>>(
121 expansionList, components);
212 std::vector<LibUtilities::Field<TData, FieldState::Phys>>
m_bndPhys;
213 std::vector<LibUtilities::Field<TData, FieldState::Coeff>>
m_bndCoeffs;
222 std::vector<LibUtilities::Field<TData, FieldState::Coeff>>
228 std::vector<LibUtilities::Field<TData, FieldState::Phys>>
m_bndNormals;
232 std::vector<LibUtilities::Field<TData, FieldState::Phys>>
239 std::vector<std::shared_ptr<MultiRegions::IProductWRTBaseOp<TData>>>
245 std::vector<std::shared_ptr<MultiRegions::ExpressionOp<TData>>>
247 std::vector<std::shared_ptr<MultiRegions::FwdTransBCOp<TData>>>
249 std::vector<std::shared_ptr<MultiRegions::BwdTransOp<TData>>>
259 std::vector<std::shared_ptr<
284 std::vector<LibUtilities::MemoryRegion<TData>>
m_sign;
301 const std::vector<std::string> &velocityComponents)
override
303 m_coordDim = velocityExpansionList->GetCoordim(0);
305 "Insufficient velocity components for HOPressureBndCond.");
306 const std::vector<std::string> velocityComps(
307 velocityComponents.begin(),
361 "regions; it has no default "
362 "regions to exclude.");
370 const std::vector<std::string> &velocityComponents)
372 struct VolumeLocation
374 unsigned int block = 0;
379 const auto velocityBlocks =
380 MultiRegions::GetBlockAttributes<TData, FieldState::Phys>(
381 velocityExpansionList,
382 MultiRegions::UnitInterleaveWidths(velocityExpansionList));
383 std::map<int, VolumeLocation> fullVolumeLocation;
384 std::map<int, int> faceOwner;
385 for (
unsigned int blk = 0; blk < velocityBlocks.size(); ++blk)
389 const auto &expansions = collection.GetExpVector();
390 for (
unsigned int e = 0; e < expansions.size(); ++e)
392 const auto volumeGeometry =
393 expansions[e]->GetGeom()->GetGlobalID();
394 fullVolumeLocation[volumeGeometry] = {blk, e, expansions[e]};
395 for (
unsigned int face = 0; face < expansions[e]->GetNtraces();
398 faceOwner[expansions[e]->GetGeom()->GetTid(face)] =
406 std::set<int> selectedVolumeGeometry;
409 const auto bndBlocks =
410 MultiRegions::GetBlockAttributes<TData, FieldState::Phys>(
413 for (
unsigned int blk = 0; blk < bndBlocks.size(); ++blk)
417 const auto &expansions = collection.GetExpVector();
418 for (
unsigned int e = 0; e < expansions.size(); ++e)
421 faceOwner.find(expansions[e]->GetGeom()->GetGlobalID());
422 if (owner != faceOwner.end())
424 selectedVolumeGeometry.insert(owner->second);
430 if (selectedVolumeGeometry.empty())
436 "HOPressureBndCond is implemented for two and three "
440 const auto &velocityExpansionInfo =
441 velocityExpansionList->GetGraph()->GetExpansionInfo(
442 velocityComponents[0]);
443 for (
const auto geometry : selectedVolumeGeometry)
445 const auto info = velocityExpansionInfo.find(geometry);
446 ASSERTL1(info != velocityExpansionInfo.end(),
447 "Unable to locate boundary-adjacent velocity expansion "
449 restrictedExpansionInfo.emplace(*info);
454 velocityExpansionList->GetSession(), restrictedExpansionInfo,
457 const auto restrictedBlocks =
458 MultiRegions::GetBlockAttributes<TData, FieldState::Phys>(
463 "HOPressureBndCond boundary element velocity and forcing",
464 restrictedBlocks, velocityComponents, 1);
466 "HOPressureBndCond CurlCurl and flux", restrictedBlocks,
467 velocityComponents, 1);
469 m_curlCurl.template Initialize<MemSpace>(0.0);
471 std::map<int, VolumeLocation> restrictedVolumeLocation;
472 for (
unsigned int blk = 0; blk < restrictedBlocks.size(); ++blk)
476 const auto &expansions = collection.GetExpVector();
477 for (
unsigned int e = 0; e < expansions.size(); ++e)
479 restrictedVolumeLocation
480 [expansions[e]->GetGeom()->GetGlobalID()] = {blk, e,
488 std::map<std::pair<unsigned int, unsigned int>,
489 std::map<size_t, size_t>>
491 for (
const auto geometry : selectedVolumeGeometry)
493 const auto &src = fullVolumeLocation.at(geometry);
494 const auto &dst = restrictedVolumeLocation.at(geometry);
495 ASSERTL1(src.expansion->GetTotPoints() ==
496 dst.expansion->GetTotPoints(),
497 "Boundary element quadrature differs after restriction.");
498 volumeMaps[{src.block, dst.block}][dst.element] = src.element;
500 for (
auto &[blocks, maps] : volumeMaps)
505 gather.
nData = restrictedBlocks[blocks.second].GetNumData();
506 for (
const auto &[dstElmt, srcElmt] : maps)
508 gather.
dstElmt.push_back(dstElmt);
509 gather.
srcElmt.push_back(srcElmt);
528 velocityExpansionList->GetGraph()));
543 const std::vector<size_t> &elmts,
544 const unsigned int interleaveWidth,
545 const unsigned int dstInterleaveWidth)
547 std::vector<size_t> index;
548 index.reserve(elmts.size() * gather.
nData);
551 for (
size_t first = 0; first < elmts.size();)
553 const size_t dstGroup = gather.
dstElmt[first] / dstInterleaveWidth;
554 size_t last = first + 1;
555 while (last < elmts.size() &&
556 gather.
dstElmt[last] / dstInterleaveWidth == dstGroup)
560 for (
size_t q = 0; q < gather.
nData; ++q)
562 for (
size_t k = first; k < last; ++k)
564 const size_t group = elmts[k] / interleaveWidth;
565 const size_t lane = elmts[k] % interleaveWidth;
566 index.push_back(group * interleaveWidth * gather.
nData +
567 q * interleaveWidth + lane);
580 const unsigned int interleaveWidth)
582 std::vector<size_t> index(targets.
elmtCoeff.size());
583 for (
size_t k = 0; k < index.size(); ++k)
587 const size_t group = elmt / interleaveWidth;
588 const size_t lane = elmt % interleaveWidth;
589 index[k] = group * interleaveWidth * targets.
nCoeffs +
590 coeff * interleaveWidth + lane;
598 template <
typename BuildIndexFn>
601 const unsigned int streamID, BuildIndexFn &&buildIndex)
604 "HOPressureBndCond takes fields at interleave width 1 or at "
605 "the interleave width of its execution space.");
606 const bool isUnitWidth = interleaveWidth == 1u;
613 MemSpace,
size_t>(buildIndex(interleaveWidth), streamID);
623 VolumeGather &gather,
const unsigned int srcInterleaveWidth,
624 const unsigned int dstInterleaveWidth,
const unsigned int streamID)
626 ASSERTL0((srcInterleaveWidth == 1u ||
628 (dstInterleaveWidth == 1u ||
630 "HOPressureBndCond takes fields at interleave width 1 or at "
631 "the interleave width of its execution space.");
632 auto [it, isNew] = gather.
indices.try_emplace(
633 std::make_pair(srcInterleaveWidth, dstInterleaveWidth));
636 it->second.srcIndex =
642 it->second.dstIndex =
659 const unsigned int interleaveWidth)
662 "HOPressureBndCond takes fields at interleave width 1 or at "
663 "the interleave width of its execution space.");
664 bool isAtWidth =
true;
665 for (
auto &block : field.GetBlocks())
668 isAtWidth && block.GetInterleaveWidth() == interleaveWidth;
672 Math::zero<ExecSpace>(field);
673 field.SetInterleaveWidth(interleaveWidth);
680 CoeffTargets &targets,
const unsigned int interleaveWidth,
681 const unsigned int streamID)
684 targets.
indices, interleaveWidth, streamID,
685 [&targets](
const unsigned int blockInterleaveWidth) {
686 return TargetIndex(targets, blockInterleaveWidth);
696 template <
bool SUBTRACT = false>
703 const unsigned int srcStreamID = gather.srcBlock + 1;
704 const unsigned int streamID = gather.dstBlock + 1;
705 auto &srcBlock = src.
GetBlocks()[gather.srcBlock];
706 auto &dstBlock = dst.
GetBlocks()[gather.dstBlock];
708 RecordStreamEvent<ExecSpace>(srcStreamID);
709 SetStreamDependencies<ExecSpace>(streamID, srcStreamID);
712 gather, srcBlock.GetInterleaveWidth(),
713 dstBlock.GetInterleaveWidth(), streamID);
715 srcBlock.template GetPtr<MemSpace, ReadOnly>(streamID);
719 dstBlock.template GetPtr<MemSpace, ReadWrite>(streamID);
721 indices.srcIndex.template GetPtr<MemSpace, ReadOnly>(streamID);
723 indices.dstIndex.template GetPtr<MemSpace, ReadOnly>(streamID);
724 const size_t nsize = gather.srcElmt.size() * gather.nData;
727 HOPressureVolumeGatherKernel<ExecSpace, 2, SUBTRACT>(
728 nsize, srcBlock.CompSize(), dstBlock.CompSize(), srcIdx,
729 dstIdx, srcPtr, dstPtr, streamID);
733 HOPressureVolumeGatherKernel<ExecSpace, 3, SUBTRACT>(
734 nsize, srcBlock.CompSize(), dstBlock.CompSize(), srcIdx,
735 dstIdx, srcPtr, dstPtr, streamID);
737 RecordStreamEvent<ExecSpace>(streamID);
742 const unsigned int srcStreamID = gather.srcBlock + 1;
743 const unsigned int streamID = gather.dstBlock + 1;
744 SetStreamDependencies<ExecSpace>(srcStreamID, streamID);
772 const unsigned int streamID = blk + 1;
776 forcingBlk.template GetPtr<MemSpace, ReadOnly>(streamID);
778 curlCurlBlk.template GetPtr<MemSpace, ReadWrite>(streamID);
781 const size_t nPoints = curlCurlBlk.GetNumElementsWithPadding() *
782 curlCurlBlk.GetNumData();
787 HOPressureVolumeCombineKernel<ExecSpace, 2, false>(
788 nPoints, curlCurlBlk.CompSize(), kinvis, scale,
789 forcingPtr, curlCurlPtr, streamID);
793 HOPressureVolumeCombineKernel<ExecSpace, 3, false>(
794 nPoints, curlCurlBlk.CompSize(), kinvis, scale,
795 forcingPtr, curlCurlPtr, streamID);
802 HOPressureVolumeCombineKernel<ExecSpace, 2, true>(
803 nPoints, curlCurlBlk.CompSize(), kinvis, scale,
804 forcingPtr, curlCurlPtr, streamID);
808 HOPressureVolumeCombineKernel<ExecSpace, 3, true>(
809 nPoints, curlCurlBlk.CompSize(), kinvis, scale,
810 forcingPtr, curlCurlPtr, streamID);
817 if (isSubtractHistory)
828 for (
unsigned int n = 0; n <
m_bndPhys.size(); ++n)
832 for (
unsigned int blk = 0; blk <
m_bndPhys[n].GetBlocks().size();
835 const unsigned int streamID = blk + 1;
838 auto &outBlk =
m_bndPhys[n].GetBlocks()[blk];
840 fluxBlk.template GetPtr<MemSpace, ReadOnly>(streamID);
842 normalBlk.template GetPtr<MemSpace, ReadOnly>(streamID);
844 outBlk.template GetPtr<MemSpace, WriteOnly>(streamID);
846 const size_t nPoints =
847 outBlk.GetNumElementsWithPadding() * outBlk.GetNumData();
850 HOPressureBoundaryCombineKernel<ExecSpace, 2>(
851 nPoints, fluxBlk.CompSize(), fluxPtr, normalPtr, outPtr,
856 HOPressureBoundaryCombineKernel<ExecSpace, 3>(
857 nPoints, fluxBlk.CompSize(), fluxPtr, normalPtr, outPtr,
870 for (
unsigned int blk = 0; blk <
m_bndPhys[n].GetBlocks().size();
873 const unsigned int streamID = blk + 1;
876 auto &outBlk =
m_bndPhys[n].GetBlocks()[blk];
878 historyBlk.template GetPtr<MemSpace, ReadOnly>(streamID);
880 normalBlk.template GetPtr<MemSpace, ReadOnly>(streamID);
882 outBlk.template GetPtr<MemSpace, ReadWrite>(streamID);
884 const size_t nPoints =
885 outBlk.GetNumElementsWithPadding() * outBlk.GetNumData();
888 HOPressureSubtractNormalVelocityKernel<ExecSpace, 2>(
889 nPoints, historyBlk.CompSize(), scale, historyPtr,
890 normalPtr, outPtr, streamID);
894 HOPressureSubtractNormalVelocityKernel<ExecSpace, 3>(
895 nPoints, historyBlk.CompSize(), scale, historyPtr,
896 normalPtr, outPtr, streamID);
904 const std::vector<std::string> &velocityComponents)
908 this->m_expansionList->GetGraph());
910 const auto &velocityBndExpansions =
911 velocityExpansionList->GetBndCondExpansions();
914 "HOPressureBndCond boundary metadata differs.");
919 ASSERTL0(conditionIt != bndConditions.end(),
920 "Unable to locate velocity boundary conditions for "
921 "HOPressureBndCond.");
927 std::vector<LibUtilities::EquationSharedPtr> equations;
929 bool isTimeDependent =
false;
932 const auto componentIt =
933 conditionIt->second->find(velocityComponents[d]);
934 ASSERTL0(componentIt != conditionIt->second->end(),
935 "Unable to locate a velocity component boundary "
936 "condition for HOPressureBndCond.");
938 componentIt->second->GetBoundaryConditionType() ==
942 (isDirichlet[d] && componentIt->second->IsTimeDependent());
944 isDirichlet[d] ? componentIt->second->GetEquation()
951 const bool hasNonDirichletVelocity =
952 std::find(isDirichlet.begin(), isDirichlet.end(),
false) !=
956 (hasNonDirichletVelocity && bndExp->GetExpSize() > 0);
958 const auto bndPhysBlocks =
959 MultiRegions::GetBlockAttributes<TData, FieldState::Phys>(
960 bndExp, MultiRegions::UnitInterleaveWidths(bndExp));
962 "HOPressureBndCond boundary flux and velocity", bndPhysBlocks,
963 velocityComponents, 1);
964 m_bndNormals.emplace_back(
"HOPressureBndCond boundary normals",
965 bndPhysBlocks, velocityComponents, 1);
969 if (hasNonDirichletVelocity)
973 "HOPressureBndCond boundary non-Dirichlet normals",
974 bndPhysBlocks, velocityComponents, 1);
982 for (
unsigned int blk = 0;
985 auto &normalBlock =
m_bndNormals.back().GetBlocks()[blk];
988 .template GetPtr<NektarSpaces::HostSpace, WriteOnly>();
989 TData *nonDirichletNormalPtr =
nullptr;
990 if (hasNonDirichletVelocity)
992 nonDirichletNormalPtr =
999 const auto &expansions = collection.GetExpVector();
1000 for (
unsigned int e = 0; e < expansions.size(); ++e)
1003 bndExp->GetPhys_Offset(expansions[e]->GetElmtId());
1004 for (
unsigned int d = 0; d <
m_coordDim; ++d)
1006 for (
unsigned int p = 0; p < normalBlock.GetNumData();
1009 const size_t idx = d * normalBlock.CompSize() +
1010 e * normalBlock.GetNumData() + p;
1012 static_cast<TData
>(normals[d][offset + p]);
1013 if (nonDirichletNormalPtr)
1015 nonDirichletNormalPtr[idx] =
1016 isDirichlet[d] ? TData(0.0)
1029 auto velocityBndExp =
1037 velocityBndExp->SetDataWarehouse();
1038 ASSERTL0(velocityBndExp->SameQuadratureLayout(bndExp),
1039 "HOPressureBndCond requires the velocity and pressure "
1040 "boundary expansions to share their quadrature points.");
1044 velocityBndExp, velocityComponents, ExecSpace::name);
1045 expressionOp->SetExpressions(equations);
1058 "HOPressureBndCond boundary velocity coeffs",
1059 MultiRegions::GetBlockAttributes<TData, FieldState::Coeff>(
1061 MultiRegions::UnitInterleaveWidths(velocityBndExp)),
1062 velocityComponents, 1);
1066 velocityBndExp, velocityComponents, ExecSpace::name);
1069 velocityBndExp, velocityComponents, ExecSpace::name);
1079 return condition->GetBoundaryConditionType() ==
1082 condition->GetUserDefined(),
1089 "HOPressureBndCond expects one pressure component.");
1091 auto contField = std::dynamic_pointer_cast<MultiRegions::ContField>(
1094 "HOPressureBndCond requires a continuous pressure field.");
1096 const auto &bndExpansions =
1098 const auto &bndConditions = this->
m_expansionList->GetBndConditions();
1101 this->m_expansionList->GetGraph());
1103 std::vector<unsigned int> bndRegionIds;
1104 for (
const auto &[regionId, region] : bregions)
1106 bndRegionIds.push_back(regionId);
1108 ASSERTL1(bndRegionIds.size() == bndExpansions.size(),
1109 "Boundary region and expansion counts differ.");
1114 std::vector<std::vector<bool>> isTypeByRegion(bndExpansions.size());
1115 std::vector<size_t> numBcExpCoeffs(bndExpansions.size());
1116 for (
unsigned int n = 0; n < bndExpansions.size(); ++n)
1119 isTypeByRegion[n] = {isHOP};
1120 numBcExpCoeffs[n] = bndExpansions[n]->GetNcoeffs();
1127 auto bndExp = bndExpansions[n];
1128 bndExp->SetDataWarehouse();
1137 "HOPressureBndCond boundary phys",
1138 MultiRegions::GetBlockAttributes<TData, FieldState::Phys>(
1139 bndExp, MultiRegions::UnitInterleaveWidths(bndExp)),
1141 m_bndCoeffs.emplace_back(
1142 "HOPressureBndCond boundary coeffs",
1143 MultiRegions::GetBlockAttributes<TData, FieldState::Coeff>(
1144 bndExp, MultiRegions::UnitInterleaveWidths(bndExp)),
1146 m_bndPhys.back().template Initialize<MemSpace>(0.0);
1147 m_bndCoeffs.back().template Initialize<MemSpace>(0.0);
1149 const bool isPoint = bndExp->GetShapeDimension() == 0;
1162 std::vector<bool>{true}));
1173 MultiRegions::detail::BuildCGBndCondCoeffMaps<ExecSpace, TData>(
1177 [](
unsigned int,
const auto &,
const auto &,
const auto &) {});
1180 m_sign = std::move(maps.uniqueSign);
1205 nUpdateStreams = std::max(nUpdateStreams, field.GetBlocks().size());
1207 for (
unsigned int id = 1;
id <= nUpdateStreams; ++
id)
1225 const auto coeffBlocks =
1226 MultiRegions::GetBlockAttributes<TData, FieldState::Coeff>(
1228 MultiRegions::UnitInterleaveWidths(expansionList));
1229 std::vector<CoeffTargets> targets(unitWidthIndex.size());
1230 for (
unsigned int blk = 0; blk < unitWidthIndex.size(); ++blk)
1232 targets[blk].nCoeffs = coeffBlocks[blk].GetNumData();
1233 const size_t nTargets = unitWidthIndex[blk].size();
1238 .template GetPtr<NektarSpaces::HostSpace, ReadOnly>();
1239 targets[blk].elmtCoeff.assign(elmtCoeff, elmtCoeff + nTargets);
1264 for (
unsigned int n = 0; n <
m_bndPhys.size(); ++n)
1273 const unsigned int blk = 0;
1274 const unsigned int streamID = blk + 1;
1275 auto &physBlk =
m_bndPhys[n].GetBlocks()[blk];
1278 physBlk.template GetPtr<MemSpace, ReadOnly>(streamID);
1280 coeffBlk.template GetPtr<MemSpace, WriteOnly>(streamID);
1282 coeffBlk.GetNumElements() * coeffBlk.GetNumData();
1283 Math::copyKernel<ExecSpace>(count, src, dst, streamID);
1287 size_t regionOffset = 0;
1288 for (
unsigned int blk = 0; blk <
m_bndCoeffs[n].GetBlocks().size();
1291 const unsigned int streamID = blk + 1;
1294 wspBlk.template GetPtr<MemSpace, ReadOnly>(streamID);
1295 const auto blockLen =
1296 wspBlk.GetNumElements() * wspBlk.GetNumData();
1299 Math::copyKernel<ExecSpace>(
1300 blockLen, srcPtr, compactPtr + bndOffset + regionOffset,
1302 regionOffset += blockLen;
1313 for (
unsigned int blk = 0; blk <
m_bndCoeff.size(); ++blk)
1315 const unsigned int streamID = blk + 1;
1320 m_bndCoeff[blk].template GetPtr<MemSpace, WriteOnly>(streamID);
1321 MultiRegions::detail::CGBndCondGatherKernel<ExecSpace>(
1328 m_groupSrc[blk].template GetPtr<MemSpace, ReadOnly>(streamID);
1330 m_groupValue[blk].template GetPtr<MemSpace, WriteOnly>(
1332 MultiRegions::detail::CGBndCondGatherKernel<ExecSpace>(
1333 m_groupSrc[blk].size(), groupIdxPtr, compactPtr, groupDstPtr,
1352 "HOPressureBndCond requires the explicit contribution rhs on "
1353 "a region with a velocity component that is not Dirichlet.");
1355 "SetVelocityContext must be called before Update.");
1357 "SetKinvis must be called before Update.");
1365 const unsigned int interleaveWidth =
1367 .GetInterleaveWidth();
1389 const bool isCoeffsCurrent =
1401 if (!isCoeffsCurrent)
1418 for (
unsigned int n = 0; n <
m_bndPhys.size(); ++n)
1420 for (
unsigned int blk = 0;
1423 const unsigned int streamID = blk + 1;
1426 auto &fluxBlk =
m_bndPhys[n].GetBlocks()[blk];
1428 velocityBlk.template GetPtr<MemSpace, ReadOnly>(streamID);
1430 normalBlk.template GetPtr<MemSpace, ReadOnly>(streamID);
1432 fluxBlk.template GetPtr<MemSpace, ReadWrite>(streamID);
1433 const size_t nPoints =
1434 fluxBlk.GetNumElementsWithPadding() * fluxBlk.GetNumData();
1437 HOPressureSubtractNormalVelocityKernel<ExecSpace, 2>(
1438 nPoints, velocityBlk.CompSize(), this->m_scale,
1439 velocityPtr, normalPtr, fluxPtr, streamID);
1443 HOPressureSubtractNormalVelocityKernel<ExecSpace, 3>(
1444 nPoints, velocityBlk.CompSize(), this->m_scale,
1445 velocityPtr, normalPtr, fluxPtr, streamID);
1464 for (
unsigned int blk = 0; blk < inout.
GetBlocks().size(); ++blk)
1466 const unsigned int streamID = blk + 1;
1469 auto &inoutBlk = inout.
GetBlocks()[blk];
1470 const unsigned int interleaveWidth = inoutBlk.GetInterleaveWidth();
1473 inoutBlk.template GetPtr<MemSpace, ReadWrite>(streamID);
1475 m_bndCoeff[blk].template GetPtr<MemSpace, ReadOnly>(streamID);
1484 .template GetPtr<MemSpace, ReadOnly>(streamID);
1488 m_sign[blk].template GetPtr<MemSpace, ReadOnly>(
1490 MultiRegions::detail::NeuBndCondKernel<ExecSpace>(
1491 nUnique, signPtr, mapPtr, bndCoeffPtr, inoutPtr,
1496 MultiRegions::detail::NeuBndCondKernel<ExecSpace>(
1497 nUnique, mapPtr, bndCoeffPtr, inoutPtr, streamID);
1506 auto groupOffsetPtr =
1509 auto groupTargetPtr =
1511 interleaveWidth, streamID)
1512 .template GetPtr<MemSpace, ReadOnly>(streamID);
1513 auto groupValuePtr =
1520 m_groupSign[blk].template GetPtr<MemSpace, ReadOnly>(
1522 MultiRegions::detail::NeuBndCondGroupKernel<ExecSpace>(
1523 nGroups, groupOffsetPtr, groupTargetPtr, groupSignPtr,
1524 groupValuePtr, inoutPtr, streamID);
1528 MultiRegions::detail::NeuBndCondGroupKernel<ExecSpace>(
1529 nGroups, groupOffsetPtr, groupTargetPtr, groupValuePtr,
1530 inoutPtr, streamID);
Public interface of the backward-transform (BwdTrans) element operator, which maps a field from coeff...
Whole-field interface of the curl-curl element operator, which evaluates curl(curl u) at the quadratu...
#define ASSERTL0(condition, msg)
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Public interface of the Expression operator, which evaluates analytical expressions at the quadrature...
Whole-field interface of the IProductWRTBase element operator, which takes a physical-space field to ...
Higher-order pressure boundary condition, added to the pressure system as a Neumann contribution.
static const std::string userDefinedType
USERDEFINEDTYPE of the pressure Neumann conditions the operator applies.
bool m_isSetKinvis
Set by SetKinvis(); checked by Update() in debug builds.
TData m_kinvis
Kinematic viscosity, set by SetKinvis().
TData m_time
Time of the prescribed boundary velocity, set by SetTime().
TData m_scale
Scale of the fields passed to Update(), set by SetScale().
bool m_hasNonDirichletVelocity
Set by SetVelocityContext(); read by HasNonDirichletVelocity().
A Field represents expansion data to be operated on.
std::vector< BlockAccessor< TData, TState > > & GetBlocks()
Get BlockAccessors for the field.
A MemoryRegion represents a memory region.
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
static std::shared_ptr< BwdTransOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="", const std::string &implStr="")
Create a backward-transform operator through the operator and block-operator factories.
static std::shared_ptr< CurlCurlOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="", const std::string &implStr="")
Build a complete curl-curl operator through the operator and block-operator factories.
static std::shared_ptr< ExpressionOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="", const std::string &implStr="")
Create an Expression operator through the two-stage element-operator factory and initialise its defau...
static std::shared_ptr< FwdTransBCOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="")
static std::shared_ptr< IProductWRTBaseOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="", const std::string &implStr="")
Build a complete IProductWRTBase operator through the operator and block-operator factories.
std::vector< std::string > m_components
Names of the field components the operator was built for.
MultiRegions::ExpListSharedPtr m_expansionList
Expansion list the operator acts on.
Adds the surface integral of boundary fields, per component and homogeneous plane,...
const BoundaryRegionCollection & GetBoundaryRegions(void) const
const BoundaryConditionCollection & GetBoundaryConditions(void) const
Implementation of HOPressureBndCondOp.
std::vector< unsigned int > m_bndConditionIndices
std::vector< LibUtilities::Field< TData, FieldState::Coeff > > m_bndCoeffs
std::vector< bool > m_bndIsPoint
static std::string className
std::vector< std::shared_ptr< MultiRegions::FwdTransBCOp< TData > > > m_bndVelocityFwdTransOps
size_t v_GetNumBndDofs() override
bool m_isBndVelocityEvaluated
static bool IsHOPressure(const SpatialDomains::BoundaryConditionShPtr &condition)
std::vector< unsigned int > m_updateStreams
LibUtilities::MemoryRegion< TData > m_compactBndCoeff
void SubtractBoundaryVelocity()
std::vector< LibUtilities::MemoryRegion< size_t > > m_groupSrc
static std::unique_ptr< MultiRegions::Operator< TData > > Instantiate(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components)
MultiRegions::ExpListSharedPtr m_bndElmtExpansionList
void EvaluateBoundaryVelocity()
MultiRegions::detail::CGBndCondSurfaceIntegral< ExecSpace, TData > m_surfaceIntegral
std::vector< VolumeGather > m_volumeGather
void v_SetVelocityContext(const MultiRegions::ExpListSharedPtr &velocityExpansionList, const std::vector< std::string > &velocityComponents) override
std::vector< MultiRegions::ExpListSharedPtr > m_bndExpLists
std::shared_ptr< MultiRegions::CurlCurlOp< TData > > m_curlCurlOp
void v_AddNeumannSurfaceIntegral(LibUtilities::MemoryRegion< TData > &data) override
static LibUtilities::MemoryRegion< size_t > & IndexAtInterleaveWidth(InterleaveWidthIndices &indices, const unsigned int interleaveWidth, const unsigned int streamID, BuildIndexFn &&buildIndex)
typename ExecSpace::memory_space MemSpace
static GatherIndices & GatherIndicesAtInterleaveWidths(VolumeGather &gather, const unsigned int srcInterleaveWidth, const unsigned int dstInterleaveWidth, const unsigned int streamID)
void BuildBoundaryCoeffs(const FluxForm form)
void FinaliseUpdate(const FluxForm form)
static std::vector< size_t > PointIndex(const VolumeGather &gather, const std::vector< size_t > &elmts, const unsigned int interleaveWidth, const unsigned int dstInterleaveWidth)
size_t m_numBndCoeffCompSize
void BuildBoundaryPhys(const FluxForm form, LibUtilities::Field< TData, FieldState::Phys > &forcing, LibUtilities::Field< TData, FieldState::Phys > *rhs, const TData kinvis, const TData scale)
bool m_velocityContextSet
std::vector< CoeffTargets > m_map
LibUtilities::Field< TData, FieldState::Phys > m_bndElmtWork
HOPressureBndCondOpImpl(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components)
std::vector< bool > m_bndVelocityIsTimeDependent
void UpdateFlux(const FluxForm form, LibUtilities::Field< TData, FieldState::Phys > &forcing, LibUtilities::Field< TData, FieldState::Phys > &velocity, LibUtilities::Field< TData, FieldState::Phys > *rhs)
LibUtilities::Field< TData, FieldState::Phys > m_curlCurl
void v_UpdateBndCoeffs(const TData &time) override
std::vector< LibUtilities::MemoryRegion< TData > > m_groupValue
std::vector< LibUtilities::MemoryRegion< TData > > m_groupSign
std::vector< LibUtilities::MemoryRegion< size_t > > m_bndCoeffSrc
void v_Update(LibUtilities::Field< TData, FieldState::Phys > &rhs, LibUtilities::Field< TData, FieldState::Phys > &velocity) override
std::vector< size_t > m_uniqueCounts
std::vector< std::shared_ptr< MultiRegions::detail::PhysTraceExtractBndCond< ExecSpace, TData > > > m_bndFluxExtractOps
std::vector< std::shared_ptr< MultiRegions::ExpressionOp< TData > > > m_bndVelocityExpressionOps
static LibUtilities::MemoryRegion< size_t > & TargetsAtInterleaveWidth(CoeffTargets &targets, const unsigned int interleaveWidth, const unsigned int streamID)
static std::vector< size_t > TargetIndex(const CoeffTargets &targets, const unsigned int interleaveWidth)
std::vector< LibUtilities::Field< TData, FieldState::Phys > > m_bndNormals
std::vector< LibUtilities::MemoryRegion< size_t > > m_groupOffset
std::vector< size_t > m_bndCoeffOffsets
std::vector< LibUtilities::MemoryRegion< TData > > m_bndCoeff
std::vector< unsigned int > m_bndRegionIds
static void SetRestrictedInterleaveWidth(LibUtilities::Field< TData, FieldState::Phys > &field, const unsigned int interleaveWidth)
void v_UpdateWithAcceleration(LibUtilities::Field< TData, FieldState::Phys > &rhs, LibUtilities::Field< TData, FieldState::Phys > &velocity, LibUtilities::Field< TData, FieldState::Phys > &predictor) override
void v_Apply(LibUtilities::Field< TData, FieldState::Coeff > &inout) override
void BuildBoundaryElementData(const MultiRegions::ExpListSharedPtr &velocityExpansionList, const std::vector< std::string > &velocityComponents)
void BuildBoundaryVelocityData(const MultiRegions::ExpListSharedPtr &velocityExpansionList, const std::vector< std::string > &velocityComponents)
static constexpr unsigned int m_interleaveWidth
std::vector< std::shared_ptr< MultiRegions::IProductWRTBaseOp< TData > > > m_bndIProductOps
std::vector< CoeffTargets > BuildCoeffTargets(std::vector< LibUtilities::MemoryRegion< size_t > > &unitWidthIndex, const MultiRegions::ExpListSharedPtr &expansionList)
std::vector< LibUtilities::MemoryRegion< TData > > m_sign
std::vector< CoeffTargets > m_groupTarget
std::vector< LibUtilities::Field< TData, FieldState::Phys > > m_bndNonDirichletNormals
void GatherBoundaryElements(LibUtilities::Field< TData, FieldState::Phys > &src, LibUtilities::Field< TData, FieldState::Phys > &dst)
std::vector< size_t > m_groupCounts
static constexpr unsigned int m_opStreamID
std::vector< LibUtilities::Field< TData, FieldState::Coeff > > m_bndVelocityCoeffs
void v_UpdateWeak(LibUtilities::Field< TData, FieldState::Phys > &rhs, LibUtilities::Field< TData, FieldState::Phys > &velocity, LibUtilities::Field< TData, FieldState::Phys > &predictor) override
std::vector< LibUtilities::Field< TData, FieldState::Phys > > m_bndWorkPhys
std::vector< std::shared_ptr< MultiRegions::BwdTransOp< TData > > > m_bndVelocityBwdTransOps
std::vector< LibUtilities::Field< TData, FieldState::Phys > > m_bndPhys
void v_ExcludeUserDefinedType(const std::string &userDefinedType) override
std::shared_ptr< Expansion > ExpansionSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
Collections::Collection GetCollection(MultiRegions::ExpListSharedPtr expansionList, unsigned int block_idx)
std::shared_ptr< BoundaryConditionBase > BoundaryConditionShPtr
std::map< int, ExpansionInfoShPtr > ExpansionInfoMap
bool IEquals(std::string_view a, std::string_view b)
InterleaveWidthIndices indices
std::vector< size_t > elmtCoeff
LibUtilities::MemoryRegion< size_t > srcIndex
LibUtilities::MemoryRegion< size_t > dstIndex
bool isBuiltInterleavedIndex
LibUtilities::MemoryRegion< size_t > index
LibUtilities::MemoryRegion< size_t > interleavedIndex
std::vector< size_t > dstElmt
std::map< std::pair< unsigned int, unsigned int >, GatherIndices > indices
VolumeGather & operator=(const VolumeGather &)=delete
VolumeGather(const VolumeGather &)=delete
VolumeGather & operator=(VolumeGather &&)=default
std::vector< size_t > srcElmt
VolumeGather(VolumeGather &&)=default