Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mesh interface (AMI). More...
Public Member Functions | |
TypeName ("cyclicAMI") | |
Runtime type information. More... | |
AMIInterpolation (const primitivePatch &srcPatch, const primitivePatch &tgtPatch, const faceAreaIntersect::triangulationMode &triMode, const bool requireMatch=true, const word &methodName=faceAreaWeightAMI::typeName, const scalar lowWeightCorrection=-1, const bool reverseTarget=false, const bool report=true) | |
Construct from components. More... | |
AMIInterpolation (const primitivePatch &srcPatch, const primitivePatch &tgtPatch, const autoPtr< searchableSurface > &surf, const faceAreaIntersect::triangulationMode &triMode, const bool requireMatch=true, const word &methodName=faceAreaWeightAMI::typeName, const scalar lowWeightCorrection=-1, const bool reverseTarget=false, const bool report=true) | |
Construct from components, with projection surface. More... | |
AMIInterpolation (const AMIInterpolation &fineAMI, const labelList &sourceRestrictAddressing, const labelList &neighbourRestrictAddressing, const bool report=false) | |
Construct from agglomeration of AMIInterpolation. More... | |
AMIInterpolation (const AMIInterpolation &)=delete | |
Disallow default bitwise copy construction. More... | |
virtual | ~AMIInterpolation () |
Destructor. More... | |
label | singlePatchProc () const |
Set to -1, or the processor holding all faces (both sides) of. More... | |
scalar | lowWeightCorrection () const |
Threshold weight below which interpolation is deactivated. More... | |
bool | applyLowWeightCorrection () const |
Return true if employing a 'lowWeightCorrection'. More... | |
const scalarField & | srcMagSf () const |
Return const access to source patch face areas. More... | |
const labelListList & | srcAddress () const |
Return const 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. More... | |
scalarField & | srcWeightsSum () |
Return access to normalisation factor of source. More... | |
const distributionMap & | srcMap () const |
Source map pointer - valid only if singlePatchProc = -1. More... | |
const scalarField & | tgtMagSf () const |
Return const access to target patch face areas. More... | |
const labelListList & | tgtAddress () const |
Return const 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. More... | |
scalarField & | tgtWeightsSum () |
Return access to normalisation factor of target. More... | |
const distributionMap & | tgtMap () const |
Target map pointer - valid only if singlePatchProc=-1. More... | |
void | update (const primitivePatch &srcPatch, const primitivePatch &tgtPatch, const bool report) |
Update addressing and weights. 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. 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. 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... | |
void | writeFaceConnectivity (const primitivePatch &srcPatch, const primitivePatch &tgtPatch, const labelListList &srcAddress) const |
Write face connectivity as OBJ file. More... | |
void | operator= (const AMIInterpolation &)=delete |
Disallow default bitwise assignment. 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 void | sumWeights (AMIInterpolation &AMI) |
Sum the weights on both sides of an AMI. More... | |
static void | sumWeights (PtrList< AMIInterpolation > &AMIs) |
As above, but for multiple AMI-s. More... | |
static void | reportSumWeights (AMIInterpolation &AMI) |
Print out information relating to the weights sum. Values close. More... | |
static void | normaliseWeights (AMIInterpolation &AMI) |
Normalise the weights on both sides of an AMI. More... | |
static void | normaliseWeights (UPtrList< AMIInterpolation > &AMIs) |
As above, but for multiple AMI-s. More... | |
static tmp< scalarField > | patchMagSf (const primitivePatch &patch, const faceAreaIntersect::triangulationMode triMode) |
Calculate the patch face magnitudes for the given tri-mode. 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.
AMIInterpolation | ( | const primitivePatch & | srcPatch, |
const primitivePatch & | tgtPatch, | ||
const faceAreaIntersect::triangulationMode & | triMode, | ||
const bool | requireMatch = true , |
||
const word & | methodName = faceAreaWeightAMI::typeName , |
||
const scalar | lowWeightCorrection = -1 , |
||
const bool | reverseTarget = false , |
||
const bool | report = true |
||
) |
Construct from components.
Definition at line 559 of file AMIInterpolation.C.
Referenced by AMIInterpolation::AMIInterpolation(), and AMIInterpolation::patchMagSf().
AMIInterpolation | ( | const primitivePatch & | srcPatch, |
const primitivePatch & | tgtPatch, | ||
const autoPtr< searchableSurface > & | surf, | ||
const faceAreaIntersect::triangulationMode & | triMode, | ||
const bool | requireMatch = true , |
||
const word & | methodName = faceAreaWeightAMI::typeName , |
||
const scalar | lowWeightCorrection = -1 , |
||
const bool | reverseTarget = false , |
||
const bool | report = true |
||
) |
Construct from components, with projection surface.
Definition at line 590 of file AMIInterpolation.C.
References AMIInterpolation::AMIInterpolation().
AMIInterpolation | ( | const AMIInterpolation & | fineAMI, |
const labelList & | sourceRestrictAddressing, | ||
const labelList & | neighbourRestrictAddressing, | ||
const bool | report = false |
||
) |
Construct from agglomeration of AMIInterpolation.
Agglomeration passed in as new coarse size and addressing from fine from coarse
Definition at line 622 of file AMIInterpolation.C.
References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::max(), Foam::nl, Foam::Pout, List< T >::size(), AMIInterpolation::srcAddress(), AMIInterpolation::srcMagSf(), AMIInterpolation::srcWeights(), AMIInterpolation::tgtAddress(), AMIInterpolation::tgtMagSf(), and AMIInterpolation::tgtWeights().
|
delete |
Disallow default bitwise copy construction.
|
virtual |
Destructor.
Definition at line 735 of file AMIInterpolation.C.
References AMIInterpolation::update().
TypeName | ( | "cyclicAMI" | ) |
Runtime type information.
|
inline |
Set to -1, or the processor holding all faces (both sides) of.
the AMI
Definition at line 26 of file AMIInterpolationI.H.
|
inline |
Threshold weight below which interpolation is deactivated.
Definition at line 32 of file AMIInterpolationI.H.
|
inline |
Return true if employing a 'lowWeightCorrection'.
Definition at line 38 of file AMIInterpolationI.H.
|
inline |
Return const access to source patch face areas.
Definition at line 44 of file AMIInterpolationI.H.
Referenced by AMIInterpolation::AMIInterpolation().
|
inline |
Return const access to source patch addressing.
Definition at line 50 of file AMIInterpolationI.H.
Referenced by AMIInterpolation::AMIInterpolation().
|
inline |
Return const access to source patch weights.
Definition at line 56 of file AMIInterpolationI.H.
Referenced by AMIInterpolation::AMIInterpolation().
|
inline |
Return access to source patch weights.
Definition at line 62 of file AMIInterpolationI.H.
|
inline |
Return const access to normalisation factor of source.
patch weights (i.e. the sum before normalisation)
Definition at line 68 of file AMIInterpolationI.H.
|
inline |
Return access to normalisation factor of source.
patch weights (i.e. the sum before normalisation)
Definition at line 74 of file AMIInterpolationI.H.
|
inline |
Source map pointer - valid only if singlePatchProc = -1.
This gets source data into a form to be consumed by tgtAddress, tgtWeights
Definition at line 80 of file AMIInterpolationI.H.
|
inline |
Return const access to target patch face areas.
Definition at line 86 of file AMIInterpolationI.H.
Referenced by AMIInterpolation::AMIInterpolation().
|
inline |
Return const access to target patch addressing.
Definition at line 92 of file AMIInterpolationI.H.
Referenced by AMIInterpolation::AMIInterpolation().
|
inline |
Return const access to target patch weights.
Definition at line 98 of file AMIInterpolationI.H.
Referenced by AMIInterpolation::AMIInterpolation().
|
inline |
Return access to target patch weights.
Definition at line 104 of file AMIInterpolationI.H.
|
inline |
Return const access to normalisation factor of target.
patch weights (i.e. the sum before normalisation)
Definition at line 110 of file AMIInterpolationI.H.
|
inline |
Return access to normalisation factor of target.
patch weights (i.e. the sum before normalisation)
Definition at line 116 of file AMIInterpolationI.H.
|
inline |
Target map pointer - valid only if singlePatchProc=-1.
This gets target data into a form to be consumed by srcAddress, srcWeights
Definition at line 122 of file AMIInterpolationI.H.
void update | ( | const primitivePatch & | srcPatch, |
const primitivePatch & | tgtPatch, | ||
const bool | report | ||
) |
Update addressing and weights.
Definition at line 742 of file AMIInterpolation.C.
References AMIMethod::calculate(), distributionMapBase::constructMap(), distributionMapBase::distribute(), Foam::endl(), forAll, Foam::gSum(), Foam::indent(), Foam::Info, AMIMethod::New(), Foam::nl, UPstream::nonBlocking, Foam::returnReduce(), List< T >::size(), distributionMapBase::subMap(), and faceAreaIntersect::triangulationModeNames_.
Referenced by AMIInterpolation::~AMIInterpolation().
|
static |
Sum the weights on both sides of an AMI.
Definition at line 976 of file AMIInterpolation.C.
|
static |
As above, but for multiple AMI-s.
Definition at line 983 of file AMIInterpolation.C.
References forAll, and UPtrList< T >::size().
|
static |
Print out information relating to the weights sum. Values close.
to one are ideal. This information acts as a measure of the quality of the AMI.
Definition at line 1013 of file AMIInterpolation.C.
|
static |
Normalise the weights on both sides of an AMI.
Definition at line 1033 of file AMIInterpolation.C.
|
static |
As above, but for multiple AMI-s.
Definition at line 1040 of file AMIInterpolation.C.
References forAll, UPtrList< T >::size(), and AMIInterpolation::srcPointFace().
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 120 of file AMIInterpolationTemplates.C.
References Foam::abort(), distributionMap::distribute(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::nl, List< T >::setSize(), and UList< T >::size().
Referenced by mappedPatchBase::distribute(), AMIInterpolation::interpolateToSource(), AMIInterpolation::interpolateToTarget(), and meshToMesh::mapSrcToTgt().
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 36 of file AMIInterpolationTemplates.C.
References Foam::abort(), distributionMap::distribute(), Foam::FatalError, FatalErrorInFunction, forAll, AMIInterpolation::interpolateToSource(), Foam::nl, List< T >::setSize(), and UList< T >::size().
Referenced by AMIInterpolation::interpolateToSource(), AMIInterpolation::interpolateToTarget(), meshToMesh::mapTgtToSrc(), and mappedPatchBase::reverseDistribute().
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 1061 of file AMIInterpolation.C.
References PointHit< Point >::distance(), PointHit< Point >::eligibleMiss(), f(), forAll, PointHit< Point >::hit(), face::nearestPoint(), PrimitivePatch< FaceList, PointField >::points(), PointHit< Point >::rawPoint(), face::ray(), AMIInterpolation::tgtPointFace(), and intersection::visible.
Referenced by AMIInterpolation::normaliseWeights().
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 1112 of file AMIInterpolation.C.
References PointHit< Point >::distance(), PointHit< Point >::eligibleMiss(), f(), forAll, PointHit< Point >::hit(), face::nearestPoint(), PrimitivePatch< FaceList, PointField >::points(), PointHit< Point >::rawPoint(), face::ray(), intersection::visible, and AMIInterpolation::writeFaceConnectivity().
Referenced by AMIInterpolation::srcPointFace().
|
static |
Calculate the patch face magnitudes for the given tri-mode.
Definition at line 43 of file AMIInterpolation.C.
References Foam::abort(), AMIInterpolation::AMIInterpolation(), List< T >::append(), distributionMapBase::constructMap(), distributionMapBase::constructSize(), distributionMap::distribute(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, Foam::findIndex(), searchableSurface::findNearest(), forAll, Foam::gMax(), Foam::gMin(), Foam::gSum(), PointIndexHit< Point >::hit(), PointIndexHit< Point >::hitPoint(), Foam::identity(), Foam::indent(), Foam::Info, Foam::labelMin, PrimitivePatch< FaceList, PointField >::localFaces(), PrimitivePatch< FaceList, PointField >::localPoints(), Foam::max(), UPstream::myProcNo(), UPstream::nProcs(), Foam::constant::mathematical::pi(), PrimitivePatch< FaceList, PointField >::points(), Foam::reduce(), tmp< T >::ref(), autoPtr< T >::reset(), Foam::returnReduce(), List< T >::setSize(), List< T >::size(), distributionMapBase::subMap(), Foam::sum(), faceAreaIntersect::triangulate(), autoPtr< T >::valid(), Foam::meshTools::writeOBJ(), and Foam::Zero.
void writeFaceConnectivity | ( | const primitivePatch & | srcPatch, |
const primitivePatch & | tgtPatch, | ||
const labelListList & | srcAddress | ||
) | const |
Write face connectivity as OBJ file.
Definition at line 1163 of file AMIInterpolation.C.
References Foam::endl(), PrimitivePatch< FaceList, PointField >::faceCentres(), forAll, UPstream::myProcNo(), Foam::name(), and Foam::meshTools::writeOBJ().
Referenced by AMIInterpolation::tgtPointFace().
|
delete |
Disallow default bitwise assignment.
Foam::tmp<Foam::Field<Type> > interpolateToSource | ( | const Field< Type > & | fld, |
const CombineOp & | cop, | ||
const UList< Type > & | defaultValues | ||
) | const |
Definition at line 205 of file AMIInterpolationTemplates.C.
References AMIInterpolation::interpolateToSource(), tmp< T >::ref(), 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 235 of file AMIInterpolationTemplates.C.
References AMIInterpolation::interpolateToTarget().
Foam::tmp<Foam::Field<Type> > interpolateToTarget | ( | const Field< Type > & | fld, |
const CombineOp & | cop, | ||
const UList< Type > & | defaultValues | ||
) | const |
Definition at line 248 of file AMIInterpolationTemplates.C.
References AMIInterpolation::interpolateToTarget(), tmp< T >::ref(), 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 278 of file AMIInterpolationTemplates.C.
References AMIInterpolation::interpolateToSource().
Foam::tmp<Foam::Field<Type> > interpolateToSource | ( | const Field< Type > & | fld, |
const UList< Type > & | defaultValues | ||
) | const |
Definition at line 291 of file AMIInterpolationTemplates.C.
References AMIInterpolation::interpolateToSource().
Foam::tmp<Foam::Field<Type> > interpolateToSource | ( | const tmp< Field< Type >> & | tFld, |
const UList< Type > & | defaultValues | ||
) | const |
Definition at line 303 of file AMIInterpolationTemplates.C.
References AMIInterpolation::interpolateToTarget().
Foam::tmp<Foam::Field<Type> > interpolateToTarget | ( | const Field< Type > & | fld, |
const UList< Type > & | defaultValues | ||
) | const |
Definition at line 315 of file AMIInterpolationTemplates.C.
References AMIInterpolation::interpolateToTarget().
Foam::tmp<Foam::Field<Type> > interpolateToTarget | ( | const tmp< Field< Type >> & | tFld, |
const UList< Type > & | defaultValues | ||
) | const |
Definition at line 327 of file AMIInterpolationTemplates.C.