diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.H b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.H index 910732fa7a..bcdd163834 100644 --- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.H +++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.H @@ -78,10 +78,8 @@ SourceFiles namespace Foam { -typedef treeDataPrimitivePatch - treeDataBPatch; - typedef PrimitivePatch bPatch; +typedef treeDataPrimitivePatch treeDataBPatch; /*---------------------------------------------------------------------------*\ Class backgroundMeshDecomposition Declaration diff --git a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C index 395ee77cbe..e64f6cb78f 100644 --- a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C +++ b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C @@ -1018,6 +1018,11 @@ int main(int argc, char *argv[]) // Update proc maps if (cellProcAddressing.headerOk()) + if + ( + cellProcAddressing.headerOk() + && cellProcAddressing.size() == mesh.nCells() + ) { Info<< "Renumbering processor cell decomposition map " << cellProcAddressing.name() << endl; @@ -1028,6 +1033,11 @@ int main(int argc, char *argv[]) ); } if (faceProcAddressing.headerOk()) + if + ( + faceProcAddressing.headerOk() + && faceProcAddressing.size() == mesh.nFaces() + ) { Info<< "Renumbering processor face decomposition map " << faceProcAddressing.name() << endl; @@ -1054,6 +1064,11 @@ int main(int argc, char *argv[]) } } if (pointProcAddressing.headerOk()) + if + ( + pointProcAddressing.headerOk() + && pointProcAddressing.size() == mesh.nPoints() + ) { Info<< "Renumbering processor point decomposition map " << pointProcAddressing.name() << endl; @@ -1173,21 +1188,41 @@ int main(int argc, char *argv[]) mesh.write(); if (cellProcAddressing.headerOk()) + if + ( + cellProcAddressing.headerOk() + && cellProcAddressing.size() == mesh.nCells() + ) { cellProcAddressing.instance() = mesh.facesInstance(); cellProcAddressing.write(); } if (faceProcAddressing.headerOk()) + if + ( + faceProcAddressing.headerOk() + && faceProcAddressing.size() == mesh.nFaces() + ) { faceProcAddressing.instance() = mesh.facesInstance(); faceProcAddressing.write(); } if (pointProcAddressing.headerOk()) + if + ( + pointProcAddressing.headerOk() + && pointProcAddressing.size() == mesh.nPoints() + ) { pointProcAddressing.instance() = mesh.facesInstance(); pointProcAddressing.write(); } if (boundaryProcAddressing.headerOk()) + if + ( + boundaryProcAddressing.headerOk() + && boundaryProcAddressing.size() == mesh.boundaryMesh().size() + ) { boundaryProcAddressing.instance() = mesh.facesInstance(); boundaryProcAddressing.write(); diff --git a/applications/utilities/preProcessing/setFields/setFields.C b/applications/utilities/preProcessing/setFields/setFields.C index 7b690d46f2..dfde514992 100644 --- a/applications/utilities/preProcessing/setFields/setFields.C +++ b/applications/utilities/preProcessing/setFields/setFields.C @@ -92,7 +92,15 @@ bool setCellFieldType field.boundaryField()[patchi].patchInternalField(); } - field.write(); + if (!field.write()) + { + FatalErrorIn + ( + "void setCellFieldType" + "(const fvMesh& mesh, const labelList& selectedCells," + "Istream& fieldValueStream)" + ) << "Failed writing field " << fieldName << endl; + } } else { @@ -260,7 +268,15 @@ bool setFaceFieldType } } - field.write(); + if (!field.write()) + { + FatalErrorIn + ( + "void setFaceFieldType" + "(const fvMesh& mesh, const labelList& selectedFaces," + "Istream& fieldValueStream)" + ) << "Failed writing field " << field.name() << exit(FatalError); + } } else { diff --git a/src/dynamicMesh/boundaryMesh/boundaryMesh.C b/src/dynamicMesh/boundaryMesh/boundaryMesh.C index 51be127dd7..4a705acead 100644 --- a/src/dynamicMesh/boundaryMesh/boundaryMesh.C +++ b/src/dynamicMesh/boundaryMesh/boundaryMesh.C @@ -924,10 +924,10 @@ Foam::labelList Foam::boundaryMesh::getNearest // Create the octrees indexedOctree < - treeDataPrimitivePatch + treeDataPrimitivePatch > leftTree ( - treeDataPrimitivePatch + treeDataPrimitivePatch ( false, // cacheBb leftPatch @@ -939,10 +939,10 @@ Foam::labelList Foam::boundaryMesh::getNearest ); indexedOctree < - treeDataPrimitivePatch + treeDataPrimitivePatch > rightTree ( - treeDataPrimitivePatch + treeDataPrimitivePatch ( false, // cacheBb rightPatch diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.H b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.H index 2e908b7318..35d0822d2a 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.H +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -249,9 +249,10 @@ class autoSnapDriver const indirectPrimitivePatch& pp, const scalarField& snapDist, - const List >& pointFaceNormals, + const List >& pointFaceSurfNormals, const List >& pointFaceDisp, const List >& pointFaceCentres, + const labelListList& pointFacePatchID, vectorField& patchAttraction, List& patchConstraints diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriverFeature.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriverFeature.C index 6347d5dd16..950849e15e 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriverFeature.C +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriverFeature.C @@ -71,14 +71,15 @@ namespace Foam } }; + template class listPlusEqOp { public: void operator() ( - List& x, - const List& y + List& x, + const List& y ) const { label sz = x.size(); @@ -486,7 +487,7 @@ void Foam::autoSnapDriver::binFeatureFaces const label pointI, - const List >& pointFaceNormals, + const List >& pointFaceSurfNormals, const List >& pointFaceDisp, const List >& pointFaceCentres, @@ -495,7 +496,7 @@ void Foam::autoSnapDriver::binFeatureFaces DynamicList