diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..99320914e0074c1110479d5afad17c0dbaa105a9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.dep +**/lnInclude/* +**/Make/**/* diff --git a/executables/cartesian2DMesh/cartesian2DMesh.C b/executables/cartesian2DMesh/cartesian2DMesh.C index 1a03a036769b465df621c75f6cdab46a68e535ef..91d954a2f2a2877ddfa9715eb152cace9a1f38ca 100644 --- a/executables/cartesian2DMesh/cartesian2DMesh.C +++ b/executables/cartesian2DMesh/cartesian2DMesh.C @@ -30,7 +30,6 @@ Description \*---------------------------------------------------------------------------*/ #include "argList.H" -#include "Time.H" #include "cartesian2DMeshGenerator.H" using namespace Foam; diff --git a/executables/pMesh/pMesh.C b/executables/pMesh/pMesh.C index 18c63b1594508ea5f2e7d7327bbc2332fc1f3430..644106e970bbd7b3a0b2406ff17015a4689fddca 100644 --- a/executables/pMesh/pMesh.C +++ b/executables/pMesh/pMesh.C @@ -30,7 +30,6 @@ Description \*---------------------------------------------------------------------------*/ #include "argList.H" -#include "Time.H" #include "voronoiMeshGenerator.H" using namespace Foam; diff --git a/executables/tetMesh/tetMesh.C b/executables/tetMesh/tetMesh.C index 307f590c10a39dcab4b72d7f336f297e6715ee80..3ebb6628bfa73e1853762300b10b4a4a20f6f4eb 100644 --- a/executables/tetMesh/tetMesh.C +++ b/executables/tetMesh/tetMesh.C @@ -30,7 +30,6 @@ Description \*---------------------------------------------------------------------------*/ #include "argList.H" -#include "Time.H" #include "tetMeshGenerator.H" using namespace Foam; diff --git a/meshLibrary/utilities/anisotropicMeshing/coordinateModification/boxScaling.C b/meshLibrary/utilities/anisotropicMeshing/coordinateModification/boxScaling.C index 020e69b5b26ccebdecbda8d5a5d2164b9bea7782..37f33240d0967108cb6fe68328aca4f0b3ccc9da 100644 --- a/meshLibrary/utilities/anisotropicMeshing/coordinateModification/boxScaling.C +++ b/meshLibrary/utilities/anisotropicMeshing/coordinateModification/boxScaling.C @@ -176,7 +176,7 @@ void boxScaling::boundingPlanes(PtrList&pl) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dictionary boxScaling::dict(bool ignoreType) const +dictionary boxScaling::dict(bool /*ignoreType*/) const { dictionary dict; diff --git a/meshLibrary/utilities/anisotropicMeshing/coordinateModification/coordinateModification.C b/meshLibrary/utilities/anisotropicMeshing/coordinateModification/coordinateModification.C index 2c34d94674412dda36287132b4c19b6a26bc709c..b383cab7e62f830652851fb93399cc1190857cde 100644 --- a/meshLibrary/utilities/anisotropicMeshing/coordinateModification/coordinateModification.C +++ b/meshLibrary/utilities/anisotropicMeshing/coordinateModification/coordinateModification.C @@ -46,7 +46,7 @@ coordinateModification::coordinateModification() coordinateModification::coordinateModification ( const word& name, - const dictionary& dict + const dictionary& /*dict*/ ) : name_(name) diff --git a/meshLibrary/utilities/anisotropicMeshing/coordinateModification/coordinateModifier.H b/meshLibrary/utilities/anisotropicMeshing/coordinateModification/coordinateModifier.H index 6e5a156d04806b8eadf7b911761247c802cad99d..e1c7c60b7843599f89754664990d9b97a2258f26 100644 --- a/meshLibrary/utilities/anisotropicMeshing/coordinateModification/coordinateModifier.H +++ b/meshLibrary/utilities/anisotropicMeshing/coordinateModification/coordinateModifier.H @@ -39,7 +39,6 @@ SourceFiles #include "word.H" #include "point.H" #include "coordinateModificationList.H" -#include "Time.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/meshLibrary/utilities/anisotropicMeshing/coordinateModification/planeScaling.C b/meshLibrary/utilities/anisotropicMeshing/coordinateModification/planeScaling.C index b782370963d6c01ad5a388bc3133ff4cc29457ba..3cf8aea3605a9014dd022daf26c8815cb84e53c8 100644 --- a/meshLibrary/utilities/anisotropicMeshing/coordinateModification/planeScaling.C +++ b/meshLibrary/utilities/anisotropicMeshing/coordinateModification/planeScaling.C @@ -153,7 +153,7 @@ void planeScaling::boundingPlanes(PtrList& pl) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dictionary planeScaling::dict(bool ignoreType) const +dictionary planeScaling::dict(bool /*ignoreType*/) const { dictionary dict; diff --git a/meshLibrary/utilities/boundaryLayers/boundaryLayers/boundaryLayersCreateVertices.C b/meshLibrary/utilities/boundaryLayers/boundaryLayers/boundaryLayersCreateVertices.C index bc8e9021ef39c50620353394d76bd1df60191c89..3aff65c60cbe72019a6e20fc0aed8364fd36b29b 100644 --- a/meshLibrary/utilities/boundaryLayers/boundaryLayers/boundaryLayersCreateVertices.C +++ b/meshLibrary/utilities/boundaryLayers/boundaryLayers/boundaryLayersCreateVertices.C @@ -686,7 +686,7 @@ void boundaryLayers::createNewPartitionVerticesParallel ( const labelLongList& procPoints, const List& pVertices, - const boolList& treatPatches + const boolList& /*treatPatches*/ ) { if( !Pstream::parRun() ) diff --git a/meshLibrary/utilities/checkMeshDict/checkMeshDict.C b/meshLibrary/utilities/checkMeshDict/checkMeshDict.C index 8d154e10bfcfe3eaac0e31c1b07257ed2d00c97c..3c490fde9b8e6c7fe7975379fb5a7bf56762ec46 100644 --- a/meshLibrary/utilities/checkMeshDict/checkMeshDict.C +++ b/meshLibrary/utilities/checkMeshDict/checkMeshDict.C @@ -860,7 +860,7 @@ void checkMeshDict::updatePatchCellSize void checkMeshDict::updateSubsetCellSize ( - const std::map& patchesFromPatch + const std::map& /*patchesFromPatch*/ ) { @@ -1028,7 +1028,7 @@ void checkMeshDict::updateRemoveCellsIntersectingPatches void checkMeshDict::updateObjectRefinements ( - const std::map& patchesFromPatch + const std::map& /*patchesFromPatch*/ ) { diff --git a/meshLibrary/utilities/containers/FRWGraph/FRWGraph.C b/meshLibrary/utilities/containers/FRWGraph/FRWGraph.C index 190d1f4c4b0e0793673e6901c6c3c3a810f02521..a8d351fde791b469560d3917c0fddf24aa3837f3 100644 --- a/meshLibrary/utilities/containers/FRWGraph/FRWGraph.C +++ b/meshLibrary/utilities/containers/FRWGraph/FRWGraph.C @@ -34,15 +34,34 @@ Foam::Ostream& Foam::operator<< const Foam::FRWGraph& DL ) { - os << DL.size() << "(" << endl; - for(register label i=0;iFoam::Ostream& Foam::operator<<" + "(Foam::Ostream& os, const Foam::FRWGraph&)" + ); + return os; } diff --git a/meshLibrary/utilities/containers/FRWGraph/FRWGraphI.H b/meshLibrary/utilities/containers/FRWGraph/FRWGraphI.H index 2a1a6ad583ffa7c9be5ccb2647af15b3e616e3f8..497735c5b7617bb2129ccd00f736a8284072f00a 100644 --- a/meshLibrary/utilities/containers/FRWGraph/FRWGraphI.H +++ b/meshLibrary/utilities/containers/FRWGraph/FRWGraphI.H @@ -36,7 +36,7 @@ void Foam::FRWGraph::checkIndex(const label i, const label j) const << " is not in range " << 0 << " and " << nRows_ << abort(FatalError); } - + if( (j < 0) || (j >= width) ) FatalErrorIn ( @@ -105,7 +105,7 @@ inline Foam::label Foam::FRWGraph::size() const } template -inline Foam::label Foam::FRWGraph::sizeOfRow(const label rowI) const +inline Foam::label Foam::FRWGraph::sizeOfRow(const label) const { return width; } @@ -155,10 +155,11 @@ inline bool Foam::FRWGraph::contains ) const { const label start = rowI * width; - for(register label i=0;i::containsAtPosition ) const { const label start = rowI * width; - for(register label i=0;i::operator() #ifdef FULLDEBUG checkIndex(i, j); #endif - + return data_[i * width + j]; } @@ -201,7 +203,7 @@ inline T& Foam::FRWGraph::operator() #ifdef FULLDEBUG checkIndex(i, j); #endif - + return data_[i * width + j]; } diff --git a/meshLibrary/utilities/containers/LongList/LongList.C b/meshLibrary/utilities/containers/LongList/LongList.C index f56faa655e063c06ecde0849178c80a9b1275ac7..2881d3840c9347fa0c52244f8ae202c07585aea6 100644 --- a/meshLibrary/utilities/containers/LongList/LongList.C +++ b/meshLibrary/utilities/containers/LongList/LongList.C @@ -202,7 +202,7 @@ Foam::Istream& Foam::operator>> if( listDelimiter == token::BEGIN_LIST ) { - for(register label i=0;i> DL[i]; @@ -223,7 +223,7 @@ Foam::Istream& Foam::operator>> "reading the single entry" ); - for(register label i=0;i::appendFromStream(Istream& is) if( listDelimiter == token::BEGIN_LIST ) { - for(register label i=0;i> this->operator[](origSize); ++origSize; @@ -328,7 +328,7 @@ void Foam::LongList::appendFromStream(Istream& is) "reading the single entry" ); - for(register label i=0;ioperator[](origSize) = element; ++origSize; @@ -346,31 +346,6 @@ void Foam::LongList::appendFromStream(Istream& is) forAll(buf, i) this->operator[](origSize++) = buf[i]; - /*const label blockSize = 1<> shift_; - const label currPos = origSize & mask_; - - Info << "Orig size " << origSize - << nl << "currBlock " << currBlock - << nl << "currPos " << currPos << endl; - - T* data = &dataPtr_[currBlock][currPos]; - - label bs = Foam::min(nextFree_-origSize, blockSize); - bs = Foam::min(blockSize - currPos, bs); - - Info << "bs " << bs << endl; - - is.read(reinterpret_cast(data), bs * sizeof(T)); - origSize += bs; - } */ - is.fatalCheck ( "appendFromStream(Istream& is)" diff --git a/meshLibrary/utilities/containers/LongList/LongList.H b/meshLibrary/utilities/containers/LongList/LongList.H index e28f7998cb34ac11dc61fed18671273c3efbf57e..5b39a8044c1f5c4824b8237be0e98484668adabe 100644 --- a/meshLibrary/utilities/containers/LongList/LongList.H +++ b/meshLibrary/utilities/containers/LongList/LongList.H @@ -41,7 +41,6 @@ SourceFiles #define LongList_H #include "label.H" -#include "longLong.H" #include "bool.H" #include "IOstreams.H" #include "error.H" diff --git a/meshLibrary/utilities/containers/LongList/LongListI.H b/meshLibrary/utilities/containers/LongList/LongListI.H index d590a3006ac92dcd5ac6ae7ee9f0422b58d8a0c1..122ad3c34d04115ddb629fcb7ec7cbb3920f30bb 100644 --- a/meshLibrary/utilities/containers/LongList/LongListI.H +++ b/meshLibrary/utilities/containers/LongList/LongListI.H @@ -78,7 +78,7 @@ inline void Foam::LongList::allocateSize(const label s) if( numblock1 < numBlocks_ ) { - for(register label i=numblock1;i numBlocks_ ) @@ -91,7 +91,8 @@ inline void Foam::LongList::allocateSize(const label s) } while( numblock1 > numAllocatedBlocks_ ); T** dataptr1 = new T*[numAllocatedBlocks_]; - for(register label i=0;i::allocateSize(const label s) dataPtr_ = dataptr1; } - for(register label i=numBlocks_;i::allocateSize(const label s) template void Foam::LongList::clearOut() { - for(register label i=0;i::appendIfNotIn(const T& e) template inline bool Foam::LongList::contains(const T& e) const { - for(register label i=0;i::containsAtPosition const T& e ) const { - for(register label i=0;i::newElmt(const label i) template inline void Foam::LongList::operator=(const T& t) { - for(register label i=0;i inline void Foam::LongList::operator=(const LongList& l) { setSize(l.size()); - for(register label i=0;i 0 ) os << token::SPACE; - + if( j ) os << token::SPACE; + os << DL(i, j); } - - os << token::END_LIST; + + os << token::END_LIST << nl; } - - os << nl << token::END_LIST; + + os << token::END_LIST; + + // Check state of IOstream + os.check + ( + "Foam::Ostream& Foam::operator<<(Foam::Ostream&, const Foam::VRWGraph&)" + ); + return os; } @@ -90,14 +97,14 @@ void Foam::VRWGraph::optimizeMemoryUsage() { newPosForNode[elI] = -1; } - + //- create new data for(label elI=0;elI& vrt, - const DynList& edges, - const DynList, 64>& edgeFaces + const DynList& /*vrt*/, + const DynList& /*edges*/, + const DynList, 64>& /*edgeFaces*/ ) { const cell& c = mesh_.cells()[cellI]; diff --git a/meshLibrary/utilities/faceDecomposition/decomposeFaces.C b/meshLibrary/utilities/faceDecomposition/decomposeFaces.C index f1903cc5794fa87ef1ccf1ca7ad5ea4e10e48954..8a23ef5af93e37b660227c64b5dfd3f8893099c8 100644 --- a/meshLibrary/utilities/faceDecomposition/decomposeFaces.C +++ b/meshLibrary/utilities/faceDecomposition/decomposeFaces.C @@ -370,7 +370,7 @@ void decomposeFaces::decomposeConcaveInternalFaces # endif //- decompose internal faces - for(register label faceI=0;faceIoperator<<(os); } -void processorBoundaryPatch::writeDict(Ostream& os) const +void processorBoundaryPatch::writeDict(Ostream& /*os*/) const { } diff --git a/meshLibrary/utilities/meshes/polyMeshGenChecks/polyMeshGenChecksGeometry.C b/meshLibrary/utilities/meshes/polyMeshGenChecks/polyMeshGenChecksGeometry.C index fd299864b2c60324a0bfbacc5c1a9755d90ed208..c44d09e9452e87adee76863670ee39eea199f3b0 100644 --- a/meshLibrary/utilities/meshes/polyMeshGenChecks/polyMeshGenChecksGeometry.C +++ b/meshLibrary/utilities/meshes/polyMeshGenChecks/polyMeshGenChecksGeometry.C @@ -367,7 +367,7 @@ bool checkFaceAreas const boolList* changedFacePtr ) { - const scalarField magFaceAreas = mag(mesh.addressingData().faceAreas()); + const vectorField& faceAreas = mesh.addressingData().faceAreas(); const labelList& own = mesh.owner(); const labelList& nei = mesh.neighbour(); @@ -384,12 +384,14 @@ bool checkFaceAreas # ifdef USE_OMP # pragma omp for schedule(guided) # endif - forAll(magFaceAreas, faceI) + forAll(faceAreas, faceI) { if( changedFacePtr && !changedFacePtr->operator[](faceI) ) continue; - if( magFaceAreas[faceI] < minFaceArea ) + const scalar magFaceArea = mag(faceAreas[faceI]); + + if( magFaceArea < minFaceArea ) { if( report ) { @@ -399,14 +401,14 @@ bool checkFaceAreas << "internal face " << faceI << " between cells " << own[faceI] << " and " << nei[faceI] << ". Face area magnitude = " - << magFaceAreas[faceI] << endl; + << magFaceArea << endl; } else { Pout<< "Zero or negative face area detected for " << "boundary face " << faceI << " next to cell " << own[faceI] << ". Face area magnitude = " - << magFaceAreas[faceI] << endl; + << magFaceArea << endl; } } @@ -419,8 +421,8 @@ bool checkFaceAreas } } - localMinArea = Foam::min(localMinArea, magFaceAreas[faceI]); - localMaxArea = Foam::max(localMaxArea, magFaceAreas[faceI]); + localMinArea = Foam::min(localMinArea, magFaceArea); + localMaxArea = Foam::max(localMaxArea, magFaceArea); } # ifdef USE_OMP @@ -1604,10 +1606,10 @@ void checkVolumeUniformity bool checkVolumeUniformity ( const polyMeshGen&, - const bool report, - const scalar warnUniform, - labelHashSet* setPtr, - const boolList* changedFacePtr + const bool /*report*/, + const scalar /*warnUniform*/, + labelHashSet* /*setPtr*/, + const boolList* /*changedFacePtr*/ ) { @@ -2120,7 +2122,7 @@ label findWorstQualityFaces ( const polyMeshGen& mesh, labelHashSet& badFaces, - const bool report, + const bool /*report*/, const boolList* activeFacePtr, const scalar relativeThreshold ) diff --git a/meshLibrary/utilities/meshes/polyMeshGenModifier/polyMeshGenModifierRemoveFaces.C b/meshLibrary/utilities/meshes/polyMeshGenModifier/polyMeshGenModifierRemoveFaces.C index be0cc13474eb3b6ce69d38fa44d652f60c41a9a8..89a5487ac6c1d0a6ac1ebda87f52c63a82328a78 100644 --- a/meshLibrary/utilities/meshes/polyMeshGenModifier/polyMeshGenModifierRemoveFaces.C +++ b/meshLibrary/utilities/meshes/polyMeshGenModifier/polyMeshGenModifierRemoveFaces.C @@ -187,7 +187,7 @@ void polyMeshGenModifier::removeFaces(const boolList& removeFace) neiProcNo[npI] = procBoundaries[patchI].neiProcNo(); nFacesInPatch[npI] = 0; - for(register label faceI=0;faceIpoints(); + const LongList& trias = this->facets(); + + //- check for inf and nan points + # ifdef USE_OMP + # pragma omp parallel for schedule(dynamic, 100) + # endif + forAll(pts, pointI) + { + const point& p = pts[pointI]; + + if( help::isnan(p) || help::isinf(p) ) + { + # ifdef USE_OMP + # pragma omp critical + # endif + { + FatalErrorIn + ( + "void triSurf::topologyCheck()" + ) << "Point " << pointI << " has invalid coordinates " + << p << exit(FatalError); + } + } + } + + //- check whether the nodes are within the scope + //- report duplicate nodes in the same triangle + # ifdef USE_OMP + # pragma omp parallel for schedule(dynamic, 100) + # endif + forAll(trias, triI) + { + const labelledTri& ltri = trias[triI]; + + forAll(ltri, pI) + { + if( ltri[pI] < 0 || (ltri[pI] >= pts.size()) ) + { + # ifdef USE_OMP + # pragma omp critical + # endif + FatalErrorIn + ( + "void triSurf::topologyCheck()" + ) << "Point " << ltri[pI] << " in triangle " << ltri + << " is out of scope 0 " << pts.size() << exit(FatalError); + } + + if( ltri[pI] == ltri[(pI+1)%3] || ltri[pI] == ltri[(pI+2)%3] ) + { + # ifdef USE_OMP + # pragma omp critical + # endif + WarningIn + ( + "void triSurf::topologyCheck()" + ) << "Triangle " << ltri << " has duplicated points. " + << "This may cause problems in the meshing process!" << endl; + } + } + } + + //- check feature edges + const edgeLongList& featureEdges = this->featureEdges(); + + # ifdef USE_OMP + # pragma omp parallel for schedule(dynamic, 100) + # endif + forAll(featureEdges, eI) + { + const edge& fe = featureEdges[eI]; + + forAll(fe, pI) + { + if( fe[pI] < 0 || (fe[pI] >= pts.size()) ) + { + # ifdef USE_OMP + # pragma omp critical + # endif + FatalErrorIn + ( + "void triSurf::topologyCheck()" + ) << "Feature edge " << fe << " point " << fe[pI] + << " is out of scope 0 " << pts.size() << exit(FatalError); + } + } + + if( fe.start() == fe.end() ) + { + # ifdef USE_OMP + # pragma omp critical + # endif + WarningIn + ( + "void triSurf::topologyCheck()" + ) << "Feature edge " << fe << " has duplicated points. " + << "This may cause problems in the meshing process!" << endl; + } + } + + //- check point subsets + DynList