fvData: should have been part of the last commit.

This commit is contained in:
henry
2010-04-07 15:42:19 +01:00
parent ba390cee89
commit 9a22d7fa77
2 changed files with 175 additions and 0 deletions

View File

@ -0,0 +1,72 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "fvData.H"
#include "Time.H"
#include "lduMatrix.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
int Foam::fvData::debug(Foam::debug::debugSwitch("fvData", false));
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fvData::fvData(const objectRegistry& obr)
:
IOdictionary
(
IOobject
(
"fvData",
obr.time().system(),
obr,
IOobject::NO_READ,
IOobject::NO_WRITE
)
)
{
set("solverPerformance", dictionary());
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::dictionary& Foam::fvData::solverPerformanceDict() const
{
return subDict("solverPerformance");
}
void Foam::fvData::setSolverPerformance
(
const word& name,
const lduMatrix::solverPerformance& sp
) const
{
const_cast<dictionary&>(solverPerformanceDict()).set(name, sp);
}
// ************************************************************************* //

View File

@ -0,0 +1,103 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 3 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, see <http://www.gnu.org/licenses/>.
Class
Foam::fvData
Description
Database for finite volume solution data, solver performance and
other reduced data. fvMesh is derived from fvData so that all fields have
access to the fvData from the mesh reference they hold.
SourceFiles
fvData.C
\*---------------------------------------------------------------------------*/
#ifndef fvData_H
#define fvData_H
#include "IOdictionary.H"
#include "lduMatrix.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class fvData Declaration
\*---------------------------------------------------------------------------*/
class fvData
:
public IOdictionary
{
// Private Member Functions
//- Disallow default bitwise copy construct
fvData(const fvData&);
//- Disallow default bitwise assignment
void operator=(const fvData&);
public:
//- Debug switch
static int debug;
// Constructors
//- Construct for objectRegistry
fvData(const objectRegistry& obr);
// Member Functions
// Access
//- Return the dictionary of solver performance data
// which includes initial and final residuals for convergence
// checking
const dictionary& solverPerformanceDict() const;
//- Add/set the solverPerformance entry for the named field
void setSolverPerformance
(
const word& name,
const lduMatrix::solverPerformance&
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //