43#ifndef Foam_fvMatrix_H
44#define Foam_fvMatrix_H
63template<
class Type>
class fvMatrix;
64template<
class T>
class UIndirectList;
156 word lduAssemblyName_;
188 template<
class Type2>
196 template<
class Type2>
205 template<
class Type2>
213 template<
class Type2>
242 const bool couples=
true
249 template<
template<
class>
class ListType>
253 const ListType<Type>& values
276 solver_(std::move(sol))
342 return (nMatrix_ == 0 ? 1 : nMatrix_);
347 return (nMatrix_ == 0 ? *
this : subMatrices_[i]);
352 return (nMatrix_ == 0 ? *
this : subMatrices_[i]);
419 (i == 0 && nMatrix_ == 0) ? psi_ :
matrix(i).
psi()
431 (i == 0 && nMatrix_ == 0)
449 subMatrices_.
clear();
473 return internalCoeffs_;
480 return internalCoeffs_;
487 return boundaryCoeffs_;
494 return boundaryCoeffs_;
504 return faceFluxCorrectionPtr_;
510 return bool(faceFluxCorrectionPtr_);
545 const bool forceReference =
false
553 const bool forceReference =
false
561 const bool forceReference =
false
723 friend Ostream& operator<< <Type>
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A field of fields is a PtrList of fields with reference counting.
Generic templated field type.
Generic GeometricField class.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A dynamically resizable PtrList with allocation management.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
void clear()
Clear the PtrList. Delete allocated entries and set size to zero.
A List with indirect addressing. Like IndirectList but does not store addressing.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Generic dimensioned Type class.
SolverPerformance< Type > solve()
Solve returning the solution statistics.
fvSolver(fvMatrix< Type > &fvMat, autoPtr< lduMatrix::solver > &&sol)
A special matrix type and solver, designed for finite volume solutions of scalar equations....
void operator-=(const fvMatrix< Type > &)
autoPtr< fvSolver > solver()
Construct and return the solver.
tmp< Field< Type > > DD() const
Return the matrix Type diagonal.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > flux() const
Return the face-flux field from the matrix.
tmp< volScalarField > A() const
Return the central coefficient.
void manipulateMatrix(direction cmp)
Manipulate matrix.
void addToInternalField(const labelUList &addr, const Field< Type2 > &pf, Field< Type2 > &intf) const
Add patch contribution to internal field.
label globalPatchID(const label fieldi, const label patchi) const
void mapContributions(label fieldi, const FieldField< Field, Type > &fluxContrib, FieldField< Field, Type > &contrib, bool internal) const
Add internal and boundary contribution to local patches.
void setReferences(const labelUList &cellLabels, const Type &value, const bool forceReference=false)
Set reference level for solution.
const Field< Type > & source() const noexcept
const FieldField< Field, Type > & internalCoeffs() const noexcept
void transferFvMatrixCoeffs()
Transfer lower, upper, diag and source to this fvMatrix.
GeometricField< Type, fvsPatchField, surfaceMesh > * faceFluxFieldPtrType
Declare return type of the faceFluxCorrectionPtr() function.
void relax()
Relax matrix (for steady-state solution).
SolverPerformance< Type > solve()
Solve returning the solution statistics.
tmp< volScalarField > H1() const
Return H(1)
void operator+=(const fvMatrix< Type > &)
const fvMatrix< Type > & matrix(const label i) const
void createOrUpdateLduPrimitiveAssembly()
Create or update ldu assembly.
faceFluxFieldPtrType & faceFluxCorrectionPtr()
Return pointer to face-flux non-orthogonal correction field.
FieldField< Field, Type > & internalCoeffs() noexcept
const FieldField< Field, Type > & boundaryCoeffs() const noexcept
GeometricField< Type, fvPatchField, volMesh > & psi(const label i=0)
virtual ~fvMatrix()
Destructor.
GeometricField< Type, fvPatchField, volMesh > psiFieldType
The geometric field type for psi.
GeometricField< Type, fvsPatchField, surfaceMesh > faceFluxFieldType
Field type for face flux (for non-orthogonal correction)
void setValues(const labelUList &cellLabels, const Type &value)
const dimensionSet & dimensions() const noexcept
const lduPrimitiveMeshAssembly & lduMeshAssembly()
Return optional lduAdressing.
void operator*=(const volScalarField::Internal &)
void addCmptAvBoundaryDiag(scalarField &diag) const
void addBoundarySource(Field< Type > &source, const bool couples=true) const
void setReference(const label celli, const Type &value, const bool forceReference=false)
Set reference level for solution.
void setComponentReference(const label patchi, const label facei, const direction cmpt, const scalar value)
void boundaryManipulate(typename GeometricField< Type, fvPatchField, volMesh >::Boundary &values)
Manipulate based on a boundary field.
void setInterfaces(lduInterfaceFieldPtrsList &, PtrDynList< lduInterfaceField > &newInterfaces)
Set interfaces.
SolverPerformance< Type > solveSegregatedOrCoupled(const dictionary &)
Solve segregated or coupled returning the solution statistics.
SolverPerformance< Type > solveCoupled(const dictionary &)
Solve coupled returning the solution statistics.
tmp< GeometricField< Type, fvPatchField, volMesh > > H() const
Return the H operation source.
tmp< Field< Type > > residual() const
Return the matrix residual.
void addBoundaryDiag(scalarField &diag, const direction cmpt) const
void negate()
Inplace negate.
tmp< fvMatrix< Type > > clone() const
Construct and return a clone.
SolverPerformance< Type > solveSegregated(const dictionary &)
Solve segregated returning the solution statistics.
void clear()
Clear multiple fvMatrices.
void addFvMatrix(fvMatrix< Type > &matrix)
Add fvMatrix.
tmp< scalarField > D() const
Return the matrix scalar diagonal.
void subtractFromInternalField(const labelUList &addr, const Field< Type2 > &pf, Field< Type2 > &intf) const
Subtract patch contribution from internal field.
const GeometricField< Type, fvPatchField, volMesh > & psi(const label i=0) const
Return psi.
bool checkImplicit(const label fieldi=0)
Name the implicit assembly addressing.
lduPrimitiveMeshAssembly * lduMeshPtr()
Access to lduPrimitiveMeshAssembly.
void operator=(const fvMatrix< Type > &)
bool hasFaceFluxCorrection() const noexcept
True if face-flux non-orthogonal correction field exists.
void setValuesFromList(const labelUList &cellLabels, const ListType< Type > &values)
Set solution in given cells to the specified values.
FieldField< Field, Type > & boundaryCoeffs() noexcept
Field< Type > & source() noexcept
fvMatrix< Type > & matrix(const label i)
const dictionary & solverDict() const
Return the solver dictionary taking into account finalIteration.
void setBounAndInterCoeffs()
Manipulate boundary/internal coeffs for coupling.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
lduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
An assembly of lduMatrix that is specific inter-region coupling through mapped patches.
const labelListList & patchMap() const
Return patchMap.
Reference counter for various OpenFOAM components.
A class for managing temporary objects.
Mesh data needed to do the Finite Volume discretisation.
A class for handling words, derived from Foam::string.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Macro definitions for declaring ClassName(), NamespaceName(), etc.
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
const volScalarField & psi
A scalar instance of fvMatrix.
void checkMethod(const faMatrix< Type > &, const faMatrix< Type > &, const char *)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
tmp< fvMatrix< Type > > correction(const fvMatrix< Type > &)
#define FOAM_DEPRECATED_FOR(since, replacement)