Skip to content

Commit

Permalink
use spans() to unpack
Browse files Browse the repository at this point in the history
  • Loading branch information
greole committed Feb 15, 2025
1 parent 5772724 commit 139ea2c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
12 changes: 7 additions & 5 deletions src/finiteVolume/cellCentred/interpolation/linear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ void computeLinearInterpolation(
{
const auto exec = dst.exec();
auto dstS = dst.internalField().span();
const auto srcS = src.internalField().span();
const auto weightS = weights.internalField().span();
const auto ownerS = dst.mesh().faceOwner().span();
const auto neighS = dst.mesh().faceNeighbour().span();
const auto boundS = src.boundaryField().value().span();
const auto [srcS, weightS, ownerS, neighS, boundS] = spans(
src.internalField(),
weights.internalField(),
dst.mesh().faceOwner(),
dst.mesh().faceNeighbour(),
src.boundaryField().value()
);
size_t nInternalFaces = dst.mesh().nInternalFaces();

NeoFOAM::parallelFor(
Expand Down
14 changes: 8 additions & 6 deletions src/finiteVolume/cellCentred/interpolation/upwind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ void computeUpwindInterpolation(
{
const auto exec = dst.exec();
auto dstS = dst.internalField().span();
const auto srcS = src.internalField().span();
const auto weightS = weights.internalField().span();
const auto ownerS = dst.mesh().faceOwner().span();
const auto neighS = dst.mesh().faceNeighbour().span();
const auto boundS = src.boundaryField().value().span();
const auto fluxS = flux.internalField().span();
const auto [srcS, weightS, ownerS, neighS, boundS, fluxS] = spans(
src.internalField(),
weights.internalField(),
dst.mesh().faceOwner(),
dst.mesh().faceNeighbour(),
src.boundaryField().value(),
flux.internalField()
);
size_t nInternalFaces = dst.mesh().nInternalFaces();

NeoFOAM::parallelFor(
Expand Down

0 comments on commit 139ea2c

Please sign in to comment.