Commit 25c74188 authored by sergio's avatar sergio

ENH: Adding lookupAndCheckout in basic thermo destructor to check out p field.

This was needed for application like postProcess.H in order to force the reading of thermal p on
every time.
parent 6978f49f
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
...@@ -159,6 +159,15 @@ Foam::volScalarField& Foam::basicThermo::lookupOrConstruct ...@@ -159,6 +159,15 @@ Foam::volScalarField& Foam::basicThermo::lookupOrConstruct
} }
void Foam::basicThermo::lookupAndCheckout(const char* name) const
{
if (db().foundObject<volScalarField>(name))
{
db().checkOut(*db()[name]);
}
}
Foam::basicThermo::basicThermo Foam::basicThermo::basicThermo
( (
const fvMesh& mesh, const fvMesh& mesh,
...@@ -280,7 +289,9 @@ Foam::autoPtr<Foam::basicThermo> Foam::basicThermo::New ...@@ -280,7 +289,9 @@ Foam::autoPtr<Foam::basicThermo> Foam::basicThermo::New
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::basicThermo::~basicThermo() Foam::basicThermo::~basicThermo()
{} {
lookupAndCheckout("p");
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
...@@ -83,12 +83,16 @@ protected: ...@@ -83,12 +83,16 @@ protected:
//- Construct as copy (not implemented) //- Construct as copy (not implemented)
basicThermo(const basicThermo&); basicThermo(const basicThermo&);
//- Look up or contruct field
volScalarField& lookupOrConstruct volScalarField& lookupOrConstruct
( (
const fvMesh& mesh, const fvMesh& mesh,
const char* name const char* name
) const; ) const;
//- Lookup and check out field
void lookupAndCheckout(const char* name) const;
//- Return the enthalpy/internal energy field boundary types //- Return the enthalpy/internal energy field boundary types
// by interrogating the temperature field boundary types // by interrogating the temperature field boundary types
wordList heBoundaryTypes(); wordList heBoundaryTypes();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment