34 template<
class Type,
class DType,
class LUType>
41 template<
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_));
68 template<
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_))
81 template<
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_));
122 template<
class Type,
class DType,
class LUType>
130 diagPtr_(new Field<DType>(is)),
131 upperPtr_(new Field<LUType>(is)),
132 lowerPtr_(new Field<LUType>(is)),
139 template<
class Type,
class DType,
class LUType>
147 ? (!lowerPtr_ ?
"diagonal" :
"diagonal-lower")
148 : (!lowerPtr_ ?
"symmetric" :
"asymmetric")
153 return (!upperPtr_ && !lowerPtr_ ?
"empty" :
"ill-defined");
157 template<
class Type,
class DType,
class LUType>
163 <<
"diagPtr_ unallocated" 171 template<
class Type,
class DType,
class LUType>
177 std::make_unique<Field<DType>>(lduAddr().size(),
Foam::zero{});
184 template<
class Type,
class DType,
class LUType>
196 <<
"lowerPtr_ and upperPtr_ unallocated" 205 template<
class Type,
class DType,
class LUType>
212 upperPtr_ = std::make_unique<Field<LUType>>(*lowerPtr_);
217 std::make_unique<Field<LUType>>
219 lduAddr().lowerAddr().size(),
229 template<
class Type,
class DType,
class LUType>
241 <<
"lowerPtr_ and upperPtr_ unallocated" 250 template<
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(),
273 template<
class Type,
class DType,
class LUType>
279 <<
"sourcePtr_ unallocated" 287 template<
class Type,
class DType,
class LUType>
293 std::make_unique<Field<Type>>(lduAddr().size(),
Foam::zero{});
318 template<
class Type,
class DType,
class LUType>
322 const LduMatrix<Type, DType, LUType>& mat
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;
const Field< DType > & diag() const
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.
LduMatrix(const lduMesh &mesh)
Construct given an LDU addressed mesh.
constexpr char nl
The newline '\n' character (0x0a)
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
Generic templated field type.
A class for handling words, derived from Foam::string.
errorManip< error > abort(error &err)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
const Field< LUType > & upper() const
const Field< LUType > & lower() const
LduMatrix is a general matrix class in which the coefficients are stored as three arrays...
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
static const Foam::dimensionedScalar A("", Foam::dimPressure, 611.21)
const Field< Type > & source() const
word matrixTypeName() const
The matrix type (empty, diagonal, symmetric, ...)