Provides caching of weights and addressing to AMIInterpolation. More...
#include <AMICache.H>
Public Member Functions | |
| TypeName ("AMICache") | |
| AMICache (const bool toSource=true) | |
| Null constructor. | |
| AMICache (const dictionary &dict, const bool toSource=true) | |
| Construct from dictionary. | |
| AMICache (const AMICache &cache) | |
| Construct as copy. | |
| AMICache (const AMICache &cache, const AMIInterpolation &fineAMI, const labelList &sourceRestrictAddressing, const labelList &targetRestrictAddressing) | |
| Construct from agglomeration of AMIInterpolation. Agglomeration passed in as new coarse size and addressing from fine from coarse. | |
| AMICache (Istream &is) | |
| Construct from stream. | |
| virtual | ~AMICache ()=default |
| Destructor. | |
| constexpr bool | active () const noexcept |
| Return true if cache is active. | |
| void | setSize (const label size) noexcept |
| Set the cache size; also deactivates the cache if size <= 0. | |
| constexpr label | size () const noexcept |
| Return cache size. | |
| constexpr bool | complete () const noexcept |
| Return true if cache is complete. | |
| constexpr label | index0 () const noexcept |
| Return cache lower bound index. | |
| constexpr label | index1 () const noexcept |
| Return cache upper bound index. | |
| constexpr label | weight () const noexcept |
| Return cache interpolation weight. | |
| const List< scalar > & | theta () const noexcept |
| Return list of cached rotation angles. | |
| const List< labelListList > & | cachedSrcAddress () const noexcept |
| Return List of source addresses. | |
| const List< scalarListList > & | cachedSrcWeights () const noexcept |
| Return List of source weights. | |
| const List< scalarField > & | cachedSrcWeightsSum () const noexcept |
| Return List of source weights sums. | |
| const List< autoPtr< mapDistribute > > & | cachedSrcMapPtr () const noexcept |
| Return List of source parallel maps. | |
| const List< labelListList > & | cachedTgtAddress () const noexcept |
| Return List of target addresses. | |
| const List< scalarListList > & | cachedTgtWeights () const noexcept |
| Return List of target weights. | |
| const List< scalarField > & | cachedTgtWeightsSum () const noexcept |
| Return List of target weights sums. | |
| const List< autoPtr< mapDistribute > > & | cachedTgtMapPtr () const noexcept |
| Return List of target parallel maps. | |
| template<class Type, class EvalFunction> | |
| bool | apply (List< Type > &result, const EvalFunction &eval) const |
| Apply cached evaluation based on user supplied evaluation function. | |
| constexpr bool | applyLower () const noexcept |
| Flag that lower bound is applicable. | |
| constexpr bool | applyUpper () const noexcept |
| Flag that upper bound is applicable. | |
| constexpr bool | applyInterpolate () const noexcept |
| Flag that interpolation is applicable. | |
| constexpr bool | setDirection (bool toSource) const noexcept |
| Set the interpolation direction. | |
| bool | restoreCache (const point &globalPoint) |
| Restore AMI weights and addressing from the cache. | |
| void | addToCache (const AMIInterpolation &ami, const point &globalPoint) |
| Add AMI weights and addressing to the cache. | |
| void | checkBounds (const label index) const |
| Check cache index is within bounds. | |
| bool | validIndex (const label bini) const |
| Return true of the cache index is set for bini. | |
| label | thetaIndex (const scalar theta) const noexcept |
| Return bin index for angle theta. | |
| const labelListList & | cSrcAddress0 () const |
| const scalarListList & | cSrcWeights0 () const |
| const scalarField & | cSrcWeightsSum0 () const |
| const autoPtr< mapDistribute > & | cSrcMapPtr0 () const |
| const labelListList & | cSrcAddress1 () const |
| const scalarListList & | cSrcWeights1 () const |
| const scalarField & | cSrcWeightsSum1 () const |
| const autoPtr< mapDistribute > & | cSrcMapPtr1 () const |
| const labelListList & | cTgtAddress0 () const |
| const scalarListList & | cTgtWeights0 () const |
| const scalarField & | cTgtWeightsSum0 () const |
| const autoPtr< mapDistribute > & | cTgtMapPtr0 () const |
| const labelListList & | cTgtAddress1 () const |
| const scalarListList & | cTgtWeights1 () const |
| const scalarField & | cTgtWeightsSum1 () const |
| const autoPtr< mapDistribute > & | cTgtMapPtr1 () const |
| const labelListList & | cSrcAddress (const label index) const |
| const scalarListList & | cSrcWeights (const label index) const |
| const scalarField & | cSrcWeightsSum (const label index) const |
| const autoPtr< mapDistribute > & | cSrcMapPtr (const label index) const |
| const labelListList & | cTgtAddress (const label index) const |
| const scalarListList & | cTgtWeights (const label index) const |
| const scalarField & | cTgtWeightsSum (const label index) const |
| const autoPtr< mapDistribute > & | cTgtMapPtr (const label index) const |
| void | write (Ostream &os) const |
| Write AMI as a dictionary. | |
| bool | writeData (Ostream &os) const |
| Write AMI raw. | |
Static Public Attributes | |
| static scalar | cacheThetaTolerance_ = 1e-8 |
| Tolerance used when caching the AMI to identify e.g. if the current rotation angle has already been captured. | |
Provides caching of weights and addressing to AMIInterpolation.
Definition at line 53 of file AMICache.H.
| AMICache | ( | const bool | toSource = true | ) |
Null constructor.
Definition at line 102 of file AMICache.C.
References Foam::Zero.
Referenced by AMICache(), AMICache(), and TypeName().

| AMICache | ( | const dictionary & | dict, |
| const bool | toSource = true ) |
Construct from dictionary.
Definition at line 64 of file AMICache.C.
References dict, and Foam::Zero.
| AMICache | ( | const AMICache & | cache | ) |
Construct as copy.
Definition at line 127 of file AMICache.C.
References AMICache(), forAll, and size().

| AMICache | ( | const AMICache & | cache, |
| const AMIInterpolation & | fineAMI, | ||
| const labelList & | sourceRestrictAddressing, | ||
| const labelList & | targetRestrictAddressing ) |
Construct from agglomeration of AMIInterpolation. Agglomeration passed in as new coarse size and addressing from fine from coarse.
Definition at line 167 of file AMICache.C.
References AMICache(), and AMIInterpolation::comm().

| AMICache | ( | Istream & | is | ) |
Construct from stream.
Definition at line 264 of file AMICache.C.
References forAll, Foam::readBool(), Foam::readLabel(), and PackedList< Width >::size().

|
virtualdefault |
Destructor.
| TypeName | ( | "AMICache" | ) |
|
inlineconstexprnoexcept |
Return true if cache is active.
Definition at line 235 of file AMICache.H.
References Foam::noexcept.
Referenced by addToCache().

|
inlinenoexcept |
Set the cache size; also deactivates the cache if size <= 0.
Definition at line 240 of file AMICache.H.
References size().

|
inlineconstexprnoexcept |
Return cache size.
Definition at line 248 of file AMICache.H.
References Foam::noexcept.
Referenced by AMICache(), and setSize().

|
inlineconstexprnoexcept |
Return true if cache is complete.
Definition at line 253 of file AMICache.H.
References Foam::noexcept.
|
inlineconstexprnoexcept |
Return cache lower bound index.
Definition at line 258 of file AMICache.H.
References Foam::noexcept.
|
inlineconstexprnoexcept |
Return cache upper bound index.
Definition at line 263 of file AMICache.H.
References Foam::noexcept.
|
inlineconstexprnoexcept |
Return cache interpolation weight.
Definition at line 268 of file AMICache.H.
References Foam::noexcept.
|
inlinenoexcept |
Return list of cached rotation angles.
Definition at line 273 of file AMICache.H.
References Foam::noexcept.
Referenced by addToCache(), restoreCache(), and thetaIndex().

|
inlinenoexcept |
Return List of source addresses.
Definition at line 278 of file AMICache.H.
References Foam::noexcept.
|
inlinenoexcept |
Return List of source weights.
Definition at line 286 of file AMICache.H.
References Foam::noexcept.
|
inlinenoexcept |
Return List of source weights sums.
Definition at line 294 of file AMICache.H.
References Foam::noexcept.
|
inlinenoexcept |
Return List of source parallel maps.
Definition at line 302 of file AMICache.H.
References Foam::noexcept.
|
inlinenoexcept |
Return List of target addresses.
Definition at line 310 of file AMICache.H.
References Foam::noexcept.
|
inlinenoexcept |
Return List of target weights.
Definition at line 318 of file AMICache.H.
References Foam::noexcept.
|
inlinenoexcept |
Return List of target weights sums.
Definition at line 326 of file AMICache.H.
References Foam::noexcept.
|
inlinenoexcept |
Return List of target parallel maps.
Definition at line 334 of file AMICache.H.
References Foam::noexcept.
| bool apply | ( | List< Type > & | result, |
| const EvalFunction & | eval ) const |
Apply cached evaluation based on user supplied evaluation function.
|
inlineconstexprnoexcept |
Flag that lower bound is applicable.
Definition at line 348 of file AMICache.H.
References Foam::noexcept.
|
inlineconstexprnoexcept |
Flag that upper bound is applicable.
Definition at line 356 of file AMICache.H.
References Foam::noexcept.
|
inlineconstexprnoexcept |
Flag that interpolation is applicable.
Definition at line 364 of file AMICache.H.
References Foam::noexcept.
|
inlineconstexprnoexcept |
Set the interpolation direction.
Definition at line 372 of file AMICache.H.
| bool restoreCache | ( | const point & | globalPoint | ) |
Restore AMI weights and addressing from the cache.
Definition at line 418 of file AMICache.C.
References cacheThetaTolerance_, DebugInfo, DebugPout, Foam::endl(), forAll, Foam::labelMax, UList< T >::last(), Foam::mag(), Foam::nl, DynamicList< T, SizeMin >::push_back(), UList< T >::size(), theta(), thetaIndex(), Foam::constant::mathematical::twoPi(), and validIndex().

