34template<
class Type,
class DType,
class LUType>
41template<
class Type,
class DType,
class LUType>
48 diagPtr_ = std::make_unique<Field<DType>>(*(A.diagPtr_));
53 upperPtr_ = std::make_unique<Field<LUType>>(*(A.upperPtr_));
58 lowerPtr_ = std::make_unique<Field<LUType>>(*(A.lowerPtr_));
63 sourcePtr_ = std::make_unique<Field<Type>>(*(A.sourcePtr_));
68template<
class Type,
class DType,
class LUType>
72 diagPtr_(std::move(
A.diagPtr_)),
73 lowerPtr_(std::move(
A.lowerPtr_)),
74 upperPtr_(std::move(
A.upperPtr_)),
75 sourcePtr_(std::move(
A.sourcePtr_))
81template<
class Type,
class DType,
class LUType>
89 diagPtr_ = std::move(
A.diagPtr_);
90 upperPtr_ = std::move(
A.upperPtr_);
91 lowerPtr_ = std::move(
A.lowerPtr_);
92 sourcePtr_ = std::move(
A.sourcePtr_);
101 diagPtr_ = std::make_unique<Field<DType>>(*(
A.diagPtr_));
106 upperPtr_ = std::make_unique<Field<LUType>>(*(
A.upperPtr_));
111 lowerPtr_ = std::make_unique<Field<LUType>>(*(
A.lowerPtr_));
116 sourcePtr_ = std::make_unique<Field<Type>>(*(
A.sourcePtr_));
122template<
class Type,
class DType,
class LUType>
130 diagPtr_(new
Field<DType>(is)),
131 upperPtr_(new
Field<LUType>(is)),
132 lowerPtr_(new
Field<LUType>(is)),
139template<
class Type,
class DType,
class LUType>
147 ? (!lowerPtr_ ?
"diagonal" :
"diagonal-lower")
148 : (!lowerPtr_ ?
"symmetric" :
"asymmetric")
153 return (!upperPtr_ && !lowerPtr_ ?
"empty" :
"ill-defined");
157template<
class Type,
class DType,
class LUType>
163 <<
"diagPtr_ unallocated"
171template<
class Type,
class DType,
class LUType>
177 std::make_unique<Field<DType>>(lduAddr().size(),
Foam::zero{});
184template<
class Type,
class DType,
class LUType>
196 <<
"lowerPtr_ and upperPtr_ unallocated"
205template<
class Type,
class DType,
class LUType>
212 upperPtr_ = std::make_unique<Field<LUType>>(*lowerPtr_);
217 std::make_unique<Field<LUType>>
219 lduAddr().lowerAddr().size(),
229template<
class Type,
class DType,
class LUType>
241 <<
"lowerPtr_ and upperPtr_ unallocated"
250template<
class Type,
class DType,
class LUType>
257 lowerPtr_ = std::make_unique<Field<LUType>>(*upperPtr_);
261 lowerPtr_ = std::make_unique<Field<LUType>>
263 lduAddr().lowerAddr().size(),
273template<
class Type,
class DType,
class LUType>
279 <<
"sourcePtr_ unallocated"
287template<
class Type,
class DType,
class LUType>
293 std::make_unique<Field<Type>>(lduAddr().size(),
Foam::zero{});
318template<
class Type,
class DType,
class LUType>
319Foam::Ostream& Foam::operator<<
327 os <<
"Diagonal = " << mat.diag() <<
nl <<
nl;
332 os <<
"Upper triangle = " << mat.upper() <<
nl <<
nl;
337 os <<
"Lower triangle = " << mat.lower() <<
nl <<
nl;
342 os <<
"Source = " << mat.source() <<
nl <<
nl;
static const Foam::dimensionedScalar A("", Foam::dimPressure, 611.21)
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
virtual bool check(const char *operation) const
Check IOstream status for given operation.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
LduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
const Field< LUType > & upper() const
const lduAddressing & lduAddr() const
Return the LDU addressing.
const Field< Type > & source() const
const Field< DType > & diag() const
LduMatrix(const lduMesh &mesh)
Construct given an LDU addressed mesh.
const lduMesh & mesh() const noexcept
Return the LDU mesh from which the addressing is obtained.
word matrixTypeName() const
The matrix type (empty, diagonal, symmetric, ...).
const Field< LUType > & lower() const
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
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 FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
errorManip< error > abort(error &err)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
constexpr char nl
The newline '\n' character (0x0a).