Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mesh interface (AMI). More...
Public Member Functions | |
TypeName ("AMIInterpolation") | |
Runtime type information. More... | |
declareRunTimeSelectionTable (autoPtr, AMIInterpolation, dict,(const dictionary &dict, const bool reverseTarget),(dict, reverseTarget)) | |
Selection table for dictionary construction. More... | |
declareRunTimeSelectionTable (autoPtr, AMIInterpolation, component,(const bool requireMatch, const bool reverseTarget, const scalar lowWeightCorrection),(requireMatch, reverseTarget, lowWeightCorrection)) | |
Selection table for component-wise construction. More... | |
AMIInterpolation (const dictionary &dict, const bool reverseTarget=false) | |
Construct from dictionary. More... | |
AMIInterpolation (const bool requireMatch=true, const bool reverseTarget=false, const scalar lowWeightCorrection=-1) | |
Construct from components. More... | |
AMIInterpolation (const AMIInterpolation &fineAMI, const labelList &sourceRestrictAddressing, const labelList &neighbourRestrictAddressing) | |
Construct from agglomeration of AMIInterpolation. Agglomeration passed in as new coarse size and addressing from fine from coarse. More... | |
AMIInterpolation (const AMIInterpolation &ami) | |
Construct as copy. More... | |
virtual autoPtr< AMIInterpolation > | clone () const |
Construct and return a clone. More... | |
AMIInterpolation (Istream &is) | |
Construct from Istream. More... | |
virtual | ~AMIInterpolation ()=default |
Destructor. More... | |
bool | upToDate () const noexcept |
Is up-to-date? More... | |
bool | upToDate (bool flag) noexcept |
Set as up-to-date, return the previous value. More... | |
bool | distributed () const noexcept |
Distributed across processors (singlePatchProc == -1) More... | |
bool | requireMatch () const noexcept |
Return the requireMatch flag. More... | |
bool | setRequireMatch (bool flag) noexcept |
Set the require match flag, return the new value. More... | |
bool | mustMatchFaces () const |
Return true if requireMatch and but not lowWeightCorrection. More... | |
bool | reverseTarget () const noexcept |
Access to the reverseTarget flag. More... | |
scalar | lowWeightCorrection () const |
Threshold weight below which interpolation is deactivated. More... | |
bool | applyLowWeightCorrection () const |
Return true if employing a 'lowWeightCorrection'. More... | |
label | singlePatchProc () const noexcept |
The processor holding all faces (both sides), or -1 if distributed. More... | |
label | comm () const |
Communicator to use for parallel operations. More... | |
label | comm (const label newComm) |
Set communicator to use for parallel operations. Return. More... | |
const List< scalar > & | srcMagSf () const |
Return const access to source patch face areas. More... | |
List< scalar > & | srcMagSf () |
Return access to source patch face areas. More... | |
const labelListList & | srcAddress () const |
Return const access to source patch addressing. More... | |
labelListList & | srcAddress () |
Return access to source patch addressing. More... | |
const scalarListList & | srcWeights () const |
Return const access to source patch weights. More... | |
scalarListList & | srcWeights () |
Return access to source patch weights. More... | |
const scalarField & | srcWeightsSum () const |
Return const access to normalisation factor of source patch weights (i.e. the sum before normalisation) More... | |
scalarField & | srcWeightsSum () |
Return access to normalisation factor of source patch weights (i.e. the sum before normalisation) More... | |
const pointListList & | srcCentroids () const |
Return const access to source patch face centroids. More... | |
pointListList & | srcCentroids () |
Return access to source patch face centroids. More... | |
const mapDistribute & | srcMap () const |
Source map - valid only if singlePatchProc = -1 This gets source data into a form to be consumed by tgtAddress, tgtWeights. More... | |
const mapDistribute * | hasSrcMap () const noexcept |
Pointer to the source map (if distributed). Can be checked as a bool. More... | |
const List< scalar > & | tgtMagSf () const |
Return const access to target patch face areas. More... | |
List< scalar > & | tgtMagSf () |
Return access to target patch face areas. More... | |
const labelListList & | tgtAddress () const |
Return const access to target patch addressing. More... | |
labelListList & | tgtAddress () |
Return access to target patch addressing. More... | |
const scalarListList & | tgtWeights () const |
Return const access to target patch weights. More... | |
scalarListList & | tgtWeights () |
Return access to target patch weights. More... | |
const scalarField & | tgtWeightsSum () const |
Return const access to normalisation factor of target patch weights (i.e. the sum before normalisation) More... | |
scalarField & | tgtWeightsSum () |
Return access to normalisation factor of target patch weights (i.e. the sum before normalisation) More... | |
const mapDistribute & | tgtMap () const |
Target map - valid only if singlePatchProc=-1. This gets target data into a form to be consumed by srcAddress, srcWeights. More... | |
const mapDistribute * | hasTgtMap () const noexcept |
Pointer to the target map (if distributed). Can be checked as a bool. More... | |
virtual bool | calculate (const primitivePatch &srcPatch, const primitivePatch &tgtPatch, const autoPtr< searchableSurface > &surfPtr=nullptr) |
Update addressing, weights and (optional) centroids. More... | |
void | reset (autoPtr< mapDistribute > &&srcToTgtMap, autoPtr< mapDistribute > &&tgtToSrcMap, labelListList &&srcAddress, scalarListList &&srcWeights, labelListList &&tgtAddress, scalarListList &&tgtWeights, const label singlePatchProc) |
Set the maps, addresses and weights from an external source. More... | |
void | append (const primitivePatch &srcPatch, const primitivePatch &tgtPatch) |
Append additional addressing and weights. More... | |
void | normaliseWeights (const bool conformal, const bool output) |
Normalise the weights. More... | |
template<class Type > | |
void | weightedSum (const bool interpolateToSource, const UList< Type > &fld, List< Type > &result, const UList< Type > &defaultValues) const |
Weighted sum of contributions. More... | |
template<class Type , class CombineOp > | |
void | interpolateToSource (const UList< Type > &fld, const CombineOp &cop, List< Type > &result, const UList< Type > &defaultValues=UList< Type >::null()) const |
Interpolate from target to source with supplied op to combine existing value with remote value and weight. More... | |
template<class Type , class CombineOp > | |
void | interpolateToTarget (const UList< Type > &fld, const CombineOp &cop, List< Type > &result, const UList< Type > &defaultValues=UList< Type >::null()) const |
Interpolate from source to target with supplied op to combine existing value with remote value and weight. More... | |
template<class Type , class CombineOp > | |
tmp< Field< Type > > | interpolateToSource (const Field< Type > &fld, const CombineOp &cop, const UList< Type > &defaultValues=UList< Type >::null()) const |
Interpolate from target to source with supplied op. More... | |
template<class Type , class CombineOp > | |
tmp< Field< Type > > | interpolateToSource (const tmp< Field< Type >> &tFld, const CombineOp &cop, const UList< Type > &defaultValues=UList< Type >::null()) const |
Interpolate from target tmp field to source with supplied op. More... | |
template<class Type , class CombineOp > | |
tmp< Field< Type > > | interpolateToTarget (const Field< Type > &fld, const CombineOp &cop, const UList< Type > &defaultValues=UList< Type >::null()) const |
Interpolate from source to target with supplied op. More... | |
template<class Type , class CombineOp > | |
tmp< Field< Type > > | interpolateToTarget (const tmp< Field< Type >> &tFld, const CombineOp &cop, const UList< Type > &defaultValues=UList< Type >::null()) const |
Interpolate from source tmp field to target with supplied op. More... | |
template<class Type > | |
tmp< Field< Type > > | interpolateToSource (const Field< Type > &fld, const UList< Type > &defaultValues=UList< Type >::null()) const |
Interpolate from target to source. More... | |
template<class Type > | |
tmp< Field< Type > > | interpolateToSource (const tmp< Field< Type >> &tFld, const UList< Type > &defaultValues=UList< Type >::null()) const |
Interpolate from target tmp field. More... | |
template<class Type > | |
tmp< Field< Type > > | interpolateToTarget (const Field< Type > &fld, const UList< Type > &defaultValues=UList< Type >::null()) const |
Interpolate from source to target. More... | |
template<class Type > | |
tmp< Field< Type > > | interpolateToTarget (const tmp< Field< Type >> &tFld, const UList< Type > &defaultValues=UList< Type >::null()) const |
Interpolate from source tmp field. More... | |
label | srcPointFace (const primitivePatch &srcPatch, const primitivePatch &tgtPatch, const vector &n, const label tgtFacei, point &tgtPoint) const |
Return source patch face index of point on target patch face. More... | |
label | tgtPointFace (const primitivePatch &srcPatch, const primitivePatch &tgtPatch, const vector &n, const label srcFacei, point &srcPoint) const |
Return target patch face index of point on source patch face. More... | |
bool | checkSymmetricWeights (const bool log) const |
Check if src addresses are present in tgt addresses and viceversa. More... | |
void | writeFaceConnectivity (const primitivePatch &srcPatch, const primitivePatch &tgtPatch, const labelListList &srcAddress) const |
Write face connectivity as OBJ file. More... | |
virtual void | write (Ostream &os) const |
Write AMI as a dictionary. More... | |
virtual bool | writeData (Ostream &os) const |
Write AMI raw. More... | |
bool & | upToDate () noexcept |
Non-const access to the up-to-date flag. More... | |
template<class Type , class CombineOp > | |
Foam::tmp< Foam::Field< Type > > | interpolateToSource (const Field< Type > &fld, const CombineOp &cop, const UList< Type > &defaultValues) const |
template<class Type , class CombineOp > | |
Foam::tmp< Foam::Field< Type > > | interpolateToSource (const tmp< Field< Type >> &tFld, const CombineOp &cop, const UList< Type > &defaultValues) const |
template<class Type , class CombineOp > | |
Foam::tmp< Foam::Field< Type > > | interpolateToTarget (const Field< Type > &fld, const CombineOp &cop, const UList< Type > &defaultValues) const |
template<class Type , class CombineOp > | |
Foam::tmp< Foam::Field< Type > > | interpolateToTarget (const tmp< Field< Type >> &tFld, const CombineOp &cop, const UList< Type > &defaultValues) const |
template<class Type > | |
Foam::tmp< Foam::Field< Type > > | interpolateToSource (const Field< Type > &fld, const UList< Type > &defaultValues) const |
template<class Type > | |
Foam::tmp< Foam::Field< Type > > | interpolateToSource (const tmp< Field< Type >> &tFld, const UList< Type > &defaultValues) const |
template<class Type > | |
Foam::tmp< Foam::Field< Type > > | interpolateToTarget (const Field< Type > &fld, const UList< Type > &defaultValues) const |
template<class Type > | |
Foam::tmp< Foam::Field< Type > > | interpolateToTarget (const tmp< Field< Type >> &tFld, const UList< Type > &defaultValues) const |
Static Public Member Functions | |
static autoPtr< AMIInterpolation > | New (const word &modelName, const dictionary &dict, const bool reverseTarget=false) |
Selector for dictionary. More... | |
static autoPtr< AMIInterpolation > | New (const word &modelName, const bool requireMatch=true, const bool reverseTarget=false, const scalar lowWeightCorrection=-1) |
Selector for components. More... | |
template<class Type , class CombineOp > | |
static void | weightedSum (const scalar lowWeightCorrection, const labelListList &allSlots, const scalarListList &allWeights, const scalarField &weightsSum, const UList< Type > &fld, const CombineOp &cop, List< Type > &result, const UList< Type > &defaultValues) |
Weighted sum of contributions. More... | |
Static Public Attributes | |
static bool | cacheIntersections_ = false |
Protected Types | |
typedef treeDataPrimitivePatch< primitivePatch > | treeType |
Local typedef to octree tree-type. More... | |
Protected Member Functions | |
void | operator= (const AMIInterpolation &)=delete |
No copy assignment. More... | |
autoPtr< indexedOctree< treeType > > | createTree (const primitivePatch &patch) const |
Reset the octree for the patch face search. More... | |
label | calcDistribution (const primitivePatch &srcPatch, const primitivePatch &tgtPatch) const |
Calculate if patches are on multiple processors. More... | |
void | projectPointsToSurface (const searchableSurface &surf, pointField &pts) const |
Project points to surface. More... | |
const primitivePatch & | srcPatch0 () const |
Return the orginal src patch with optionally updated points. More... | |
const primitivePatch & | tgtPatch0 () const |
Return the orginal tgt patch with optionally updated points. More... | |
Static Protected Member Functions | |
static void | normaliseWeights (const scalarList &patchAreas, const word &patchName, const labelListList &addr, scalarListList &wght, scalarField &wghtSum, const bool conformal, const bool output, const scalar lowWeightTol, const label comm) |
Normalise the (area) weights - suppresses numerical error in weights calculation. More... | |
static void | agglomerate (const autoPtr< mapDistribute > &targetMap, const scalarList &fineSrcMagSf, const labelListList &fineSrcAddress, const scalarListList &fineSrcWeights, const labelList &sourceRestrictAddressing, const labelList &targetRestrictAddressing, scalarList &srcMagSf, labelListList &srcAddress, scalarListList &srcWeights, scalarField &srcWeightsSum, autoPtr< mapDistribute > &tgtMap, const label comm) |
Protected Attributes | |
bool | requireMatch_ |
Flag to indicate that the two patches must be matched/an overlap exists between them. More... | |
const bool | reverseTarget_ |
Flag to indicate that the two patches are co-directional and that the orientation of the target patch should be reversed. More... | |
const scalar | lowWeightCorrection_ |
Threshold weight below which interpolation is deactivated. More... | |
label | singlePatchProc_ |
Index of processor that holds all of both sides. The value is -1 for distributed cases. More... | |
label | comm_ |
Communicator to use for parallel operations. More... | |
scalarList | srcMagSf_ |
Source face areas. More... | |
labelListList | srcAddress_ |
Addresses of target faces per source face. More... | |
scalarListList | srcWeights_ |
Weights of target faces per source face. More... | |
scalarField | srcWeightsSum_ |
Sum of weights of target faces per source face. More... | |
pointListList | srcCentroids_ |
Centroid of target faces per source face. More... | |
pointField | srcPatchPts_ |
Source patch points if input points are manipulated, e.g. projected. More... | |
refPtr< primitivePatch > | tsrcPatch0_ |
Source patch using manipulated input points. More... | |
autoPtr< mapDistribute > | srcMapPtr_ |
Source map pointer - parallel running only. More... | |
scalarList | tgtMagSf_ |
Target face areas. More... | |
labelListList | tgtAddress_ |
Addresses of source faces per target face. More... | |
scalarListList | tgtWeights_ |
Weights of source faces per target face. More... | |
scalarField | tgtWeightsSum_ |
Sum of weights of source faces per target face. More... | |
pointListList | tgtCentroids_ |
Centroid of source faces per target face. More... | |
pointField | tgtPatchPts_ |
Target patch points if input points are manipulated, e.g. projected. More... | |
refPtr< primitivePatch > | ttgtPatch0_ |
Target patch using manipulated input points. More... | |
autoPtr< mapDistribute > | tgtMapPtr_ |
Target map pointer - parallel running only. More... | |
bool | upToDate_ |
Up-to-date flag. More... | |
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mesh interface (AMI).
Based on the algorithm given in:
Conservative interpolation between volume meshes by local Galerkin projection, Farrell PE and Maddison JR, 2011, Comput. Methods Appl. Mech Engrg, Volume 200, Issues 1-4, pp 89-100
Interpolation requires that the two patches should have opposite orientations (opposite normals). The 'reverseTarget' flag can be used to reverse the orientation of the target patch.
Definition at line 70 of file AMIInterpolation.H.
|
protected |
Local typedef to octree tree-type.
Definition at line 84 of file AMIInterpolation.H.
|
explicit |
Construct from dictionary.
Definition at line 550 of file AMIInterpolation.C.
|
explicit |
Construct from components.
Definition at line 577 of file AMIInterpolation.C.
AMIInterpolation | ( | const AMIInterpolation & | fineAMI, |
const labelList & | sourceRestrictAddressing, | ||
const labelList & | neighbourRestrictAddressing | ||
) |
Construct from agglomeration of AMIInterpolation. Agglomeration passed in as new coarse size and addressing from fine from coarse.
Definition at line 607 of file AMIInterpolation.C.
References AMIInterpolation::comm(), Foam::ensightOutput::debug, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::max(), Foam::nl, Foam::Pout, UList< T >::size(), AMIInterpolation::srcAddress(), AMIInterpolation::srcMagSf(), AMIInterpolation::srcMapPtr_, AMIInterpolation::srcWeights(), AMIInterpolation::tgtAddress(), AMIInterpolation::tgtMagSf(), AMIInterpolation::tgtMapPtr_, and AMIInterpolation::tgtWeights().
AMIInterpolation | ( | const AMIInterpolation & | ami | ) |
Construct as copy.
Definition at line 715 of file AMIInterpolation.C.
AMIInterpolation | ( | Istream & | is | ) |
Construct from Istream.
Note: does not transfer src(tgt)PatchPts, tsrc(tgt)Patch0_
Definition at line 738 of file AMIInterpolation.C.
References AMIInterpolation::singlePatchProc_, AMIInterpolation::srcMapPtr_, and AMIInterpolation::tgtMapPtr_.
|
virtualdefault |
Destructor.
|
protecteddelete |
No copy assignment.
|
protected |
Reset the octree for the patch face search.
Definition at line 47 of file AMIInterpolation.C.
References boundBox::inflate(), Foam::New(), and Foam::foamVersion::patch.
|
protected |
Calculate if patches are on multiple processors.
Definition at line 71 of file AMIInterpolation.C.
References bitSet::count(), DebugInFunction, and Foam::endl().
|
protected |
Project points to surface.
Definition at line 113 of file AMIInterpolation.C.
References Foam::abort(), addProfiling, DebugInfo, Foam::endl(), Foam::FatalError, FatalErrorInFunction, searchableSurface::findNearest(), forAll, Foam::constant::mathematical::pi(), and pts.
|
inlineprotected |
Return the orginal src patch with optionally updated points.
Definition at line 22 of file AMIInterpolationI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and AMIInterpolation::tsrcPatch0_.
|
inlineprotected |
Return the orginal tgt patch with optionally updated points.
Definition at line 35 of file AMIInterpolationI.H.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
|
staticprotected |
Normalise the (area) weights - suppresses numerical error in weights calculation.
NOTE: if area weights are incorrect by 'a significant amount' normalisation may stabilise the solution, but will introduce numerical error!
Definition at line 153 of file AMIInterpolation.C.
References addProfiling, Foam::endl(), forAll, Foam::gAverage(), Foam::gMax(), Foam::gMin(), Foam::indent(), Foam::Info, Foam::nl, Foam::output(), List< T >::resize_nocopy(), returnReduce(), Foam::returnReduceOr(), s, UList< T >::size(), and Foam::sum().
|
staticprotected |
Definition at line 237 of file AMIInterpolation.C.
References addProfiling, List< T >::append(), mapDistributeBase::constructMap(), mapDistributeBase::constructSize(), mapDistribute::distribute(), UList< T >::find(), forAll, Foam::identity(), Foam::labelMin, Foam::max(), autoPtr< T >::reset(), List< T >::resize(), List< T >::resize_nocopy(), List< T >::setSize(), UList< T >::size(), and mapDistributeBase::subMap().
TypeName | ( | "AMIInterpolation" | ) |
Runtime type information.
declareRunTimeSelectionTable | ( | autoPtr | , |
AMIInterpolation | , | ||
dict | , | ||
(const dictionary &dict, const bool reverseTarget) | , | ||
(dict, reverseTarget) | |||
) |
Selection table for dictionary construction.
declareRunTimeSelectionTable | ( | autoPtr | , |
AMIInterpolation | , | ||
component | , | ||
(const bool requireMatch, const bool reverseTarget, const scalar lowWeightCorrection) | , | ||
(requireMatch, reverseTarget, lowWeightCorrection) | |||
) |
Selection table for component-wise construction.
|
static |
Selector for dictionary.
Definition at line 26 of file AMIInterpolationNew.C.
References DebugInfo, dict, Foam::endl(), Foam::exit(), Foam::FatalError, and FatalErrorInLookup.
Referenced by regionModel::interRegionAMI().
|
static |
Selector for components.
Definition at line 51 of file AMIInterpolationNew.C.
References DebugInfo, Foam::endl(), Foam::exit(), Foam::FatalError, and FatalErrorInLookup.
|
inlinevirtual |
Construct and return a clone.
Reimplemented in advancingFrontAMI, faceAreaWeightAMI, faceAreaWeightAMI2D, and nearestFaceAMI.
Definition at line 415 of file AMIInterpolation.H.
References autoPtr< T >::New().
|
inlinenoexcept |
Is up-to-date?
Definition at line 441 of file AMIInterpolation.H.
References AMIInterpolation::upToDate_.
|
inlinenoexcept |
Set as up-to-date, return the previous value.
Definition at line 446 of file AMIInterpolation.H.
References AMIInterpolation::upToDate_.
|
inlinenoexcept |
Distributed across processors (singlePatchProc == -1)
Definition at line 49 of file AMIInterpolationI.H.
|
inlinenoexcept |
Return the requireMatch flag.
Definition at line 55 of file AMIInterpolationI.H.
|
inlinenoexcept |
Set the require match flag, return the new value.
Definition at line 61 of file AMIInterpolationI.H.
|
inline |
Return true if requireMatch and but not lowWeightCorrection.
Definition at line 68 of file AMIInterpolationI.H.
|
inlinenoexcept |
Access to the reverseTarget flag.
Definition at line 74 of file AMIInterpolationI.H.
|
inline |
Threshold weight below which interpolation is deactivated.
Definition at line 80 of file AMIInterpolationI.H.
|
inline |
Return true if employing a 'lowWeightCorrection'.
Definition at line 86 of file AMIInterpolationI.H.
|
inlinenoexcept |
The processor holding all faces (both sides), or -1 if distributed.
Definition at line 92 of file AMIInterpolationI.H.
Referenced by cyclicACMIGAMGInterface::cyclicACMIGAMGInterface(), and cyclicAMIGAMGInterface::cyclicAMIGAMGInterface().
|
inline |
Communicator to use for parallel operations.
Definition at line 98 of file AMIInterpolationI.H.
Referenced by AMIInterpolation::AMIInterpolation().
|
inline |
Set communicator to use for parallel operations. Return.
old value
Definition at line 104 of file AMIInterpolationI.H.
|
inline |
Return const access to source patch face areas.
Definition at line 112 of file AMIInterpolationI.H.
Referenced by AMIInterpolation::AMIInterpolation().
|
inline |
Return access to source patch face areas.
Definition at line 118 of file AMIInterpolationI.H.
|
inline |
Return const access to source patch addressing.
Definition at line 124 of file AMIInterpolationI.H.
Referenced by AMIInterpolation::AMIInterpolation(), mappedPatchFieldBase< scalar >::distribute(), and cyclicAMIPolyPatch::mapCollocatedFaces().
|
inline |
Return access to source patch addressing.
Definition at line 130 of file AMIInterpolationI.H.
|
inline |
Return const access to source patch weights.
Definition at line 136 of file AMIInterpolationI.H.
Referenced by AMIInterpolation::AMIInterpolation(), assemblyFaceAreaPairGAMGAgglomeration::assemblyFaceAreaPairGAMGAgglomeration(), and mappedPatchFieldBase< scalar >::distribute().
|
inline |
Return access to source patch weights.
Definition at line 142 of file AMIInterpolationI.H.
|
inline |
Return const access to normalisation factor of source patch weights (i.e. the sum before normalisation)
Definition at line 148 of file AMIInterpolationI.H.
Referenced by cyclicACMIPolyPatch::resetAMI(), and AMIWeights::writeWeightFields().
|
inline |
Return access to normalisation factor of source patch weights (i.e. the sum before normalisation)
Definition at line 154 of file AMIInterpolationI.H.
|
inline |
Return const access to source patch face centroids.
Definition at line 160 of file AMIInterpolationI.H.
|
inline |
Return access to source patch face centroids.
Definition at line 166 of file AMIInterpolationI.H.
|
inline |
Source map - valid only if singlePatchProc = -1 This gets source data into a form to be consumed by tgtAddress, tgtWeights.
Definition at line 172 of file AMIInterpolationI.H.
Referenced by mappedPatchFieldBase< scalar >::distribute().
|
inlinenoexcept |
Pointer to the source map (if distributed). Can be checked as a bool.
Definition at line 179 of file AMIInterpolationI.H.
|
inline |
Return const access to target patch face areas.
Definition at line 185 of file AMIInterpolationI.H.
Referenced by AMIInterpolation::AMIInterpolation().
|
inline |
Return access to target patch face areas.
Definition at line 191 of file AMIInterpolationI.H.
|
inline |
Return const access to target patch addressing.
Definition at line 197 of file AMIInterpolationI.H.
Referenced by AMIInterpolation::AMIInterpolation(), and mappedPatchFieldBase< scalar >::distribute().
|
inline |
Return access to target patch addressing.
Definition at line 203 of file AMIInterpolationI.H.
|
inline |
Return const access to target patch weights.
Definition at line 209 of file AMIInterpolationI.H.
Referenced by AMIInterpolation::AMIInterpolation(), and mappedPatchFieldBase< scalar >::distribute().
|
inline |
Return access to target patch weights.
Definition at line 215 of file AMIInterpolationI.H.
|
inline |
Return const access to normalisation factor of target patch weights (i.e. the sum before normalisation)
Definition at line 221 of file AMIInterpolationI.H.
Referenced by cyclicACMIPolyPatch::resetAMI(), and AMIWeights::writeWeightFields().
|
inline |
Return access to normalisation factor of target patch weights (i.e. the sum before normalisation)
Definition at line 227 of file AMIInterpolationI.H.
|
inline |
Target map - valid only if singlePatchProc=-1. This gets target data into a form to be consumed by srcAddress, srcWeights.
Definition at line 233 of file AMIInterpolationI.H.
Referenced by mappedPatchFieldBase< scalar >::distribute().
|
inlinenoexcept |
Pointer to the target map (if distributed). Can be checked as a bool.
Definition at line 240 of file AMIInterpolationI.H.
|
virtual |
Update addressing, weights and (optional) centroids.
Reimplemented in faceAreaWeightAMI, advancingFrontAMI, faceAreaWeightAMI2D, and nearestFaceAMI.
Definition at line 775 of file AMIInterpolation.C.
References addProfiling, DebugInfo, Foam::endl(), Foam::indent(), Foam::Info, UPstream::msgType(), UPstream::myProcNo(), refPtr< T >::New(), Foam::nl, PrimitivePatch< FaceList, PointField >::points(), and Foam::returnReduce().
Referenced by nearestFaceAMI::calculate(), and advancingFrontAMI::calculate().
void reset | ( | autoPtr< mapDistribute > && | srcToTgtMap, |
autoPtr< mapDistribute > && | tgtToSrcMap, | ||
labelListList && | srcAddress, | ||
scalarListList && | srcWeights, | ||
labelListList && | tgtAddress, | ||
scalarListList && | tgtWeights, | ||
const label | singlePatchProc | ||
) |
Set the maps, addresses and weights from an external source.
Definition at line 857 of file AMIInterpolation.C.
References DebugInFunction, Foam::endl(), forAll, and Foam::sum().
Referenced by mappedPatchBase::AMI().
void append | ( | const primitivePatch & | srcPatch, |
const primitivePatch & | tgtPatch | ||
) |
Append additional addressing and weights.
Definition at line 897 of file AMIInterpolation.C.
References addProfiling, UList< T >::begin(), forAll, Foam::max(), List< T >::push_back(), and UList< T >::size().
void normaliseWeights | ( | const bool | conformal, |
const bool | output | ||
) |
Normalise the weights.
Definition at line 1088 of file AMIInterpolation.C.
References Foam::output().
|
static |
Weighted sum of contributions.
Definition at line 29 of file AMIInterpolationTemplates.C.
void weightedSum | ( | const bool | interpolateToSource, |
const UList< Type > & | fld, | ||
List< Type > & | result, | ||
const UList< Type > & | defaultValues | ||
) | const |
Weighted sum of contributions.
Definition at line 78 of file AMIInterpolationTemplates.C.
References fld.
void interpolateToSource | ( | const UList< Type > & | fld, |
const CombineOp & | cop, | ||
List< Type > & | result, | ||
const UList< Type > & | defaultValues = UList<Type>::null() |
||
) | const |
Interpolate from target to source with supplied op to combine existing value with remote value and weight.
Definition at line 161 of file AMIInterpolationTemplates.C.
References Foam::abort(), addProfiling, mapDistribute::distribute(), Foam::FatalError, FatalErrorInFunction, fld, Foam::nl, List< T >::setSize(), and UList< T >::size().
Referenced by regionModel::mapRegionPatchField(), and regionModel::mapRegionPatchInternalField().
void interpolateToTarget | ( | const UList< Type > & | fld, |
const CombineOp & | cop, | ||
List< Type > & | result, | ||
const UList< Type > & | defaultValues = UList<Type>::null() |
||
) | const |
Interpolate from source to target with supplied op to combine existing value with remote value and weight.
Definition at line 101 of file AMIInterpolationTemplates.C.
References Foam::abort(), addProfiling, mapDistribute::distribute(), Foam::FatalError, FatalErrorInFunction, fld, Foam::nl, List< T >::setSize(), and UList< T >::size().
tmp<Field<Type> > interpolateToSource | ( | const Field< Type > & | fld, |
const CombineOp & | cop, | ||
const UList< Type > & | defaultValues = UList< Type >::null() |
||
) | const |
Interpolate from target to source with supplied op.
tmp<Field<Type> > interpolateToSource | ( | const tmp< Field< Type >> & | tFld, |
const CombineOp & | cop, | ||
const UList< Type > & | defaultValues = UList< Type >::null() |
||
) | const |
Interpolate from target tmp field to source with supplied op.
tmp<Field<Type> > interpolateToTarget | ( | const Field< Type > & | fld, |
const CombineOp & | cop, | ||
const UList< Type > & | defaultValues = UList< Type >::null() |
||
) | const |
Interpolate from source to target with supplied op.
tmp<Field<Type> > interpolateToTarget | ( | const tmp< Field< Type >> & | tFld, |
const CombineOp & | cop, | ||
const UList< Type > & | defaultValues = UList< Type >::null() |
||
) | const |
Interpolate from source tmp field to target with supplied op.
tmp<Field<Type> > interpolateToSource | ( | const Field< Type > & | fld, |
const UList< Type > & | defaultValues = UList< Type >::null() |
||
) | const |
Interpolate from target to source.
tmp<Field<Type> > interpolateToSource | ( | const tmp< Field< Type >> & | tFld, |
const UList< Type > & | defaultValues = UList< Type >::null() |
||
) | const |
Interpolate from target tmp field.
tmp<Field<Type> > interpolateToTarget | ( | const Field< Type > & | fld, |
const UList< Type > & | defaultValues = UList< Type >::null() |
||
) | const |
Interpolate from source to target.
tmp<Field<Type> > interpolateToTarget | ( | const tmp< Field< Type >> & | tFld, |
const UList< Type > & | defaultValues = UList< Type >::null() |
||
) | const |
Interpolate from source tmp field.
Foam::label srcPointFace | ( | const primitivePatch & | srcPatch, |
const primitivePatch & | tgtPatch, | ||
const vector & | n, | ||
const label | tgtFacei, | ||
point & | tgtPoint | ||
) | const |
Return source patch face index of point on target patch face.
Definition at line 1122 of file AMIInterpolation.C.
References PointHit< PointType >::distance(), PointHit< PointType >::eligibleMiss(), f(), PointHit< PointType >::hit(), n, PointHit< PointType >::point(), PrimitivePatch< FaceList, PointField >::points(), and PointHit< PointType >::setDistance().
Foam::label tgtPointFace | ( | const primitivePatch & | srcPatch, |
const primitivePatch & | tgtPatch, | ||
const vector & | n, | ||
const label | srcFacei, | ||
point & | srcPoint | ||
) | const |
Return target patch face index of point on source patch face.
Definition at line 1171 of file AMIInterpolation.C.
References PointHit< PointType >::distance(), PointHit< PointType >::eligibleMiss(), f(), PointHit< PointType >::hit(), n, PointHit< PointType >::point(), PrimitivePatch< FaceList, PointField >::points(), and PointHit< PointType >::setDistance().
bool checkSymmetricWeights | ( | const bool | log | ) | const |
Check if src addresses are present in tgt addresses and viceversa.
Definition at line 1219 of file AMIInterpolation.C.
References Foam::endl(), forAll, found, Log, Foam::nl, and UPstream::parRun().
void writeFaceConnectivity | ( | const primitivePatch & | srcPatch, |
const primitivePatch & | tgtPatch, | ||
const labelListList & | srcAddress | ||
) | const |
Write face connectivity as OBJ file.
Definition at line 1283 of file AMIInterpolation.C.
References Foam::endl(), PrimitivePatch< FaceList, PointField >::faceCentres(), forAll, UPstream::myProcNo(), Foam::name(), os(), and Foam::meshTools::writeOBJ().
|
virtual |
Write AMI as a dictionary.
Reimplemented in advancingFrontAMI, faceAreaWeightAMI, faceAreaWeightAMI2D, and nearestFaceAMI.
Definition at line 1314 of file AMIInterpolation.C.
References os(), Foam::type(), and Ostream::writeEntry().
Referenced by nearestFaceAMI::write(), and advancingFrontAMI::write().
|
virtual |
Write AMI raw.
Definition at line 1335 of file AMIInterpolation.C.
References IOstream::good(), os(), and token::SPACE.
Referenced by cyclicACMIGAMGInterface::write(), and cyclicAMIGAMGInterface::write().
|
inlinenoexcept |
Non-const access to the up-to-date flag.
Definition at line 886 of file AMIInterpolation.H.
References AMIInterpolation::upToDate_.
Foam::tmp<Foam::Field<Type> > interpolateToSource | ( | const Field< Type > & | fld, |
const CombineOp & | cop, | ||
const UList< Type > & | defaultValues | ||
) | const |
Definition at line 221 of file AMIInterpolationTemplates.C.
References fld, Foam::New(), and Foam::Zero.
Foam::tmp<Foam::Field<Type> > interpolateToSource | ( | const tmp< Field< Type >> & | tFld, |
const CombineOp & | cop, | ||
const UList< Type > & | defaultValues | ||
) | const |
Definition at line 243 of file AMIInterpolationTemplates.C.
Foam::tmp<Foam::Field<Type> > interpolateToTarget | ( | const Field< Type > & | fld, |
const CombineOp & | cop, | ||
const UList< Type > & | defaultValues | ||
) | const |
Definition at line 255 of file AMIInterpolationTemplates.C.
References fld, Foam::New(), and Foam::Zero.
Foam::tmp<Foam::Field<Type> > interpolateToTarget | ( | const tmp< Field< Type >> & | tFld, |
const CombineOp & | cop, | ||
const UList< Type > & | defaultValues | ||
) | const |
Definition at line 277 of file AMIInterpolationTemplates.C.
Foam::tmp<Foam::Field<Type> > interpolateToSource | ( | const Field< Type > & | fld, |
const UList< Type > & | defaultValues | ||
) | const |
Definition at line 289 of file AMIInterpolationTemplates.C.
References fld.
Foam::tmp<Foam::Field<Type> > interpolateToSource | ( | const tmp< Field< Type >> & | tFld, |
const UList< Type > & | defaultValues | ||
) | const |
Definition at line 300 of file AMIInterpolationTemplates.C.
Foam::tmp<Foam::Field<Type> > interpolateToTarget | ( | const Field< Type > & | fld, |
const UList< Type > & | defaultValues | ||
) | const |
Definition at line 311 of file AMIInterpolationTemplates.C.
References fld.
Foam::tmp<Foam::Field<Type> > interpolateToTarget | ( | const tmp< Field< Type >> & | tFld, |
const UList< Type > & | defaultValues | ||
) | const |
Definition at line 322 of file AMIInterpolationTemplates.C.
|
static |
Definition at line 76 of file AMIInterpolation.H.
|
protected |
Flag to indicate that the two patches must be matched/an overlap exists between them.
Definition at line 92 of file AMIInterpolation.H.
Referenced by advancingFrontAMI::checkPatches().
|
protected |
Flag to indicate that the two patches are co-directional and that the orientation of the target patch should be reversed.
Definition at line 98 of file AMIInterpolation.H.
|
protected |
Threshold weight below which interpolation is deactivated.
Definition at line 103 of file AMIInterpolation.H.
|
protected |
Index of processor that holds all of both sides. The value is -1 for distributed cases.
Definition at line 109 of file AMIInterpolation.H.
Referenced by AMIInterpolation::AMIInterpolation().
|
protected |
Communicator to use for parallel operations.
Definition at line 114 of file AMIInterpolation.H.
Referenced by advancingFrontAMI::checkPatches().
|
protected |
Source face areas.
Definition at line 122 of file AMIInterpolation.H.
|
protected |
Addresses of target faces per source face.
Definition at line 127 of file AMIInterpolation.H.
|
protected |
Weights of target faces per source face.
Definition at line 132 of file AMIInterpolation.H.
|
protected |
Sum of weights of target faces per source face.
Definition at line 137 of file AMIInterpolation.H.
|
protected |
Centroid of target faces per source face.
Definition at line 142 of file AMIInterpolation.H.
|
protected |
Source patch points if input points are manipulated, e.g. projected.
Definition at line 148 of file AMIInterpolation.H.
|
protected |
Source patch using manipulated input points.
Definition at line 153 of file AMIInterpolation.H.
Referenced by advancingFrontAMI::srcPatch(), and AMIInterpolation::srcPatch0().
|
protected |
Source map pointer - parallel running only.
Definition at line 158 of file AMIInterpolation.H.
Referenced by AMIInterpolation::AMIInterpolation().
|
protected |
Target face areas.
Definition at line 167 of file AMIInterpolation.H.
|
protected |
Addresses of source faces per target face.
Definition at line 172 of file AMIInterpolation.H.
|
protected |
Weights of source faces per target face.
Definition at line 177 of file AMIInterpolation.H.
|
protected |
Sum of weights of source faces per target face.
Definition at line 182 of file AMIInterpolation.H.
|
protected |
Centroid of source faces per target face.
Definition at line 187 of file AMIInterpolation.H.
|
protected |
Target patch points if input points are manipulated, e.g. projected.
Definition at line 193 of file AMIInterpolation.H.
|
protected |
Target patch using manipulated input points.
Definition at line 198 of file AMIInterpolation.H.
|
protected |
Target map pointer - parallel running only.
Definition at line 203 of file AMIInterpolation.H.
Referenced by AMIInterpolation::AMIInterpolation().
|
protected |
Up-to-date flag.
Definition at line 208 of file AMIInterpolation.H.
Referenced by AMIInterpolation::upToDate().