69 template<
class Type,
class DType,
class LUType>
72 template<
class Type,
class DType,
class LUType>
84 template<
class Type,
class DType,
class LUType>
149 const word& controlName
160 virtual const word&
type()
const = 0;
275 virtual const word&
type()
const = 0;
375 virtual const word&
type()
const = 0;
389 (sol, preconditionerDict)
401 (sol, preconditionerDict)
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_;
List of coupled interface fields to be used in coupling.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Abstract base-class for LduMatrix preconditioners.
virtual ~preconditioner()
const solver & solver_
Reference to the base-solver this preconditioner is used with.
virtual const word & type() const =0
Runtime type information.
preconditioner(const solver &sol)
declareRunTimeSelectionTable(autoPtr, preconditioner, symMatrix,(const solver &sol, const dictionary &preconditionerDict),(sol, preconditionerDict))
static autoPtr< preconditioner > New(const solver &sol, const dictionary &preconditionerDict)
Return a new preconditioner.
virtual void read(const dictionary &preconditionerDict)
Read and reset the preconditioner parameters.
virtual void preconditionT(Field< Type > &wT, const Field< Type > &rT) const
Return wT the transpose-matrix preconditioned form of.
virtual void precondition(Field< Type > &wA, const Field< Type > &rA) const =0
Return wA the preconditioned form of residual rA.
Abstract base-class for LduMatrix smoothers.
virtual const word & type() const =0
Runtime type information.
declareRunTimeSelectionTable(autoPtr, smoother, symMatrix,(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix),(fieldName, matrix))
smoother(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix)
const LduMatrix< Type, DType, LUType > & matrix() const
const word & fieldName() const
const LduMatrix< Type, DType, LUType > & matrix_
virtual void smooth(Field< Type > &psi, const label nSweeps) const =0
Smooth the solution for a given number of sweeps.
static autoPtr< smoother > New(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &smootherDict)
Return a new smoother.
Abstract base-class for LduMatrix solvers.
label maxIter_
Maximum number of iterations in the solver.
solver(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict)
virtual const word & type() const =0
Runtime type information.
static const label defaultMaxIter_
Default maximum number of iterations in the solver.
Type relTol_
Convergence tolerance relative to the initial.
const LduMatrix< Type, DType, LUType > & matrix() const
virtual void read(const dictionary &solverDict)
Read and reset the solver parameters from the given dictionary.
void readControl(const dictionary &controlDict, T &control, const word &controlName)
Read a control parameter from controlDict.
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.
label minIter_
Minimum number of iterations in the solver.
const word & fieldName() const
Type tolerance_
Final convergence tolerance.
virtual void readControls()
Read the control parameters from the controlDict_.
const LduMatrix< Type, DType, LUType > & matrix_
declareRunTimeSelectionTable(autoPtr, solver, symMatrix,(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict),(fieldName, matrix, solverDict))
static autoPtr< solver > New(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict)
Return a new solver.
virtual SolverPerformance< Type > solve(Field< Type > &psi) const =0
dictionary controlDict_
Dictionary of controls.
LduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
void Tmul(Field< Type > &, const tmp< Field< Type >> &) const
Matrix transpose multiplication.
const lduSchedule & patchSchedule() const
Return the patch evaluation schedule.
void Amul(Field< Type > &, const tmp< Field< Type >> &) const
Matrix multiplication.
void sumA(Field< Type > &) const
Sum the coefficients on each row of the matrix.
const lduMesh & mesh() const
Return the LDU mesh from which the addressing is obtained.
void updateMatrixInterfaces(const FieldField< Field, LUType > &interfaceCoeffs, const Field< Type > &psiif, Field< Type > &result) const
Update interfaced interfaces for matrix operations.
tmp< Field< Type > > H(const Field< Type > &) const
Field< LUType > & upper()
void operator+=(const LduMatrix< Type, DType, LUType > &)
void operator=(const LduMatrix< Type, DType, LUType > &)
void operator*=(const scalarField &)
FieldField< Field, LUType > & interfacesLower()
void sumMagOffDiag(Field< LUType > &sumOff) const
void initMatrixInterfaces(const FieldField< Field, LUType > &interfaceCoeffs, const Field< Type > &psiif, Field< Type > &result) const
Initialise the update of interfaced interfaces.
const lduAddressing & lduAddr() const
Return the LDU addressing.
void residual(Field< Type > &rA, const Field< Type > &psi) const
tmp< Field< Type > > faceH(const Field< Type > &) const
LduMatrix(const lduMesh &)
Construct given an LDU addressed mesh.
const LduInterfaceFieldPtrsList< Type > & interfaces() const
Return interfaces.
void operator-=(const LduMatrix< Type, DType, LUType > &)
Field< LUType > & lower()
FieldField< Field, LUType > & interfacesUpper()
void size(const label)
Override size to be inconsistent with allocated storage.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
static bool & parRun()
Is this a parallel run?
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....
The class contains the addressing required by the lduMatrix: upper, lower and losort.
virtual const lduSchedule & patchSchedule() const =0
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
virtual const lduAddressing & lduAddr() const =0
Return ldu addressing.
A class for managing temporary objects.
A class for handling words, derived from string.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
const volScalarField & psi
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
runTime controlDict().lookup("adjustTimeStep") >> adjustTimeStep
Macros to ease declaration of run-time selection tables.
Basic run-time type information using word as the type's name. Used to enhance the standard RTTI to c...