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_));
88 lowerCSRPtr_ = std::make_unique<scalarField>(*(
A.lowerCSRPtr_));
98 diagPtr_(
std::move(
A.diagPtr_)),
99 lowerPtr_(
std::move(
A.lowerPtr_)),
100 upperPtr_(
std::move(
A.upperPtr_)),
101 lowerCSRPtr_(
std::move(
A.lowerCSRPtr_)),
102 workPtr_(
std::move(
A.workPtr_))
112 diagPtr_ = std::move(
A.diagPtr_);
113 upperPtr_ = std::move(
A.upperPtr_);
114 lowerPtr_ = std::move(
A.lowerPtr_);
115 lowerCSRPtr_ = std::move(
A.lowerCSRPtr_);
116 workPtr_ = std::move(
A.workPtr_);
123 diagPtr_ = std::make_unique<scalarField>(*(
A.diagPtr_));
128 upperPtr_ = std::make_unique<scalarField>(*(
A.upperPtr_));
133 lowerPtr_ = std::make_unique<scalarField>(*(
A.lowerPtr_));
140 lowerCSRPtr_ = std::make_unique<scalarField>(*(
A.lowerCSRPtr_));
150 bool withLower, withDiag, withUpper, withLowerCSR;
152 is >> withLower >> withDiag >> withUpper >> withLowerCSR;
156 lowerPtr_ = std::make_unique<scalarField>(is);
160 diagPtr_ = std::make_unique<scalarField>(is);
164 upperPtr_ = std::make_unique<scalarField>(is);
177 lowerCSRPtr_ = std::make_unique<scalarField>(is);
192 ? (!lowerPtr_ ?
"diagonal" :
"diagonal-lower")
193 : (!lowerPtr_ ?
"symmetric" :
"asymmetric")
198 return (!upperPtr_ && !lowerPtr_ ?
"empty" :
"ill-defined");
207 <<
"diagPtr_ unallocated" 220 std::make_unique<scalarField>(lduAddr().size(),
Foam::zero{});
235 diagPtr_ = std::make_unique<scalarField>(size,
Foam::zero{});
253 <<
"lowerPtr_ and upperPtr_ unallocated" 268 upperPtr_ = std::make_unique<scalarField>(*lowerPtr_);
273 lowerCSRPtr_.reset(
nullptr);
276 std::make_unique<scalarField>
278 lduAddr().lowerAddr().size(),
294 upperPtr_ = std::make_unique<scalarField>(*lowerPtr_);
299 lowerCSRPtr_.reset(
nullptr);
305 upperPtr_ = std::make_unique<scalarField>(nCoeffs,
Foam::zero{});
324 <<
"lowerPtr_ and upperPtr_ unallocated" 337 lowerCSRPtr_.reset(
nullptr);
341 lowerPtr_ = std::make_unique<scalarField>(*upperPtr_);
346 std::make_unique<scalarField>
348 lduAddr().lowerAddr().size(),
362 lowerCSRPtr_.reset(
nullptr);
366 lowerPtr_ = std::make_unique<scalarField>(*upperPtr_);
375 std::make_unique<scalarField>(nCoeffs,
Foam::zero{});
387 const label nLower = lduAddr().losortAddr().
size();
389 lowerCSRPtr_ = std::make_unique<scalarField>(nLower);
393 lduAddr().map(*lowerPtr_, *lowerCSRPtr_);
397 lduAddr().map(*upperPtr_, *lowerCSRPtr_);
402 <<
"lowerPtr_ and upperPtr_ unallocated" 407 return *lowerCSRPtr_;
415 const label nLower = lduAddr().losortAddr().
size();
417 lowerCSRPtr_ = std::make_unique<scalarField>(nLower);
421 lduAddr().map(*lowerPtr_, *lowerCSRPtr_);
425 lduAddr().map(*upperPtr_, *lowerCSRPtr_);
430 <<
"lowerPtr_ and upperPtr_ unallocated" 435 return *lowerCSRPtr_;
441 if (!workPtr_ || workPtr_->size() != size)
443 workPtr_ = std::make_unique<solveScalarField>(size,
Foam::zero{});
455 <<
"workPtr_ unallocated" 466 const word& fieldName,
480 : IOobject::scopedName(
"residual", fieldName)
489 if (initial && dataPtr->isFirstIteration())
491 *residualPtr = residual;
493 <<
"Setting residual field for first solver iteration " 494 <<
"for solver field: " << fieldName <<
endl;
499 *residualPtr = residual;
501 <<
"Setting residual field for solver field " 502 << fieldName <<
endl;
532 if (mat.hasLowerCSR() && !mat.hasLower())
535 os << mat.lowerCSR();
547 const InfoProxy<lduMatrix>& iproxy
550 const auto& mat = *iproxy;
560 os <<
"lower:" << mat.lower().size() <<
endl;
564 os <<
"diag :" << mat.diag().size() <<
endl;
568 os <<
"upper:" << mat.upper().size() <<
endl;
const scalarField & diag() const
void size(const label n)
Older name for setAddressableSize.
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.
const solveScalarField & work() const
Work array.
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)
const scalarField & lowerCSR() const