Go to the documentation of this file.
69 template<
class Type,
class DType,
class LUType>
72 template<
class Type,
class DType,
class LUType>
84 template<
class Type,
class DType,
class LUType>
146 const word& controlName
157 virtual const word&
type()
const = 0;
272 virtual const word&
type()
const = 0;
372 virtual const word&
type()
const = 0;
386 (sol, preconditionerDict)
398 (sol, preconditionerDict)
653 friend Ostream& operator<< <Type, DType, LUType>
667 #define makeLduMatrix(Type, DType, LUType) \
669 typedef Foam::LduMatrix<Type, DType, LUType> \
670 ldu##Type##DType##LUType##Matrix; \
672 defineNamedTemplateTypeNameAndDebug(ldu##Type##DType##LUType##Matrix, 0); \
675 typedef LduMatrix<Type, DType, LUType>::smoother \
676 ldu##Type##DType##LUType##Smoother; \
678 defineTemplateRunTimeSelectionTable \
680 ldu##Type##DType##LUType##Smoother, \
684 defineTemplateRunTimeSelectionTable \
686 ldu##Type##DType##LUType##Smoother, \
691 typedef LduMatrix<Type, DType, LUType>::preconditioner \
692 ldu##Type##DType##LUType##Preconditioner; \
694 defineTemplateRunTimeSelectionTable \
696 ldu##Type##DType##LUType##Preconditioner, \
700 defineTemplateRunTimeSelectionTable \
702 ldu##Type##DType##LUType##Preconditioner, \
707 typedef LduMatrix<Type, DType, LUType>::solver \
708 ldu##Type##DType##LUType##Solver; \
710 defineTemplateRunTimeSelectionTable \
712 ldu##Type##DType##LUType##Solver, \
716 defineTemplateRunTimeSelectionTable \
718 ldu##Type##DType##LUType##Solver, \
723 #define makeLduPreconditioner(Precon, Type, DType, LUType) \
725 typedef Precon<Type, DType, LUType> \
726 Precon##Type##DType##LUType##Preconditioner; \
727 defineNamedTemplateTypeNameAndDebug \
729 Precon##Type##DType##LUType##Preconditioner, \
733 #define makeLduSymPreconditioner(Precon, Type, DType, LUType) \
735 LduMatrix<Type, DType, LUType>::preconditioner:: \
736 addsymMatrixConstructorToTable<Precon##Type##DType##LUType##Preconditioner> \
737 add##Precon##Type##DType##LUType##PreconditionerSymMatrixConstructorToTable_;
739 #define makeLduAsymPreconditioner(Precon, Type, DType, LUType) \
741 LduMatrix<Type, DType, LUType>::preconditioner:: \
742 addasymMatrixConstructorToTable<Precon##Type##DType##LUType##Preconditioner> \
743 add##Precon##Type##DType##LUType##PreconditionerAsymMatrixConstructorToTable_;
746 #define makeLduSmoother(Smoother, Type, DType, LUType) \
748 typedef Smoother<Type, DType, LUType> \
749 Smoother##Type##DType##LUType##Smoother; \
751 defineNamedTemplateTypeNameAndDebug \
753 Smoother##Type##DType##LUType##Smoother, \
757 #define makeLduSymSmoother(Smoother, Type, DType, LUType) \
759 LduMatrix<Type, DType, LUType>::smoother:: \
760 addsymMatrixConstructorToTable<Smoother##Type##DType##LUType##Smoother> \
761 add##Smoother##Type##DType##LUType##SymMatrixConstructorToTable_;
763 #define makeLduAsymSmoother(Smoother, Type, DType, LUType) \
765 LduMatrix<Type, DType, LUType>::smoother:: \
766 addasymMatrixConstructorToTable<Smoother##Type##DType##LUType##Smoother> \
767 add##Smoother##Type##DType##LUType##AsymMatrixConstructorToTable_;
770 #define makeLduSolver(Solver, Type, DType, LUType) \
772 typedef Solver<Type, DType, LUType> \
773 Solver##Type##DType##LUType##Solver; \
775 defineNamedTemplateTypeNameAndDebug \
777 Solver##Type##DType##LUType##Solver, \
781 #define makeLduSymSolver(Solver, Type, DType, LUType) \
783 LduMatrix<Type, DType, LUType>::solver:: \
784 addsymMatrixConstructorToTable<Solver##Type##DType##LUType##Solver> \
785 add##Solver##Type##DType##LUType##SymMatrixConstructorToTable_;
787 #define makeLduAsymSolver(Solver, Type, DType, LUType) \
789 LduMatrix<Type, DType, LUType>::solver:: \
790 addasymMatrixConstructorToTable<Solver##Type##DType##LUType##Solver> \
791 add##Solver##Type##DType##LUType##AsymMatrixConstructorToTable_;
The class contains the addressing required by the lduMatrix: upper, lower and losort.
FieldField< Field, LUType > & interfacesLower()
declareRunTimeSelectionTable(autoPtr, solver, symMatrix,(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict),(fieldName, matrix, solverDict))
void sumMagOffDiag(Field< LUType > &sumOff) const
A class for handling words, derived from string.
static autoPtr< smoother > New(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &smootherDict)
Return a new smoother.
void operator=(const LduMatrix< Type, DType, LUType > &)
A class for managing temporary objects.
FieldField< Field, LUType > interfacesUpper_
Off-diagonal coefficients for interfaces.
const word & fieldName() const
void sumA(Field< Type > &) const
Sum the coefficients on each row of the matrix.
virtual const word & type() const =0
Runtime type information.
virtual void preconditionT(Field< Type > &wT, const Field< Type > &rT) const
Return wT the transpose-matrix preconditioned form of.
LduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
label maxIter_
Maximum number of iterations in the solver.
void Tmul(Field< Type > &, const tmp< Field< Type > > &) const
Matrix transpose multiplication.
Field< Type > * sourcePtr_
Source.
void initMatrixInterfaces(const FieldField< Field, LUType > &interfaceCoeffs, const Field< Type > &psiif, Field< Type > &result) const
Initialise the update of interfaced interfaces.
const FieldField< Field, LUType > & interfacesUpper() const
Field< LUType > & upper()
void operator-=(const LduMatrix< Type, DType, LUType > &)
preconditioner(const solver &sol)
const LduMatrix< Type, DType, LUType > & matrix_
Abstract base-class for LduMatrix solvers.
virtual ~preconditioner()
virtual void precondition(Field< Type > &wA, const Field< Type > &rA) const =0
Return wA the preconditioned form of residual rA.
dictionary controlDict_
Dictionary of controls.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
const LduMatrix< Type, DType, LUType > & matrix_
const solver & solver_
Reference to the base-solver this preconditioner is used with.
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 SolverPerformance< Type > solve(Field< Type > &psi) const =0
void residual(Field< Type > &rA, const Field< Type > &psi) const
virtual void read(const dictionary &solverDict)
Read and reset the solver parameters from the given dictionary.
runTime controlDict().lookup("adjustTimeStep") >> adjustTimeStep
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
tmp< Field< Type > > H(const Field< Type > &) const
declareRunTimeSelectionTable(autoPtr, preconditioner, symMatrix,(const solver &sol, const dictionary &preconditionerDict),(sol, preconditionerDict))
List of coupled interface fields to be used in coupling.
LduMatrix(const lduMesh &)
Construct given an LDU addressed mesh.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
virtual const lduSchedule & patchSchedule() const =0
Type relTol_
Convergence tolerance relative to the initial.
virtual const word & type() const =0
Runtime type information.
virtual void smooth(Field< Type > &psi, const label nSweeps) const =0
Smooth the solution for a given number of sweeps.
void operator+=(const LduMatrix< Type, DType, LUType > &)
A list of keyword definitions, which are a keyword followed by any number of values (e....
void readControl(const dictionary &controlDict, T &control, const word &controlName)
Read a control parameter from controlDict.
Type tolerance_
Final convergence tolerance.
Abstract base-class for LduMatrix smoothers.
const LduMatrix< Type, DType, LUType > & matrix() const
Abstract base-class for LduMatrix preconditioners.
void Amul(Field< Type > &, const tmp< Field< Type > > &) const
Matrix multiplication.
void operator*=(const scalarField &)
tmp< Field< Type > > faceH(const Field< Type > &) const
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
label minIter_
Minimum number of iterations in the solver.
void updateMatrixInterfaces(const FieldField< Field, LUType > &interfaceCoeffs, const Field< Type > &psiif, Field< Type > &result) const
Update interfaced interfaces for matrix operations.
Field< LUType > * lowerPtr_
Macros to ease declaration of run-time selection tables.
virtual const word & type() const =0
Runtime type information.
smoother(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const lduMesh & lduMesh_
LDU mesh reference.
FieldField< Field, LUType > interfacesLower_
const lduSchedule & patchSchedule() const
Return the patch evaluation schedule.
const FieldField< Field, LUType > & interfacesLower() const
const word & fieldName() const
virtual void read(const dictionary &preconditionerDict)
Read and reset the preconditioner parameters.
const LduMatrix< Type, DType, LUType > & matrix() const
solver(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict)
LduInterfaceFieldPtrsList< Type > interfaces_
Field interfaces (processor patches etc.)
static autoPtr< preconditioner > New(const solver &sol, const dictionary &preconditionerDict)
Return a new preconditioner.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Field< DType > * diagPtr_
Diagonal coefficients.
const LduInterfaceFieldPtrsList< Type > & interfaces() const
Return interfaces.
declareRunTimeSelectionTable(autoPtr, smoother, symMatrix,(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix),(fieldName, matrix))
FieldField< Field, LUType > & interfacesUpper()
const lduAddressing & lduAddr() const
Return the LDU addressing.
LduInterfaceFieldPtrsList< Type > & interfaces()
Return interfaces.
virtual const lduAddressing & lduAddr() const =0
Return ldu addressing.
Field< LUType > * upperPtr_
Off-diagonal coefficients.
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.
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
static autoPtr< solver > New(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict)
Return a new solver.
virtual void readControls()
Read the control parameters from the controlDict_.
Field< LUType > & lower()