Go to the documentation of this file.
72 template<
class Type,
class DType,
class LUType>
75 template<
class Type,
class DType,
class LUType>
87 template<
class Type,
class DType,
class LUType>
167 virtual const word&
type()
const = 0;
279 virtual const word&
type()
const = 0;
376 virtual const word&
type()
const = 0;
390 (sol, preconditionerDict)
402 (sol, preconditionerDict)
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_);
601 void Amul(Field<Type>&,
const tmp<Field<Type>>&)
const;
604 void Tmul(Field<Type>&,
const tmp<Field<Type>>&)
const;
608 void sumA(Field<Type>&)
const;
611 void residual(Field<Type>& rA,
const Field<Type>&
psi)
const;
613 tmp<Field<Type>>
residual(
const Field<Type>&
psi)
const;
621 const FieldField<Field, LUType>& interfaceCoeffs,
622 const Field<Type>& psiif,
630 const FieldField<Field, LUType>& interfaceCoeffs,
631 const Field<Type>& psiif,
636 tmp<Field<Type>>
H(
const Field<Type>&)
const;
637 tmp<Field<Type>>
H(
const tmp<Field<Type>>&)
const;
639 tmp<Field<Type>>
faceH(
const Field<Type>&)
const;
640 tmp<Field<Type>>
faceH(
const tmp<Field<Type>>&)
const;
645 void operator=(
const LduMatrix<Type, DType, LUType>&);
649 void operator+=(
const LduMatrix<Type, DType, LUType>&);
650 void operator-=(
const LduMatrix<Type, DType, LUType>&);
658 friend Ostream& operator<< <Type, DType, LUType>
661 const LduMatrix<Type, DType, LUType>&
672 #define makeLduMatrix(Type, DType, LUType) \
674 typedef Foam::LduMatrix<Type, DType, LUType> \
675 ldu##Type##DType##LUType##Matrix; \
677 defineNamedTemplateTypeNameAndDebug(ldu##Type##DType##LUType##Matrix, 0); \
680 typedef LduMatrix<Type, DType, LUType>::smoother \
681 ldu##Type##DType##LUType##Smoother; \
683 defineTemplateRunTimeSelectionTable \
685 ldu##Type##DType##LUType##Smoother, \
689 defineTemplateRunTimeSelectionTable \
691 ldu##Type##DType##LUType##Smoother, \
696 typedef LduMatrix<Type, DType, LUType>::preconditioner \
697 ldu##Type##DType##LUType##Preconditioner; \
699 defineTemplateRunTimeSelectionTable \
701 ldu##Type##DType##LUType##Preconditioner, \
705 defineTemplateRunTimeSelectionTable \
707 ldu##Type##DType##LUType##Preconditioner, \
712 typedef LduMatrix<Type, DType, LUType>::solver \
713 ldu##Type##DType##LUType##Solver; \
715 defineTemplateRunTimeSelectionTable \
717 ldu##Type##DType##LUType##Solver, \
721 defineTemplateRunTimeSelectionTable \
723 ldu##Type##DType##LUType##Solver, \
728 #define makeLduPreconditioner(Precon, Type, DType, LUType) \
730 typedef Precon<Type, DType, LUType> \
731 Precon##Type##DType##LUType##Preconditioner; \
732 defineNamedTemplateTypeNameAndDebug \
734 Precon##Type##DType##LUType##Preconditioner, \
738 #define makeLduSymPreconditioner(Precon, Type, DType, LUType) \
740 LduMatrix<Type, DType, LUType>::preconditioner:: \
741 addsymMatrixConstructorToTable<Precon##Type##DType##LUType##Preconditioner> \
742 add##Precon##Type##DType##LUType##PreconditionerSymMatrixConstructorToTable_;
744 #define makeLduAsymPreconditioner(Precon, Type, DType, LUType) \
746 LduMatrix<Type, DType, LUType>::preconditioner:: \
747 addasymMatrixConstructorToTable<Precon##Type##DType##LUType##Preconditioner> \
748 add##Precon##Type##DType##LUType##PreconditionerAsymMatrixConstructorToTable_;
751 #define makeLduSmoother(Smoother, Type, DType, LUType) \
753 typedef Smoother<Type, DType, LUType> \
754 Smoother##Type##DType##LUType##Smoother; \
756 defineNamedTemplateTypeNameAndDebug \
758 Smoother##Type##DType##LUType##Smoother, \
762 #define makeLduSymSmoother(Smoother, Type, DType, LUType) \
764 LduMatrix<Type, DType, LUType>::smoother:: \
765 addsymMatrixConstructorToTable<Smoother##Type##DType##LUType##Smoother> \
766 add##Smoother##Type##DType##LUType##SymMatrixConstructorToTable_;
768 #define makeLduAsymSmoother(Smoother, Type, DType, LUType) \
770 LduMatrix<Type, DType, LUType>::smoother:: \
771 addasymMatrixConstructorToTable<Smoother##Type##DType##LUType##Smoother> \
772 add##Smoother##Type##DType##LUType##AsymMatrixConstructorToTable_;
775 #define makeLduSolver(Solver, Type, DType, LUType) \
777 typedef Solver<Type, DType, LUType> \
778 Solver##Type##DType##LUType##Solver; \
780 defineNamedTemplateTypeNameAndDebug \
782 Solver##Type##DType##LUType##Solver, \
786 #define makeLduSymSolver(Solver, Type, DType, LUType) \
788 LduMatrix<Type, DType, LUType>::solver:: \
789 addsymMatrixConstructorToTable<Solver##Type##DType##LUType##Solver> \
790 add##Solver##Type##DType##LUType##SymMatrixConstructorToTable_;
792 #define makeLduAsymSolver(Solver, Type, DType, LUType) \
794 LduMatrix<Type, DType, LUType>::solver:: \
795 addasymMatrixConstructorToTable<Solver##Type##DType##LUType##Solver> \
796 add##Solver##Type##DType##LUType##AsymMatrixConstructorToTable_;
The class contains the addressing required by the lduMatrix: upper, lower and losort.
FieldField< Field, LUType > & interfacesLower()
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
declareRunTimeSelectionTable(autoPtr, solver, symMatrix,(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict),(fieldName, matrix, solverDict))
static const label defaultMaxIter_
virtual ~preconditioner()=default
void sumMagOffDiag(Field< LUType > &sumOff) const
A class for handling words, derived from Foam::string.
static autoPtr< smoother > New(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &smootherDict)
A field of fields is a PtrList of fields with reference counting.
void operator=(const LduMatrix< Type, DType, LUType > &)
A class for managing temporary objects.
void readControl(const dictionary &dict, T &val, const word &key)
void initMatrixInterfaces(const bool add, const FieldField< Field, LUType > &interfaceCoeffs, const Field< Type > &psiif, Field< Type > &result) const
void sumA(Field< Type > &) const
virtual const word & type() const =0
virtual void preconditionT(Field< Type > &wT, const Field< Type > &rT) const
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
LduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
const FieldField< Field, LUType > & interfacesUpper() const
void Amul(Field< Type > &, const tmp< Field< Type >> &) const
void updateMatrixInterfaces(const bool add, const FieldField< Field, LUType > &interfaceCoeffs, const Field< Type > &psiif, Field< Type > &result) const
Field< LUType > & upper()
virtual ~solver()=default
const word & fieldName() const noexcept
void operator-=(const LduMatrix< Type, DType, LUType > &)
preconditioner(const solver &sol)
const LduMatrix< Type, DType, LUType > & matrix_
virtual void precondition(Field< Type > &wA, const Field< Type > &rA) const =0
void Tmul(Field< Type > &, const tmp< Field< Type >> &) const
const LduMatrix< Type, DType, LUType > & matrix_
const LduMatrix< Type, DType, LUType > & matrix() const noexcept
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)
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 &)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
virtual const lduSchedule & patchSchedule() const =0
virtual const word & type() const =0
virtual void smooth(Field< Type > &psi, const label nSweeps) const =0
void operator+=(const LduMatrix< Type, DType, LUType > &)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
void operator*=(const scalarField &)
tmp< Field< Type > > faceH(const Field< Type > &) const
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
const lduMesh & mesh() const
Macros to ease declaration of run-time selection tables.
virtual const word & type() const =0
const word & fieldName() const noexcept
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 lduSchedule & patchSchedule() const
const FieldField< Field, LUType > & interfacesLower() const
virtual void read(const dictionary &preconditionerDict)
solver(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict)
virtual ~smoother()=default
static autoPtr< preconditioner > New(const solver &sol, const dictionary &preconditionerDict)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
const LduInterfaceFieldPtrsList< Type > & interfaces() const
const volScalarField & psi
declareRunTimeSelectionTable(autoPtr, smoother, symMatrix,(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix),(fieldName, matrix))
FieldField< Field, LUType > & interfacesUpper()
const lduAddressing & lduAddr() const
LduInterfaceFieldPtrsList< Type > & interfaces()
Type normFactor(const Field< Type > &psi, const Field< Type > &Apsi, Field< Type > &tmpField) const
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)
const LduMatrix< Type, DType, LUType > & matrix() const noexcept
virtual void readControls()
Field< LUType > & lower()