mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: improve consistency of ListOps and stringListOps
- subsetList, inplaceSubsetList with optional inverted logic. - use moveable elements where possible. - allow optional starting offset for the identity global function. Eg, 'identity(10, start)' vs 'identity(10) + start'
This commit is contained in:
@ -372,8 +372,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::agglomerate
|
||||
|
||||
// Local constructMap is just identity
|
||||
{
|
||||
tgtConstructMap[Pstream::myProcNo()] =
|
||||
identity(targetCoarseSize);
|
||||
tgtConstructMap[Pstream::myProcNo()] = identity(targetCoarseSize);
|
||||
}
|
||||
|
||||
labelList tgtCompactMap(map.constructSize());
|
||||
@ -1134,13 +1133,19 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::append
|
||||
{
|
||||
mapMap.append
|
||||
(
|
||||
identity(srcConstructMap[proci].size())
|
||||
+ mapMap.size() + newMapMap.size()
|
||||
identity
|
||||
(
|
||||
srcConstructMap[proci].size(),
|
||||
(mapMap.size() + newMapMap.size())
|
||||
)
|
||||
);
|
||||
newMapMap.append
|
||||
(
|
||||
identity(newSrcConstructMap[proci].size())
|
||||
+ mapMap.size() + newMapMap.size()
|
||||
identity
|
||||
(
|
||||
newSrcConstructMap[proci].size(),
|
||||
(mapMap.size() + newMapMap.size())
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -1188,13 +1193,19 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::append
|
||||
{
|
||||
mapMap.append
|
||||
(
|
||||
identity(tgtConstructMap[proci].size())
|
||||
+ mapMap.size() + newMapMap.size()
|
||||
identity
|
||||
(
|
||||
tgtConstructMap[proci].size(),
|
||||
(mapMap.size() + newMapMap.size())
|
||||
)
|
||||
);
|
||||
newMapMap.append
|
||||
(
|
||||
identity(newTgtConstructMap[proci].size())
|
||||
+ mapMap.size() + newMapMap.size()
|
||||
identity
|
||||
(
|
||||
newTgtConstructMap[proci].size(),
|
||||
(mapMap.size() + newMapMap.size())
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -1034,20 +1034,20 @@ Foam::extendedEdgeMesh::edgeTreesByType() const
|
||||
|
||||
// External edges
|
||||
sliceEdges[0] =
|
||||
identity(internalStart_ - externalStart_) + externalStart_;
|
||||
identity((internalStart_ - externalStart_), externalStart_);
|
||||
|
||||
// Internal edges
|
||||
sliceEdges[1] = identity(flatStart_ - internalStart_) + internalStart_;
|
||||
sliceEdges[1] = identity((flatStart_ - internalStart_), internalStart_);
|
||||
|
||||
// Flat edges
|
||||
sliceEdges[2] = identity(openStart_ - flatStart_) + flatStart_;
|
||||
sliceEdges[2] = identity((openStart_ - flatStart_), flatStart_);
|
||||
|
||||
// Open edges
|
||||
sliceEdges[3] = identity(multipleStart_ - openStart_) + openStart_;
|
||||
sliceEdges[3] = identity((multipleStart_ - openStart_), openStart_);
|
||||
|
||||
// Multiple edges
|
||||
sliceEdges[4] =
|
||||
identity(edges().size() - multipleStart_) + multipleStart_;
|
||||
identity((edges().size() - multipleStart_), multipleStart_);
|
||||
|
||||
forAll(edgeTreesByType_, i)
|
||||
{
|
||||
|
||||
@ -122,8 +122,7 @@ Foam::treeDataFace::treeDataFace
|
||||
mesh_(patch.boundaryMesh().mesh()),
|
||||
faceLabels_
|
||||
(
|
||||
identity(patch.size())
|
||||
+ patch.start()
|
||||
identity(patch.size(), patch.start())
|
||||
),
|
||||
isTreeFace_(mesh_.nFaces(), 0),
|
||||
cacheBb_(cacheBb)
|
||||
|
||||
@ -281,7 +281,7 @@ void Foam::mappedPatchBase::findSamples
|
||||
else
|
||||
{
|
||||
// patch faces
|
||||
const labelList patchFaces(identity(pp.size()) + pp.start());
|
||||
const labelList patchFaces(identity(pp.size(), pp.start()));
|
||||
|
||||
treeBoundBox patchBb
|
||||
(
|
||||
|
||||
@ -626,8 +626,7 @@ Foam::List<Foam::labelPair> Foam::localPointRegion::findDuplicateFacePairs
|
||||
// Faces to test: all boundary faces
|
||||
labelList testFaces
|
||||
(
|
||||
identity(mesh.nFaces()-mesh.nInternalFaces())
|
||||
+ mesh.nInternalFaces()
|
||||
identity(mesh.nFaces()-mesh.nInternalFaces(), mesh.nInternalFaces())
|
||||
);
|
||||
|
||||
// Find correspondencing baffle face (or -1)
|
||||
|
||||
@ -564,12 +564,7 @@ Foam::triSurfaceMesh::edgeTree() const
|
||||
// Boundary edges
|
||||
labelList bEdges
|
||||
(
|
||||
identity
|
||||
(
|
||||
nEdges()
|
||||
-nInternalEdges()
|
||||
)
|
||||
+ nInternalEdges()
|
||||
identity(nEdges() - nInternalEdges(), nInternalEdges())
|
||||
);
|
||||
|
||||
treeBoundBox bb(Zero, Zero);
|
||||
|
||||
Reference in New Issue
Block a user