mesh to mesh interpolation class. More...
Data Structures | |
class | patchFieldInterpolator |
Patch-field interpolation class. More... | |
Public Types | |
enum | order { MAP, INTERPOLATE, CELL_POINT_INTERPOLATE, CELL_VOLUME_WEIGHT } |
Enumeration specifying required accuracy. More... | |
Public Member Functions | |
ClassName ("meshToMesh0") | |
meshToMesh0 (const fvMesh &fromMesh, const fvMesh &toMesh, const HashTable< word > &patchMap, const wordList &cuttingPatchNames) | |
Construct from the two meshes, the patch name map for the patches. More... | |
meshToMesh0 (const fvMesh &fromMesh, const fvMesh &toMesh) | |
Construct from the two meshes assuming there is an exact mapping. More... | |
~meshToMesh0 () | |
Destructor. More... | |
const fvMesh & | fromMesh () const |
const fvMesh & | toMesh () const |
const labelList & | cellAddressing () const |
From toMesh cells to fromMesh cells. More... | |
scalar | V () const |
Overlap volume. More... | |
template<class Type , class CombineOp > | |
void | mapField (Field< Type > &, const Field< Type > &, const labelList &adr, const CombineOp &cop) const |
Map field. More... | |
template<class Type , class CombineOp > | |
void | interpolateField (Field< Type > &, const GeometricField< Type, fvPatchField, volMesh > &, const labelList &adr, const scalarListList &weights, const CombineOp &cop) const |
Interpolate field using inverse-distance weights. More... | |
template<class Type , class CombineOp > | |
void | interpolateField (Field< Type > &, const GeometricField< Type, fvPatchField, volMesh > &, const labelListList &adr, const scalarListList &weights, const CombineOp &cop) const |
Interpolate field using inverse-volume weights. More... | |
template<class Type , class CombineOp > | |
void | interpolateField (Field< Type > &, const GeometricField< Type, fvPatchField, volMesh > &, const labelList &adr, const vectorField ¢res, const CombineOp &cop) const |
Interpolate field using cell-point interpolation. More... | |
template<class Type , class CombineOp > | |
void | interpolateInternalField (Field< Type > &, const GeometricField< Type, fvPatchField, volMesh > &, order=INTERPOLATE, const CombineOp &cop=eqOp< Type >()) const |
Interpolate internal volume field. More... | |
template<class Type , class CombineOp > | |
void | interpolateInternalField (Field< Type > &, const tmp< GeometricField< Type, fvPatchField, volMesh > > &, order=INTERPOLATE, const CombineOp &cop=eqOp< Type >()) const |
template<class Type , class CombineOp > | |
void | interpolate (GeometricField< Type, fvPatchField, volMesh > &, const GeometricField< Type, fvPatchField, volMesh > &, order=INTERPOLATE, const CombineOp &cop=eqOp< Type >()) const |
Interpolate volume field. More... | |
template<class Type , class CombineOp > | |
void | interpolate (GeometricField< Type, fvPatchField, volMesh > &, const tmp< GeometricField< Type, fvPatchField, volMesh > > &, order=INTERPOLATE, const CombineOp &cop=eqOp< Type >()) const |
template<class Type , class CombineOp > | |
tmp< GeometricField< Type, fvPatchField, volMesh > > | interpolate (const GeometricField< Type, fvPatchField, volMesh > &, order=INTERPOLATE, const CombineOp &cop=eqOp< Type >()) const |
Interpolate volume field. More... | |
template<class Type , class CombineOp > | |
tmp< GeometricField< Type, fvPatchField, volMesh > > | interpolate (const tmp< GeometricField< Type, fvPatchField, volMesh > > &, order=INTERPOLATE, const CombineOp &cop=eqOp< Type >()) const |
template<class Type , class CombineOp > | |
Foam::tmp< Foam::GeometricField< Type, Foam::fvPatchField, Foam::volMesh > > | interpolate (const GeometricField< Type, fvPatchField, volMesh > &fromVf, meshToMesh0::order ord, const CombineOp &cop) const |
template<class Type , class CombineOp > | |
Foam::tmp< Foam::GeometricField< Type, Foam::fvPatchField, Foam::volMesh > > | interpolate (const tmp< GeometricField< Type, fvPatchField, volMesh > > &tfromVf, meshToMesh0::order ord, const CombineOp &cop) const |
Private Member Functions | |
void | calcAddressing () |
void | cellAddresses (labelList &cells, const pointField &points, const fvMesh &fromMesh, const List< bool > &boundaryCell, const indexedOctree< treeDataCell > &oc) const |
void | calculateInverseDistanceWeights () const |
void | calculateInverseVolumeWeights () const |
void | calculateCellToCellAddressing () const |
const scalarListList & | inverseDistanceWeights () const |
const scalarListList & | inverseVolumeWeights () const |
const labelListList & | cellToCellAddressing () const |
Private Attributes | |
const fvMesh & | fromMesh_ |
const fvMesh & | toMesh_ |
HashTable< label > | fromMeshPatches_ |
fromMesh patch labels More... | |
HashTable< label > | toMeshPatches_ |
toMesh patch labels More... | |
HashTable< word > | patchMap_ |
Patch map. More... | |
HashTable< label > | cuttingPatches_ |
toMesh patch labels which cut the from-mesh More... | |
labelList | cellAddressing_ |
Cell addressing. More... | |
labelListList | boundaryAddressing_ |
Boundary addressing. More... | |
scalarListList * | inverseDistanceWeightsPtr_ |
Inverse-distance interpolation weights. More... | |
scalarListList * | inverseVolumeWeightsPtr_ |
Inverse-volume interpolation weights. More... | |
labelListList * | cellToCellAddressingPtr_ |
Cell to cell overlap addressing. More... | |
scalar | V_ |
Overlap volume. More... | |
Static Private Attributes | |
static const scalar | directHitTol = 1e-5 |
Direct hit tolerance. More... | |
mesh to mesh interpolation class.
Definition at line 63 of file meshToMesh0.H.
enum order |
Enumeration specifying required accuracy.
Enumerator | |
---|---|
MAP | |
INTERPOLATE | |
CELL_POINT_INTERPOLATE | |
CELL_VOLUME_WEIGHT |
Definition at line 142 of file meshToMesh0.H.
meshToMesh0 | ( | const fvMesh & | fromMesh, |
const fvMesh & | toMesh, | ||
const HashTable< word > & | patchMap, | ||
const wordList & | cuttingPatchNames | ||
) |
Construct from the two meshes, the patch name map for the patches.
to be interpolated and the names of the toMesh-patches which cut the fromMesh
Definition at line 43 of file meshToMesh0.C.
References Foam::endl(), forAll, patchi, and WarningInFunction.
meshToMesh0 | ( | const fvMesh & | fromMesh, |
const fvMesh & | toMesh | ||
) |
Construct from the two meshes assuming there is an exact mapping.
between the patches
Definition at line 114 of file meshToMesh0.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, and patchi.
~meshToMesh0 | ( | ) |
Destructor.
Definition at line 194 of file meshToMesh0.C.
References meshToMesh0::cellToCellAddressingPtr_, Foam::deleteDemandDrivenData(), meshToMesh0::inverseDistanceWeightsPtr_, and meshToMesh0::inverseVolumeWeightsPtr_.
|
private |
Definition at line 40 of file calculateMeshToMesh0Addressing.C.
References boundBox::avgDim(), meshToMesh0::boundaryAddressing_, polyMesh::boundaryMesh(), Foam::cbrt(), polyMesh::CELL_TETS, meshToMesh0::cellAddresses(), meshToMesh0::cellAddressing_, primitiveMesh::cellCentres(), primitiveMesh::cells(), meshToMesh0::cuttingPatches_, Foam::endl(), polyPatch::faceCentres(), HashTable::find(), indexedOctree::findNearest(), forAll, HashTable::found(), meshToMesh0::fromMesh_, meshToMesh0::fromMeshPatches_, Foam::Info, PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), boundBox::mag(), boundBox::max(), meshBb, boundBox::min(), patchIdentifier::name(), patchi, meshToMesh0::patchMap_, polyMesh::points(), Foam::Pout, indexedOctree::print(), List::setSize(), List::size(), Foam::sqr(), Foam::sqrt(), meshToMesh0::toMesh_, treeBoundBox::typDim(), and WarningInFunction.
|
private |
Definition at line 213 of file calculateMeshToMesh0Addressing.C.
References primitiveMesh::cellCells(), primitiveMesh::cellCentres(), indexedOctree::findInside(), forAll, found, Foam::magSqr(), p, polyMesh::pointInCell(), and points.
Referenced by meshToMesh0::calcAddressing().
|
private |
Initialise overlap volume to zero
Definition at line 31 of file calculateMeshToMesh0Weights.C.
References fvMesh::C(), meshToMesh0::cellAddressing_, primitiveMesh::cellCells(), meshToMesh0::directHitTol, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, meshToMesh0::fromMesh_, Foam::Info, GeometricField::internalField(), meshToMesh0::inverseDistanceWeightsPtr_, Foam::mag(), primitiveMesh::nCells(), List::setSize(), List::size(), meshToMesh0::toMesh_, fvMesh::V(), and meshToMesh0::V_.
|
private |
Initialise overlap volume to zero
Definition at line 133 of file calculateMeshToMesh0Weights.C.
References tetOverlapVolume::cellCellOverlapVolumeMinDecomp(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::Info, List::setSize(), and List::size().
|
private |
Initialise overlap volume to zero
Definition at line 196 of file calculateMeshToMesh0Weights.C.
References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::Info, tetOverlapVolume::overlappingCells(), and List::size().
|
private |
Definition at line 241 of file calculateMeshToMesh0Weights.C.
|
private |
Definition at line 252 of file calculateMeshToMesh0Weights.C.
|
private |
Definition at line 263 of file calculateMeshToMesh0Weights.C.
ClassName | ( | "meshToMesh0" | ) |
|
inline |
Definition at line 229 of file meshToMesh0.H.
References meshToMesh0::fromMesh_.
Referenced by Foam::MapConsistentVolFields(), and Foam::MapVolFields().
|
inline |
Definition at line 234 of file meshToMesh0.H.
References meshToMesh0::toMesh_.
Referenced by Foam::MapConsistentVolFields(), Foam::MapLagrangianFields(), and Foam::MapVolFields().
|
inline |
From toMesh cells to fromMesh cells.
Definition at line 240 of file meshToMesh0.H.
References meshToMesh0::cellAddressing_.
|
inline |
void interpolateField | ( | Field< Type > & | toF, |
const GeometricField< Type, fvPatchField, volMesh > & | fromVf, | ||
const labelList & | adr, | ||
const scalarListList & | weights, | ||
const CombineOp & | cop | ||
) | const |
Interpolate field using inverse-distance weights.
Definition at line 86 of file meshToMesh0Templates.C.
References f(), forAll, and w().
void interpolateField | ( | Field< Type > & | toF, |
const GeometricField< Type, fvPatchField, volMesh > & | fromVf, | ||
const labelListList & | adr, | ||
const scalarListList & | weights, | ||
const CombineOp & | cop | ||
) | const |
Interpolate field using inverse-volume weights.
Definition at line 59 of file meshToMesh0Templates.C.
References f(), forAll, and w().
void interpolateField | ( | Field< Type > & | toF, |
const GeometricField< Type, fvPatchField, volMesh > & | fromVf, | ||
const labelList & | adr, | ||
const vectorField & | centres, | ||
const CombineOp & | cop | ||
) | const |
Interpolate field using cell-point interpolation.
Definition at line 121 of file meshToMesh0Templates.C.
References forAll, and interpolationCellPoint< Type >::interpolate().
void interpolateInternalField | ( | Field< Type > & | toF, |
const GeometricField< Type, fvPatchField, volMesh > & | fromVf, | ||
meshToMesh0::order | ord = INTERPOLATE , |
||
const CombineOp & | cop = eqOp<Type>() |
||
) | const |
Interpolate internal volume field.
Definition at line 152 of file meshToMesh0Templates.C.
References Foam::exit(), Foam::FatalError, and FatalErrorInFunction.
void interpolateInternalField | ( | Field< Type > & | toF, |
const tmp< GeometricField< Type, fvPatchField, volMesh > > & | tfromVf, | ||
meshToMesh0::order | ord = INTERPOLATE , |
||
const CombineOp & | cop = eqOp<Type>() |
||
) | const |
Definition at line 233 of file meshToMesh0Templates.C.
void interpolate | ( | GeometricField< Type, fvPatchField, volMesh > & | toVf, |
const GeometricField< Type, fvPatchField, volMesh > & | fromVf, | ||
meshToMesh0::order | ord = INTERPOLATE , |
||
const CombineOp & | cop = eqOp<Type>() |
||
) | const |
Interpolate volume field.
Definition at line 247 of file meshToMesh0Templates.C.
References GeometricField::boundaryField(), fvPatch::Cf(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::isA(), fvPatch::name(), and patchi.
Referenced by Foam::MapConsistentVolFields(), and Foam::MapVolFields().
void interpolate | ( | GeometricField< Type, fvPatchField, volMesh > & | toVf, |
const tmp< GeometricField< Type, fvPatchField, volMesh > > & | tfromVf, | ||
meshToMesh0::order | ord = INTERPOLATE , |
||
const CombineOp & | cop = eqOp<Type>() |
||
) | const |
Definition at line 355 of file meshToMesh0Templates.C.
References Foam::MULES::interpolate().
tmp<GeometricField<Type, fvPatchField, volMesh> > interpolate | ( | const GeometricField< Type, fvPatchField, volMesh > & | , |
order | = INTERPOLATE , |
||
const CombineOp & | cop = eqOp< Type >() |
||
) | const |
Interpolate volume field.
tmp<GeometricField<Type, fvPatchField, volMesh> > interpolate | ( | const tmp< GeometricField< Type, fvPatchField, volMesh > > & | , |
order | = INTERPOLATE , |
||
const CombineOp & | cop = eqOp< Type >() |
||
) | const |
Foam::tmp< Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> > interpolate | ( | const GeometricField< Type, fvPatchField, volMesh > & | fromVf, |
meshToMesh0::order | ord, | ||
const CombineOp & | cop | ||
) | const |
Definition at line 370 of file meshToMesh0Templates.C.
References GeometricField::boundaryField(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, internalField(), and PtrList::set().
Foam::tmp< Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> > interpolate | ( | const tmp< GeometricField< Type, fvPatchField, volMesh > > & | tfromVf, |
meshToMesh0::order | ord, | ||
const CombineOp & | cop | ||
) | const |
Definition at line 442 of file meshToMesh0Templates.C.
References Foam::MULES::interpolate().
|
private |
Definition at line 69 of file meshToMesh0.H.
Referenced by meshToMesh0::calcAddressing(), meshToMesh0::calculateInverseDistanceWeights(), and meshToMesh0::fromMesh().
|
private |
Definition at line 70 of file meshToMesh0.H.
Referenced by meshToMesh0::calcAddressing(), meshToMesh0::calculateInverseDistanceWeights(), and meshToMesh0::toMesh().
fromMesh patch labels
Definition at line 73 of file meshToMesh0.H.
Referenced by meshToMesh0::calcAddressing().
toMesh patch labels
Definition at line 76 of file meshToMesh0.H.
Patch map.
Definition at line 79 of file meshToMesh0.H.
Referenced by meshToMesh0::calcAddressing().
toMesh patch labels which cut the from-mesh
Definition at line 82 of file meshToMesh0.H.
Referenced by meshToMesh0::calcAddressing().
|
private |
Cell addressing.
Definition at line 85 of file meshToMesh0.H.
Referenced by meshToMesh0::calcAddressing(), meshToMesh0::calculateInverseDistanceWeights(), and meshToMesh0::cellAddressing().
|
private |
Boundary addressing.
Definition at line 88 of file meshToMesh0.H.
Referenced by meshToMesh0::calcAddressing().
|
mutableprivate |
Inverse-distance interpolation weights.
Definition at line 91 of file meshToMesh0.H.
Referenced by meshToMesh0::calculateInverseDistanceWeights(), and meshToMesh0::~meshToMesh0().
|
mutableprivate |
Inverse-volume interpolation weights.
Definition at line 94 of file meshToMesh0.H.
Referenced by meshToMesh0::~meshToMesh0().
|
mutableprivate |
Cell to cell overlap addressing.
Definition at line 97 of file meshToMesh0.H.
Referenced by meshToMesh0::~meshToMesh0().
|
mutableprivate |
Overlap volume.
Definition at line 100 of file meshToMesh0.H.
Referenced by meshToMesh0::calculateInverseDistanceWeights(), and meshToMesh0::V().
|
staticprivate |
Direct hit tolerance.
Definition at line 132 of file meshToMesh0.H.
Referenced by meshToMesh0::calculateInverseDistanceWeights().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.