diff --git a/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H b/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H index 7bd4f6655affdc380f238f8ee794f51e876fd7ae..5078a594c23708d23ef87fde25199c6db2c4f222 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<T, SizeInc, SizeMult, SizeDiv>::append const T& e ) { - operator()(size()) = e; + nextFree_++; + + if (nextFree_ > List<T>::size()) + { + List<T>::setSize + ( + max + ( + nextFree_, + label(SizeMult*List<T>::size()/SizeDiv + SizeInc) + ) + ); + } + + this->operator[](nextFree_ - 1) = e; } @@ -186,7 +200,7 @@ inline T Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::remove() template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv> inline T& Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::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 e158ccff2409a7aff6ab858e0fb1d508697e7409..13a5bcaf4744b3aa28881afc21c8ff1d2d77cb67 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 <class Container> 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 bed484b5bffdfdf3ef37fe5884d910aae7a4a90f..75939dfaa4c9b1ade173f4044a89c6a39ae3b362 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 f845da2c289930a54e9a05a5d08280020bfa23ac..8bca925a93e2d6eaff2726167673ca219d1d2334 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 b5e6c205fa490cbf33ebba4146f73bbb24531643..cf4239a92fcb1e93dbfb8ccca6b0b6a14f2dcf29 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 1064a9cf5698d8578693c6a62e4f14b503119129..e0441621688d2f7b9189c6444e9858cfced246ef 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<Type>& ) const; - + //- Raw field receive function with data compression template<class Type> void compressedReceive diff --git a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterfaceTemplates.C b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterfaceTemplates.C index ffd1702dc4dd81c6682dd73cade6d16e8b4105cb..2944cb8d84621ef304787d54380a5329595bbab6 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<char*>(f.begin()), f.byteSize() ); @@ -150,7 +150,7 @@ void Foam::processorLduInterface::compressedSend } reinterpret_cast<Type&>(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 a0283fa178257e44f527a6eda741e615fd7cbc30..8ec113d9f9049f41d7c54b640d821182f4767926 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<scalarField&>(ACf), + const_cast<scalarField&>(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<scalarField&>(ACf), + const_cast<scalarField&>(ACf.operator const scalarField&()), coarseCorrFields[leveli], interfaceLevelsBouCoeffs_[leveli], interfaceLevels_[leveli], @@ -269,7 +269,7 @@ void Foam::GAMGSolver::Vcycle scalar sf = scalingFactor ( - reinterpret_cast<scalarField&>(ACf), + const_cast<scalarField&>(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 1ea4054892b98c9ed9d9dfe37ec3423ac0c7fd0d..9ce91ec8ece145b8b1687ae979acdaed489e3537 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 be573aa4ba2b5cd9f8facf1fc77916330e5ea296..98937e05fb264ab094a2a09f8e49bb20eaaccecc 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 88c1c299e19dd9c328d8d451d262cb9494f1bca9..35895872b601bf61dd1bf531408f2e3410cd0ae9 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 - // ************************************************************************* //