diff --git a/applications/solvers/discreteMethods/dsmc/dsmcFoam/dsmcFoam.C b/applications/solvers/discreteMethods/dsmc/dsmcFoam/dsmcFoam.C index cb068960e8..7a4d8ce8b9 100644 --- a/applications/solvers/discreteMethods/dsmc/dsmcFoam/dsmcFoam.C +++ b/applications/solvers/discreteMethods/dsmc/dsmcFoam/dsmcFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/applications/test/ptrList/Make/files b/applications/test/ptrList/Make/files deleted file mode 100644 index 2a4e0ad01b..0000000000 --- a/applications/test/ptrList/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -ptrListTest.C - -EXE = $(FOAM_USER_APPBIN)/ptrListTest diff --git a/applications/test/ptrList/Make/options b/applications/test/ptrList/Make/options deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/applications/test/ptrList/ptrListTest.C b/applications/test/ptrList/ptrListTest.C deleted file mode 100644 index 7b2f6722bc..0000000000 --- a/applications/test/ptrList/ptrListTest.C +++ /dev/null @@ -1,60 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 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 2 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, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -\*---------------------------------------------------------------------------*/ - -#include "PtrList.H" -#include "scalar.H" - -using namespace Foam; - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Main program: - -int main(int argc, char *argv[]) -{ - PtrList list(10); - - forAll(list, i) - { - list.set(i, new scalar(i)); - } - - for - ( - PtrList::iterator iter = list.begin(); - iter != list.end(); - ++iter - ) - { - Info<< *iter << endl; - } - - Info<< list << endl; - - return 0; -} - - -// ************************************************************************* // diff --git a/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C b/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C index 1bcee69984..1d034714ef 100644 --- a/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C +++ b/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C @@ -243,14 +243,7 @@ int main(int argc, char *argv[]) meshDict.lookup("mergePatchPairs") ); - if (mergePatchPairs.size()) - { - FatalErrorIn(args.executable()) - << "mergePatchPairs not currently supported." - << exit(FatalError); - } - - //// #include "mergePatchPairs.H" +# include "mergePatchPairs.H" } else { diff --git a/applications/utilities/mesh/generation/blockMesh/mergePatchPairs.C b/applications/utilities/mesh/generation/blockMesh/mergePatchPairs.H similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/mergePatchPairs.C rename to applications/utilities/mesh/generation/blockMesh/mergePatchPairs.H diff --git a/applications/utilities/mesh/manipulation/stitchMesh/stitchMesh.C b/applications/utilities/mesh/manipulation/stitchMesh/stitchMesh.C index e3536a5ad0..859ddf20a2 100644 --- a/applications/utilities/mesh/manipulation/stitchMesh/stitchMesh.C +++ b/applications/utilities/mesh/manipulation/stitchMesh/stitchMesh.C @@ -63,6 +63,7 @@ Description #include "slidingInterface.H" #include "perfectInterface.H" #include "IOobjectList.H" +#include "ReadFields.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -90,34 +91,6 @@ void checkPatch(const polyBoundaryMesh& bMesh, const word& name) } -// Read field -template -void readFields -( - const fvMesh& mesh, - const IOobjectList& objects, - PtrList& fields -) -{ - // Search list of objects for volScalarFields - IOobjectList fieldObjects(objects.lookupClass(GeoField::typeName)); - - // Construct the vol scalar fields - fields.setSize(fieldObjects.size()); - - label fieldi = 0; - for - ( - IOobjectList::iterator iter = fieldObjects.begin(); - iter != fieldObjects.end(); - ++iter - ) - { - fields.set(fieldi++, new GeoField(*iter(), mesh)); - } -} - - // Main program: int main(int argc, char *argv[]) @@ -343,7 +316,8 @@ int main(int argc, char *argv[]) cutZoneName, masterPatchName, slavePatchName, - tom // integral or partial + tom, // integral or partial + true // couple/decouple mode ) ); } @@ -355,30 +329,30 @@ int main(int argc, char *argv[]) // Read all current fvFields so they will get mapped Info<< "Reading all current volfields" << endl; PtrList volScalarFields; - readFields(mesh, objects, volScalarFields); + ReadFields(mesh, objects, volScalarFields); PtrList volVectorFields; - readFields(mesh, objects, volVectorFields); + ReadFields(mesh, objects, volVectorFields); PtrList volSphericalTensorFields; - readFields(mesh, objects, volSphericalTensorFields); + ReadFields(mesh, objects, volSphericalTensorFields); PtrList volSymmTensorFields; - readFields(mesh, objects, volSymmTensorFields); + ReadFields(mesh, objects, volSymmTensorFields); PtrList volTensorFields; - readFields(mesh, objects, volTensorFields); + ReadFields(mesh, objects, volTensorFields); //- uncomment if you want to interpolate surface fields (usually bad idea) //Info<< "Reading all current surfaceFields" << endl; //PtrList surfaceScalarFields; - //readFields(mesh, objects, surfaceScalarFields); + //ReadFields(mesh, objects, surfaceScalarFields); // //PtrList surfaceVectorFields; - //readFields(mesh, objects, surfaceVectorFields); + //ReadFields(mesh, objects, surfaceVectorFields); // //PtrList surfaceTensorFields; - //readFields(mesh, objects, surfaceTensorFields); + //ReadFields(mesh, objects, surfaceTensorFields); if (!overwrite) { @@ -394,11 +368,22 @@ int main(int argc, char *argv[]) if (overwrite) { mesh.setInstance(oldInstance); + stitcher.instance() = oldInstance; } Info << nl << "Writing polyMesh to time " << runTime.timeName() << endl; IOstream::defaultPrecision(10); - if (!mesh.write()) + + // Bypass runTime write (since only writes at outputTime) + if + ( + !runTime.objectRegistry::writeObject + ( + runTime.writeFormat(), + IOstream::currentVersion, + runTime.writeCompression() + ) + ) { FatalErrorIn(args.executable()) << "Failed writing polyMesh." diff --git a/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C b/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C index c8dd69c442..0140ba4e23 100644 --- a/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C +++ b/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C @@ -41,6 +41,7 @@ Description #include "pointFields.H" #include "cellIOList.H" #include "IOobjectList.H" +#include "IOPtrList.H" #include "writeMeshObject.H" #include "fieldDictionary.H" @@ -49,6 +50,14 @@ using namespace Foam; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +namespace Foam +{ + defineTemplateTypeNameAndDebug(IOPtrList, 0); +} + + +// Main program: + int main(int argc, char *argv[]) { timeSelector::addOptions(); @@ -67,6 +76,9 @@ int main(int argc, char *argv[]) writeMeshObject("neighbour", runTime); writeMeshObject("faces", runTime); writeMeshObject("points", runTime); + writeMeshObject >("cellZones", runTime); + writeMeshObject >("faceZones", runTime); + writeMeshObject >("pointZones", runTime); // Get list of objects from the database IOobjectList objects(runTime, runTime.timeName()); diff --git a/applications/utilities/miscellaneous/foamFormatConvert/writeMeshObject.H b/applications/utilities/miscellaneous/foamFormatConvert/writeMeshObject.H index 383154223e..10b6d83d90 100644 --- a/applications/utilities/miscellaneous/foamFormatConvert/writeMeshObject.H +++ b/applications/utilities/miscellaneous/foamFormatConvert/writeMeshObject.H @@ -61,8 +61,17 @@ inline bool writeMeshObject(const word& name, Time& runTime) Info<< " Reading " << io.headerClassName() << " : " << name << endl; + // Switch off type checking (for reading e.g. faceZones as + // generic list of dictionaries). + const word 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(); + Info<< " Writing " << name << endl; writeOk = meshObject.regIOobject::write(); } diff --git a/applications/utilities/postProcessing/miscellaneous/dsmcFieldsCalc/dsmcFieldsCalc.C b/applications/utilities/postProcessing/miscellaneous/dsmcFieldsCalc/dsmcFieldsCalc.C index 15c1153db5..95077df225 100644 --- a/applications/utilities/postProcessing/miscellaneous/dsmcFieldsCalc/dsmcFieldsCalc.C +++ b/applications/utilities/postProcessing/miscellaneous/dsmcFieldsCalc/dsmcFieldsCalc.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/applications/utilities/preProcessing/dsmcInitialise/dsmcInitialise.C b/applications/utilities/preProcessing/dsmcInitialise/dsmcInitialise.C index c2f797c17e..f8b831001d 100644 --- a/applications/utilities/preProcessing/dsmcInitialise/dsmcInitialise.C +++ b/applications/utilities/preProcessing/dsmcInitialise/dsmcInitialise.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/OpenFOAM/containers/Lists/ListOps/ListOps.H b/src/OpenFOAM/containers/Lists/ListOps/ListOps.H index 7de9239d04..1504fb4d78 100644 --- a/src/OpenFOAM/containers/Lists/ListOps/ListOps.H +++ b/src/OpenFOAM/containers/Lists/ListOps/ListOps.H @@ -73,7 +73,7 @@ void inplaceReorder(const UList