31 template<
class Type,
class DType,
class LUType>
35 const word& fieldName,
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()
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>
155 template<
class Type,
class DType,
class LUType>
166 template<
class Type,
class DType,
class LUType>
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
Ostream & endl(Ostream &os)
Add newline and flush stream.
Traits class for primitives.
label minIter_
Minimum number of iterations in the solver.
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.
dictionary controlDict_
Dictionary of controls.
Type gSum(const FieldField< Field, Type > &f)
volScalarField & e
Elementary charge.
Pre-declare SubField and related Field type.
A class for handling words, derived from string.
void readControl(const dictionary &controlDict, T &control, const word &controlName)
Read a control parameter from controlDict.
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
void cmptMag(FieldField< Field, Type > &cf, const FieldField< Field, Type > &f)
solver(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict)
tmp< DimensionedField< scalar, GeoMesh > > stabilise(const DimensionedField< scalar, GeoMesh > &dsf, const dimensioned< scalar > &ds)
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Type relTol_
Convergence tolerance relative to the initial.
Type gAverage(const FieldField< Field, Type > &f)
LduMatrix is a general matrix class in which the coefficients are stored as three arrays...
virtual void read(const dictionary &solverDict)
Read and reset the solver parameters from the given dictionary.
label maxIter_
Maximum number of iterations in the solver.
static autoPtr< solver > New(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict)
Return a new solver.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
const LduMatrix< Type, DType, LUType > & matrix_
virtual void readControls()
Read the control parameters from the controlDict_.
Type tolerance_
Final convergence tolerance.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.