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_;
584 !lowerPtr_ && !upperPtr_
586 !(lowerPtr_ && lowerPtr_->
size())
587 && !(upperPtr_ && upperPtr_->
size())
598 !lowerPtr_ && upperPtr_
600 !(lowerPtr_ && lowerPtr_->
size())
601 && (upperPtr_ && upperPtr_->
size())
612 lowerPtr_ && upperPtr_
614 (lowerPtr_ && lowerPtr_->
size())
615 && (upperPtr_ && upperPtr_->
size())
683 friend Ostream& operator<< <Type, DType, LUType>
697 #define makeLduMatrix(Type, DType, LUType) \ 699 typedef Foam::LduMatrix<Type, DType, LUType> \ 700 ldu##Type##DType##LUType##Matrix; \ 702 defineNamedTemplateTypeNameAndDebug(ldu##Type##DType##LUType##Matrix, 0); \ 705 typedef LduMatrix<Type, DType, LUType>::smoother \ 706 ldu##Type##DType##LUType##Smoother; \ 708 defineTemplateRunTimeSelectionTable \ 710 ldu##Type##DType##LUType##Smoother, \ 714 defineTemplateRunTimeSelectionTable \ 716 ldu##Type##DType##LUType##Smoother, \ 721 typedef LduMatrix<Type, DType, LUType>::preconditioner \ 722 ldu##Type##DType##LUType##Preconditioner; \ 724 defineTemplateRunTimeSelectionTable \ 726 ldu##Type##DType##LUType##Preconditioner, \ 730 defineTemplateRunTimeSelectionTable \ 732 ldu##Type##DType##LUType##Preconditioner, \ 737 typedef LduMatrix<Type, DType, LUType>::solver \ 738 ldu##Type##DType##LUType##Solver; \ 740 defineTemplateRunTimeSelectionTable \ 742 ldu##Type##DType##LUType##Solver, \ 746 defineTemplateRunTimeSelectionTable \ 748 ldu##Type##DType##LUType##Solver, \ 753 #define makeLduPreconditioner(Precon, Type, DType, LUType) \ 755 typedef Precon<Type, DType, LUType> \ 756 Precon##Type##DType##LUType##Preconditioner; \ 757 defineNamedTemplateTypeNameAndDebug \ 759 Precon##Type##DType##LUType##Preconditioner, \ 763 #define makeLduSymPreconditioner(Precon, Type, DType, LUType) \ 765 LduMatrix<Type, DType, LUType>::preconditioner:: \ 766 addsymMatrixConstructorToTable<Precon##Type##DType##LUType##Preconditioner> \ 767 add##Precon##Type##DType##LUType##PreconditionerSymMatrixConstructorToTable_; 769 #define makeLduAsymPreconditioner(Precon, Type, DType, LUType) \ 771 LduMatrix<Type, DType, LUType>::preconditioner:: \ 772 addasymMatrixConstructorToTable<Precon##Type##DType##LUType##Preconditioner> \ 773 add##Precon##Type##DType##LUType##PreconditionerAsymMatrixConstructorToTable_; 776 #define makeLduSmoother(Smoother, Type, DType, LUType) \ 778 typedef Smoother<Type, DType, LUType> \ 779 Smoother##Type##DType##LUType##Smoother; \ 781 defineNamedTemplateTypeNameAndDebug \ 783 Smoother##Type##DType##LUType##Smoother, \ 787 #define makeLduSymSmoother(Smoother, Type, DType, LUType) \ 789 LduMatrix<Type, DType, LUType>::smoother:: \ 790 addsymMatrixConstructorToTable<Smoother##Type##DType##LUType##Smoother> \ 791 add##Smoother##Type##DType##LUType##SymMatrixConstructorToTable_; 793 #define makeLduAsymSmoother(Smoother, Type, DType, LUType) \ 795 LduMatrix<Type, DType, LUType>::smoother:: \ 796 addasymMatrixConstructorToTable<Smoother##Type##DType##LUType##Smoother> \ 797 add##Smoother##Type##DType##LUType##AsymMatrixConstructorToTable_; 800 #define makeLduSolver(Solver, Type, DType, LUType) \ 802 typedef Solver<Type, DType, LUType> \ 803 Solver##Type##DType##LUType##Solver; \ 805 defineNamedTemplateTypeNameAndDebug \ 807 Solver##Type##DType##LUType##Solver, \ 811 #define makeLduSymSolver(Solver, Type, DType, LUType) \ 813 LduMatrix<Type, DType, LUType>::solver:: \ 814 addsymMatrixConstructorToTable<Solver##Type##DType##LUType##Solver> \ 815 add##Solver##Type##DType##LUType##SymMatrixConstructorToTable_; 817 #define makeLduAsymSolver(Solver, Type, DType, LUType) \ 819 LduMatrix<Type, DType, LUType>::solver:: \ 820 addasymMatrixConstructorToTable<Solver##Type##DType##LUType##Solver> \ 821 add##Solver##Type##DType##LUType##AsymMatrixConstructorToTable_;
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)...
void size(const label)
Override size to be inconsistent with allocated storage.
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.
const volScalarField & psi
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.
static bool & parRun()
Is this a parallel run?
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.
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