43#ifndef Foam_faMatrix_H
44#define Foam_faMatrix_H
154 mutable std::unique_ptr<faceFluxFieldType> faceFluxCorrectionPtr_;
160 friend class faSolver;
166 template<
class Type2>
174 template<
class Type2>
183 template<
class Type2>
191 template<
class Type2>
213 const bool couples =
true
220 template<
template<
class>
class ListType>
224 const ListType<Type>& values
245 solver_(std::move(sol))
331 return internalCoeffs_;
338 return internalCoeffs_;
345 return boundaryCoeffs_;
352 return boundaryCoeffs_;
361 return faceFluxCorrectionPtr_;
367 faceFluxCorrectionPtr_.reset(
flux);
373 return bool(faceFluxCorrectionPtr_);
408 const bool forceReference =
false
416 const bool forceReference =
false
424 const bool forceReference =
false
556 friend Ostream& operator<< <Type>
labelList faceLabels(nFaceLabels)
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 that is much like a Foam::List except that it is expected to hold numeri...
Generic GeometricField class.
DimensionedField< scalar, areaMesh > Internal
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 List with indirect addressing. Like IndirectList but does not store addressing.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Mesh data needed to do the Finite Area discretisation.
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.
SolverPerformance< Type > solve(const dictionary &solverControls)
Solve returning the solution statistics.
faSolver(faMatrix< Type > &faMat, autoPtr< lduMatrix::solver > &&sol)
A special matrix type and solver, designed for finite area solutions of scalar equations....
faMatrix(const tmp< faMatrix< Type > > &)
Copy/move construct from tmp<faMatrix<Type>>.
void setValues(const labelUList &faceLabels, const UList< Type > &values)
Set solution in given faces to the specified values and eliminate the corresponding equations from th...
void relax(const scalar alpha)
Relax matrix (for steady-state solution).
void operator+=(const dimensioned< Type > &)
SolverPerformance< Type > solve(const dictionary &)
Solve returning the solution statistics.
void addToInternalField(const labelUList &addr, const Field< Type2 > &pf, Field< Type2 > &intf) const
Add patch contribution to internal field.
void operator*=(const dimensioned< scalar > &)
const Field< Type > & source() const noexcept
void operator*=(const tmp< areaScalarField > &)
void operator=(const faMatrix< Type > &)
SolverPerformance< Type > solve(const word &name)
Solve returning the solution statistics.
GeometricField< scalar, faePatchField, edgeMesh > faceFluxFieldType
const FieldField< Field, Type > & internalCoeffs() const noexcept
faBoundary scalar field containing pseudo-matrix coeffs for internal cells
void operator+=(const DimensionedField< Type, areaMesh > &)
void relax()
Relax matrix (for steady-state solution).
SolverPerformance< Type > solve()
Solve returning the solution statistics.
void setReferences(const labelUList &faceLabels, const UList< Type > &values, const bool forceReference=false)
Set reference level for solution.
std::unique_ptr< faceFluxFieldType > faceFluxFieldPtrType
tmp< faMatrix< Type > > clone() const
Construct and return a clone.
void operator+=(Foam::zero)
faceFluxFieldPtrType & faceFluxCorrectionPtr()
Return pointer to face-flux non-orthogonal correction field.
FieldField< Field, Type > & internalCoeffs() noexcept
faBoundary scalar field containing pseudo-matrix coeffs for internal cells
tmp< GeometricField< scalar, faePatchField, edgeMesh > > flux() const
void setValues(const labelUList &faceLabels, const Type &value)
Set solution in given faces to the specified value and eliminate the corresponding equations from the...
const FieldField< Field, Type > & boundaryCoeffs() const noexcept
faBoundary scalar field containing pseudo-matrix coeffs for boundary cells
void setReference(const label facei, const Type &value, const bool forceReference=false)
Set reference level for solution.
void setValues(const labelUList &faceLabels, const UIndirectList< Type > &values)
Set solution in given faces to the specified values and eliminate the corresponding equations from th...
void setReferences(const labelUList &faceLabels, const Type &value, const bool forceReference=false)
Set reference level for solution.
void operator+=(const faMatrix< Type > &)
faMatrix(const faMatrix< Type > &)
Copy construct.
const GeometricField< scalar, faPatchField, areaMesh > & psi() const
const dimensionSet & dimensions() const noexcept
tmp< GeometricField< Type, faPatchField, areaMesh > > H() const
Return the H operation source.
void addCmptAvBoundaryDiag(scalarField &diag) const
void addBoundarySource(Field< Type > &source, const bool couples=true) const
friend class faSolver
Declare friendship with the faSolver class.
void setComponentReference(const label patchi, const label facei, const direction cmpt, const scalar value)
Set reference level for a component of the solution on a given patch face.
GeometricField< scalar, faPatchField, areaMesh > psiFieldType
virtual ~faMatrix()
Destructor.
void operator+=(const tmp< faMatrix< Type > > &)
void operator-=(const dimensioned< Type > &)
const dictionary & solverDict(const word &name) const
Return the solver dictionary (from faSolution) for name.
void operator-=(Foam::zero)
tmp< areaScalarField > A() const
Return the central coefficient.
void operator-=(const faMatrix< Type > &)
tmp< Field< Type > > residual() const
Return the matrix residual.
void faceFluxCorrectionPtr(faceFluxFieldType *flux)
Set pointer to face-flux non-orthogonal correction field.
void addBoundaryDiag(scalarField &diag, const direction cmpt) const
void negate()
Inplace negate.
faMatrix(const GeometricField< Type, faPatchField, areaMesh > &psi, const dimensionSet &ds)
Construct given a field to solve for.
void setValuesFromList(const labelUList &faceLabels, const ListType< Type > &values)
Set solution in given faces to the specified values.
void operator+=(const tmp< DimensionedField< Type, areaMesh > > &)
void operator-=(const tmp< faMatrix< Type > > &)
void operator-=(const tmp< DimensionedField< Type, areaMesh > > &)
tmp< scalarField > D() const
Return the matrix diagonal.
void subtractFromInternalField(const labelUList &addr, const Field< Type2 > &pf, Field< Type2 > &intf) const
Subtract patch contribution from internal field.
void addToInternalField(const labelUList &addr, const tmp< Field< Type2 > > &tpf, Field< Type2 > &intf) const
void subtractFromInternalField(const labelUList &addr, const tmp< Field< Type2 > > &tpf, Field< Type2 > &intf) const
bool hasFaceFluxCorrection() const noexcept
True if face-flux non-orthogonal correction field exists.
void operator-=(const DimensionedField< Type, areaMesh > &)
void operator*=(const tmp< areaScalarField::Internal > &)
FieldField< Field, Type > & boundaryCoeffs() noexcept
faBoundary scalar field containing pseudo-matrix coeffs for boundary cells
void operator=(const tmp< faMatrix< Type > > &)
Field< scalar > & source() noexcept
const dictionary & solverDict() const
Return the solver dictionary for psi.
void operator*=(const areaScalarField::Internal &)
faPatchField<Type> abstract base class. This class gives a fat-interface to all derived classes cover...
lduMatrix(const lduMesh &mesh)
Construct (without coefficients) for an LDU addressed mesh.
const scalarField & diag() const
constexpr refCount() noexcept
Default construct, initializing count to 0.
A class for managing temporary objects.
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 ...
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
void checkMethod(const faMatrix< Type > &, const faMatrix< Type > &, const char *)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
UList< label > labelUList
A UList of labels.
#define FOAM_DEPRECATED_FOR(since, replacement)