/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 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 .
Class
Foam::errorEstimate
Description
Residual error estimation
SourceFiles
errorEstimate.C
\*---------------------------------------------------------------------------*/
#ifndef errorEstimate_H
#define errorEstimate_H
#include "volFields.H"
#include "surfaceFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class errorEstimate Declaration
\*---------------------------------------------------------------------------*/
template
class errorEstimate
:
public refCount
{
// Private data
// Reference to GeometricField
const GeometricField& psi_;
//- Dimension set
dimensionSet dimensions_;
//- Cell residual pointer
Field residual_;
//- Normalisation factor
scalarField normFactor_;
// Private Member Functions
//- Return boundary condition types for the error field
wordList errorBCTypes() const;
public:
// Static data members
ClassName("errorEstimate");
// Constructors
//- Construct from components
errorEstimate
(
const GeometricField& psi,
const dimensionSet& ds,
const Field& res,
const scalarField& norm
);
//- Construct as copy
errorEstimate(const errorEstimate&);
//- Destructor
~errorEstimate();
// Member Functions
// Access
//- Return field
const GeometricField& psi() const
{
return psi_;
}
//- Return residual dimensions
const dimensionSet& dimensions() const
{
return dimensions_;
}
// Raw residual (for calculus)
Field& res()
{
return residual_;
}
const Field& res() const
{
return residual_;
}
// Error Estimate
//- Cell residual (volume intensive)
tmp > residual() const;
//- Normalisation factor
tmp normFactor() const;
//- Error estimate
tmp > error() const;
// Member Operators
void operator=(const errorEstimate&);
void operator=(const tmp >&);
void negate();
void operator+=(const errorEstimate&);
void operator+=(const tmp >&);
void operator-=(const errorEstimate&);
void operator-=(const tmp >&);
void operator+=(const GeometricField&);
void operator+=(const tmp >&);
void operator-=(const GeometricField&);
void operator-=(const tmp >&);
void operator+=(const dimensioned&);
void operator-=(const dimensioned&);
void operator*=(const volScalarField&);
void operator*=(const tmp&);
void operator*=(const dimensioned&);
// Friend Functions
// Friend Operators
};
// * * * * * * * * * * * * * * * Global functions * * * * * * * * * * * * * //
template
void checkMethod
(
const errorEstimate&,
const errorEstimate&,
const char*
);
template
void checkMethod
(
const errorEstimate&,
const GeometricField&,
const char*
);
template
void checkMethod
(
const errorEstimate&,
const dimensioned&,
const char*
);
// * * * * * * * * * * * * * * * Global operators * * * * * * * * * * * * * //
template
tmp > operator-
(
const errorEstimate&
);
template
tmp > operator-
(
const tmp >&
);
template
tmp > operator+
(
const errorEstimate&,
const errorEstimate&
);
template
tmp > operator+
(
const tmp >&,
const errorEstimate&
);
template
tmp > operator+
(
const errorEstimate&,
const tmp >&
);
template
tmp > operator+
(
const tmp >&,
const tmp >&
);
template
tmp > operator-
(
const errorEstimate&,
const errorEstimate&
);
template
tmp > operator-
(
const tmp >&,
const errorEstimate&
);
template
tmp > operator-
(
const errorEstimate&,
const tmp >&
);
template
tmp > operator-
(
const tmp >&,
const tmp >&
);
template
tmp > operator==
(
const errorEstimate&,
const errorEstimate&
);
template
tmp > operator==
(
const tmp >&,
const errorEstimate&
);
template
tmp > operator==
(
const errorEstimate&,
const tmp >&
);
template
tmp > operator==
(
const tmp >&,
const tmp >&
);
template
tmp > operator+
(
const errorEstimate&,
const GeometricField&
);
template
tmp > operator+
(
const tmp >&,
const GeometricField&
);
template
tmp > operator+
(
const errorEstimate&,
const tmp >&
);
template
tmp > operator+
(
const tmp >&,
const tmp >&
);
template
tmp > operator+
(
const GeometricField&,
const errorEstimate&
);
template
tmp > operator+
(
const GeometricField&,
const tmp >&
);
template
tmp > operator+
(
const tmp >&,
const errorEstimate&
);
template
tmp > operator+
(
const tmp >&,
const tmp >&
);
template
tmp > operator-
(
const errorEstimate&,
const GeometricField&
);
template
tmp > operator-
(
const tmp >&,
const GeometricField&
);
template
tmp > operator-
(
const errorEstimate&,
const tmp >&
);
template
tmp > operator-
(
const tmp >&,
const tmp >&
);
template
tmp > operator-
(
const GeometricField&,
const errorEstimate&
);
template
tmp > operator-
(
const GeometricField&,
const tmp >&
);
template
tmp > operator-
(
const tmp >&,
const errorEstimate&
);
template
tmp > operator-
(
const tmp >&,
const tmp >&
);
template
tmp > operator+
(
const tmp >&,
const dimensioned&
);
template
tmp > operator+
(
const dimensioned&,
const tmp >&
);
template
tmp > operator-
(
const tmp >&,
const dimensioned&
);
template
tmp > operator-
(
const dimensioned&,
const tmp >&
);
template
tmp > operator==
(
const errorEstimate&,
const GeometricField&
);
template
tmp > operator==
(
const tmp >&,
const GeometricField&
);
template
tmp > operator==
(
const errorEstimate&,
const tmp >&
);
template
tmp > operator==
(
const tmp >&,
const tmp >&
);
template
tmp > operator==
(
const errorEstimate&,
const dimensioned&
);
template
tmp > operator==
(
const tmp >&,
const dimensioned&
);
template
tmp > operator*
(
const volScalarField&,
const errorEstimate&
);
template
tmp > operator*
(
const volScalarField&,
const tmp >&
);
template
tmp > operator*
(
const tmp&,
const errorEstimate&
);
template
tmp > operator*
(
const tmp&,
const tmp >&
);
template
tmp > operator*
(
const dimensioned&,
const errorEstimate&
);
template
tmp > operator*
(
const dimensioned&,
const tmp >&
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "errorEstimate.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //