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;
168 const word& fieldName,
185 const word& fieldName,
201 const word& fieldName,
212 const word& fieldName,
272 virtual const word&
type()
const = 0;
283 const word& fieldName,
298 const word& fieldName,
312 const word& fieldName,
322 const word& fieldName,
372 virtual const word&
type()
const = 0;
386 (sol, preconditionerDict)
398 (sol, preconditionerDict)
437 virtual void precondition
446 virtual void preconditionT
498 return lduMesh_.lduAddr();
529 return interfacesUpper_;
534 return interfacesLower_;
545 return interfacesUpper_;
550 return interfacesLower_;
576 return (diagPtr_ && !lowerPtr_ && !upperPtr_);
581 return (diagPtr_ && (!lowerPtr_ && upperPtr_));
586 return (diagPtr_ && lowerPtr_ && upperPtr_);
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_;
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...
const lduMesh & mesh() const
Return the LDU mesh from which the addressing is obtained.
tmp< Field< Type > > H(const Field< Type > &) const
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 Amul(Field< Type > &, const tmp< Field< Type >> &) const
Matrix multiplication.
void residual(Field< Type > &rA, const Field< Type > &psi) const
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Field< LUType > & lower()
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.
void smooth(volScalarField &field, const scalar coeff)
dictionary controlDict_
Dictionary of controls.
const word & fieldName() const
void Tmul(Field< Type > &, const tmp< Field< Type >> &) const
Matrix transpose multiplication.
const LduInterfaceFieldPtrsList< Type > & interfaces() const
Return 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.
Abstract base-class for LduMatrix preconditioners.
void operator*=(const scalarField &)
void initMatrixInterfaces(const FieldField< Field, LUType > &interfaceCoeffs, const Field< Type > &psiif, Field< Type > &result) const
Initialise the update of interfaced interfaces.
Field< LUType > & upper()
const LduMatrix< Type, DType, LUType > & matrix() const
void operator-=(const LduMatrix< Type, DType, LUType > &)
Abstract base-class for LduMatrix solvers.
void sumA(Field< Type > &) const
Sum the coefficients on each row of the matrix.
solver(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict)
const lduSchedule & patchSchedule() const
Return the patch evaluation schedule.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
void updateMatrixInterfaces(const FieldField< Field, LUType > &interfaceCoeffs, const Field< Type > &psiif, Field< Type > &result) const
Update interfaced interfaces for matrix operations.
void sumMagOffDiag(Field< LUType > &sumOff) const
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.
const lduAddressing & lduAddr() const
Return the LDU addressing.
void operator+=(const LduMatrix< Type, DType, LUType > &)
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 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_
tmp< Field< Type > > faceH(const Field< Type > &) const
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