ENH: identityOp as equivalent to std::identity (C++20)

- similar to how noOp was defined, but with perfect forwarding

STYLE: combine Swap into stdFoam

STYLE: capitalize FileOp, NegateOp template parameters
This commit is contained in:
Mark Olesen
2022-03-13 18:12:58 +01:00
parent ed73bcbc33
commit 327c43f3e8
39 changed files with 221 additions and 305 deletions

View File

@ -85,7 +85,7 @@ int main(int argc, char *argv[])
{
const mapDistribute& faceMap = map.faceMap();
pointField fc(mesh.faceCentres());
faceMap.distribute(fc, noOp());
faceMap.distribute(fc, identityOp());
Pout<< "Construct size:" << faceMap.constructSize() << endl;
forAll(distributedMesh.faceCentres(), facei)
{
@ -118,7 +118,7 @@ int main(int argc, char *argv[])
{
const mapDistribute& cellMap = map.cellMap();
pointField cc(mesh.cellCentres());
cellMap.distribute(cc, noOp());
cellMap.distribute(cc, identityOp());
Pout<< "Construct size:" << cellMap.constructSize() << endl;
forAll(distributedMesh.cellCentres(), celli)
{
@ -131,7 +131,7 @@ int main(int argc, char *argv[])
{
const mapDistribute& pointMap = map.pointMap();
pointField pc(mesh.points());
pointMap.distribute(pc, noOp());
pointMap.distribute(pc, identityOp());
Pout<< "Construct size:" << pointMap.constructSize() << endl;
forAll(distributedMesh.points(), pointi)
{