ListOps::identity -> identityMap

to avoid confusion with the tensor identity.
This commit is contained in:
Henry Weller
2023-02-03 17:12:31 +00:00
parent efca6df9f7
commit 4dbc23c141
125 changed files with 351 additions and 346 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -48,7 +48,7 @@ int main(int argc, char *argv[])
Info<< "Test const circulator. First go forwards, then backwards."
<< nl << endl;
face f(identity(4));
face f(identityMap(4));
ConstCirculator<face> cStart(f);
@ -95,7 +95,7 @@ int main(int argc, char *argv[])
Info<< nl << nl << "Compare two faces: " << endl;
face a(identity(5));
face a(identityMap(5));
Info<< "Compare " << a << " and " << a << " Match = " << face::compare(a, a)
<< endl;
@ -127,11 +127,11 @@ int main(int argc, char *argv[])
Info<< "Compare " << g << " and " << h << " Match = " << face::compare(g, h)
<< endl;
face face1(identity(1));
face face1(identityMap(1));
Info<< "Compare " << face1 << " and " << face1
<< " Match = " << face::compare(face1, face1) << endl;
face face2(identity(1)+1);
face face2(identityMap(1)+1);
Info<< "Compare " << face1 << " and " << face2
<< " Match = " << face::compare(face1, face2) << endl;
@ -146,7 +146,7 @@ int main(int argc, char *argv[])
} while (cZero.circulate(CirculatorBase::direction::clockwise));
fZero = face(identity(5));
fZero = face(identityMap(5));
// circulator was invalidated so reset
cZero = Circulator<face>(fZero);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -71,7 +71,7 @@ int main(int argc, char *argv[])
size
);
const face f(identity(4));
const face f(identityMap(4));
forAll(faces2, i)
{
@ -134,7 +134,7 @@ int main(int argc, char *argv[])
size
);
const face f(identity(4));
const face f(identityMap(4));
forAll(faces2, i)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -208,7 +208,7 @@ int main(int argc, char *argv[])
dlE3 = dlE2; // assign identical
printInfo("dlE3", dlE3, true);
DynamicList<label> dlE4(reorder(identity(dlE3.size()), dlE3));
DynamicList<label> dlE4(reorder(identityMap(dlE3.size()), dlE3));
printInfo("dlE4", dlE4, true);
printInfo("dlE3", dlE3, true);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -58,7 +58,7 @@ int main(int argc, char *argv[])
const scalar dx = (x1 - x0)/(nX - 1);
const scalarField xs
(
x0 + dx*List<scalar>(identity(nX))
x0 + dx*List<scalar>(identityMap(nX))
);
Info<< "Calculating values\n" << endl;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -67,7 +67,7 @@ int main(int argc, char *argv[])
pDict
);
labelList cellToCoarse(identity(mesh.nCells()));
labelList cellToCoarse(identityMap(mesh.nCells()));
labelListList coarseToCell(invertOneToMany(mesh.nCells(), cellToCoarse));
runTime++;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -43,8 +43,8 @@ int main(int argc, char *argv[])
{
Info<< "Test Rotations:" << nl << endl;
List<label> forwardRotate(identity(5));
face testFace(identity(4));
List<label> forwardRotate(identityMap(5));
face testFace(identityMap(4));
for (label i = 0; i < 8; ++i)
{
@ -69,7 +69,7 @@ int main(int argc, char *argv[])
inplaceRotateList(forwardRotate, -2);
Info<< "Rotate to the left by 2 : " << forwardRotate << endl;
List<label> subRotate(identity(10));
List<label> subRotate(identityMap(10));
SubList<label> subL(subRotate, 5, 3);
Info<< "Test inplace rotate on sublist : " << subRotate << endl;
@ -80,32 +80,32 @@ int main(int argc, char *argv[])
Info<< nl << nl << "Test Reversing:" << nl << endl;
Info<< "List : " << identity(5) << endl;
Info<< "Reverse : " << reverseList(identity(5)) << endl;
Info<< "List : " << identity(6) << endl;
Info<< "Reverse : " << reverseList(identity(6)) << nl << endl;
Info<< "List : " << identityMap(5) << endl;
Info<< "Reverse : " << reverseList(identityMap(5)) << endl;
Info<< "List : " << identityMap(6) << endl;
Info<< "Reverse : " << reverseList(identityMap(6)) << nl << endl;
List<label> test1(identity(5));
List<label> test1(identityMap(5));
Info<< "List : " << test1 << endl;
inplaceReverseList(test1);
Info<< "Inplace Reverse : " << test1 << nl << endl;
List<label> test2(identity(6));
List<label> test2(identityMap(6));
Info<< "List : " << test2 << endl;
inplaceReverseList(test2);
Info<< "Inplace Reverse : " << test2 << nl << endl;
face test3(identity(6));
face test3(identityMap(6));
Info<< "Face : " << test3 << endl;
inplaceReverseList(test3);
Info<< "Inplace Reverse : " << test3 << nl << endl;
FixedList<label, 6> test4(identity(6));
FixedList<label, 6> test4(identityMap(6));
Info<< "FixedList : " << test4 << endl;
inplaceReverseList(test4);
Info<< "Inplace Reverse : " << test4 << nl << endl;
List<label> test5(identity(9));
List<label> test5(identityMap(9));
SubList<label> test5SubList(test5, 4, 3);
Info<< "List : " << test5 << endl;
inplaceReverseList(test5SubList);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -129,7 +129,7 @@ int main(int argc, char *argv[])
// 2. Use a wrapper to walk from all boundary edges on selected patches
{
labelHashSet otherPatchIDs(identity(mesh.boundaryMesh().size()));
labelHashSet otherPatchIDs(identityMap(mesh.boundaryMesh().size()));
otherPatchIDs.erase(patch.index());
Info<< "Walking on patch " << patch.index()

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -259,7 +259,7 @@ int main(int argc, char *argv[])
// (
// mesh,
// pp,
// identity(pp.size())+pp.start()
// identityMap(pp.size())+pp.start()
// )
// );
// forAll(pn, pointi)
@ -276,7 +276,7 @@ int main(int argc, char *argv[])
// (
// mesh,
// pp,
// identity(pp.size())+pp.start()
// identityMap(pp.size())+pp.start()
// )
// );
// forAll(pn, pointi)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -69,7 +69,7 @@ int main(int argc, char *argv[])
bb.min() -= point(rootVSmall, rootVSmall, rootVSmall);
bb.max() += point(rootVSmall, rootVSmall, rootVSmall);
labelList allEdges(identity(efem.edges().size()));
labelList allEdges(identityMap(efem.edges().size()));
indexedOctree<treeDataEdge> edgeTree
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -72,7 +72,7 @@ int main(int argc, char *argv[])
pts[4] = point(4.294, 4.024, -4.317);
pts[5] = point(4.409, 3.687, -4.317);
face f(identity(nPts));
face f(identityMap(nPts));
point Cf = f.centre(pts);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -94,7 +94,7 @@ int main(int argc, char *argv[])
// Write the polygon
{
OBJstream os(args[0] + "_polygon.obj");
os.write(face(identity(polygon.size())), polygon, false);
os.write(face(identityMap(polygon.size())), polygon, false);
}
// Triangulate the polygon