45 internalCoeffs_[patchi][facei].component(cmpt) +=
46 diag()[psi_.mesh().boundary()[patchi].faceCells()[facei]];
48 boundaryCoeffs_[patchi][facei].component(cmpt) +=
49 diag()[psi_.mesh().boundary()[patchi].faceCells()[facei]]*value;
60 <<
"solving faMatrix<Type>"
70 auto&
psi = psi_.constCast();
74 "faMatrix<Type>::solve",
81 addBoundarySource(source);
85 psi_.boundaryField().scalarInterfaces();
87 for (
direction cmpt = 0; cmpt < Type::nComponents; ++cmpt)
91 scalarField psiCmpt(psi_.primitiveField().component(cmpt));
92 addBoundaryDiag(
diag(), cmpt);
98 boundaryCoeffs_.component(cmpt)
103 internalCoeffs_.component(cmpt)
125 updateMatrixInterfaces
148 )->solve(psiCmpt, sourceCmpt, cmpt);
155 solverPerfVec.
replace(cmpt, solverPerf);
158 psi.primitiveFieldRef().replace(cmpt, psiCmpt);
162 psi.correctBoundaryConditions();
164 psi.mesh().data().setSolverPerformance(
psi.name(), solverPerfVec);
166 return solverPerfVec;
173 return solve(faMat_.solverDict());
195 auto& res = tres().ref();
200 for (
direction cmpt = 0; cmpt < Type::nComponents; ++cmpt)
209 boundaryCoeffs_.component(cmpt)
218 res.component(cmpt) - boundaryDiagCmpt*psiCmpt,
A const Field/List wrapper with possible data conversion.
tmp< DimensionedField< cmptType, GeoMesh > > component(const direction d) const
Return a component field of the field.
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...
tmp< Field< cmptType > > component(const direction) const
Return a component field of the field.
lduInterfaceFieldPtrsList scalarInterfaces() const
Return a list of pointers for each patch field with only those pointing to interfaces being set.
const Internal & internalField() const noexcept
Return a const-reference to the dimensioned internal field.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
A non-const Field/List wrapper with possible data conversion.
void size(const label n)
Older name for setAddressableSize.
static label nRequests() noexcept
Number of outstanding requests (on the internal list of requests).
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T, or return the given default value. FatalIOError if it is found and the number of...
SolverPerformance< Type > solve()
Solve returning the solution statistics.
SolverPerformance< Type > solve()
Solve returning the solution statistics.
const GeometricField< Type, faPatchField, areaMesh > & psi() const
void addBoundarySource(Field< Type > &source, const bool couples=true) const
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.
tmp< Field< Type > > residual() const
Return the matrix residual.
void addBoundaryDiag(scalarField &diag, const direction cmpt) const
Field< Type > & source() noexcept
const dictionary & solverDict() const
Return the solver dictionary for psi.
static autoPtr< solver > New(const word &solverName, const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces, const dictionary &solverControls)
Return a new solver of given type.
void residual(solveScalarField &rA, const solveScalarField &psi, const scalarField &source, const FieldField< Field, scalar > &interfaceBouCoeffs, const lduInterfaceFieldPtrsList &interfaces, const direction cmpt) const
const scalarField & diag() const
void initMatrixInterfaces(const bool add, const FieldField< Field, scalar > &interfaceCoeffs, const lduInterfaceFieldPtrsList &interfaces, const solveScalarField &psiif, solveScalarField &result, const direction cmpt) const
Initialise the update of interfaced interfaces for matrix operations.
void updateMatrixInterfaces(const bool add, const FieldField< Field, scalar > &interfaceCoeffs, const lduInterfaceFieldPtrsList &interfaces, const solveScalarField &psiif, solveScalarField &result, const direction cmpt, const label startRequest) const
Update interfaced interfaces for matrix operations.
A traits class, which is primarily used for primitives and vector-space.
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
const volScalarField & psi
#define DebugInFunction
Report an information message using Foam::Info.
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.
messageStream Info
Information stream (stdout output on master, null elsewhere).
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static constexpr const zero Zero
Global zero (0).
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
void diag(pointPatchField< vector > &, const pointPatchField< tensor > &)
UPtrList< const lduInterfaceField > lduInterfaceFieldPtrsList
List of coupled interface fields to be used in coupling.
SolverPerformance< scalar > solverPerformance
SolverPerformance instantiated for a scalar.