31 template<
class Type,
class DType,
class LUType>
35 const word& fieldName,
54 else if (
matrix.symmetric())
56 typename symMatrixConstructorTable::iterator constructorIter =
57 symMatrixConstructorTablePtr_->find(solverName);
59 if (constructorIter == symMatrixConstructorTablePtr_->end())
62 <<
"Unknown symmetric matrix solver " << solverName
64 <<
"Valid symmetric matrix solvers are :" <<
endl
65 << symMatrixConstructorTablePtr_->toc()
79 else if (
matrix.asymmetric())
81 typename asymMatrixConstructorTable::iterator constructorIter =
82 asymMatrixConstructorTablePtr_->find(solverName);
84 if (constructorIter == asymMatrixConstructorTablePtr_->end())
87 <<
"Unknown asymmetric matrix solver " << solverName
89 <<
"Valid asymmetric matrix solvers are :" <<
endl
90 << asymMatrixConstructorTablePtr_->toc()
107 <<
"cannot solve incomplete matrix, "
108 "no diagonal or off-diagonal coefficient"
121 template<
class Type,
class DType,
class LUType>
124 const word& fieldName,
129 fieldName_(fieldName),
132 controlDict_(solverDict),
134 maxIter_(defaultMaxIter_),
145 template<
class Type,
class DType,
class LUType>
148 readControl(controlDict_, maxIter_,
"maxIter");
149 readControl(controlDict_, minIter_,
"minIter");
150 readControl(controlDict_, tolerance_,
"tolerance");
151 readControl(controlDict_, relTol_,
"relTol");
155 template<
class Type,
class DType,
class LUType>
161 controlDict_ = solverDict;
166 template<
class Type,
class DType,
class LUType>
175 matrix_.sumA(tmpField);
Pre-declare SubField and related Field type.
solver(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict)
const LduMatrix< Type, DType, LUType > & matrix() const
virtual void read(const dictionary &solverDict)
Read and reset the solver parameters from the given dictionary.
Type normFactor(const Field< Type > &psi, const Field< Type > &Apsi, Field< Type > &tmpField) const
Return the matrix norm used to normalise the residual for the.
const word & fieldName() const
virtual void readControls()
Read the control parameters from the controlDict_.
static autoPtr< solver > New(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict)
Return a new solver.
LduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
A list of keyword definitions, which are a keyword followed by any number of values (e....
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
A class representing the concept of 1 (scalar(1)) used to avoid unnecessary manipulations for objects...
Traits class for primitives.
A class for handling words, derived from string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
const volScalarField & psi
errorManipArg< error, int > exit(error &err, const int errNo=1)
Type gSum(const FieldField< Field, Type > &f)
tmp< DimensionedField< scalar, GeoMesh > > stabilise(const DimensionedField< scalar, GeoMesh > &dsf, const dimensioned< scalar > &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
dimensionSet cmptMag(const dimensionSet &)
Type gAverage(const FieldField< Field, Type > &f)