diff --git a/ReleaseNotes-dev b/ReleaseNotes-dev index fa6c09664b..227041536f 100644 --- a/ReleaseNotes-dev +++ b/ReleaseNotes-dev @@ -5,7 +5,7 @@ #+DATE: TBA #+LINK: http://www.openfoam.com #+OPTIONS: author:nil ^:{} -# Copyright (c) 2010 OpenCFD Ltd. +# Copyright (c) 2011 OpenCFD Ltd. * Overview OpenFOAM-dev is the latest major release of OpenFOAM including many new @@ -117,7 +117,7 @@ *** *New* compact binary I/O for faces and cells. This speeds up reading/writing meshes in binary. *** *Updated* runTimeModifiable + user selectable model to use for checking run-time modifiable - dictionaries: + dictionaries (see also doc/changes/inotify.txt): + timeStamp : use time stamp as before + inotify : use inotify instead of time stamp + timeStampMaster : only master checks and reads file. Slaves get file diff --git a/applications/test/globalMeshData/Test-globalMeshData.C b/applications/test/globalMeshData/Test-globalMeshData.C index 551e3e5365..6feaf5cc05 100644 --- a/applications/test/globalMeshData/Test-globalMeshData.C +++ b/applications/test/globalMeshData/Test-globalMeshData.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 @@ -50,133 +50,71 @@ int main(int argc, char *argv[]) const globalMeshData& globalData = mesh.globalData(); const indirectPrimitivePatch& coupledPatch = globalData.coupledPatch(); + const globalIndexAndTransform& transforms = globalData.globalTransforms(); - // Test:print (collocated) shared points + // Test:print shared points { - const labelListList& globalPointSlaves = - globalData.globalPointSlaves(); const mapDistribute& globalPointSlavesMap = globalData.globalPointSlavesMap(); + const labelListList& slaves = + globalData.globalPointSlaves(); + const labelListList& transformedSlaves = + globalData.globalPointTransformedSlaves(); + // Create field with my local data pointField coords(globalPointSlavesMap.constructSize()); SubList(coords, coupledPatch.nPoints()).assign ( coupledPatch.localPoints() ); - // Exchange data - globalPointSlavesMap.distribute(coords); + // Exchange data. Apply positional transforms. + globalPointSlavesMap.distribute(transforms, coords, true); // Print - forAll(globalPointSlaves, pointI) + forAll(slaves, pointI) { - const labelList& slavePoints = globalPointSlaves[pointI]; + const labelList& slavePoints = slaves[pointI]; if (slavePoints.size() > 0) { Pout<< "Master point:" << pointI << " coord:" << coords[pointI] - << " connected to slave points:" << endl; + << " connected to untransformed slave points:" << endl; forAll(slavePoints, i) { Pout<< " " << coords[slavePoints[i]] << endl; } } - } - } + const labelList& transformedSlavePoints = transformedSlaves[pointI]; - - // Test: (collocated) point to faces addressing - { - const labelListList& globalPointBoundaryFaces = - globalData.globalPointBoundaryFaces(); - const mapDistribute& globalPointBoundaryFacesMap = - globalData.globalPointBoundaryFacesMap(); - - label nBnd = mesh.nFaces()-mesh.nInternalFaces(); - - pointField fc(globalPointBoundaryFacesMap.constructSize()); - SubList(fc, nBnd).assign - ( - primitivePatch - ( - SubList - ( - mesh.faces(), - nBnd, - mesh.nInternalFaces() - ), - mesh.points() - ).faceCentres() - ); - - // Exchange data - globalPointBoundaryFacesMap.distribute(fc); - - // Print - forAll(globalPointBoundaryFaces, pointI) - { - const labelList& bFaces = globalPointBoundaryFaces[pointI]; - - Pout<< "Point:" << pointI - << " at:" << coupledPatch.localPoints()[pointI] - << " connected to faces:" << endl; - - forAll(bFaces, i) + if (transformedSlavePoints.size() > 0) { - Pout<< " " << fc[bFaces[i]] << endl; + Pout<< "Master point:" << pointI + << " coord:" << coords[pointI] + << " connected to transformed slave points:" << endl; + + forAll(transformedSlavePoints, i) + { + Pout<< " " << coords[transformedSlavePoints[i]] + << endl; + } } } } - - - - // Test:(collocated) point to cells addressing + // Test:print shared edges { - const labelList& boundaryCells = globalData.boundaryCells(); - const labelListList& globalPointBoundaryCells = - globalData.globalPointBoundaryCells(); - const mapDistribute& globalPointBoundaryCellsMap = - globalData.globalPointBoundaryCellsMap(); - - pointField cc(globalPointBoundaryCellsMap.constructSize()); - forAll(boundaryCells, i) - { - cc[i] = mesh.cellCentres()[boundaryCells[i]]; - } - - // Exchange data - globalPointBoundaryCellsMap.distribute(cc); - - // Print - forAll(globalPointBoundaryCells, pointI) - { - const labelList& bCells = globalPointBoundaryCells[pointI]; - - Pout<< "Point:" << pointI - << " at:" << coupledPatch.localPoints()[pointI] - << " connected to cells:" << endl; - - forAll(bCells, i) - { - Pout<< " " << cc[bCells[i]] << endl; - } - } - } - - - - // Test:print (collocated) shared edges - { - const labelListList& globalEdgeSlaves = - globalData.globalEdgeSlaves(); const mapDistribute& globalEdgeSlavesMap = globalData.globalEdgeSlavesMap(); + const labelListList& slaves = + globalData.globalEdgeSlaves(); + const labelListList& transformedSlaves = + globalData.globalEdgeTransformedSlaves(); // Test: distribute edge centres pointField ec(globalEdgeSlavesMap.constructSize()); @@ -188,13 +126,13 @@ int main(int argc, char *argv[]) ); } - // Exchange data - globalEdgeSlavesMap.distribute(ec); + // Exchange data Apply positional transforms. + globalEdgeSlavesMap.distribute(transforms, ec, true); // Print - forAll(globalEdgeSlaves, edgeI) + forAll(slaves, edgeI) { - const labelList& slaveEdges = globalEdgeSlaves[edgeI]; + const labelList& slaveEdges = slaves[edgeI]; if (slaveEdges.size() > 0) { @@ -207,10 +145,102 @@ int main(int argc, char *argv[]) Pout<< " " << ec[slaveEdges[i]] << endl; } } + const labelList& transformedSlaveEdges = transformedSlaves[edgeI]; + + if (transformedSlaveEdges.size() > 0) + { + Pout<< "Master edge:" << edgeI + << " centre:" << ec[edgeI] + << " connected to transformed slave edges:" << endl; + + forAll(transformedSlaveEdges, i) + { + Pout<< " " << ec[transformedSlaveEdges[i]] + << endl; + } + } } } + //// Test: (collocated) point to faces addressing + //{ + // const labelListList& globalPointBoundaryFaces = + // globalData.globalPointBoundaryFaces(); + // const mapDistribute& globalPointBoundaryFacesMap = + // globalData.globalPointBoundaryFacesMap(); + // + // label nBnd = mesh.nFaces()-mesh.nInternalFaces(); + // + // pointField fc(globalPointBoundaryFacesMap.constructSize()); + // SubList(fc, nBnd).assign + // ( + // primitivePatch + // ( + // SubList + // ( + // mesh.faces(), + // nBnd, + // mesh.nInternalFaces() + // ), + // mesh.points() + // ).faceCentres() + // ); + // + // // Exchange data + // globalPointBoundaryFacesMap.distribute(fc); + // + // // Print + // forAll(globalPointBoundaryFaces, pointI) + // { + // const labelList& bFaces = globalPointBoundaryFaces[pointI]; + // + // Pout<< "Point:" << pointI + // << " at:" << coupledPatch.localPoints()[pointI] + // << " connected to faces:" << endl; + // + // forAll(bFaces, i) + // { + // Pout<< " " << fc[bFaces[i]] << endl; + // } + // } + //} + // + // + //// Test:(collocated) point to cells addressing + //{ + // const labelList& boundaryCells = globalData.boundaryCells(); + // const labelListList& globalPointBoundaryCells = + // globalData.globalPointBoundaryCells(); + // const mapDistribute& globalPointBoundaryCellsMap = + // globalData.globalPointBoundaryCellsMap(); + // + // pointField cc(globalPointBoundaryCellsMap.constructSize()); + // forAll(boundaryCells, i) + // { + // cc[i] = mesh.cellCentres()[boundaryCells[i]]; + // } + // + // // Exchange data + // globalPointBoundaryCellsMap.distribute(cc); + // + // // Print + // forAll(globalPointBoundaryCells, pointI) + // { + // const labelList& bCells = globalPointBoundaryCells[pointI]; + // + // Pout<< "Point:" << pointI + // << " at:" << coupledPatch.localPoints()[pointI] + // << " connected to cells:" << endl; + // + // forAll(bCells, i) + // { + // Pout<< " " << cc[bCells[i]] << endl; + // } + // } + //} + + Info<< "End\n" << endl; return 0; diff --git a/applications/test/lduMatrix/Make/files b/applications/test/lduMatrix/Make/files deleted file mode 100644 index 69b87cfc1e..0000000000 --- a/applications/test/lduMatrix/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -Test-lduMatrix3.C - -EXE = $(FOAM_USER_APPBIN)/Test-lduMatrix diff --git a/applications/test/lduMatrix/Make/options b/applications/test/lduMatrix/Make/options deleted file mode 100644 index 725122ea1d..0000000000 --- a/applications/test/lduMatrix/Make/options +++ /dev/null @@ -1,4 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/finiteVolume/lnInclude - -EXE_LIBS = -lfiniteVolume diff --git a/applications/test/lduMatrix/Test-lduMatrix.C b/applications/test/lduMatrix/Test-lduMatrix.C deleted file mode 100644 index 963aa096a6..0000000000 --- a/applications/test/lduMatrix/Test-lduMatrix.C +++ /dev/null @@ -1,163 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "argList.H" -#include "Time.H" -#include "fvMesh.H" -#include "volFields.H" -#include "LduMatrix.H" -#include "diagTensorField.H" -#include "TPCG.H" -#include "TPBiCG.H" -#include "NoPreconditioner.H" - -using namespace Foam; - -typedef Foam::LduMatrix - lduVectorMatrix; -defineNamedTemplateTypeNameAndDebug(lduVectorMatrix, 0); - -typedef Foam::DiagonalSolver - lduVectorDiagonalSolver; -defineNamedTemplateTypeNameAndDebug(lduVectorDiagonalSolver, 0); - -template<> -const vector lduVectorMatrix::great_(1e15, 1e15, 1e15); - -template<> -const vector lduVectorMatrix::small_(1e-15, 1e-15, 1e-15); - -namespace Foam -{ - typedef LduMatrix::preconditioner - lduVectorPreconditioner; - defineTemplateRunTimeSelectionTable(lduVectorPreconditioner, symMatrix); - defineTemplateRunTimeSelectionTable(lduVectorPreconditioner, asymMatrix); - - typedef LduMatrix::smoother - lduVectorSmoother; - defineTemplateRunTimeSelectionTable(lduVectorSmoother, symMatrix); - defineTemplateRunTimeSelectionTable(lduVectorSmoother, asymMatrix); - - typedef LduMatrix::solver - lduVectorSolver; - defineTemplateRunTimeSelectionTable(lduVectorSolver, symMatrix); - defineTemplateRunTimeSelectionTable(lduVectorSolver, asymMatrix); - - typedef TPCG TPCGVector; - defineNamedTemplateTypeNameAndDebug(TPCGVector, 0); - - LduMatrix::solver:: - addsymMatrixConstructorToTable - addTPCGSymMatrixConstructorToTable_; - - typedef TPBiCG TPBiCGVector; - defineNamedTemplateTypeNameAndDebug(TPBiCGVector, 0); - - LduMatrix::solver:: - addasymMatrixConstructorToTable - addTPBiCGSymMatrixConstructorToTable_; - - typedef NoPreconditioner NoPreconditionerVector; - defineNamedTemplateTypeNameAndDebug(NoPreconditionerVector, 0); - - LduMatrix::preconditioner:: - addsymMatrixConstructorToTable - addNoPreconditionerSymMatrixConstructorToTable_; - - LduMatrix::preconditioner:: - addasymMatrixConstructorToTable - addNoPreconditionerAsymMatrixConstructorToTable_; -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Main program: - -int main(int argc, char *argv[]) -{ - -# include "setRootCase.H" - -# include "createTime.H" -# include "createMesh.H" - - volVectorField psi - ( - IOobject - ( - "U", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ); - - lduVectorMatrix testMatrix(mesh); - testMatrix.diag() = 2*pTraits::one; - testMatrix.source() = pTraits::one; - testMatrix.upper() = 0.1; - testMatrix.lower() = -0.1; - - Info<< testMatrix << endl; - - FieldField boundaryCoeffs(0); - FieldField internalCoeffs(0); - - autoPtr testMatrixSolver = - lduVectorMatrix::solver::New - ( - psi.name(), - testMatrix, - boundaryCoeffs, - internalCoeffs, - psi.boundaryField().interfaces(), - IStringStream - ( - "PBiCG" - "{" - " preconditioner none;" - " tolerance (1e-05 1e-05 1e-05);" - " relTol (0 0 0);" - "}" - )() - ); - - lduVectorMatrix::solverPerformance solverPerf = - testMatrixSolver->solve(psi); - - solverPerf.print(); - - Info<< psi << endl; - - Info<< "End\n" << endl; - - return 0; -} - - -// ************************************************************************* // diff --git a/applications/test/lduMatrix/Test-lduMatrix2.C b/applications/test/lduMatrix/Test-lduMatrix2.C deleted file mode 100644 index ec63ac95c3..0000000000 --- a/applications/test/lduMatrix/Test-lduMatrix2.C +++ /dev/null @@ -1,163 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "argList.H" -#include "Time.H" -#include "fvMesh.H" -#include "volFields.H" -#include "LduMatrix.H" -#include "tensorField.H" -#include "TPCG.H" -#include "TPBiCG.H" -#include "NoPreconditioner.H" - -using namespace Foam; - -typedef Foam::LduMatrix - lduVectorMatrix; -defineNamedTemplateTypeNameAndDebug(lduVectorMatrix, 0); - -typedef Foam::DiagonalSolver - lduVectorDiagonalSolver; -defineNamedTemplateTypeNameAndDebug(lduVectorDiagonalSolver, 0); - -template<> -const vector lduVectorMatrix::great_(1e15, 1e15, 1e15); - -template<> -const vector lduVectorMatrix::small_(1e-15, 1e-15, 1e-15); - -namespace Foam -{ - typedef LduMatrix::preconditioner - lduVectorPreconditioner; - defineTemplateRunTimeSelectionTable(lduVectorPreconditioner, symMatrix); - defineTemplateRunTimeSelectionTable(lduVectorPreconditioner, asymMatrix); - - typedef LduMatrix::smoother - lduVectorSmoother; - defineTemplateRunTimeSelectionTable(lduVectorSmoother, symMatrix); - defineTemplateRunTimeSelectionTable(lduVectorSmoother, asymMatrix); - - typedef LduMatrix::solver - lduVectorSolver; - defineTemplateRunTimeSelectionTable(lduVectorSolver, symMatrix); - defineTemplateRunTimeSelectionTable(lduVectorSolver, asymMatrix); - - typedef TPCG TPCGVector; - defineNamedTemplateTypeNameAndDebug(TPCGVector, 0); - - LduMatrix::solver:: - addsymMatrixConstructorToTable - addTPCGSymMatrixConstructorToTable_; - - typedef TPBiCG TPBiCGVector; - defineNamedTemplateTypeNameAndDebug(TPBiCGVector, 0); - - LduMatrix::solver:: - addasymMatrixConstructorToTable - addTPBiCGSymMatrixConstructorToTable_; - - typedef NoPreconditioner NoPreconditionerVector; - defineNamedTemplateTypeNameAndDebug(NoPreconditionerVector, 0); - - LduMatrix::preconditioner:: - addsymMatrixConstructorToTable - addNoPreconditionerSymMatrixConstructorToTable_; - - LduMatrix::preconditioner:: - addasymMatrixConstructorToTable - addNoPreconditionerAsymMatrixConstructorToTable_; -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Main program: - -int main(int argc, char *argv[]) -{ - -# include "setRootCase.H" - -# include "createTime.H" -# include "createMesh.H" - - volVectorField psi - ( - IOobject - ( - "U", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ); - - lduVectorMatrix testMatrix(mesh); - testMatrix.diag() = 2*I; - testMatrix.source() = pTraits::one; - testMatrix.upper() = 0.1; - testMatrix.lower() = -0.1; - - Info<< testMatrix << endl; - - FieldField boundaryCoeffs(0); - FieldField internalCoeffs(0); - - autoPtr testMatrixSolver = - lduVectorMatrix::solver::New - ( - psi.name(), - testMatrix, - //boundaryCoeffs, - //internalCoeffs, - //psi.boundaryField().interfaces(), - IStringStream - ( - "PBiCG" - "{" - " preconditioner none;" - " tolerance (1e-05 1e-05 1e-05);" - " relTol (0 0 0);" - "}" - )() - ); - - lduVectorMatrix::solverPerformance solverPerf = - testMatrixSolver->solve(psi); - - solverPerf.print(); - - Info<< psi << endl; - - Info<< "End\n" << endl; - - return 0; -} - - -// ************************************************************************* // diff --git a/applications/test/lduMatrix/Test-lduMatrix3.C b/applications/test/lduMatrix/Test-lduMatrix3.C deleted file mode 100644 index c33034d5e3..0000000000 --- a/applications/test/lduMatrix/Test-lduMatrix3.C +++ /dev/null @@ -1,148 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Application - icoFoam - -Description - Transient solver for incompressible, laminar flow of Newtonian fluids. - -\*---------------------------------------------------------------------------*/ - -#include "fvCFD.H" -#include "LduMatrix.H" -#include "diagTensorField.H" - -typedef LduMatrix lduVectorMatrix; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main(int argc, char *argv[]) -{ - -# include "setRootCase.H" - -# include "createTime.H" -# include "createMesh.H" -# include "createFields.H" -# include "initContinuityErrs.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - Info<< "\nStarting time loop\n" << endl; - - while (runTime.loop()) - { - Info<< "Time = " << runTime.timeName() << nl << endl; - -# include "readPISOControls.H" -# include "CourantNo.H" - - fvVectorMatrix UEqn - ( - fvm::ddt(U) - + fvm::div(phi, U) - - fvm::laplacian(nu, U) - ); - - fvVectorMatrix UEqnp(UEqn == -fvc::grad(p)); - - lduVectorMatrix U3Eqnp(mesh); - U3Eqnp.diag() = UEqnp.diag(); - U3Eqnp.upper() = UEqnp.upper(); - U3Eqnp.lower() = UEqnp.lower(); - U3Eqnp.source() = UEqnp.source(); - - UEqnp.addBoundaryDiag(U3Eqnp.diag(), 0); - UEqnp.addBoundarySource(U3Eqnp.source(), false); - - autoPtr U3EqnpSolver = - lduVectorMatrix::solver::New - ( - U.name(), - U3Eqnp, - dictionary - ( - IStringStream - ( - "{" - " solver PBiCG;" - " preconditioner DILU;" - " tolerance (1e-13 1e-13 1e-13);" - " relTol (0 0 0);" - "}" - )() - ) - ); - - U3EqnpSolver->solve(U).print(Info); - - // --- PISO loop - - for (int corr=0; corr(T::typeName) = word::null; + word oldTypeName; + if (disableHeaderChecking) + { + oldTypeName = T::typeName; + const_cast(T::typeName) = word::null; + } T meshObject(io); - const_cast(T::typeName) = oldTypeName; - // Fake type back to what was in field - const_cast(meshObject.type()) = io.headerClassName(); + if (disableHeaderChecking) + { + const_cast(T::typeName) = oldTypeName; + // Fake type back to what was in field + const_cast(meshObject.type()) = io.headerClassName(); + } Info<< " Writing " << name << endl; writeOk = meshObject.regIOobject::write(); diff --git a/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C b/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C index 8960ba7522..a447f8af63 100644 --- a/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C +++ b/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.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 @@ -910,7 +910,7 @@ int main(int argc, char *argv[]) ( args, runTime, - mesh.globalData().bb() + mesh.bounds() ); // Mesh distribution engine diff --git a/applications/utilities/postProcessing/sampling/sample/sampleDict b/applications/utilities/postProcessing/sampling/sample/sampleDict index 2c7bbe35af..cd0ae63fe4 100644 --- a/applications/utilities/postProcessing/sampling/sample/sampleDict +++ b/applications/utilities/postProcessing/sampling/sample/sampleDict @@ -231,6 +231,7 @@ surfaces // Sampling on triSurface type sampledTriSurfaceMesh; surface integrationPlane.stl; + source boundaryFaces; // sample cells or boundaryFaces interpolate true; } ); diff --git a/applications/utilities/surface/surfaceToPatch/surfaceToPatch.C b/applications/utilities/surface/surfaceToPatch/surfaceToPatch.C index f752631d72..d8a52f7643 100644 --- a/applications/utilities/surface/surfaceToPatch/surfaceToPatch.C +++ b/applications/utilities/surface/surfaceToPatch/surfaceToPatch.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 @@ -208,7 +208,7 @@ int main(int argc, char *argv[]) const scalar searchTol = args.optionLookupOrDefault("tol", 1e-3); // Get search box. Anything not within this box will not be considered. - const boundBox& meshBb = mesh.globalData().bb(); + const boundBox& meshBb = mesh.bounds(); const vector searchSpan = searchTol * meshBb.span(); Info<< "All boundary faces further away than " << searchTol diff --git a/bin/mpirunDebug b/bin/mpirunDebug index ebb3e5cd5c..b3eef1ea73 100755 --- a/bin/mpirunDebug +++ b/bin/mpirunDebug @@ -3,7 +3,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 @@ -145,12 +145,12 @@ fi # use FOAM_SETTINGS to pass command-line settings if [ "$FOAM_INST_DIR" ] then - sourceFoam='[ "$WM_PROJECT" ] || '"FOAM_INST_DIR=$FOAM_INST_DIR . $sourceFoam $FOAM_SETTINGS" + sourceFoam="FOAM_INST_DIR=$FOAM_INST_DIR . $sourceFoam $FOAM_SETTINGS" else - sourceFoam='[ "$WM_PROJECT" ] || '". $sourceFoam $FOAM_SETTINGS" + sourceFoam=". $sourceFoam $FOAM_SETTINGS" fi -echo "**sourceFoam:$sourceFoam $FOAM_SETTINGS" +echo "**sourceFoam:$sourceFoam" rm -f $PWD/mpirun.schema touch $PWD/mpirun.schema diff --git a/doc/changes/inotify.txt b/doc/changes/inotify.txt index 0c7969da81..0f91d7c03b 100644 --- a/doc/changes/inotify.txt +++ b/doc/changes/inotify.txt @@ -1,4 +1,6 @@ -2010-05-28 +http://www.openfoam.com +Copyright (c) 2011 OpenCFD Ltd. + Cleanup of automatic regIOobject rereading. - all files (usually only IOdictionary) that need to be monitored diff --git a/doc/changes/pointAndEdgeSync.txt b/doc/changes/pointAndEdgeSync.txt new file mode 100644 index 0000000000..7dd385acce --- /dev/null +++ b/doc/changes/pointAndEdgeSync.txt @@ -0,0 +1,41 @@ +http://www.openfoam.com +Copyright (c) 2011 OpenCFD Ltd. + +Some background on the new structure to synchronise point and edge data. The +building blocks: +- globalIndex : globally consecutive numbering of (untransformed) data. It +consists of a single label which starts at 0 on processor 0 and is numbered +consecutively on consecutive processors. The globalIndex class contains +functions to convert to/from processor and local index. + +- globalIndexAndTransform : all the transformations in a mesh. Because the +transformations (cyclics, processorCyclics) need to fill space there can +be only three independent transforms. This class contains functions to encode +local index,processor and transformation into a labelPair. + +- mapDistribute : contains constructors from local and remote data and +works out a compact storage scheme and returns corresponding indices into +the local storage and calculates a scheduling to get the local and remote +data into the local storage. The wanted data is + - untransformed: labelList(List) in globalIndex numbering + - transformed: labelPairList(List) in globalIndexAndTransform +See also mapDistribute.H + +- globalMeshData : works out and stores a mapDistribute to get hold +of coupled point or edge data: + - globalPointSlavesMap() : the map to get all coupled point data + into a compact form + - globalPointSlaves : per point (on the patch of coupled faces) the + indices into the compact data corresponding to untransformed connected + points + - globalPointTransformedSlaves : same but for transformed connected + points +See e.g. syncPointData which applies a reduction operator to data on +coupled points. Note that it needs to know whether the data is a position +(since might need separation() vector). + +These structures get used in e.g. +- syncTools : general synchronisation on points,edges, faces. The point and +edge synchronisation are thin wrappers around the globalMeshData functionality. +- volPointInterpolation : uses a mix of globalMeshData (for synchronising +collocated points) and patch-wise (for separated points). diff --git a/doc/changes/splitCyclic.txt b/doc/changes/splitCyclic.txt index 0797151faf..99f42b3194 100644 --- a/doc/changes/splitCyclic.txt +++ b/doc/changes/splitCyclic.txt @@ -1,3 +1,6 @@ +http://www.openfoam.com +Copyright (c) 2011 OpenCFD Ltd. + Short overview of the changes to have cyclics split into two halves. Cyclics diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index 9cc3dd17b9..372ce59ff2 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -42,6 +42,8 @@ primitives/SphericalTensor2D/sphericalTensor2D/sphericalTensor2D.C primitives/Vector2D/vector2D/vector2D.C primitives/complex/complex.C +primitives/globalIndexAndTransform/globalIndexAndTransform.C +primitives/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransform.C primitives/quaternion/quaternion.C primitives/septernion/septernion.C diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C index 5790d951eb..fd39d1d0f8 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.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 @@ -30,7 +30,6 @@ License #include "processorPolyPatch.H" #include "demandDrivenData.H" #include "globalPoints.H" -//#include "geomGlobalPoints.H" #include "polyMesh.H" #include "mapDistribute.H" #include "labelIOList.H" @@ -38,6 +37,7 @@ License #include "mergePoints.H" #include "matchPoints.H" #include "OFstream.H" +#include "globalIndexAndTransform.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -117,6 +117,126 @@ void Foam::globalMeshData::initProcAddr() } +void Foam::globalMeshData::calcSharedPoints() const +{ + if + ( + nGlobalPoints_ != -1 + || sharedPointLabelsPtr_.valid() + || sharedPointAddrPtr_.valid() + ) + { + FatalErrorIn("globalMeshData::calcSharedPoints()") + << "Shared point addressing already done" << abort(FatalError); + } + + // Calculate all shared points (exclude points that are only + // on two coupled patches). This does all the hard work. + globalPoints parallelPoints(mesh_, false, true); + + // Count the number of master points + label nMaster = 0; + forAll(parallelPoints.pointPoints(), i) + { + const labelList& pPoints = parallelPoints.pointPoints()[i]; + const labelList& transPPoints = + parallelPoints.transformedPointPoints()[i]; + + if (pPoints.size()+transPPoints.size() > 0) + { + nMaster++; + } + } + + // Allocate global numbers + globalIndex masterNumbering(nMaster); + + nGlobalPoints_ = masterNumbering.size(); + + + // Push master number to slaves + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // 1. Fill master and slave slots + nMaster = 0; + labelList master(parallelPoints.map().constructSize(), -1); + forAll(parallelPoints.pointPoints(), i) + { + const labelList& pPoints = parallelPoints.pointPoints()[i]; + const labelList& transPPoints = + parallelPoints.transformedPointPoints()[i]; + + if (pPoints.size()+transPPoints.size() > 0) + { + master[i] = masterNumbering.toGlobal(nMaster); + forAll(pPoints, j) + { + master[pPoints[j]] = master[i]; + } + forAll(transPPoints, j) + { + master[transPPoints[j]] = master[i]; + } + nMaster++; + } + } + + + // 2. Push slave slots back to local storage on originating processor + // For all the four types of points: + // - local master : already set + // - local transformed slave point : the reverse transform at + // reverseDistribute will have copied it back to its originating local + // point + // - remote untransformed slave point : sent back to originating processor + // - remote transformed slave point : the reverse transform will + // copy it back into the remote slot which then gets sent back to + // originating processor + + parallelPoints.map().reverseDistribute + ( + parallelPoints.map().constructSize(), + master + ); + + + // Collect all points that are a master or refer to a master. + nMaster = 0; + forAll(parallelPoints.pointPoints(), i) + { + if (master[i] != -1) + { + nMaster++; + } + } + + sharedPointLabelsPtr_.reset(new labelList(nMaster)); + labelList& sharedPointLabels = sharedPointLabelsPtr_(); + sharedPointAddrPtr_.reset(new labelList(nMaster)); + labelList& sharedPointAddr = sharedPointAddrPtr_(); + nMaster = 0; + + forAll(parallelPoints.pointPoints(), i) + { + if (master[i] != -1) + { + // I am master or slave + sharedPointLabels[nMaster] = i; + sharedPointAddr[nMaster] = master[i]; + nMaster++; + } + } + + if (debug) + { + Pout<< "globalMeshData : nGlobalPoints_:" << nGlobalPoints_ << nl + << "globalMeshData : sharedPointLabels_:" + << sharedPointLabelsPtr_().size() << nl + << "globalMeshData : sharedPointAddr_:" + << sharedPointAddrPtr_().size() << endl; + } +} + + // Given information about locally used edges allocate global shared edges. void Foam::globalMeshData::countSharedEdges ( @@ -166,7 +286,12 @@ void Foam::globalMeshData::countSharedEdges // clusters of shared points) void Foam::globalMeshData::calcSharedEdges() const { - if (nGlobalEdges_ != -1 || sharedEdgeLabelsPtr_ || sharedEdgeAddrPtr_) + if + ( + nGlobalEdges_ != -1 + || sharedEdgeLabelsPtr_.valid() + || sharedEdgeAddrPtr_.valid() + ) { FatalErrorIn("globalMeshData::calcSharedEdges()") << "Shared edge addressing already done" << abort(FatalError); @@ -370,12 +495,12 @@ void Foam::globalMeshData::calcSharedEdges() const } } - sharedEdgeLabelsPtr_ = new labelList(); - labelList& sharedEdgeLabels = *sharedEdgeLabelsPtr_; + sharedEdgeLabelsPtr_.reset(new labelList()); + labelList& sharedEdgeLabels = sharedEdgeLabelsPtr_(); sharedEdgeLabels.transfer(dynSharedEdgeLabels); - sharedEdgeAddrPtr_ = new labelList(); - labelList& sharedEdgeAddr = *sharedEdgeAddrPtr_; + sharedEdgeAddrPtr_.reset(new labelList()); + labelList& sharedEdgeAddr = sharedEdgeAddrPtr_(); sharedEdgeAddr.transfer(dynSharedEdgeAddr); if (debug) @@ -389,220 +514,41 @@ void Foam::globalMeshData::calcSharedEdges() const } -// Helper function to count coincident faces. This part used to be -// in updateMesh but I've had to move it to a separate function -// because of aliasing optimisation errors in icc9.1 on the -// Itanium. -Foam::label Foam::globalMeshData::countCoincidentFaces -( - const scalar tolDim, - const vectorField& separationDist -) -{ - label nCoincident = 0; - - forAll(separationDist, faceI) - { - if (mag(separationDist[faceI]) < tolDim) - { - // Faces coincide - nCoincident++; - } - } - return nCoincident; -} - - -void Foam::globalMeshData::calcGlobalPointSlaves -( - const globalPoints& globalData, - autoPtr& globalIndicesPtr, - autoPtr& globalPointSlavesPtr, - autoPtr& globalPointSlavesMapPtr -) const -{ - // Create global numbering for coupled points - globalIndicesPtr.reset - ( - new globalIndex(globalData.globalIndices()) - ); - const globalIndex& globalIndices = globalIndicesPtr(); - - // Create master to slave addressing. Empty for slave points. - globalPointSlavesPtr.reset - ( - new labelListList(coupledPatch().nPoints()) - ); - labelListList& globalPointSlaves = globalPointSlavesPtr(); - - - const Map