45#ifndef Foam_meshToMesh_H
46#define Foam_meshToMesh_H
142 label singleMeshProc_;
159 template<
class Type,
class CombineOp>
160 void mapInternalSrcToTgt
163 const CombineOp& cop,
165 const bool secondOrder
170 template<
class Type,
class CombineOp>
171 void mapInternalTgtToSrc
174 const CombineOp& cop,
176 const bool secondOrder
181 template<
class Type,
class CombineOp>
182 void mapAndOpSrcToTgt
192 template<
class Type,
class CombineOp>
193 void mapAndOpTgtToSrc
205 void normaliseWeights
207 const word& descriptor,
216 const word& methodName,
222 void calculate(
const word& methodName,
const bool normalise);
225 void calculatePatchAMIs(
const word& amiMethodName);
228 void constructNoCuttingPatches
230 const word& methodName,
231 const word& AMIMethodName,
232 const bool interpAllPatches
236 void constructFromCuttingPatches
238 const word& methodName,
239 const word& AMIMethodName,
249 label calcDistribution
256 label calcOverlappingProcs
287 void distributeAndMergeCells
320 const bool interpAllPatches =
true
328 const word& methodName,
329 const word& AMIMethodName,
331 const bool interpAllPatches =
true
343 const bool normalise =
true
352 const word& methodName,
353 const word& AMIMethodName,
357 const bool normalise =
true
394 inline scalar
V()
const;
434 template<class Type, class CombineOp>
437 const
UList<Type>& srcFld,
438 const CombineOp& cop,
448 template<class Type, class CombineOp>
451 const
UList<Type>& srcField,
453 const CombineOp& cop,
459 template<class Type, class CombineOp>
462 const
Field<Type>& srcFld,
468 template<class Type, class CombineOp>
480 const
Field<Type>& srcFld
497 template<class Type, class CombineOp>
500 const
UList<Type>& tgtFld,
501 const CombineOp& cop,
511 template<class Type, class CombineOp>
514 const
UList<Type>& srcField,
516 const CombineOp& cop,
522 template<class Type, class CombineOp>
525 const
Field<Type>& tgtFld,
531 template<class Type, class CombineOp>
543 const
Field<Type>& tgtFld
561 template<class Type, class CombineOp>
565 const CombineOp& cop,
567 const
bool secondOrder = true
572 template<class Type, class CombineOp>
576 const CombineOp& cop,
577 const
bool secondOrder = true
582 template<class Type, class CombineOp>
586 const CombineOp& cop,
587 const
bool secondOrder = true
596 const
bool secondOrder = true
605 const
bool secondOrder = true
615 template<class Type, class CombineOp>
619 const CombineOp& cop,
621 const
bool secondOrder = true
626 template<class Type, class CombineOp>
630 const CombineOp& cop,
631 const
bool secondOrder = true
636 template<class Type, class CombineOp>
641 const CombineOp& cop,
642 const
bool secondOrder = true
651 const
bool secondOrder = true
660 const
bool secondOrder = true
670void meshToMesh::mapInternalSrcToTgt
678void meshToMesh::mapInternalSrcToTgt
686void meshToMesh::mapInternalSrcToTgt
694void meshToMesh::mapInternalSrcToTgt
702void meshToMesh::mapInternalSrcToTgt
710void meshToMesh::mapInternalSrcToTgt
718void meshToMesh::mapInternalTgtToSrc
726void meshToMesh::mapInternalTgtToSrc
734void meshToMesh::mapInternalTgtToSrc
742void meshToMesh::mapInternalTgtToSrc
750void meshToMesh::mapInternalTgtToSrc
758void meshToMesh::mapInternalTgtToSrc
770void meshToMesh::mapAndOpSrcToTgt
774 Field<scalar>& tgtField,
778void meshToMesh::mapAndOpSrcToTgt
786void meshToMesh::mapAndOpSrcToTgt
794void meshToMesh::mapAndOpSrcToTgt
802void meshToMesh::mapAndOpSrcToTgt
812void meshToMesh::mapAndOpTgtToSrc
815 Field<scalar>& srcField,
816 const
Field<scalar>& tgtField,
820void meshToMesh::mapAndOpTgtToSrc
828void meshToMesh::mapAndOpTgtToSrc
836void meshToMesh::mapAndOpTgtToSrc
844void meshToMesh::mapAndOpTgtToSrc
857#include "meshToMeshI.H"
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edges")));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
A HashTable similar to std::unordered_map.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A bounding box defined in terms of min/max extrema points.
Calculates a non-overlapping list of offsets based on an input size (eg, number of cells) from differ...
Class containing processor-to-processor mapping information.
Class to calculate the cell-addressing between two overlapping meshes.
virtual ~meshToMesh()
Destructor.
interpolationMethod
Enumeration specifying interpolation method.
@ imCorrectedCellVolumeWeight
const autoPtr< mapDistribute > & srcMap() const noexcept
Source map pointer - valid if no singleMeshProc.
const labelListList & srcToTgtCellAddr() const
Return const access to the source to target cell addressing.
scalar V() const
Return const access to the overlap volume.
bool distributed() const noexcept
Distributed across processors (singleMeshProc == -1).
const mapDistribute * hasTgtMap() const noexcept
Pointer to the target map (if distributed). Can be checked as a bool.
procMapMethod
Enumeration specifying processor parallel map construction method.
const scalarListList & srcToTgtCellWght() const
Return const access to the source to target cell weights.
const scalarListList & tgtToSrcCellWght() const
Return const access to the target to source cell weights.
const pointListList & srcToTgtCellVec() const
Return const access to the source to target offset vectors.
const PtrList< AMIPatchToPatchInterpolation > & patchAMIs() const
Return the list of AMIs between source and target patches.
TypeName("meshToMesh")
Run-time type information.
const mapDistribute * hasSrcMap() const noexcept
Pointer to the source map (if distributed). Can be checked as a bool.
const labelListList & tgtToSrcCellAddr() const
Return const access to the target to source cell addressing.
const pointListList & tgtToSrcCellVec() const
Return const access to the target to source offset vectors.
void mapTgtToSrc(const UList< Type > &tgtFld, const CombineOp &cop, List< Type > &result) const
Map field from tgt to src mesh with defined operation.
const polyMesh & srcRegion() const
Return const access to the source mesh.
static word interpolationMethodAMI(const interpolationMethod method)
Conversion between mesh and patch interpolation methods.
void mapSrcToTgt(const UList< Type > &srcFld, const CombineOp &cop, List< Type > &result) const
Map field from src to tgt mesh with defined operation.
static const Enum< procMapMethod > procMapMethodNames_
static const Enum< interpolationMethod > interpolationMethodNames_
const autoPtr< mapDistribute > & tgtMap() const noexcept
Target map pointer - valid if no singleMeshProc.
const polyMesh & tgtRegion() const
Return const access to the target mesh.
Mesh consisting of general polyhedral cells.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
List< scalarList > scalarListList
List of scalarList.
List< word > wordList
List of word.
GeometricField< Type, fvPatchField, volMesh > VolumeField
A volume field for a given type.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
List< face > faceList
List of faces.
void add(DimensionedField< scalar, GeoMesh > &result, const dimensioned< scalar > &dt1, const DimensionedField< scalar, GeoMesh > &f2)
AMIInterpolation AMIPatchToPatchInterpolation
Patch-to-patch interpolation == Foam::AMIInterpolation.
List< bool > boolList
A List of bools.
vectorField pointField
pointField is a vectorField.
SphericalTensor< scalar > sphericalTensor
SphericalTensor of scalars, i.e. SphericalTensor<scalar>.
List< pointList > pointListList
List of pointList.
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Forwards and collection of common volume field types.