mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
Legacy solver wrappers ICCG and BICCG removed
Instead of ICCG use PCG with the DIC preconditioner Instead of BICCG use PBiCG with the DILU preconditioner
This commit is contained in:
@ -75,7 +75,6 @@ DebugSwitches
|
|||||||
Analytical 0;
|
Analytical 0;
|
||||||
APIdiffCoefFunc 0;
|
APIdiffCoefFunc 0;
|
||||||
Ar 0;
|
Ar 0;
|
||||||
BICCG 0;
|
|
||||||
BirdCarreau 0;
|
BirdCarreau 0;
|
||||||
C10H22 0;
|
C10H22 0;
|
||||||
C12H26 0;
|
C12H26 0;
|
||||||
@ -158,7 +157,6 @@ DebugSwitches
|
|||||||
HerschelBulkley 0;
|
HerschelBulkley 0;
|
||||||
HrenyaSinclair 0;
|
HrenyaSinclair 0;
|
||||||
IC8H18 0;
|
IC8H18 0;
|
||||||
ICCG 0;
|
|
||||||
IDDESDelta 0;
|
IDDESDelta 0;
|
||||||
IDEA 0;
|
IDEA 0;
|
||||||
IFstream 0;
|
IFstream 0;
|
||||||
|
|||||||
@ -271,8 +271,6 @@ $(lduMatrix)/solvers/diagonalSolver/diagonalSolver.C
|
|||||||
$(lduMatrix)/solvers/smoothSolver/smoothSolver.C
|
$(lduMatrix)/solvers/smoothSolver/smoothSolver.C
|
||||||
$(lduMatrix)/solvers/PCG/PCG.C
|
$(lduMatrix)/solvers/PCG/PCG.C
|
||||||
$(lduMatrix)/solvers/PBiCG/PBiCG.C
|
$(lduMatrix)/solvers/PBiCG/PBiCG.C
|
||||||
$(lduMatrix)/solvers/ICCG/ICCG.C
|
|
||||||
$(lduMatrix)/solvers/BICCG/BICCG.C
|
|
||||||
|
|
||||||
$(lduMatrix)/smoothers/GaussSeidel/GaussSeidelSmoother.C
|
$(lduMatrix)/smoothers/GaussSeidel/GaussSeidelSmoother.C
|
||||||
$(lduMatrix)/smoothers/symGaussSeidel/symGaussSeidelSmoother.C
|
$(lduMatrix)/smoothers/symGaussSeidel/symGaussSeidelSmoother.C
|
||||||
|
|||||||
@ -1,113 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ 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 "BICCG.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(BICCG, 0);
|
|
||||||
|
|
||||||
lduMatrix::solver::addasymMatrixConstructorToTable<BICCG>
|
|
||||||
addBICCGSymMatrixConstructorToTable_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dictionary Foam::BICCG::solverDict
|
|
||||||
(
|
|
||||||
const scalar tol,
|
|
||||||
const scalar relTol
|
|
||||||
)
|
|
||||||
{
|
|
||||||
dictionary dict(IStringStream("solver PBiCG; preconditioner DILU;")());
|
|
||||||
dict.add("tolerance", tol);
|
|
||||||
dict.add("relTol", relTol);
|
|
||||||
|
|
||||||
return dict;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::dictionary Foam::BICCG::solverDict
|
|
||||||
(
|
|
||||||
Istream& is
|
|
||||||
)
|
|
||||||
{
|
|
||||||
scalar tol(readScalar(is));
|
|
||||||
scalar relTol(readScalar(is));
|
|
||||||
|
|
||||||
return solverDict(tol, relTol);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::BICCG::BICCG
|
|
||||||
(
|
|
||||||
const word& fieldName,
|
|
||||||
const lduMatrix& matrix,
|
|
||||||
const FieldField<Field, scalar>& interfaceBouCoeffs,
|
|
||||||
const FieldField<Field, scalar>& interfaceIntCoeffs,
|
|
||||||
const lduInterfaceFieldPtrsList& interfaces,
|
|
||||||
const dictionary& solverControls
|
|
||||||
)
|
|
||||||
:
|
|
||||||
PBiCG
|
|
||||||
(
|
|
||||||
fieldName,
|
|
||||||
matrix,
|
|
||||||
interfaceBouCoeffs,
|
|
||||||
interfaceIntCoeffs,
|
|
||||||
interfaces,
|
|
||||||
solverControls
|
|
||||||
)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::BICCG::BICCG
|
|
||||||
(
|
|
||||||
const word& fieldName,
|
|
||||||
const lduMatrix& matrix,
|
|
||||||
const FieldField<Field, scalar>& interfaceBouCoeffs,
|
|
||||||
const FieldField<Field, scalar>& interfaceIntCoeffs,
|
|
||||||
const lduInterfaceFieldPtrsList& interfaces,
|
|
||||||
const scalar tolerance,
|
|
||||||
const scalar relTol
|
|
||||||
)
|
|
||||||
:
|
|
||||||
PBiCG
|
|
||||||
(
|
|
||||||
fieldName,
|
|
||||||
matrix,
|
|
||||||
interfaceBouCoeffs,
|
|
||||||
interfaceIntCoeffs,
|
|
||||||
interfaces,
|
|
||||||
solverDict(tolerance, relTol)
|
|
||||||
)
|
|
||||||
{}
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,127 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ 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::BICCG
|
|
||||||
|
|
||||||
Description
|
|
||||||
Diagonal incomplete LU preconditioned BiCG solver derived from the general
|
|
||||||
preconditioned BiCG solver PBiCG but with the choice of preconditioner
|
|
||||||
pre-selected.
|
|
||||||
|
|
||||||
Deprecated
|
|
||||||
This solver is present for backward-compatibility and the PBiCG solver
|
|
||||||
should be used instead. (deprecated Apr 2008)
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
BICCG.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef BICCG_H
|
|
||||||
#define BICCG_H
|
|
||||||
|
|
||||||
#include "PBiCG.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class BICCG Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class BICCG
|
|
||||||
:
|
|
||||||
public PBiCG
|
|
||||||
{
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
|
||||||
BICCG(const BICCG&);
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
void operator=(const BICCG&);
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Return the dictionary constructed from the components.
|
|
||||||
// Needed for backward compatibility
|
|
||||||
static dictionary solverDict
|
|
||||||
(
|
|
||||||
const scalar tol,
|
|
||||||
const scalar relTol
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Return the dictionary constructed from the old-style data-stream.
|
|
||||||
// Needed for backward compatibility
|
|
||||||
static dictionary solverDict(Istream&);
|
|
||||||
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("BICCG");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from matrix components and solver data stream
|
|
||||||
BICCG
|
|
||||||
(
|
|
||||||
const word& fieldName,
|
|
||||||
const lduMatrix& matrix,
|
|
||||||
const FieldField<Field, scalar>& interfaceBouCoeffs,
|
|
||||||
const FieldField<Field, scalar>& interfaceIntCoeffs,
|
|
||||||
const lduInterfaceFieldPtrsList& interfaces,
|
|
||||||
const dictionary& solverControls
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Construct from matrix components and tolerances
|
|
||||||
BICCG
|
|
||||||
(
|
|
||||||
const word& fieldName,
|
|
||||||
const lduMatrix& matrix,
|
|
||||||
const FieldField<Field, scalar>& interfaceBouCoeffs,
|
|
||||||
const FieldField<Field, scalar>& interfaceIntCoeffs,
|
|
||||||
const lduInterfaceFieldPtrsList& interfaces,
|
|
||||||
const scalar tolerance,
|
|
||||||
const scalar relTol = 0.0
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~BICCG()
|
|
||||||
{}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -39,7 +39,7 @@ Description
|
|||||||
- Coarse matrix scaling: performed by correction scaling, using steepest
|
- Coarse matrix scaling: performed by correction scaling, using steepest
|
||||||
descent optimisation.
|
descent optimisation.
|
||||||
- Type of cycle: V-cycle with optional pre-smoothing.
|
- Type of cycle: V-cycle with optional pre-smoothing.
|
||||||
- Coarsest-level matrix solved using ICCG or BICCG.
|
- Coarsest-level matrix solved using PCG or PBiCG.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
GAMGSolver.C
|
GAMGSolver.C
|
||||||
@ -234,7 +234,7 @@ class GAMGSolver
|
|||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Interpolate the correction after injected prolongation and
|
//- Interpolate the correction after injected prolongation and
|
||||||
/// re-normalise
|
// re-normalise
|
||||||
void interpolate
|
void interpolate
|
||||||
(
|
(
|
||||||
scalarField& psi,
|
scalarField& psi,
|
||||||
@ -292,6 +292,21 @@ class GAMGSolver
|
|||||||
const direction cmpt=0
|
const direction cmpt=0
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
//- Create and return the dictionary to specify the PCG solver
|
||||||
|
// to solve the coarsest level
|
||||||
|
dictionary PCGsolverDict
|
||||||
|
(
|
||||||
|
const scalar tol,
|
||||||
|
const scalar relTol
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Create and return the dictionary to specify the PBiCG solver
|
||||||
|
// to solve the coarsest level
|
||||||
|
dictionary PBiCGsolverDict
|
||||||
|
(
|
||||||
|
const scalar tol,
|
||||||
|
const scalar relTol
|
||||||
|
) const;
|
||||||
|
|
||||||
//- Solve the coarsest level with either an iterative or direct solver
|
//- Solve the coarsest level with either an iterative or direct solver
|
||||||
void solveCoarsestLevel
|
void solveCoarsestLevel
|
||||||
|
|||||||
@ -24,8 +24,8 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "GAMGSolver.H"
|
#include "GAMGSolver.H"
|
||||||
#include "ICCG.H"
|
#include "PCG.H"
|
||||||
#include "BICCG.H"
|
#include "PBiCG.H"
|
||||||
#include "SubField.H"
|
#include "SubField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
@ -519,6 +519,34 @@ void Foam::GAMGSolver::initVcycle
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::dictionary Foam::GAMGSolver::PCGsolverDict
|
||||||
|
(
|
||||||
|
const scalar tol,
|
||||||
|
const scalar relTol
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
dictionary dict(IStringStream("solver PCG; preconditioner DIC;")());
|
||||||
|
dict.add("tolerance", tol);
|
||||||
|
dict.add("relTol", relTol);
|
||||||
|
|
||||||
|
return dict;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::dictionary Foam::GAMGSolver::PBiCGsolverDict
|
||||||
|
(
|
||||||
|
const scalar tol,
|
||||||
|
const scalar relTol
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
dictionary dict(IStringStream("solver PBiCG; preconditioner DILU;")());
|
||||||
|
dict.add("tolerance", tol);
|
||||||
|
dict.add("relTol", relTol);
|
||||||
|
|
||||||
|
return dict;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::GAMGSolver::solveCoarsestLevel
|
void Foam::GAMGSolver::solveCoarsestLevel
|
||||||
(
|
(
|
||||||
scalarField& coarsestCorrField,
|
scalarField& coarsestCorrField,
|
||||||
@ -584,15 +612,14 @@ void Foam::GAMGSolver::solveCoarsestLevel
|
|||||||
//
|
//
|
||||||
// if (allMatrix.asymmetric())
|
// if (allMatrix.asymmetric())
|
||||||
// {
|
// {
|
||||||
// coarseSolverPerf = BICCG
|
// coarseSolverPerf = PBiCG
|
||||||
// (
|
// (
|
||||||
// "coarsestLevelCorr",
|
// "coarsestLevelCorr",
|
||||||
// allMatrix,
|
// allMatrix,
|
||||||
// procInterfaceLevelsBouCoeffs_[coarsestLevel],
|
// procInterfaceLevelsBouCoeffs_[coarsestLevel],
|
||||||
// procInterfaceLevelsIntCoeffs_[coarsestLevel],
|
// procInterfaceLevelsIntCoeffs_[coarsestLevel],
|
||||||
// procInterfaceLevels_[coarsestLevel],
|
// procInterfaceLevels_[coarsestLevel],
|
||||||
// tolerance_,
|
// PBiCGsolverDict(tolerance_, relTol_)
|
||||||
// relTol_
|
|
||||||
// ).solve
|
// ).solve
|
||||||
// (
|
// (
|
||||||
// coarsestCorrField,
|
// coarsestCorrField,
|
||||||
@ -601,15 +628,14 @@ void Foam::GAMGSolver::solveCoarsestLevel
|
|||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
// coarseSolverPerf = ICCG
|
// coarseSolverPerf = PCG
|
||||||
// (
|
// (
|
||||||
// "coarsestLevelCorr",
|
// "coarsestLevelCorr",
|
||||||
// allMatrix,
|
// allMatrix,
|
||||||
// procInterfaceLevelsBouCoeffs_[coarsestLevel],
|
// procInterfaceLevelsBouCoeffs_[coarsestLevel],
|
||||||
// procInterfaceLevelsIntCoeffs_[coarsestLevel],
|
// procInterfaceLevelsIntCoeffs_[coarsestLevel],
|
||||||
// procInterfaceLevels_[coarsestLevel],
|
// procInterfaceLevels_[coarsestLevel],
|
||||||
// tolerance_,
|
// PCGsolverDict(tolerance_, relTol_)
|
||||||
// relTol_
|
|
||||||
// ).solve
|
// ).solve
|
||||||
// (
|
// (
|
||||||
// coarsestCorrField,
|
// coarsestCorrField,
|
||||||
@ -647,15 +673,14 @@ void Foam::GAMGSolver::solveCoarsestLevel
|
|||||||
|
|
||||||
if (matrixLevels_[coarsestLevel].asymmetric())
|
if (matrixLevels_[coarsestLevel].asymmetric())
|
||||||
{
|
{
|
||||||
coarseSolverPerf = BICCG
|
coarseSolverPerf = PBiCG
|
||||||
(
|
(
|
||||||
"coarsestLevelCorr",
|
"coarsestLevelCorr",
|
||||||
matrixLevels_[coarsestLevel],
|
matrixLevels_[coarsestLevel],
|
||||||
interfaceLevelsBouCoeffs_[coarsestLevel],
|
interfaceLevelsBouCoeffs_[coarsestLevel],
|
||||||
interfaceLevelsIntCoeffs_[coarsestLevel],
|
interfaceLevelsIntCoeffs_[coarsestLevel],
|
||||||
interfaceLevels_[coarsestLevel],
|
interfaceLevels_[coarsestLevel],
|
||||||
tolerance_,
|
PBiCGsolverDict(tolerance_, relTol_)
|
||||||
relTol_
|
|
||||||
).solve
|
).solve
|
||||||
(
|
(
|
||||||
coarsestCorrField,
|
coarsestCorrField,
|
||||||
@ -664,15 +689,14 @@ void Foam::GAMGSolver::solveCoarsestLevel
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
coarseSolverPerf = ICCG
|
coarseSolverPerf = PCG
|
||||||
(
|
(
|
||||||
"coarsestLevelCorr",
|
"coarsestLevelCorr",
|
||||||
matrixLevels_[coarsestLevel],
|
matrixLevels_[coarsestLevel],
|
||||||
interfaceLevelsBouCoeffs_[coarsestLevel],
|
interfaceLevelsBouCoeffs_[coarsestLevel],
|
||||||
interfaceLevelsIntCoeffs_[coarsestLevel],
|
interfaceLevelsIntCoeffs_[coarsestLevel],
|
||||||
interfaceLevels_[coarsestLevel],
|
interfaceLevels_[coarsestLevel],
|
||||||
tolerance_,
|
PCGsolverDict(tolerance_, relTol_)
|
||||||
relTol_
|
|
||||||
).solve
|
).solve
|
||||||
(
|
(
|
||||||
coarsestCorrField,
|
coarsestCorrField,
|
||||||
|
|||||||
@ -1,111 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ 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 "ICCG.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(ICCG, 0);
|
|
||||||
|
|
||||||
lduMatrix::solver::addsymMatrixConstructorToTable<ICCG>
|
|
||||||
addICCGSymMatrixConstructorToTable_;
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dictionary Foam::ICCG::solverDict
|
|
||||||
(
|
|
||||||
const scalar tol,
|
|
||||||
const scalar relTol
|
|
||||||
)
|
|
||||||
{
|
|
||||||
dictionary dict(IStringStream("solver PCG; preconditioner DIC;")());
|
|
||||||
dict.add("tolerance", tol);
|
|
||||||
dict.add("relTol", relTol);
|
|
||||||
|
|
||||||
return dict;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::dictionary Foam::ICCG::solverDict
|
|
||||||
(
|
|
||||||
Istream& is
|
|
||||||
)
|
|
||||||
{
|
|
||||||
scalar tol(readScalar(is));
|
|
||||||
scalar relTol(readScalar(is));
|
|
||||||
|
|
||||||
return solverDict(tol, relTol);
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::ICCG::ICCG
|
|
||||||
(
|
|
||||||
const word& fieldName,
|
|
||||||
const lduMatrix& matrix,
|
|
||||||
const FieldField<Field, scalar>& interfaceBouCoeffs,
|
|
||||||
const FieldField<Field, scalar>& interfaceIntCoeffs,
|
|
||||||
const lduInterfaceFieldPtrsList& interfaces,
|
|
||||||
const dictionary& solverControls
|
|
||||||
)
|
|
||||||
:
|
|
||||||
PCG
|
|
||||||
(
|
|
||||||
fieldName,
|
|
||||||
matrix,
|
|
||||||
interfaceBouCoeffs,
|
|
||||||
interfaceIntCoeffs,
|
|
||||||
interfaces,
|
|
||||||
solverControls
|
|
||||||
)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::ICCG::ICCG
|
|
||||||
(
|
|
||||||
const word& fieldName,
|
|
||||||
const lduMatrix& matrix,
|
|
||||||
const FieldField<Field, scalar>& interfaceBouCoeffs,
|
|
||||||
const FieldField<Field, scalar>& interfaceIntCoeffs,
|
|
||||||
const lduInterfaceFieldPtrsList& interfaces,
|
|
||||||
const scalar tolerance,
|
|
||||||
const scalar relTol
|
|
||||||
)
|
|
||||||
:
|
|
||||||
PCG
|
|
||||||
(
|
|
||||||
fieldName,
|
|
||||||
matrix,
|
|
||||||
interfaceBouCoeffs,
|
|
||||||
interfaceIntCoeffs,
|
|
||||||
interfaces,
|
|
||||||
solverDict(tolerance, relTol)
|
|
||||||
)
|
|
||||||
{}
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,126 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ 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::ICCG
|
|
||||||
|
|
||||||
Description
|
|
||||||
Incomplete Cholesky preconditioned CG solver derived from the general
|
|
||||||
preconditioned CG solver PCG but with the choice of preconditioner
|
|
||||||
pre-selected.
|
|
||||||
|
|
||||||
Deprecated
|
|
||||||
This solver is present for backward-compatibility and the PCG solver
|
|
||||||
should be used for preference. (deprecated Apr 2008)
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
ICCG.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef ICCG_H
|
|
||||||
#define ICCG_H
|
|
||||||
|
|
||||||
#include "PCG.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class ICCG Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class ICCG
|
|
||||||
:
|
|
||||||
public PCG
|
|
||||||
{
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
|
||||||
ICCG(const ICCG&);
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
void operator=(const ICCG&);
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Return the dictionary constructed from the components.
|
|
||||||
// Needed for backward compatibility
|
|
||||||
static dictionary solverDict
|
|
||||||
(
|
|
||||||
const scalar tol,
|
|
||||||
const scalar relTol
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Return the dictionary constructed from the old-style data-stream.
|
|
||||||
// Needed for backward compatibility
|
|
||||||
static dictionary solverDict(Istream&);
|
|
||||||
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("ICCG");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from matrix components and solver data stream
|
|
||||||
ICCG
|
|
||||||
(
|
|
||||||
const word& fieldName,
|
|
||||||
const lduMatrix& matrix,
|
|
||||||
const FieldField<Field, scalar>& interfaceBouCoeffs,
|
|
||||||
const FieldField<Field, scalar>& interfaceIntCoeffs,
|
|
||||||
const lduInterfaceFieldPtrsList& interfaces,
|
|
||||||
const dictionary& solverControls
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct from matrix components and tolerances
|
|
||||||
ICCG
|
|
||||||
(
|
|
||||||
const word& fieldName,
|
|
||||||
const lduMatrix& matrix,
|
|
||||||
const FieldField<Field, scalar>& interfaceBouCoeffs,
|
|
||||||
const FieldField<Field, scalar>& interfaceIntCoeffs,
|
|
||||||
const lduInterfaceFieldPtrsList& interfaces,
|
|
||||||
const scalar tolerance,
|
|
||||||
const scalar relTol = 0.0
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~ICCG()
|
|
||||||
{}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -26,11 +26,6 @@ License
|
|||||||
#include "solution.H"
|
#include "solution.H"
|
||||||
#include "Time.H"
|
#include "Time.H"
|
||||||
|
|
||||||
// These are for old syntax compatibility:
|
|
||||||
#include "BICCG.H"
|
|
||||||
#include "ICCG.H"
|
|
||||||
#include "IStringStream.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
@ -185,48 +180,34 @@ Foam::label Foam::solution::upgradeSolverDict
|
|||||||
word name(is);
|
word name(is);
|
||||||
dictionary subdict;
|
dictionary subdict;
|
||||||
|
|
||||||
if (name == "BICCG")
|
subdict.add("solver", name);
|
||||||
{
|
subdict <<= dictionary(is);
|
||||||
// special treatment for very old syntax
|
|
||||||
subdict = BICCG::solverDict(is);
|
|
||||||
}
|
|
||||||
else if (name == "ICCG")
|
|
||||||
{
|
|
||||||
// special treatment for very old syntax
|
|
||||||
subdict = ICCG::solverDict(is);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
subdict.add("solver", name);
|
|
||||||
subdict <<= dictionary(is);
|
|
||||||
|
|
||||||
// preconditioner and smoother entries can be
|
// preconditioner and smoother entries can be
|
||||||
// 1) primitiveEntry w/o settings,
|
// 1) primitiveEntry w/o settings,
|
||||||
// 2) or a dictionaryEntry.
|
// 2) or a dictionaryEntry.
|
||||||
// transform primitiveEntry with settings -> dictionaryEntry
|
// transform primitiveEntry with settings -> dictionaryEntry
|
||||||
forAll(subDictNames, dictI)
|
forAll(subDictNames, dictI)
|
||||||
|
{
|
||||||
|
const word& dictName = subDictNames[dictI];
|
||||||
|
entry* ePtr = subdict.lookupEntryPtr(dictName,false,false);
|
||||||
|
|
||||||
|
if (ePtr && !ePtr->isDict())
|
||||||
{
|
{
|
||||||
const word& dictName = subDictNames[dictI];
|
Istream& is = ePtr->stream();
|
||||||
entry* ePtr = subdict.lookupEntryPtr(dictName,false,false);
|
is >> name;
|
||||||
|
|
||||||
if (ePtr && !ePtr->isDict())
|
if (!is.eof())
|
||||||
{
|
{
|
||||||
Istream& is = ePtr->stream();
|
dictionary newDict;
|
||||||
is >> name;
|
newDict.add(dictName, name);
|
||||||
|
newDict <<= dictionary(is);
|
||||||
|
|
||||||
if (!is.eof())
|
subdict.set(dictName, newDict);
|
||||||
{
|
|
||||||
dictionary newDict;
|
|
||||||
newDict.add(dictName, name);
|
|
||||||
newDict <<= dictionary(is);
|
|
||||||
|
|
||||||
subdict.set(dictName, newDict);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// write out information to help people adjust to the new syntax
|
// write out information to help people adjust to the new syntax
|
||||||
if (verbose && Pstream::master())
|
if (verbose && Pstream::master())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user