PCICG.H 3.01 KB
Newer Older
Henry's avatar
Henry committed
1 2 3 4
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
OpenFOAM bot's avatar
OpenFOAM bot committed
5
    \\  /    A nd           | www.openfoam.com
Henry's avatar
Henry committed
6
     \\/     M anipulation  |
OpenFOAM bot's avatar
OpenFOAM bot committed
7
-------------------------------------------------------------------------------
OpenFOAM bot's avatar
OpenFOAM bot committed
8
    Copyright (C) 2011-2016 OpenFOAM Foundation
9
    Copyright (C) 2019 OpenCFD Ltd.
Henry's avatar
Henry committed
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
-------------------------------------------------------------------------------
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
28
    Foam::PCICG
Henry's avatar
Henry committed
29 30 31

Description
    Preconditioned conjugate gradient solver for symmetric lduMatrices
Henry Weller's avatar
Henry Weller committed
32
    using a run-time selectable preconditioner.
Henry's avatar
Henry committed
33 34

SourceFiles
35
    PCICG.C
Henry's avatar
Henry committed
36 37 38

\*---------------------------------------------------------------------------*/

39 40
#ifndef PCICG_H
#define PCICG_H
Henry's avatar
Henry committed
41 42 43 44 45 46 47 48 49

#include "LduMatrix.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{

/*---------------------------------------------------------------------------*\
50
                           Class PCICG Declaration
Henry's avatar
Henry committed
51 52 53
\*---------------------------------------------------------------------------*/

template<class Type, class DType, class LUType>
54
class PCICG
Henry's avatar
Henry committed
55 56 57 58 59
:
    public LduMatrix<Type, DType, LUType>::solver
{
    // Private Member Functions

60 61
        //- No copy construct
        PCICG(const PCICG&) = delete;
Henry's avatar
Henry committed
62

63 64
        //- No copy assignment
        void operator=(const PCICG&) = delete;
Henry's avatar
Henry committed
65 66 67 68 69


public:

    //- Runtime type information
70
    TypeName("PCICG");
Henry's avatar
Henry committed
71 72 73 74 75


    // Constructors

        //- Construct from matrix components and solver data dictionary
76
        PCICG
Henry's avatar
Henry committed
77 78 79 80 81 82 83 84 85
        (
            const word& fieldName,
            const LduMatrix<Type, DType, LUType>& matrix,
            const dictionary& solverDict
        );


    // Destructor

86
        virtual ~PCICG() = default;
Henry's avatar
Henry committed
87 88 89 90 91


    // Member Functions

        //- Solve the matrix with this solver
92
        virtual SolverPerformance<Type> solve(Field<Type>& psi) const;
Henry's avatar
Henry committed
93 94 95 96 97 98 99 100 101 102
};


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

} // End namespace Foam

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#ifdef NoRepository
103
    #include "PCICG.C"
Henry's avatar
Henry committed
104 105 106 107 108 109 110
#endif

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#endif

// ************************************************************************* //