diff --git a/applications/solvers/multiphase/bubbleFoam/wallFunctions.H b/applications/solvers/multiphase/bubbleFoam/wallFunctions.H index bc9e93c63d..0d04746840 100644 --- a/applications/solvers/multiphase/bubbleFoam/wallFunctions.H +++ b/applications/solvers/multiphase/bubbleFoam/wallFunctions.H @@ -4,6 +4,7 @@ scalar Cmu25 = ::pow(Cmu.value(), 0.25); scalar Cmu75 = ::pow(Cmu.value(), 0.75); scalar kappa_ = kappa.value(); + scalar nub_ = nub.value(); const fvPatchList& patches = mesh.boundary(); @@ -32,7 +33,7 @@ if (isA(currPatch)) { - const scalarField& nuw = nutb.boundaryField()[patchi]; + const scalarField& nutbw = nutb.boundaryField()[patchi]; scalarField magFaceGradU(mag(Ub.boundaryField()[patchi].snGrad())); @@ -43,7 +44,7 @@ scalar yPlus = Cmu25*y[patchi][facei] *::sqrt(k[faceCelli]) - /nub.value(); + /nub_; // For corner cells (with two boundary or more faces), @@ -59,7 +60,7 @@ if (yPlus > 11.6) { G[faceCelli] += - nuw[facei]*magFaceGradU[facei] + (nutbw[facei] + nub_)*magFaceGradU[facei] *Cmu25*::sqrt(k[faceCelli]) /(kappa_*y[patchi][facei]); } diff --git a/src/OpenFOAM/db/dynamicLibrary/dynamicCode/dynamicCodeContext.C b/src/OpenFOAM/db/dynamicLibrary/dynamicCode/dynamicCodeContext.C index 81c1a50ceb..93d6ebbdd7 100644 --- a/src/OpenFOAM/db/dynamicLibrary/dynamicCode/dynamicCodeContext.C +++ b/src/OpenFOAM/db/dynamicLibrary/dynamicCode/dynamicCodeContext.C @@ -46,7 +46,6 @@ Foam::dynamicCodeContext::dynamicCodeContext(const dictionary& dict) const entry& codeEntry = dict.lookupEntry("code", false, false); code_ = stringOps::trim(codeEntry.stream()); stringOps::inplaceExpand(code_, dict); - addLineDirective(code_, codeEntry.startLineNumber(), dict.name()); } // note: removes any leading/trailing whitespace @@ -64,7 +63,6 @@ Foam::dynamicCodeContext::dynamicCodeContext(const dictionary& dict) { include_ = stringOps::trim(includePtr->stream()); stringOps::inplaceExpand(include_, dict); - addLineDirective(include_, includePtr->startLineNumber(), dict.name()); } // optional @@ -92,6 +90,28 @@ Foam::dynamicCodeContext::dynamicCodeContext(const dictionary& dict) OSHA1stream os; os << include_ << options_ << libs_ << localCode_ << code_; sha1_ = os.digest(); + + + + // Add line number after calculating sha1 since includes processorDDD + // in path which differs between processors. + + { + const entry& codeEntry = dict.lookupEntry("code", false, false); + addLineDirective(code_, codeEntry.startLineNumber(), dict.name()); + } + if (includePtr) + { + addLineDirective(include_, includePtr->startLineNumber(), dict.name()); + } + if (optionsPtr) + { + addLineDirective(options_, optionsPtr->startLineNumber(), dict.name()); + } + if (libsPtr) + { + addLineDirective(libs_, libsPtr->startLineNumber(), dict.name()); + } } diff --git a/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C b/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C index c1a2b66f1e..85590cc5e2 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C +++ b/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -96,7 +96,8 @@ void Foam::plane::calcPntAndVec " const point&,\n" " const point&\n" ")\n" - ) << "Bad points." << abort(FatalError); + ) << "Bad points:" << point1 << ' ' << point2 << ' ' << point3 + << abort(FatalError); } unitVector_ = line12 ^ line23; @@ -112,7 +113,8 @@ void Foam::plane::calcPntAndVec " const point&,\n" " const point&\n" ")\n" - ) << "Plane normal defined with zero length" + ) << "Plane normal defined with zero length" << nl + << "Bad points:" << point1 << ' ' << point2 << ' ' << point3 << abort(FatalError); } @@ -137,7 +139,7 @@ Foam::plane::plane(const vector& normalVector) else { FatalErrorIn("plane::plane(const vector&)") - << "plane normal has zero length" + << "plane normal has zero length. basePoint:" << basePoint_ << abort(FatalError); } } @@ -158,7 +160,7 @@ Foam::plane::plane(const point& basePoint, const vector& normalVector) else { FatalErrorIn("plane::plane(const point&, const vector&)") - << "plane normal has zero length" + << "plane normal has zero length. basePoint:" << basePoint_ << abort(FatalError); } } @@ -228,8 +230,7 @@ Foam::plane::plane(const dictionary& dict) ( "plane::plane(const dictionary&)", dict - ) - << "Invalid plane type: " << planeType + ) << "Invalid plane type: " << planeType << abort(FatalIOError); } } @@ -250,7 +251,7 @@ Foam::plane::plane(Istream& is) else { FatalErrorIn("plane::plane(Istream& is)") - << "plane normal has zero length" + << "plane normal has zero length. basePoint:" << basePoint_ << abort(FatalError); } } diff --git a/src/OpenFOAM/primitives/strings/wordRe/wordRe.H b/src/OpenFOAM/primitives/strings/wordRe/wordRe.H index 8fd3eabc63..4136aa02cb 100644 --- a/src/OpenFOAM/primitives/strings/wordRe/wordRe.H +++ b/src/OpenFOAM/primitives/strings/wordRe/wordRe.H @@ -52,6 +52,7 @@ SourceFiles #include "word.H" #include "regExp.H" +#include "keyType.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -60,7 +61,6 @@ namespace Foam // Forward declaration of friend functions and operators class wordRe; - class Istream; class Ostream; @@ -119,6 +119,9 @@ public: //- Construct as copy inline wordRe(const wordRe&); + //- Construct from keyType + inline wordRe(const keyType&, const compOption=LITERAL); + //- Construct as copy of word inline wordRe(const word&); @@ -206,6 +209,10 @@ public: //- Copy word, never a regular expression inline const wordRe& operator=(const word&); + //- Copy keyType, auto-test for regular expression + // Always case sensitive + inline const wordRe& operator=(const keyType&); + //- Copy string, auto-test for regular expression // Always case sensitive inline const wordRe& operator=(const string&); diff --git a/src/OpenFOAM/primitives/strings/wordRe/wordReI.H b/src/OpenFOAM/primitives/strings/wordRe/wordReI.H index 713c003064..fcbd1c3845 100644 --- a/src/OpenFOAM/primitives/strings/wordRe/wordReI.H +++ b/src/OpenFOAM/primitives/strings/wordRe/wordReI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -65,6 +65,18 @@ inline Foam::wordRe::wordRe(const word& str) {} +inline Foam::wordRe::wordRe(const keyType& str, const compOption opt) +: + word(str, false), + re_() +{ + if (str.isPattern()) + { + compile(opt); + } +} + + inline Foam::wordRe::wordRe(const char* str, const compOption opt) : word(str, false), @@ -236,6 +248,17 @@ inline const Foam::wordRe& Foam::wordRe::operator=(const word& str) } +inline const Foam::wordRe& Foam::wordRe::operator=(const keyType& str) +{ + string::operator=(str); + if (str.isPattern()) + { + compile(); + } + return *this; +} + + inline const Foam::wordRe& Foam::wordRe::operator=(const string& str) { string::operator=(str); diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/combineFaces.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/combineFaces.C index 0d5d6ef768..e10e44d1ef 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/combineFaces.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/combineFaces.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -109,6 +109,12 @@ bool Foam::combineFaces::validFace return false; } + bool isNonManifold = bigFace.checkPointManifold(false, NULL); + if (isNonManifold) + { + return false; + } + // Check for convexness face f(getOutsideFace(bigFace)); @@ -984,6 +990,7 @@ void Foam::combineFaces::setUnrefinement zoneFlip // face flip in zone ) ); + restoredFaces.insert(masterFaceI, masterFaceI); // Add the previously removed faces for (label i = 1; i < faces.size(); i++) @@ -991,7 +998,7 @@ void Foam::combineFaces::setUnrefinement //Pout<< "Restoring removed face with vertices " << faces[i] // << endl; - meshMod.setAction + label faceI = meshMod.setAction ( polyAddFace ( @@ -1007,6 +1014,7 @@ void Foam::combineFaces::setUnrefinement zoneFlip // zoneFlip ) ); + restoredFaces.insert(faceI, masterFaceI); } // Clear out restored set diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C index 9d8e9ba2ca..4441e3a00d 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -302,6 +302,35 @@ void Foam::polyTopoChange::getMergeSets } +bool Foam::polyTopoChange::hasValidPoints(const face& f) const +{ + forAll(f, fp) + { + if (f[fp] < 0 || f[fp] >= points_.size()) + { + return false; + } + } + return true; +} + + +Foam::pointField Foam::polyTopoChange::facePoints(const face& f) const +{ + pointField points(f.size()); + forAll(f, fp) + { + if (f[fp] < 0 && f[fp] >= points_.size()) + { + FatalErrorIn("polyTopoChange::facePoints(const face&) const") + << "Problem." << abort(FatalError); + } + points[fp] = points_[f[fp]]; + } + return points; +} + + void Foam::polyTopoChange::checkFace ( const face& f, @@ -329,7 +358,14 @@ void Foam::polyTopoChange::checkFace << "f:" << f << " faceI(-1 if added face):" << faceI << " own:" << own << " nei:" << nei - << " patchI:" << patchI << abort(FatalError); + << " patchI:" << patchI << nl; + if (hasValidPoints(f)) + { + FatalError + << "points (removed points marked with " + << vector::max << ") " << facePoints(f); + } + FatalError << abort(FatalError); } } else @@ -344,7 +380,14 @@ void Foam::polyTopoChange::checkFace << "f:" << f << " faceI(-1 if added face):" << faceI << " own:" << own << " nei:" << nei - << " patchI:" << patchI << abort(FatalError); + << " patchI:" << patchI << nl; + if (hasValidPoints(f)) + { + FatalError + << "points (removed points marked with " + << vector::max << ") : " << facePoints(f); + } + FatalError << abort(FatalError); } if (nei <= own) @@ -358,7 +401,14 @@ void Foam::polyTopoChange::checkFace << "f:" << f << " faceI(-1 if added face):" << faceI << " own:" << own << " nei:" << nei - << " patchI:" << patchI << abort(FatalError); + << " patchI:" << patchI << nl; + if (hasValidPoints(f)) + { + FatalError + << "points (removed points marked with " + << vector::max << ") : " << facePoints(f); + } + FatalError << abort(FatalError); } } @@ -373,7 +423,14 @@ void Foam::polyTopoChange::checkFace << "f:" << f << " faceI(-1 if added face):" << faceI << " own:" << own << " nei:" << nei - << " patchI:" << patchI << abort(FatalError); + << " patchI:" << patchI << nl; + if (hasValidPoints(f)) + { + FatalError + << "points (removed points marked with " + << vector::max << ") : " << facePoints(f); + } + FatalError << abort(FatalError); } if (faceI >= 0 && faceI < faces_.size() && faceRemoved(faceI)) { @@ -386,7 +443,14 @@ void Foam::polyTopoChange::checkFace << "f:" << f << " faceI(-1 if added face):" << faceI << " own:" << own << " nei:" << nei - << " patchI:" << patchI << abort(FatalError); + << " patchI:" << patchI << nl; + if (hasValidPoints(f)) + { + FatalError + << "points (removed points marked with " + << vector::max << ") : " << facePoints(f); + } + FatalError << abort(FatalError); } forAll(f, fp) { @@ -401,7 +465,14 @@ void Foam::polyTopoChange::checkFace << "f:" << f << " faceI(-1 if added face):" << faceI << " own:" << own << " nei:" << nei - << " patchI:" << patchI << abort(FatalError); + << " patchI:" << patchI << nl; + if (hasValidPoints(f)) + { + FatalError + << "points (removed points marked with " + << vector::max << ") : " << facePoints(f); + } + FatalError << abort(FatalError); } } } @@ -729,8 +800,16 @@ void Foam::polyTopoChange::getFaceOrder << " neighbour " << faceNeighbour_[faceI] << " region " << region_[faceI] << endl << "This is usually caused by not specifying a patch for" - << " a boundary face." - << abort(FatalError); + << " a boundary face." << nl + << "Switch on the polyTopoChange::debug flag to catch" + << " this error earlier." << nl; + if (hasValidPoints(faces_[faceI])) + { + FatalError + << "points (removed points marked with " + << vector::max << ") " << facePoints(faces_[faceI]); + } + FatalError << abort(FatalError); } } } diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.H b/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.H index 1e5ae305ff..48b7862646 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.H +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -239,6 +239,12 @@ class polyTopoChange List& cellsFromCells ); + //- Are all face vertices valid + bool hasValidPoints(const face&) const; + + //- Return face points + pointField facePoints(const face& f) const; + //- Check inputs to modFace or addFace void checkFace ( diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 95ca51d2f6..446b64460a 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -208,9 +208,6 @@ $(interpolation)/interpolationPoint/pointMVCWeight.C $(interpolation)/interpolationPoint/makeInterpolationPoint.C volPointInterpolation = interpolation/volPointInterpolation -/* -$(volPointInterpolation)/pointPatchInterpolation/pointPatchInterpolation.C -*/ $(volPointInterpolation)/volPointInterpolation.C surfaceInterpolation = interpolation/surfaceInterpolation diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/correctedSnGrad/correctedSnGrad.C b/src/finiteVolume/finiteVolume/snGradSchemes/correctedSnGrad/correctedSnGrad.C index 88f0bc01c9..3440de6f66 100644 --- a/src/finiteVolume/finiteVolume/snGradSchemes/correctedSnGrad/correctedSnGrad.C +++ b/src/finiteVolume/finiteVolume/snGradSchemes/correctedSnGrad/correctedSnGrad.C @@ -56,7 +56,7 @@ Foam::fv::correctedSnGrad::fullGradCorrection gradScheme::New ( mesh, - mesh.gradScheme(vf.name()) + mesh.gradScheme("grad(" + vf.name() + ')') )().grad(vf, "grad(" + vf.name() + ')') ); tssf().rename("snGradCorr(" + vf.name() + ')'); @@ -108,7 +108,7 @@ Foam::fv::correctedSnGrad::correction gradScheme::cmptType>::New ( mesh, - mesh.gradScheme(ssf.name()) + mesh.gradScheme("grad(" + ssf.name() + ')') )() //gaussGrad::cmptType>(mesh) .grad(vf.component(cmpt)) diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwind.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwind.H index 6c00e4deb2..13b98512df 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwind.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwind.H @@ -111,7 +111,16 @@ public: mesh.gradScheme(gradSchemeName_) ) ) - {} + { + if (!schemeData.eof()) + { + IOWarningIn("linearUpwind(const fvMesh&, Istream&)", schemeData) + << "unexpected additional entries in stream." << nl + << " Only the name of the gradient scheme in the" + " 'gradSchemes' dictionary should be specified." + << endl; + } + } //- Construct from faceFlux and Istream linearUpwind @@ -131,7 +140,16 @@ public: mesh.gradScheme(gradSchemeName_) ) ) - {} + { + if (!schemeData.eof()) + { + IOWarningIn("linearUpwind(const fvMesh&, Istream&)", schemeData) + << "unexpected additional entries in stream." << nl + << " Only the name of the gradient scheme in the" + " 'gradSchemes' dictionary should be specified." + << endl; + } + } // Member Functions diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwindV.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwindV.H index 262d54115d..ce07b1017b 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwindV.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearUpwind/linearUpwindV.H @@ -110,7 +110,13 @@ public: mesh.gradScheme(gradSchemeName_) ) ) - {} + { + IOWarningIn("linearUpwindV(const fvMesh&, Istream&)", schemeData) + << "unexpected additional entries in stream." << nl + << " Only the name of the gradient scheme in the" + " 'gradSchemes' dictionary should be specified." + << endl; + } //- Construct from faceFlux and Istream linearUpwindV @@ -130,7 +136,13 @@ public: mesh.gradScheme(gradSchemeName_) ) ) - {} + { + IOWarningIn("linearUpwindV(const fvMesh&, Istream&)", schemeData) + << "unexpected additional entries in stream." << nl + << " Only the name of the gradient scheme in the" + " 'gradSchemes' dictionary should be specified." + << endl; + } // Member Functions diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C index cdaa9f83c7..a1e274d2c0 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C @@ -2615,9 +2615,12 @@ void Foam::autoLayerDriver::addLayers extrudeStatus ); - Info<< "Extruding " << countExtrusion(pp, extrudeStatus) - << " out of " << returnReduce(pp().size(), sumOp