Files
openfoam/src/OpenFOAM/matrices/lduMatrix/solvers/PCG/PCG.H
Mark Olesen 4f1bb8345f lduMatrix now takes a dictionary instead of an Istream for the solver controls
- can now use dictionary substitutions and regular expressions in
    system/fvSolution

  - foamUpgradeFvSolution application to convert system/fvSolution
    (with -test option)

motion solver syntax left as-is.
2008-12-08 17:22:01 +01:00

111 lines
3.0 KiB
C++

/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::PCG
Description
Preconditioned conjugate gradient solver for symmetric lduMatrices
using a run-time selectable preconditioner.
SourceFiles
PCG.C
\*---------------------------------------------------------------------------*/
#ifndef PCG_H
#define PCG_H
#include "lduMatrix.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class PCG Declaration
\*---------------------------------------------------------------------------*/
class PCG
:
public lduMatrix::solver
{
// Private Member Functions
//- Disallow default bitwise copy construct
PCG(const PCG&);
//- Disallow default bitwise assignment
void operator=(const PCG&);
public:
//- Runtime type information
TypeName("PCG");
// Constructors
//- Construct from matrix components and solver controls
PCG
(
const word& fieldName,
const lduMatrix& matrix,
const FieldField<Field, scalar>& interfaceBouCoeffs,
const FieldField<Field, scalar>& interfaceIntCoeffs,
const lduInterfaceFieldPtrsList& interfaces,
const dictionary& solverControls
);
// Destructor
virtual ~PCG()
{}
// Member Functions
//- Solve the matrix with this solver
virtual lduMatrix::solverPerformance solve
(
scalarField& psi,
const scalarField& source,
const direction cmpt=0
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //