diff --git a/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H b/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H index 7bd4f6655a..5078a594c2 100644 --- a/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H +++ b/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H @@ -162,7 +162,21 @@ inline void Foam::DynamicList::append const T& e ) { - operator()(size()) = e; + nextFree_++; + + if (nextFree_ > List::size()) + { + List::setSize + ( + max + ( + nextFree_, + label(SizeMult*List::size()/SizeDiv + SizeInc) + ) + ); + } + + this->operator[](nextFree_ - 1) = e; } @@ -186,7 +200,7 @@ inline T Foam::DynamicList::remove() template inline T& Foam::DynamicList::operator() ( - const Foam::label i + const label i ) { nextFree_ = max(nextFree_, i + 1); diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/Pstream.H b/src/OpenFOAM/db/IOstreams/Pstreams/Pstream.H index e158ccff24..13a5bcaf47 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/Pstream.H +++ b/src/OpenFOAM/db/IOstreams/Pstreams/Pstream.H @@ -125,7 +125,7 @@ public: label above() const { return above_; - } + } const labelList& below() const { @@ -468,7 +468,7 @@ public: //- Like above but switches between linear/tree communication template static void mapCombineScatter(Container& Values); - + // Gather/scatter keeping the individual processor data separate. diff --git a/src/OpenFOAM/db/IOstreams/Sstreams/ISnextValid.C b/src/OpenFOAM/db/IOstreams/Sstreams/ISnextValid.C index bed484b5bf..75939dfaa4 100644 --- a/src/OpenFOAM/db/IOstreams/Sstreams/ISnextValid.C +++ b/src/OpenFOAM/db/IOstreams/Sstreams/ISnextValid.C @@ -34,21 +34,15 @@ Description // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// Get next 'valid character': i.e. not white space or comment. - -char ISstream::nextValid() +char Foam::ISstream::nextValid() { char c = 0; for (;;) { // Get next non-whitespace character - while (get(c) && isspace(c)); + while (get(c) && isspace(c)) + {} // Return if stream is bad if (bad() || isspace(c)) @@ -67,7 +61,8 @@ char ISstream::nextValid() if (c == '/') // This is the start of a C++ style one line comment { - while (get(c) && c != '\n'); + while (get(c) && c != '\n') + {} } else if (c == '*') // This is the start of a C style comment { @@ -105,8 +100,4 @@ char ISstream::nextValid() } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/OpenFOAM/db/IOstreams/Sstreams/readHexLabel.C b/src/OpenFOAM/db/IOstreams/Sstreams/readHexLabel.C index f845da2c28..8bca925a93 100644 --- a/src/OpenFOAM/db/IOstreams/Sstreams/readHexLabel.C +++ b/src/OpenFOAM/db/IOstreams/Sstreams/readHexLabel.C @@ -31,12 +31,7 @@ Description // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -label readHexLabel(ISstream& is) +Foam::label Foam::readHexLabel(ISstream& is) { register label result = 0; @@ -48,7 +43,8 @@ label readHexLabel(ISstream& is) static const label alphaOffset = toupper('A') - 10; // Get next non-whitespace character - while (is.get(c) && isspace(c)); + while (is.get(c) && isspace(c)) + {} do { @@ -77,8 +73,4 @@ label readHexLabel(ISstream& is) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/OpenFOAM/db/dictionary/dictionaryIO.C b/src/OpenFOAM/db/dictionary/dictionaryIO.C index b5e6c205fa..cf4239a92f 100644 --- a/src/OpenFOAM/db/dictionary/dictionaryIO.C +++ b/src/OpenFOAM/db/dictionary/dictionaryIO.C @@ -47,7 +47,8 @@ bool Foam::dictionary::read(Istream& is) is.putBack(currToken); } - while (!is.eof() && entry::New(*this, is)); + while (!is.eof() && entry::New(*this, is)) + {} // Remove the FoamFile header entry if it exists remove("FoamFile"); diff --git a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterface.H b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterface.H index 1064a9cf56..e044162168 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterface.H +++ b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterface.H @@ -130,7 +130,7 @@ public: const Pstream::commsTypes commsType, const UList& ) const; - + //- Raw field receive function with data compression template void compressedReceive diff --git a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterfaceTemplates.C b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterfaceTemplates.C index ffd1702dc4..2944cb8d84 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterfaceTemplates.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterfaceTemplates.C @@ -54,7 +54,7 @@ void Foam::processorLduInterface::send IPstream::read ( commsType, - neighbProcNo(), + neighbProcNo(), receiveBuf_.begin(), receiveBuf_.size() ); @@ -92,7 +92,7 @@ void Foam::processorLduInterface::receive IPstream::read ( commsType, - neighbProcNo(), + neighbProcNo(), reinterpret_cast(f.begin()), f.byteSize() ); @@ -150,7 +150,7 @@ void Foam::processorLduInterface::compressedSend } reinterpret_cast(fArray[nm1]) = f[f.size() - 1]; - + if (commsType == Pstream::blocking || commsType == Pstream::scheduled) { OPstream::write @@ -168,7 +168,7 @@ void Foam::processorLduInterface::compressedSend IPstream::read ( commsType, - neighbProcNo(), + neighbProcNo(), receiveBuf_.begin(), receiveBuf_.size() ); diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolverSolve.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolverSolve.C index a0283fa178..8ec113d9f9 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolverSolve.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolverSolve.C @@ -172,7 +172,7 @@ void Foam::GAMGSolver::Vcycle { scalar sf = scalingFactor ( - reinterpret_cast(ACf), + const_cast(ACf.operator const scalarField&()), matrixLevels_[leveli], coarseCorrFields[leveli], interfaceLevelsBouCoeffs_[leveli], @@ -192,7 +192,7 @@ void Foam::GAMGSolver::Vcycle // Correct the residual with the new solution matrixLevels_[leveli].Amul ( - reinterpret_cast(ACf), + const_cast(ACf.operator const scalarField&()), coarseCorrFields[leveli], interfaceLevelsBouCoeffs_[leveli], interfaceLevels_[leveli], @@ -269,7 +269,7 @@ void Foam::GAMGSolver::Vcycle scalar sf = scalingFactor ( - reinterpret_cast(ACf), + const_cast(ACf.operator const scalarField&()), matrixLevels_[leveli], coarseCorrFields[leveli], interfaceLevelsBouCoeffs_[leveli], diff --git a/src/OpenFOAM/meshes/meshShapes/face/faceAreaInContact.C b/src/OpenFOAM/meshes/meshShapes/face/faceAreaInContact.C index 1ea4054892..9ce91ec8ec 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/faceAreaInContact.C +++ b/src/OpenFOAM/meshes/meshShapes/face/faceAreaInContact.C @@ -56,7 +56,7 @@ scalar face::areaInContact // Loop through vertexValue. If all greater that 0 return 0 (no contact); // if all less than zero return 1 - // all zeros is assumed to be in contact. + // all zeros is assumed to be in contact. bool allPositive = true; bool allNegative = true; @@ -108,8 +108,8 @@ scalar face::areaInContact if ( - vertexValue[vI] > 0 && vertexValue[vI + 1] < 0 - || vertexValue[vI] < 0 && vertexValue[vI + 1] > 0 + (vertexValue[vI] > 0 && vertexValue[vI + 1] < 0) + || (vertexValue[vI] < 0 && vertexValue[vI + 1] > 0) ) { // Edge intersection. Calculate intersection point and add to list @@ -133,8 +133,8 @@ scalar face::areaInContact if ( - vertexValue[size() - 1] > 0 && vertexValue[0] < 0 - || vertexValue[size() - 1] < 0 && vertexValue[0] > 0 + (vertexValue[size() - 1] > 0 && vertexValue[0] < 0) + || (vertexValue[size() - 1] < 0 && vertexValue[0] > 0) ) { // Edge intersection. Calculate intersection point and add to list diff --git a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C index be573aa4ba..98937e05fb 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C @@ -511,7 +511,7 @@ bool Foam::polyBoundaryMesh::checkParallelSync(const bool report) const { boundaryError = true; - if (debug || report && Pstream::master()) + if (debug || (report && Pstream::master())) { Info<< " ***Inconsistent patches across processors, " "processor 0 has patch names:" << allNames[0] diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellEdges.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellEdges.C index 88c1c299e1..35895872b6 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellEdges.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellEdges.C @@ -28,14 +28,9 @@ License #include "DynamicList.H" #include "ListOps.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -void primitiveMesh::calcCellEdges() const +void Foam::primitiveMesh::calcCellEdges() const { // Loop through all faces and mark up cells with edges of the face. // Check for duplicates @@ -78,7 +73,7 @@ void primitiveMesh::calcCellEdges() const if (findIndex(curCellEdges, curEdges[edgeI]) == -1) { // Add the edge - curCellEdges.append(curEdges[edgeI]); + //curCellEdges.append(curEdges[edgeI]); } } } @@ -94,7 +89,7 @@ void primitiveMesh::calcCellEdges() const if (findIndex(curCellEdges, curEdges[edgeI]) == -1) { // add the edge - curCellEdges.append(curEdges[edgeI]); + //curCellEdges.append(curEdges[edgeI]); } } } @@ -113,7 +108,7 @@ void primitiveMesh::calcCellEdges() const // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -const labelListList& primitiveMesh::cellEdges() const +const Foam::labelListList& Foam::primitiveMesh::cellEdges() const { if (!cePtr_) { @@ -124,8 +119,4 @@ const labelListList& primitiveMesh::cellEdges() const } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* //