mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: region models - sub-models write to common output properties dictionary
This commit is contained in:
@ -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")),
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user