Base class for Arbitrary Mesh Interface (AMI) methods. More...
Public Member Functions | |
TypeName ("advancingFrontAMI") | |
Runtime type information. More... | |
advancingFrontAMI (const dictionary &dict, const bool reverseTarget) | |
Construct from components. More... | |
advancingFrontAMI (const bool requireMatch=true, const bool reverseTarget=false, const scalar lowWeightCorrection=-1, const faceAreaIntersect::triangulationMode triMode=faceAreaIntersect::tmMesh) | |
Construct from components. More... | |
advancingFrontAMI (const advancingFrontAMI &ami) | |
Construct as copy. More... | |
virtual autoPtr< AMIInterpolation > | clone () const |
Construct and return a clone. More... | |
virtual | ~advancingFrontAMI ()=default |
Destructor. More... | |
const primitivePatch & | srcPatch () const |
Return const access to the source patch. More... | |
const primitivePatch & | tgtPatch () const |
Return const access to the target patch. More... | |
const labelList & | srcNonOverlap () const |
Labels of faces that are not overlapped by any target faces. More... | |
virtual void | write (Ostream &os) const |
Write. More... | |
Public Member Functions inherited from AMIInterpolation | |
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) | |
AMIInterpolation (const AMIInterpolation &ami) | |
Construct as copy. More... | |
virtual autoPtr< AMIInterpolation > | clone () const |
Construct and return a clone. More... | |
virtual | ~AMIInterpolation ()=default |
Destructor. More... | |
bool | upToDate () const |
Access to the up-to-date flag. More... | |
bool & | upToDate () |
Access to the up-to-date flag. More... | |
bool | distributed () const |
Access to the distributed flag. More... | |
bool | requireMatch () const |
Access to the requireMatch flag. More... | |
bool | setRequireMatch (const bool flag) |
Access to the requireMatch flag. More... | |
bool | mustMatchFaces () const |
Return true if requireMatch and lowWeightCorrectionin active. More... | |
bool | reverseTarget () const |
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 |
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 |
scalarField & | srcWeightsSum () |
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 |
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 |
scalarField & | tgtWeightsSum () |
const mapDistribute & | tgtMap () const |
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) |
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 , class CombineOp > | |
void | interpolateToSource (const UList< Type > &fld, const CombineOp &cop, List< Type > &result, const UList< Type > &defaultValues=UList< Type >::null()) const |
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 |
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 |
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. 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 |
Protected Member Functions | |
void | createExtendedTgtPatch () |
Create a map that extends tgtPatch so that it covers srcPatch. More... | |
void | checkPatches () const |
Check AMI patch coupling. More... | |
bool | isCandidate (const label srcFacei, const label tgtFacei) const |
Is source/target a valid pair (i.e. not too far/different. More... | |
virtual bool | calculate (const primitivePatch &srcPatch, const primitivePatch &tgtPatch, const autoPtr< searchableSurface > &surfPtr=nullptr) |
Update addressing, weights and (optional) centroids. More... | |
bool | initialiseWalk (label &srcFacei, label &tgtFacei) |
Initialise walk and return true if all ok. More... | |
void | writeIntersectionOBJ (const scalar area, const face &f1, const face &f2, const pointField &f1Points, const pointField &f2Points) const |
Write triangle intersection to OBJ file. More... | |
label | findTargetFace (const label srcFacei, const UList< label > &excludeFaces=UList< label >::null(), const label srcFacePti=-1) const |
void | appendNbrFaces (const label facei, const primitivePatch &patch, const DynamicList< label > &visitedFaces, DynamicList< label > &faceIDs) const |
Add faces neighbouring facei to the ID list. More... | |
void | triangulatePatch (const primitivePatch &patch, List< DynamicList< face > > &tris, List< scalar > &magSf) const |
Helper function to decompose a patch. More... | |
virtual void | nonConformalCorrection () |
Correction for non-conformal interpolations, e.g. for ACMI. More... | |
Protected Member Functions inherited from AMIInterpolation | |
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... | |
Protected Attributes | |
const scalar | maxDistance2_ |
Maximum squared distance. More... | |
const scalar | minCosAngle_ |
Minimum (cos of) angle. 1 for perfectly matching. More... | |
List< DynamicList< face > > | srcTris_ |
Storage for src-side triangle decomposition. More... | |
List< DynamicList< face > > | tgtTris_ |
Storage for tgt-side triangle decomposition. More... | |
autoPtr< primitivePatch > | extendedTgtPatchPtr_ |
Demand-driven extended target mesh (distributed parallel usage) More... | |
faceList | extendedTgtFaces_ |
Extended patch faces. More... | |
pointField | extendedTgtPoints_ |
Extended patch points. More... | |
labelList | extendedTgtFaceIDs_ |
Extended patch face IDs. More... | |
autoPtr< mapDistribute > | extendedTgtMapPtr_ |
Extended patch map. More... | |
labelList | srcNonOverlap_ |
autoPtr< indexedOctree< treeType > > | treePtr_ |
Octree used to find face seeds. More... | |
const faceAreaIntersect::triangulationMode | triMode_ |
Face triangulation mode. More... | |
Protected Attributes inherited from AMIInterpolation | |
bool | requireMatch_ |
const bool | reverseTarget_ |
const scalar | lowWeightCorrection_ |
Threshold weight below which interpolation is deactivated. More... | |
label | singlePatchProc_ |
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_ |
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_ |
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... | |
Additional Inherited Members | |
Static Public Member Functions inherited from AMIInterpolation | |
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... | |
Static Public Attributes inherited from AMIInterpolation | |
static bool | cacheIntersections_ = false |
Protected Types inherited from AMIInterpolation | |
typedef treeDataPrimitivePatch< primitivePatch > | treeType |
Local typedef to octree tree-type. More... | |
Static Protected Member Functions inherited from AMIInterpolation | |
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) |
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) |
Base class for Arbitrary Mesh Interface (AMI) methods.
Definition at line 55 of file advancingFrontAMI.H.
advancingFrontAMI | ( | const dictionary & | dict, |
const bool | reverseTarget | ||
) |
Construct from components.
Definition at line 422 of file advancingFrontAMI.C.
advancingFrontAMI | ( | const bool | requireMatch = true , |
const bool | reverseTarget = false , |
||
const scalar | lowWeightCorrection = -1 , |
||
const faceAreaIntersect::triangulationMode | triMode = faceAreaIntersect::tmMesh |
||
) |
Construct from components.
Definition at line 451 of file advancingFrontAMI.C.
advancingFrontAMI | ( | const advancingFrontAMI & | ami | ) |
Construct as copy.
Definition at line 474 of file advancingFrontAMI.C.
|
virtualdefault |
Destructor.
|
protected |
Create a map that extends tgtPatch so that it covers srcPatch.
Definition at line 135 of file advancingFrontAMI.C.
|
protected |
Check AMI patch coupling.
Definition at line 45 of file advancingFrontAMI.C.
References boundBox::contains(), Foam::endl(), boundBox::inflate(), Foam::nl, Foam::Pout, AMIInterpolation::requireMatch_, boundBox::span(), advancingFrontAMI::srcPatch(), advancingFrontAMI::tgtPatch(), and WarningInFunction.
|
protected |
Is source/target a valid pair (i.e. not too far/different.
orientation). Used for prefiltering before e.g. area overlap
Definition at line 84 of file advancingFrontAMI.C.
References Foam::sqr().
|
protectedvirtual |
Update addressing, weights and (optional) centroids.
Reimplemented from AMIInterpolation.
Reimplemented in faceAreaWeightAMI, and faceAreaWeightAMI2D.
Definition at line 493 of file advancingFrontAMI.C.
References advancingFrontAMI::calculate().
Referenced by advancingFrontAMI::calculate().
|
protected |
Initialise walk and return true if all ok.
Definition at line 169 of file advancingFrontAMI.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::Pout, and WarningInFunction.
|
protected |
Write triangle intersection to OBJ file.
Definition at line 230 of file advancingFrontAMI.C.
References Foam::endl(), forAll, n, Foam::name(), Foam::nl, os(), face::points(), Foam::Pout, UList< T >::size(), and Foam::meshTools::writeOBJ().
|
protected |
Definition at line 281 of file advancingFrontAMI.C.
References boundBox::centre(), Foam::endl(), Foam::magSqr(), boundBox::max(), and Foam::Pout.
|
protected |
Add faces neighbouring facei to the ID list.
Definition at line 321 of file advancingFrontAMI.C.
References DynamicList< T, SizeMin >::append(), Foam::cos(), Foam::degToRad(), and UList< T >::found().
|
protected |
Helper function to decompose a patch.
Definition at line 353 of file advancingFrontAMI.C.
References f(), forAll, points, List< T >::setSize(), faceAreaIntersect::tmFan, faceAreaIntersect::tmMesh, and faceAreaIntersect::triangleFan().
|
protectedvirtual |
Correction for non-conformal interpolations, e.g. for ACMI.
Definition at line 399 of file advancingFrontAMI.C.
TypeName | ( | "advancingFrontAMI" | ) |
Runtime type information.
|
inlinevirtual |
Construct and return a clone.
Reimplemented from AMIInterpolation.
Reimplemented in faceAreaWeightAMI, and faceAreaWeightAMI2D.
Definition at line 243 of file advancingFrontAMI.H.
|
inline |
Return const access to the source patch.
Definition at line 28 of file advancingFrontAMII.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and AMIInterpolation::tsrcPatch0_.
Referenced by advancingFrontAMI::checkPatches(), and faceAreaWeightAMI2D::writeNoMatch().
|
inline |
Return const access to the target patch.
Definition at line 41 of file advancingFrontAMII.H.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
Referenced by advancingFrontAMI::checkPatches(), and faceAreaWeightAMI2D::writeNoMatch().
|
inline |
Labels of faces that are not overlapped by any target faces.
Note: this should be empty for correct functioning
Definition at line 59 of file advancingFrontAMII.H.
|
virtual |
Write.
Reimplemented from AMIInterpolation.
Reimplemented in faceAreaWeightAMI, and faceAreaWeightAMI2D.
Definition at line 554 of file advancingFrontAMI.C.
References os(), faceAreaIntersect::tmMesh, faceAreaIntersect::triangulationModeNames_, ObukhovLength::write(), and Ostream::writeEntryIfDifferent().
|
protected |
Maximum squared distance.
Definition at line 109 of file advancingFrontAMI.H.
|
protected |
Minimum (cos of) angle. 1 for perfectly matching.
Definition at line 112 of file advancingFrontAMI.H.
|
protected |
Storage for src-side triangle decomposition.
Definition at line 115 of file advancingFrontAMI.H.
|
protected |
Storage for tgt-side triangle decomposition.
Definition at line 118 of file advancingFrontAMI.H.
|
protected |
Demand-driven extended target mesh (distributed parallel usage)
Definition at line 121 of file advancingFrontAMI.H.
|
protected |
Extended patch faces.
Definition at line 124 of file advancingFrontAMI.H.
|
protected |
Extended patch points.
Definition at line 127 of file advancingFrontAMI.H.
|
protected |
Extended patch face IDs.
Definition at line 130 of file advancingFrontAMI.H.
|
protected |
Extended patch map.
Definition at line 133 of file advancingFrontAMI.H.
|
protected |
Labels of faces that are not overlapped by any target faces (should be empty for correct functioning for fully covered AMIs)
Definition at line 137 of file advancingFrontAMI.H.
Referenced by faceAreaWeightAMI::calcAddressing().
|
protected |
Octree used to find face seeds.
Definition at line 140 of file advancingFrontAMI.H.
|
protected |
Face triangulation mode.
Definition at line 143 of file advancingFrontAMI.H.