Commit fa5f40b1 authored by Mark Olesen's avatar Mark Olesen
Browse files

ENH: align method name with OpenFOAM changes

- appendUniq() instead of appendIfNotIn()

- IOobject::selectIO instead of decompositionModel::selectIO
parent f76034ed
......@@ -533,7 +533,7 @@ void Foam::Module::boundaryLayers::createLayerCells
DynList<label, 3> patchIDs;
forAll(fPatches, fpI)
{
patchIDs.appendIfNotIn(fPatches[fpI]);
patchIDs.appendUniq(fPatches[fpI]);
}
nodePatches.insert(std::make_pair(bPoints[iter->first], patchIDs));
......@@ -587,7 +587,7 @@ void Foam::Module::boundaryLayers::createLayerCells
DynList<label, 3> patchIDs;
forAll(pFaces, patchI)
{
patchIDs.appendIfNotIn(boundaryFacePatches[pFaces[patchI]]);
patchIDs.appendUniq(boundaryFacePatches[pFaces[patchI]]);
}
nodePatches.insert(std::make_pair(iter->first, patchIDs));
......@@ -607,7 +607,7 @@ void Foam::Module::boundaryLayers::createLayerCells
continue;
}
pKeys.appendIfNotIn(pKey);
pKeys.appendUniq(pKey);
}
if (pKeys.size() != 3)
......
......@@ -426,7 +426,7 @@ void Foam::Module::boundaryLayers::findPatchesToBeTreatedTogether()
const label size = cPatches[counter++];
for (label i = 0; i < size; ++i)
{
treatPatchesWithPatch_[patchI].appendIfNotIn
treatPatchesWithPatch_[patchI].appendUniq
(
cPatches[counter++]
);
......
......@@ -146,7 +146,7 @@ Foam::point Foam::Module::boundaryLayers::createNewVertex
{
if (!treatPatches[pPatches(bpI, patchI)])
{
otherPatches.appendIfNotIn
otherPatches.appendUniq
(
pPatches(bpI, patchI)
);
......@@ -860,7 +860,7 @@ void Foam::Module::boundaryLayers::createNewEdgeVerticesParallel
continue;
}
neiProcs.appendIfNotIn(neiProc);
neiProcs.appendUniq(neiProc);
}
if (pVertices[bpI] & EDGENODE)
......@@ -910,7 +910,7 @@ void Foam::Module::boundaryLayers::createNewEdgeVerticesParallel
{
if (!treatPatches[pPatches(bpI, patchI)])
{
otherPatches.appendIfNotIn(pPatches(bpI, patchI));
otherPatches.appendUniq(pPatches(bpI, patchI));
}
}
......@@ -1033,7 +1033,7 @@ void Foam::Module::boundaryLayers::createNewEdgeVerticesParallel
{
if (!treatPatches[pPatches(bpI, patchI)])
{
otherPatches.appendIfNotIn(pPatches(bpI, patchI));
otherPatches.appendUniq(pPatches(bpI, patchI));
}
}
......@@ -1060,7 +1060,7 @@ void Foam::Module::boundaryLayers::createNewEdgeVerticesParallel
{
if (!treatPatches[pPatches(bpI, patchI)])
{
otherPatches.appendIfNotIn(pPatches(bpI, patchI));
otherPatches.appendUniq(pPatches(bpI, patchI));
}
}
......
......@@ -267,7 +267,7 @@ public:
DynList<label>& ng = neiGroups[localGroupLabel[groupI]];
// store the connection over the inter-processor boundary
ng.appendIfNotIn(lp.second());
ng.appendUniq(lp.second());
}
}
};
......@@ -466,7 +466,7 @@ void Foam::Module::detectBoundaryLayers::analyseLayers()
forAll(facePatch, bfI)
{
patchToLayer[facePatch[bfI]].appendIfNotIn(layerAtBndFace_[bfI]);
patchToLayer[facePatch[bfI]].appendUniq(layerAtBndFace_[bfI]);
}
// all faces of a patch must be in the same layer
......
......@@ -1388,11 +1388,11 @@ void Foam::Module::extrudeLayer::updateBoundary()
{
if (origPointLabel_[f[pI]] < 0)
{
origPts.appendIfNotIn(f[pI]);
origPts.appendUniq(f[pI]);
}
else
{
origPts.appendIfNotIn(origPointLabel_[f[pI]]);
origPts.appendUniq(origPointLabel_[f[pI]]);
newPts.append(f[pI]);
}
}
......
......@@ -149,7 +149,7 @@ bool Foam::Module::refineBoundaryLayers::analyseLayers()
List<DynList<label>> groupsAtPatch(boundaries.size());
forAll(faceInLayer, bfI)
{
groupsAtPatch[facePatch[bfI]].appendIfNotIn(faceInLayer[bfI]);
groupsAtPatch[facePatch[bfI]].appendUniq(faceInLayer[bfI]);
}
// set the information which patches have an extruded layer
......
......@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2014-2017 Creative Fields, Ltd.
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
Author
Franjo Juretic (franjo.juretic@c-fields.com)
......@@ -206,7 +206,7 @@ public:
//- Append an element at the end of the list if it is not yet
//- present in the list (takes linear time)
inline void appendIfNotIn(const T& val);
inline void appendUniq(const T& val);
//- Remove and return the last element. Fatal on an empty list.
inline T remove();
......@@ -247,6 +247,15 @@ public:
Istream& is,
DynList<T, SizeMin>& list
);
// Housekeeping
//- Same as appendUniq()
void appendIfNotIn(const label rowI, const label val)
{
this->appendUniq(rowI, val);
}
};
......
......@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2014-2017 Creative Fields, Ltd.
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
Author
Franjo Juretic (franjo.juretic@c-fields.com)
......@@ -385,7 +385,7 @@ inline void Foam::Module::DynList<T, SizeMin>::append(const T& val)
template<class T, int SizeMin>
inline void Foam::Module::DynList<T, SizeMin>::appendIfNotIn(const T& val)
inline void Foam::Module::DynList<T, SizeMin>::appendUniq(const T& val)
{
if (!UList<T>::found(val))
{
......
......@@ -80,7 +80,7 @@ Istream& operator>>
template<class T, label width>
class FRWGraph
{
// Private data
// Private Data
//- list containing the data
LongList<T> data_;
......@@ -89,7 +89,8 @@ class FRWGraph
label nRows_;
// Private member functions
// Private Member Functions
//- check index
void checkIndex(const label i, const label j) const;
......
......@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2014-2017 Creative Fields, Ltd.
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
Author
Franjo Juretic (franjo.juretic@c-fields.com)
......@@ -180,7 +181,7 @@ public:
//- Append an element at the end of the list if it is not yet
//- present in the list (takes linear time)
inline void appendIfNotIn(const T& e);
inline void appendUniq(const T& e);
//- check if the element is in the list (takes linear time)
inline bool found(const T& e) const;
......@@ -235,6 +236,15 @@ public:
Istream&,
LongList<T, Offset>&
);
// Housekeeping
//- Same as appendUniq()
void appendIfNotIn(const label val)
{
this->appendUniq(val);
}
};
......
......@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2014-2017 Creative Fields, Ltd.
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
Author
Franjo Juretic (franjo.juretic@c-fields.com)
......@@ -292,7 +293,7 @@ inline void Foam::Module::LongList<T, Offset>::append(const T& e)
template<class T, int Offset>
inline void Foam::Module::LongList<T, Offset>::appendIfNotIn(const T& e)
inline void Foam::Module::LongList<T, Offset>::appendUniq(const T& e)
{
if (!found(e))
{
......
......@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2014-2017 Creative Fields, Ltd.
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
Author
Franjo Juretic (franjo.juretic@c-fields.com)
......@@ -232,7 +233,7 @@ public:
inline void append(const label rowI, const label);
//- Append an element to the given row if it does not exist there
inline void appendIfNotIn(const label rowI, const label);
inline void appendUniq(const label rowI, const label);
//- Set row with the list
template<class ListType>
......@@ -294,6 +295,15 @@ public:
VRWGraph<T, width>&
);
*/
// Housekeeping
//- Same as appendUniq()
void appendIfNotIn(const label rowI, const label val)
{
this->appendUniq(rowI, val);
}
};
......
......@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2014-2017 Creative Fields, Ltd.
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
Author
Franjo Juretic (franjo.juretic@c-fields.com)
......@@ -375,7 +376,7 @@ inline void Foam::Module::VRWGraph::append(const label rowI, const label el)
}
inline void Foam::Module::VRWGraph::appendIfNotIn
inline void Foam::Module::VRWGraph::appendUniq
(
const label rowI,
const label el
......
......@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2014-2017 Creative Fields, Ltd.
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
Author
Franjo Juretic (franjo.juretic@c-fields.com)
......@@ -107,7 +108,7 @@ public:
inline void append(const label);
//- Append an element to the given row if it does not exist there
inline void appendIfNotIn(const label);
inline void appendUniq(const label);
//- check if the element is in the given row (takes linear time)
inline bool found(const label e) const;
......@@ -134,6 +135,14 @@ public:
const graphRow<graphType>& r
);
// Housekeeping
//- Same as appendUniq()
void appendIfNotIn(const label val)
{
this->appendUniq(val);
}
};
......
......@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2014-2017 Creative Fields, Ltd.
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
Author
Franjo Juretic (franjo.juretic@c-fields.com)
......@@ -82,9 +83,9 @@ inline void Foam::Module::graphRow<graphType>::append(const label el)
template<class graphType>
inline void Foam::Module::graphRow<graphType>::appendIfNotIn(const label el)
inline void Foam::Module::graphRow<graphType>::appendUniq(const label el)
{
data_.appendIfNotIn(rowI_, el);
data_.appendUniq(rowI_, el);
}
......
......@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2014-2017 Creative Fields, Ltd.
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
Author
Franjo Juretic (franjo.juretic@c-fields.com)
......@@ -66,7 +67,7 @@ Ostream& operator<<(Ostream&, const subGraph<graphType>&);
template<class graphType>
class subGraph
{
// Private data
// Private Data
//- reference to the graph
graphType& data_;
......@@ -78,7 +79,7 @@ class subGraph
const label size_;
// Private member functions
// Private Member Functions
//- check index
inline void checkIndex(const label i) const;
......@@ -114,7 +115,7 @@ public:
inline void append(const label rowI, const label);
//- Append an element to the given row if it does not exist there
inline void appendIfNotIn(const label rowI, const label);
inline void appendUniq(const label rowI, const label);
//- check if the element is in the given row (takes linear time)
inline bool found(const label rowI, const label e) const;
......@@ -135,6 +136,15 @@ public:
Ostream&,
const subGraph<graphType>&
);
// Housekeeping
//- Same as appendUniq()
void appendIfNotIn(const label rowI, const label val)
{
this->appendUniq(rowI, val);
}
};
......
......@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2014-2017 Creative Fields, Ltd.
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
Author
Franjo Juretic (franjo.juretic@c-fields.com)
......@@ -100,13 +101,13 @@ inline void Foam::Module::subGraph<graphType>::append
template<class graphType>
inline void Foam::Module::subGraph<graphType>::appendIfNotIn
inline void Foam::Module::subGraph<graphType>::appendUniq
(
const label rowI,
const label el
)
{
data_.appendIfNotIn(start_ + rowI, el);
data_.appendUniq(start_ + rowI, el);
}
......
......@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2014-2017 Creative Fields, Ltd.
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
Author
Franjo Juretic (franjo.juretic@c-fields.com)
......@@ -316,8 +317,8 @@ Foam::label Foam::Module::help::groupMarking
if (neiGroup != -1)
{
localNeiGroups[groupI].appendIfNotIn(neiGroup);
localNeiGroups[neiGroup].appendIfNotIn(groupI);
localNeiGroups[groupI].appendUniq(neiGroup);
localNeiGroups[neiGroup].appendUniq(groupI);
}
}
......@@ -331,11 +332,11 @@ Foam::label Foam::Module::help::groupMarking
{
const DynList<label>& lGroups = localNeiGroups[groupI];
neighbouringGroups.appendIfNotIn(groupI, groupI);
neighbouringGroups.appendUniq(groupI, groupI);
forAll(lGroups, i)
{
neighbouringGroups.appendIfNotIn(groupI, lGroups[i]);
neighbouringGroups.appendUniq(groupI, lGroups[i]);
}
}
}
......@@ -488,8 +489,8 @@ Foam::label Foam::Module::help::groupMarking
{
const labelPair& lp = connections[i];
allGroups.appendIfNotIn(lp.first(), lp.second());
allGroups.appendIfNotIn(lp.second(), lp.first());
allGroups.appendUniq(lp.first(), lp.second());
allGroups.appendUniq(lp.second(), lp.first());
}
}
......
......@@ -437,7 +437,7 @@ void Foam::Module::partTetMesh::updateVertex
const label centreI = tets_[pointTets_(pointI, ptI)][2];
if (smoothVertex_[centreI] & FACECENTRE)
{
helper.appendIfNotIn(centreI);
helper.appendUniq(centreI);
}
}
......@@ -473,7 +473,7 @@ void Foam::Module::partTetMesh::updateVertex
const label centreI = tets_[pointTets_(pointI, ptI)][3];
if (smoothVertex_[centreI] & CELLCENTRE)
{
helper.appendIfNotIn(centreI);
helper.appendUniq(centreI);
}
}
......
......@@ -461,11 +461,11 @@ void Foam::Module::partTetMesh::createSMOOTHPointsOrdering() const
{
if (smoothVertex_[tet[i]] & (FACECENTRE + CELLCENTRE))
{
neiCentrePoints.appendIfNotIn(tet[i]);
neiCentrePoints.appendUniq(tet[i]);
}
else if (smoothVertex_[tet[i]] & SMOOTH)
{
neiSmoothPoints.appendIfNotIn(tet[i]);
neiSmoothPoints.appendUniq(tet[i]);
}
}
}
......@@ -483,7 +483,7 @@ void Foam::Module::partTetMesh::createSMOOTHPointsOrdering() const
{
if (smoothVertex_[tet[i]] & SMOOTH)
{
neiSmoothPoints.appendIfNotIn(tet[i]);
neiSmoothPoints.appendUniq(tet[i]);
}
}
}
......@@ -549,11 +549,11 @@ void Foam::Module::partTetMesh::createBOUNDARYPointsOrdering() const
{
if (smoothVertex_[tet[i]] & (FACECENTRE + CELLCENTRE))
{
neiCentrePoints.appendIfNotIn(tet[i]);
neiCentrePoints.appendUniq(tet[i]);
}
else if (smoothVertex_[tet[i]] & BOUNDARY)
{
neiSmoothPoints.appendIfNotIn(tet[i]);
neiSmoothPoints.appendUniq(tet[i]);
}
}
}
......@@ -571,7 +571,7 @@ void Foam::Module::partTetMesh::createBOUNDARYPointsOrdering() const
{
if (smoothVertex_[tet[i]] & BOUNDARY)
{
neiSmoothPoints.appendIfNotIn(tet[i]);
neiSmoothPoints.appendUniq(tet[i]);
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment