diff --git a/src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionary.C b/src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionary.C index 2f1b3383f5..6b34384df0 100644 --- a/src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionary.C +++ b/src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionary.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 @@ -137,7 +137,7 @@ Foam::IOdictionary::IOdictionary(const IOobject& io) } // Everyone check or just master - bool masterOnly = + bool masterOnly = regIOobject::fileModificationChecking == timeStampMaster || regIOobject::fileModificationChecking == inotifyMaster; @@ -195,7 +195,7 @@ Foam::IOdictionary::IOdictionary(const IOobject& io, const dictionary& dict) } // Everyone check or just master - bool masterOnly = + bool masterOnly = regIOobject::fileModificationChecking == timeStampMaster || regIOobject::fileModificationChecking == inotifyMaster; @@ -239,6 +239,15 @@ Foam::IOdictionary::IOdictionary(const IOobject& io, const dictionary& dict) } +Foam::IOdictionary::IOdictionary(const IOobject& io, Istream& is) +: + regIOobject(io), + dictionary(is) +{ + dictionary::name() = IOobject::objectPath(); +} + + // * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * // Foam::IOdictionary::~IOdictionary() diff --git a/src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionary.H b/src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionary.H index cb66efd46f..581d9bec72 100644 --- a/src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionary.H +++ b/src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionary.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 @@ -75,6 +75,9 @@ public: //- Construct given an IOobject and dictionary IOdictionary(const IOobject&, const dictionary&); + //- Construct given an IOobject and Istream + IOdictionary(const IOobject&, Istream&); + //- Destructor virtual ~IOdictionary(); diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C index ee411f7e15..cecce00eae 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.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 @@ -95,17 +95,22 @@ Foam::tmp > Foam::GeometricField::readField(Istream& is) { - if (is.version() < 2.0) - { - FatalIOErrorIn + return readField + ( + IOdictionary ( - "GeometricField::readField(Istream&)", + IOobject + ( + this->name(), + this->time().timeName(), + this->db(), + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), is - ) << "IO versions < 2.0 are not supported." - << exit(FatalIOError); - } - - return readField(dictionary(is)); + ) + ); } @@ -384,45 +389,6 @@ Foam::GeometricField::GeometricField } -template class PatchField, class GeoMesh> -Foam::GeometricField::GeometricField -( - const IOobject& io, - const Mesh& mesh, - Istream& is -) -: - DimensionedField(io, mesh, dimless, false), - timeIndex_(this->time().timeIndex()), - field0Ptr_(NULL), - fieldPrevIterPtr_(NULL), - boundaryField_(*this, readField(is)) -{ - // Check compatibility between field and mesh - - if (this->size() != GeoMesh::size(this->mesh())) - { - FatalIOErrorIn - ( - "GeometricField::GeometricField" - "(const IOobject&, const Mesh&, Istream&)", - is - ) << " number of field elements = " << this->size() - << " number of mesh elements = " << GeoMesh::size(this->mesh()) - << exit(FatalIOError); - } - - readOldTimeIfPresent(); - - if (debug) - { - Info<< "Finishing read-construct of " - "GeometricField" - << endl << this->info() << endl; - } -} - - template class PatchField, class GeoMesh> Foam::GeometricField::GeometricField ( diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H index d276ebfcae..9c04299593 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.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 @@ -325,14 +325,6 @@ public: const Mesh& ); - //- Construct and read from given stream - GeometricField - ( - const IOobject&, - const Mesh&, - Istream& - ); - //- Construct from dictionary GeometricField (