69 template<
class Type,
class DType,
class LUType>
72 template<
class Type,
class DType,
class LUType>
84 template<
class Type,
class DType,
class LUType>
126 static const label defaultMaxIter_ = 1000;
149 const word& controlName
160 virtual const word&
type()
const = 0;
171 const word& fieldName,
188 const word& fieldName,
204 const word& fieldName,
215 const word& fieldName,
275 virtual const word&
type()
const = 0;
286 const word& fieldName,
301 const word& fieldName,
315 const word& fieldName,
325 const word& fieldName,
375 virtual const word&
type()
const = 0;
389 (sol, preconditionerDict)
401 (sol, preconditionerDict)
440 virtual void precondition
449 virtual void preconditionT
501 return lduMesh_.lduAddr();
532 return interfacesUpper_;
537 return interfacesLower_;
548 return interfacesUpper_;
553 return interfacesLower_;
579 return (diagPtr_ && !lowerPtr_ && !upperPtr_);
584 return (diagPtr_ && (!lowerPtr_ && upperPtr_));
589 return (diagPtr_ && lowerPtr_ && upperPtr_);
656 friend Ostream& operator<< <Type, DType, LUType>
670 #define makeLduMatrix(Type, DType, LUType) \ 672 typedef Foam::LduMatrix<Type, DType, LUType> \ 673 ldu##Type##DType##LUType##Matrix; \ 675 defineNamedTemplateTypeNameAndDebug(ldu##Type##DType##LUType##Matrix, 0); \ 678 typedef LduMatrix<Type, DType, LUType>::smoother \ 679 ldu##Type##DType##LUType##Smoother; \ 681 defineTemplateRunTimeSelectionTable \ 683 ldu##Type##DType##LUType##Smoother, \ 687 defineTemplateRunTimeSelectionTable \ 689 ldu##Type##DType##LUType##Smoother, \ 694 typedef LduMatrix<Type, DType, LUType>::preconditioner \ 695 ldu##Type##DType##LUType##Preconditioner; \ 697 defineTemplateRunTimeSelectionTable \ 699 ldu##Type##DType##LUType##Preconditioner, \ 703 defineTemplateRunTimeSelectionTable \ 705 ldu##Type##DType##LUType##Preconditioner, \ 710 typedef LduMatrix<Type, DType, LUType>::solver \ 711 ldu##Type##DType##LUType##Solver; \ 713 defineTemplateRunTimeSelectionTable \ 715 ldu##Type##DType##LUType##Solver, \ 719 defineTemplateRunTimeSelectionTable \ 721 ldu##Type##DType##LUType##Solver, \ 726 #define makeLduPreconditioner(Precon, Type, DType, LUType) \ 728 typedef Precon<Type, DType, LUType> \ 729 Precon##Type##DType##LUType##Preconditioner; \ 730 defineNamedTemplateTypeNameAndDebug \ 732 Precon##Type##DType##LUType##Preconditioner, \ 736 #define makeLduSymPreconditioner(Precon, Type, DType, LUType) \ 738 LduMatrix<Type, DType, LUType>::preconditioner:: \ 739 addsymMatrixConstructorToTable<Precon##Type##DType##LUType##Preconditioner> \ 740 add##Precon##Type##DType##LUType##PreconditionerSymMatrixConstructorToTable_; 742 #define makeLduAsymPreconditioner(Precon, Type, DType, LUType) \ 744 LduMatrix<Type, DType, LUType>::preconditioner:: \ 745 addasymMatrixConstructorToTable<Precon##Type##DType##LUType##Preconditioner> \ 746 add##Precon##Type##DType##LUType##PreconditionerAsymMatrixConstructorToTable_; 749 #define makeLduSmoother(Smoother, Type, DType, LUType) \ 751 typedef Smoother<Type, DType, LUType> \ 752 Smoother##Type##DType##LUType##Smoother; \ 754 defineNamedTemplateTypeNameAndDebug \ 756 Smoother##Type##DType##LUType##Smoother, \ 760 #define makeLduSymSmoother(Smoother, Type, DType, LUType) \ 762 LduMatrix<Type, DType, LUType>::smoother:: \ 763 addsymMatrixConstructorToTable<Smoother##Type##DType##LUType##Smoother> \ 764 add##Smoother##Type##DType##LUType##SymMatrixConstructorToTable_; 766 #define makeLduAsymSmoother(Smoother, Type, DType, LUType) \ 768 LduMatrix<Type, DType, LUType>::smoother:: \ 769 addasymMatrixConstructorToTable<Smoother##Type##DType##LUType##Smoother> \ 770 add##Smoother##Type##DType##LUType##AsymMatrixConstructorToTable_; 773 #define makeLduSolver(Solver, Type, DType, LUType) \ 775 typedef Solver<Type, DType, LUType> \ 776 Solver##Type##DType##LUType##Solver; \ 778 defineNamedTemplateTypeNameAndDebug \ 780 Solver##Type##DType##LUType##Solver, \ 784 #define makeLduSymSolver(Solver, Type, DType, LUType) \ 786 LduMatrix<Type, DType, LUType>::solver:: \ 787 addsymMatrixConstructorToTable<Solver##Type##DType##LUType##Solver> \ 788 add##Solver##Type##DType##LUType##SymMatrixConstructorToTable_; 790 #define makeLduAsymSolver(Solver, Type, DType, LUType) \ 792 LduMatrix<Type, DType, LUType>::solver:: \ 793 addasymMatrixConstructorToTable<Solver##Type##DType##LUType##Solver> \ 794 add##Solver##Type##DType##LUType##AsymMatrixConstructorToTable_;
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual const word & type() const =0
Runtime type information.
runTime controlDict().lookup("adjustTimeStep") >> adjustTimeStep
A list of keyword definitions, which are a keyword followed by any number of values (e...
FieldField< Field, LUType > & interfacesLower()
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
LduMatrix(const lduMesh &)
Construct given an LDU addressed mesh.
void sumMagOffDiag(Field< LUType > &sumOff) const
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Field< LUType > & lower()
label minIter_
Minimum number of iterations in the solver.
const LduMatrix< Type, DType, LUType > & matrix() const
void sumA(Field< Type > &) const
Sum the coefficients on each row of the matrix.
void smooth(volScalarField &field, const scalar coeff)
const word & fieldName() const
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.
void Amul(Field< Type > &, const tmp< Field< Type >> &) const
Matrix multiplication.
void initMatrixInterfaces(const FieldField< Field, LUType > &interfaceCoeffs, const Field< Type > &psiif, Field< Type > &result) const
Initialise the update of interfaced interfaces.
Abstract base-class for LduMatrix smoothers.
A class for handling words, derived from string.
void readControl(const dictionary &controlDict, T &control, const word &controlName)
Read a control parameter from controlDict.
void updateMatrixInterfaces(const FieldField< Field, LUType > &interfaceCoeffs, const Field< Type > &psiif, Field< Type > &result) const
Update interfaced interfaces for matrix operations.
Abstract base-class for LduMatrix preconditioners.
tmp< Field< Type > > H(const Field< Type > &) const
const lduSchedule & patchSchedule() const
Return the patch evaluation schedule.
void operator*=(const scalarField &)
Field< LUType > & upper()
void operator-=(const LduMatrix< Type, DType, LUType > &)
Abstract base-class for LduMatrix solvers.
void residual(Field< Type > &rA, const Field< Type > &psi) const
solver(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict)
void Tmul(Field< Type > &, const tmp< Field< Type >> &) const
Matrix transpose multiplication.
const lduAddressing & lduAddr() const
Return the LDU addressing.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
const LduInterfaceFieldPtrsList< Type > & interfaces() const
Return interfaces.
Type relTol_
Convergence tolerance relative to the initial.
FieldField< Field, LUType > & interfacesUpper()
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.
void operator+=(const LduMatrix< Type, DType, LUType > &)
tmp< Field< Type > > faceH(const Field< Type > &) const
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 lduMesh & mesh() const
Return the LDU mesh from which the addressing is obtained.
const volScalarField & psi
The class contains the addressing required by the lduMatrix: upper, lower and losort.
virtual SolverPerformance< Type > solve(Field< Type > &psi) const =0
const LduMatrix< Type, DType, LUType > & matrix_
Macros to ease declaration of run-time selection tables.
virtual void readControls()
Read the control parameters from the controlDict_.
A class for managing temporary objects.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
declareRunTimeSelectionTable(autoPtr, solver, symMatrix,(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict),(fieldName, matrix, solverDict))
void operator=(const LduMatrix< Type, DType, LUType > &)
List of coupled interface fields to be used in coupling.
Type tolerance_
Final convergence tolerance.
virtual const lduSchedule & patchSchedule() const =0