A Field wrapper with possible data conversion. More...
Public Types | |
typedef Container< Type > | FieldType |
The adapted field type. More... | |
Public Types inherited from tmpNrc< Container< Type > > | |
typedef Container< Type > | element_type |
Type of object being managed. More... | |
typedef Container< Type > * | pointer |
Pointer to type of object being managed. More... | |
typedef Foam::refCount::zero | refCount |
Null reference counter class. More... | |
Public Member Functions | |
PrecisionAdaptor (Container< InputType > &input, const bool copy=true) | |
Construct from Container<InputType>, copying on input if required. More... | |
~PrecisionAdaptor () | |
Destructor, copying on destroy. More... | |
FieldType & | ref () |
Allow modification without const-ref check. More... | |
Public Member Functions inherited from tmpNrc< Container< Type > > | |
Foam::tmpNrc< Container< Type > > | New (Args &&... args) |
Foam::tmpNrc< Container< Type > > | NewFrom (Args &&... args) |
constexpr | tmpNrc () noexcept |
Construct with no managed pointer. More... | |
constexpr | tmpNrc (std::nullptr_t) noexcept |
Construct with no managed pointer. More... | |
tmpNrc (Container< Type > *p) noexcept | |
Construct, taking ownership of the pointer. More... | |
tmpNrc (const Container< Type > &obj) noexcept | |
Construct for a const reference to an object. More... | |
tmpNrc (tmpNrc< Container< Type > > &&t) noexcept | |
Move construct, transferring ownership. More... | |
tmpNrc (const tmpNrc< Container< Type > > &t) | |
Copy construct. More... | |
tmpNrc (const tmpNrc< Container< Type > > &t, bool reuse) | |
Copy construct. Optionally reusing pointer. More... | |
~tmpNrc () | |
Destructor: deletes managed pointer. More... | |
bool | isTmp () const noexcept |
True if this is a managed pointer (not a const reference) More... | |
bool | empty () const noexcept |
True if this is a non-null managed pointer. More... | |
bool | valid () const noexcept |
bool | movable () const noexcept |
True if this is a non-null managed pointer with a unique ref-count. More... | |
word | typeName () const |
Return type-name of the tmp, constructed from type-name of T. More... | |
Container< Type > * | get () noexcept |
Return pointer without nullptr checking. More... | |
const Container< Type > * | get () const noexcept |
Return const pointer without nullptr checking. More... | |
const Container< Type > & | cref () const |
void | cref (const Container< Type > &obj) noexcept |
Delete managed temporary object and set to const reference. More... | |
Container< Type > & | ref () const |
Container< Type > & | constCast () const |
Non-const dereference, even if the object is const. More... | |
Container< Type > * | ptr () const |
void | clear () const noexcept |
void | reset () noexcept |
Release ownership of managed temporary object. More... | |
void | reset (Container< Type > *p) noexcept |
Delete managed temporary object and set to new given pointer. More... | |
void | reset (tmpNrc< Container< Type > > &&other) noexcept |
Clear existing and transfer ownership. More... | |
void | swap (tmpNrc< Container< Type > > &other) noexcept |
Swaps the managed object with other. More... | |
const Container< Type > & | operator() () const |
Return const reference to the object. More... | |
operator const Container< Type > & () const | |
Cast to underlying data type, using the cref() method. More... | |
const Container< Type > * | operator-> () const |
Dereferences (const) pointer to the managed object. More... | |
Container< Type > * | operator-> () |
Dereferences (non-const) pointer to the managed object. More... | |
operator bool () const noexcept | |
Is non-null managed pointer or const object reference : valid() More... | |
void | operator= (Container< Type > *p) |
Take ownership of the pointer. More... | |
void | operator= (const tmpNrc< Container< Type > > &t) |
Transfer ownership of the managed pointer. More... | |
void | operator= (tmpNrc< Container< Type > > &&other) noexcept |
Clear existing and transfer ownership. More... | |
void | operator= (std::nullptr_t)=delete |
No assignment from literal nullptr. More... | |
operator tmp< Container< Type > > () | |
Conversion to tmp. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from tmpNrc< Container< Type > > | |
static tmpNrc< Container< Type > > | New (Args &&... args) |
Construct tmpNrc of T with forwarding arguments. More... | |
static tmpNrc< Container< Type > > | NewFrom (Args &&... args) |
Construct tmpNrc from derived type with forwarding arguments. More... | |
A Field wrapper with possible data conversion.
Conversion adaptor for Field that either wraps as a tmp reference or creates the necessary tmp and copies the values on construction and destruction. This provides automatic conversion between (scalar) types for use with linear solvers able to run mixed precision.
Definition at line 158 of file PrecisionAdaptor.H.
typedef Container<Type> FieldType |
The adapted field type.
Definition at line 185 of file PrecisionAdaptor.H.
|
inline |
Construct from Container<InputType>, copying on input if required.
Definition at line 191 of file PrecisionAdaptor.H.
References tmpNrc< Container< Type > >::cref().
|
inline |
Destructor, copying on destroy.
Definition at line 208 of file PrecisionAdaptor.H.
References tmpNrc< Container< Type > >::cref(), and tmpNrc< Container< Type > >::isTmp().
|
inline |
Allow modification without const-ref check.
Definition at line 222 of file PrecisionAdaptor.H.
References tmpNrc< Container< Type > >::constCast().
Referenced by primitiveMesh::makeCellCentresAndVols(), lduMatrix::solver::scalarSolve(), PBiCG::solve(), smoothSolver::solve(), PCG::solve(), PPCR::solve(), PBiCGStab::solve(), PPCG::solve(), faMatrix< Type >::solve(), GAMGSolver::solve(), and fvMatrix< Type >::solveSegregated().