diff --git a/src/regionModels/regionModel/regionModel/regionModel.C b/src/regionModels/regionModel/regionModel/regionModel.C index 5bf2951451580c3dd9a527a59088a88b5e97e3cd..8068660057bf972daf75f8df22371b766d7deed9 100644 --- a/src/regionModels/regionModel/regionModel/regionModel.C +++ b/src/regionModels/regionModel/regionModel/regionModel.C @@ -142,6 +142,27 @@ void Foam::regionModels::regionModel::initialise() << "Region model has no mapped boundary conditions - transfer " << "between regions will not be possible" << endl; } + + if (!outputPropertiesPtr_.valid()) + { + const fileName uniformPath(word("uniform")/"regionModels"); + + outputPropertiesPtr_.reset + ( + new IOdictionary + ( + IOobject + ( + regionName_ + "OutputProperties", + time_.timeName(), + uniformPath/regionName_, + primaryMesh_, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ) + ) + ); + } } @@ -389,6 +410,7 @@ Foam::regionModels::regionModel::regionModel modelName_("none"), regionMeshPtr_(NULL), coeffs_(dictionary::null), + outputPropertiesPtr_(NULL), primaryPatchIDs_(), intCoupledPatchIDs_(), regionName_("none"), @@ -424,6 +446,7 @@ Foam::regionModels::regionModel::regionModel modelName_(modelName), regionMeshPtr_(NULL), coeffs_(subOrEmptyDict(modelName + "Coeffs")), + outputPropertiesPtr_(NULL), primaryPatchIDs_(), intCoupledPatchIDs_(), regionName_(lookup("regionName")), @@ -471,6 +494,7 @@ Foam::regionModels::regionModel::regionModel modelName_(modelName), regionMeshPtr_(NULL), coeffs_(dict.subOrEmptyDict(modelName + "Coeffs")), + outputPropertiesPtr_(NULL), primaryPatchIDs_(), intCoupledPatchIDs_(), regionName_(dict.lookup("regionName")), diff --git a/src/regionModels/regionModel/regionModel/regionModel.H b/src/regionModels/regionModel/regionModel/regionModel.H index 83afc6898be4f61e57fbced338b25a8b19536af3..d77916c70b271d6c0c8a52f77b12c6e0a534c0ad 100644 --- a/src/regionModels/regionModel/regionModel/regionModel.H +++ b/src/regionModels/regionModel/regionModel/regionModel.H @@ -105,6 +105,9 @@ protected: //- Model coefficients dictionary dictionary coeffs_; + //- Dictionary of output properties + autoPtr<IOdictionary> outputPropertiesPtr_; + // Addressing @@ -216,6 +219,12 @@ public: //- Return the solution dictionary inline const dictionary& solution() const; + //- Return const access to the output properties dictionary + inline const IOdictionary& outputProperties() const; + + //- Return output properties dictionary + inline IOdictionary& outputProperties(); + // Addressing diff --git a/src/regionModels/regionModel/regionModel/regionModelI.H b/src/regionModels/regionModel/regionModel/regionModelI.H index 287fcc1920291ea3296dbf826f2c295770e781bd..95defc744eda93bc805bd1f83f00f33a1f5a0281 100644 --- a/src/regionModels/regionModel/regionModel/regionModelI.H +++ b/src/regionModels/regionModel/regionModel/regionModelI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -112,6 +112,42 @@ Foam::regionModels::regionModel::solution() const } +inline const Foam::IOdictionary& +Foam::regionModels::regionModel::outputProperties() const +{ + if (!outputPropertiesPtr_.valid()) + { + FatalErrorIn + ( + "inline const Foam::IOdictionary& " + "Foam::regionModels::regionModel::outputProperties() const" + ) + << "outputProperties dictionary not available" + << abort(FatalError); + } + + return outputPropertiesPtr_(); +} + + +inline Foam::IOdictionary& +Foam::regionModels::regionModel::outputProperties() +{ + if (!outputPropertiesPtr_.valid()) + { + FatalErrorIn + ( + "inline Foam::IOdictionary& " + "Foam::regionModels::regionModel::outputProperties()" + ) + << "outputProperties dictionary not available" + << abort(FatalError); + } + + return outputPropertiesPtr_(); +} + + inline bool Foam::regionModels::regionModel::isCoupledPatch ( const label regionPatchI