53 { normTypes::NO_NORM,
"none" },
54 { normTypes::DEFAULT_NORM,
"default" },
55 { normTypes::L1_SCALED_NORM,
"L1_scaled" },
73 diagPtr_ = std::make_unique<scalarField>(*(
A.diagPtr_));
78 upperPtr_ = std::make_unique<scalarField>(*(
A.upperPtr_));
83 lowerPtr_ = std::make_unique<scalarField>(*(
A.lowerPtr_));
91 diagPtr_(
std::move(
A.diagPtr_)),
92 lowerPtr_(
std::move(
A.lowerPtr_)),
93 upperPtr_(
std::move(
A.upperPtr_))
103 diagPtr_ = std::move(
A.diagPtr_);
104 upperPtr_ = std::move(
A.upperPtr_);
105 lowerPtr_ = std::move(
A.lowerPtr_);
112 diagPtr_ = std::make_unique<scalarField>(*(
A.diagPtr_));
117 upperPtr_ = std::make_unique<scalarField>(*(
A.upperPtr_));
122 lowerPtr_ = std::make_unique<scalarField>(*(
A.lowerPtr_));
132 bool withLower, withDiag, withUpper;
134 is >> withLower >> withDiag >> withUpper;
138 lowerPtr_ = std::make_unique<scalarField>(is);
142 diagPtr_ = std::make_unique<scalarField>(is);
146 upperPtr_ = std::make_unique<scalarField>(is);
160 ? (!lowerPtr_ ?
"diagonal" :
"diagonal-lower")
161 : (!lowerPtr_ ?
"symmetric" :
"asymmetric")
166 return (!upperPtr_ && !lowerPtr_ ?
"empty" :
"ill-defined");
175 <<
"diagPtr_ unallocated" 188 std::make_unique<scalarField>(lduAddr().size(),
Foam::zero{});
203 diagPtr_ = std::make_unique<scalarField>(size,
Foam::zero{});
221 <<
"lowerPtr_ and upperPtr_ unallocated" 236 upperPtr_ = std::make_unique<scalarField>(*lowerPtr_);
241 std::make_unique<scalarField>
243 lduAddr().lowerAddr().size(),
259 upperPtr_ = std::make_unique<scalarField>(*lowerPtr_);
267 upperPtr_ = std::make_unique<scalarField>(nCoeffs,
Foam::zero{});
286 <<
"lowerPtr_ and upperPtr_ unallocated" 301 lowerPtr_ = std::make_unique<scalarField>(*upperPtr_);
306 std::make_unique<scalarField>
308 lduAddr().lowerAddr().size(),
324 lowerPtr_ = std::make_unique<scalarField>(*upperPtr_);
333 std::make_unique<scalarField>(nCoeffs,
Foam::zero{});
344 const word& fieldName,
358 : IOobject::scopedName(
"residual", fieldName)
367 if (initial && dataPtr->isFirstIteration())
369 *residualPtr = residual;
371 <<
"Setting residual field for first solver iteration " 372 <<
"for solver field: " << fieldName <<
endl;
377 *residualPtr = residual;
379 <<
"Setting residual field for solver field " 380 << fieldName <<
endl;
418 const InfoProxy<lduMatrix>& iproxy
421 const auto& mat = *iproxy;
429 os <<
"lower:" << mat.lower().size() <<
endl;
433 os <<
"diag :" << mat.diag().size() <<
endl;
437 os <<
"upper:" << mat.upper().size() <<
endl;
const scalarField & diag() const
word matrixTypeName() const
The matrix type (empty, diagonal, symmetric, ...)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
void setResidualField(const scalarField &residual, const word &fieldName, const bool initial) const
Set the residual field using an IOField on the object registry if it exists.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
const Type * findObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
IOField< scalar > scalarIOField
IO for a Field of scalar.
static const Enum< normTypes > normTypesNames_
Names for the normTypes.
virtual const objectRegistry & thisDb() const
Return the object registry - resolve conflict polyMesh/lduMesh.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
static const char * name(const bool b) noexcept
A string representation of bool as "false" / "true".
const dimensionedScalar e
Elementary charge.
A class for handling words, derived from Foam::string.
Type * getObjectPtr(const word &name, const bool recursive=false) const
Return non-const pointer to the object of the given Type, using a const-cast to have it behave like a...
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const scalarField & lower() const
static const scalar defaultTolerance
Default (absolute) tolerance (1e-6)
normTypes
Enumerated matrix normalisation types.
errorManip< error > abort(error &err)
#define DebugInfo
Report an information message using Foam::Info.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
defineTypeNameAndDebug(combustionModel, 0)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
lduMatrix is a general matrix class in which the coefficients are stored as three arrays...
const scalarField & upper() const
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
lduMatrix(const lduMesh &mesh)
Construct (without coefficients) for an LDU addressed mesh.
static const Foam::dimensionedScalar A("", Foam::dimPressure, 611.21)