STYLE: remove unneed DynamicList::reserve() call

- DynamicList now has SizeMin=16, which eliminates the need for reserve()
  in some cases

- remove unused enrichedPatch static variable
This commit is contained in:
Mark Olesen
2017-12-17 13:47:12 +01:00
parent c70d7237e2
commit 8567ef594a
2 changed files with 4 additions and 18 deletions

View File

@ -176,9 +176,6 @@ class enrichedPatch
//- Estimated ratio of original-to-enriched face size //- Estimated ratio of original-to-enriched face size
static const label enrichedFaceRatio_; static const label enrichedFaceRatio_;
//- Estimated number of master face hits by slave points
static const label nFaceHits_;
//- Size of face on which the check is forced //- Size of face on which the check is forced
static const label maxFaceSizeDebug_; static const label maxFaceSizeDebug_;

View File

@ -28,11 +28,6 @@ License
#include "demandDrivenData.H" #include "demandDrivenData.H"
#include "DynamicList.H" #include "DynamicList.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const Foam::label Foam::enrichedPatch::nFaceHits_ = 4;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::enrichedPatch::calcMasterPointFaces() const void Foam::enrichedPatch::calcMasterPointFaces() const
@ -63,11 +58,8 @@ void Foam::enrichedPatch::calcMasterPointFaces() const
for (const label pointi : curFace) for (const label pointi : curFace)
{ {
DynamicList<label>& dynLst = mpf(pointi); // Get or create // Existing or auto-vivify DynamicList
mpf(pointi).append(facei);
dynLst.reserve(primitiveMesh::facesPerPoint_); // Min size for list
dynLst.append(facei);
} }
} }
@ -86,11 +78,8 @@ void Foam::enrichedPatch::calcMasterPointFaces() const
// Index of projected point corresponding to this slave point // Index of projected point corresponding to this slave point
const label mergedPointi = pointMergeMap()[slaveMeshPoints[pointi]]; const label mergedPointi = pointMergeMap()[slaveMeshPoints[pointi]];
DynamicList<label>& dynLst = mpf(mergedPointi); // Get or create // Existing or auto-vivify DynamicList
mpf(mergedPointi).append(slavePointFaceHits_[pointi].hitObject());
dynLst.reserve(primitiveMesh::facesPerPoint_); // Min size for list
dynLst.append(slavePointFaceHits_[pointi].hitObject());
} }
} }