| void addToCache | ( | const AMIInterpolation & | ami, |
| const point & | globalPoint ) |
Add AMI weights and addressing to the cache.
Definition at line 336 of file AMICache.C.
References active(), mapDistribute::clone(), DebugInfo, DebugPout, Foam::endl(), forAll, AMIInterpolation::hasSrcMap(), AMIInterpolation::hasTgtMap(), AMIInterpolation::srcAddress(), AMIInterpolation::srcMap(), AMIInterpolation::srcWeights(), AMIInterpolation::srcWeightsSum(), AMIInterpolation::tgtAddress(), AMIInterpolation::tgtMap(), AMIInterpolation::tgtWeights(), AMIInterpolation::tgtWeightsSum(), theta(), thetaIndex(), and validIndex().

|
inline |
Check cache index is within bounds.
Definition at line 395 of file AMICache.H.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.

|
inline |
Return true of the cache index is set for bini.
Definition at line 408 of file AMICache.H.
References Foam::constant::mathematical::twoPi().
Referenced by addToCache(), and restoreCache().


|
inlinenoexcept |
Return bin index for angle theta.
Definition at line 417 of file AMICache.H.
References cacheThetaTolerance_, theta(), and Foam::constant::mathematical::twoPi().
Referenced by addToCache(), and restoreCache().


|
inline |
Definition at line 461 of file AMICache.H.
|
inline |
Definition at line 461 of file AMICache.H.
|
inline |
Definition at line 461 of file AMICache.H.
|
inline |
Definition at line 461 of file AMICache.H.
|
inline |
Definition at line 462 of file AMICache.H.
References defineMethods01.
|
inline |
Definition at line 462 of file AMICache.H.
|
inline |
Definition at line 462 of file AMICache.H.
|
inline |
Definition at line 462 of file AMICache.H.
|
inline |
Definition at line 463 of file AMICache.H.
References defineMethods01.
|
inline |
Definition at line 463 of file AMICache.H.
|
inline |
Definition at line 463 of file AMICache.H.
|
inline |
Definition at line 463 of file AMICache.H.
|
inline |
Definition at line 464 of file AMICache.H.
References defineMethods01.
|
inline |
Definition at line 464 of file AMICache.H.
|
inline |
Definition at line 464 of file AMICache.H.
|
inline |
Definition at line 464 of file AMICache.H.
|
inline |
Definition at line 501 of file AMICache.H.
|
inline |
Definition at line 501 of file AMICache.H.
|
inline |
Definition at line 501 of file AMICache.H.
|
inline |
Definition at line 501 of file AMICache.H.
|
inline |
Definition at line 502 of file AMICache.H.
References defineMethodsIndex, os(), write(), and writeData().

|
inline |
Definition at line 502 of file AMICache.H.
|
inline |
Definition at line 502 of file AMICache.H.
|
inline |
Definition at line 502 of file AMICache.H.
| void write | ( | Ostream & | os | ) | const |
Write AMI as a dictionary.
Definition at line 604 of file AMICache.C.
References os().
Referenced by cTgtAddress().


| bool writeData | ( | Ostream & | os | ) | const |
Write AMI raw.
Definition at line 617 of file AMICache.C.
References forAll, os(), bitSet::set(), PackedList< Width >::size(), and token::SPACE.
Referenced by cTgtAddress().


|
static |
Tolerance used when caching the AMI to identify e.g. if the current rotation angle has already been captured.
Definition at line 63 of file AMICache.H.
Referenced by restoreCache(), and thetaIndex().