meshToMesh.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2012-2016 OpenFOAM Foundation
9  Copyright (C) 2015-2022 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::meshToMesh
29 
30 Description
31  Class to calculate the cell-addressing between two overlapping meshes
32 
33  Mapping is performed using a run-time selectable interpolation mothod
34 
35 SeeAlso
36  meshToMeshMethod
37 
38 SourceFiles
39  meshToMesh.C
40  meshToMeshParallelOps.C
41  meshToMeshTemplates.C
42 
43 \*---------------------------------------------------------------------------*/
44 
45 #ifndef Foam_meshToMesh_H
46 #define Foam_meshToMesh_H
47 
48 #include "polyMesh.H"
49 #include "treeBoundBox.H"
50 #include "mapDistribute.H"
51 #include "volFieldsFwd.H"
52 #include "Enum.H"
54 #include "pointList.H"
55 
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 
58 namespace Foam
59 {
60 
61 /*---------------------------------------------------------------------------*\
62  Class meshToMesh Declaration
63 \*---------------------------------------------------------------------------*/
64 
65 class meshToMesh
66 {
67 public:
68 
69  // Public data types
70 
71  //- Enumeration specifying interpolation method
72  enum class interpolationMethod
73  {
74  imDirect,
78  };
79 
81 
82  //- Enumeration specifying processor parallel map construction method
83  enum class procMapMethod
84  {
85  pmAABB,
86  pmLOD
87  };
88 
90 
91 private:
92 
93  // Private data
94 
95  //- Reference to the source mesh
96  const polyMesh& srcRegion_;
97 
98  //- Reference to the target mesh
99  const polyMesh& tgtRegion_;
100 
101  //- Processor parallel map construction method
102  procMapMethod procMapMethod_;
103 
104  //- List of target patch IDs per source patch (local index)
105  List<label> srcPatchID_;
106 
107  //- List of source patch IDs per target patch (local index)
108  List<label> tgtPatchID_;
109 
110  //- List of AMIs between source and target patches
112 
113  //- Cutting patches whose values are set using a zero-gradient condition
114  List<label> cuttingPatches_;
115 
116  //- Source to target cell addressing
117  labelListList srcToTgtCellAddr_;
118 
119  //- Target to source cell addressing
120  labelListList tgtToSrcCellAddr_;
121 
122  //- Source to target cell interpolation weights
123  scalarListList srcToTgtCellWght_;
124 
125  //- Target to source cell interpolation weights
126  scalarListList tgtToSrcCellWght_;
127 
128  // Vectors from cell centre to overlap volume for 2nd order correction
129  // (only set for corrected methods)
130 
131  //- Source to target cell offset vectors
132  pointListList srcToTgtCellVec_;
133 
134  //- Target to source cell offset vectors
135  pointListList tgtToSrcCellVec_;
136 
137  //- Cell total volume in overlap region [m3]
138  scalar V_;
139 
140  //- Index of processor that holds all of both sides. -1 in all other
141  // cases
142  label singleMeshProc_;
143 
144  //- Source map pointer - parallel running only
145  autoPtr<mapDistribute> srcMapPtr_;
146 
147  //- Target map pointer - parallel running only
148  autoPtr<mapDistribute> tgtMapPtr_;
149 
150 
151  // Private Member Functions
152 
153  //- Helper function to add a constant offset to a list
154  template<class Type>
155  void add(UList<Type>& fld, const label offset) const;
156 
157  //- Helper function to interpolate internal field. Optionally uses
158  // gradient. Template specialisations for tensor types below
159  template<class Type, class CombineOp>
160  void mapInternalSrcToTgt
161  (
162  const VolumeField<Type>& field,
163  const CombineOp& cop,
164  VolumeField<Type>& result,
165  const bool secondOrder
166  ) const;
167 
168  //- Helper function to interpolate internal field. Optionally uses
169  // gradient. Template specialisations for tensor types below
170  template<class Type, class CombineOp>
171  void mapInternalTgtToSrc
172  (
173  const VolumeField<Type>& field,
174  const CombineOp& cop,
175  VolumeField<Type>& result,
176  const bool secondOrder
177  ) const;
178 
179  //- Helper function to interpolate patch field. Template
180  // specialisations below
181  template<class Type, class CombineOp>
182  void mapAndOpSrcToTgt
183  (
184  const AMIPatchToPatchInterpolation& AMI,
185  const Field<Type>& srcField,
186  Field<Type>& tgtField,
187  const CombineOp& cop
188  ) const;
189 
190  //- Helper function to interpolate patch field. Template
191  // specialisations below
192  template<class Type, class CombineOp>
193  void mapAndOpTgtToSrc
194  (
195  const AMIPatchToPatchInterpolation& AMI,
196  Field<Type>& srcField,
197  const Field<Type>& tgtField,
198  const CombineOp& cop
199  ) const;
200 
201  //- Return src cell IDs for the overlap region
202  labelList maskCells(const polyMesh& src, const polyMesh& tgt) const;
203 
204  //- Normalise the interpolation weights
205  void normaliseWeights
206  (
207  const word& descriptor,
208  const labelListList& addr,
209  scalarListList& wght
210  ) const;
211 
212  //- Calculate the addressing between overlapping regions of src and tgt
213  // meshes
214  void calcAddressing
215  (
216  const word& methodName,
217  const polyMesh& src,
218  const polyMesh& tgt
219  );
220 
221  //- Calculate - main driver function
222  void calculate(const word& methodName, const bool normalise);
223 
224  //- Calculate patch overlap
225  void calculatePatchAMIs(const word& amiMethodName);
226 
227  //- Constructor helper
228  void constructNoCuttingPatches
229  (
230  const word& methodName,
231  const word& AMIMethodName,
232  const bool interpAllPatches
233  );
234 
235  //- Constructor helper
236  void constructFromCuttingPatches
237  (
238  const word& methodName,
239  const word& AMIMethodName,
240  const HashTable<word>& patchMap,
241  const wordList& cuttingPatches,
242  const bool normalise
243  );
244 
245  // Parallel operations
246 
247  //- Determine whether the meshes are split across multiple
248  //- processors
249  label calcDistribution
250  (
251  const polyMesh& src,
252  const polyMesh& tgt
253  ) const;
254 
255  //- Determine which processor bounding-boxes overlap
256  label calcOverlappingProcs
257  (
258  const List<treeBoundBoxList>& procBb,
259  const boundBox& bb,
260  boolList& overlaps
261  ) const;
262 
263  //- Calculate the mapping between processors
264  autoPtr<mapDistribute> calcProcMap
265  (
266  const polyMesh& src,
267  const polyMesh& tgt
268  ) const;
269 
270  //- Distribute mesh info from 'my' processor to others
271  void distributeCells
272  (
273  const mapDistribute& map,
274  const polyMesh& tgtMesh,
275  const globalIndex& globalI,
277  List<label>& nInternalFaces,
278  List<faceList>& faces,
279  List<labelList>& faceOwner,
280  List<labelList>& faceNeighbour,
282  List<labelList>& nbrProcIDs,
283  List<labelList>& procLocalFaceIDs
284  ) const;
285 
286  //- Collect pieces of tgt mesh from other processors and restructure
287  void distributeAndMergeCells
288  (
289  const mapDistribute& map,
290  const polyMesh& tgt,
291  const globalIndex& globalI,
292  pointField& tgtPoints,
293  faceList& tgtFaces,
294  labelList& tgtFaceOwners,
295  labelList& tgtFaceNeighbours,
296  labelList& tgtCellIDs
297  ) const;
298 
299 
300  //- No copy construct
301  meshToMesh(const meshToMesh&) = delete;
302 
303  //- No copy assignment
304  void operator=(const meshToMesh&) = delete;
305 
306 
307 public:
308 
309  //- Run-time type information
310  TypeName("meshToMesh");
311 
312 
313  //- Construct from source and target meshes
314  meshToMesh
315  (
316  const polyMesh& src,
317  const polyMesh& tgt,
318  const interpolationMethod& method,
319  const procMapMethod& mapMethod = procMapMethod::pmAABB,
320  const bool interpAllPatches = true
321  );
322 
323  //- Construct from source and target meshes, generic mapping methods
324  meshToMesh
325  (
326  const polyMesh& src,
327  const polyMesh& tgt,
328  const word& methodName, // internal mapping
329  const word& AMIMethodName, // boundary mapping
330  const procMapMethod& mapMethod = procMapMethod::pmAABB,
331  const bool interpAllPatches = true
332  );
333 
334  //- Construct from source and target meshes
335  meshToMesh
336  (
337  const polyMesh& src,
338  const polyMesh& tgt,
339  const interpolationMethod& method,
340  const HashTable<word>& patchMap,
341  const wordList& cuttingPatches,
342  const procMapMethod& mapMethod = procMapMethod::pmAABB,
343  const bool normalise = true
344  );
345 
346 
347  //- Construct from source and target meshes, generic mapping methods
348  meshToMesh
349  (
350  const polyMesh& src,
351  const polyMesh& tgt,
352  const word& methodName, // internal mapping
353  const word& AMIMethodName, // boundary mapping
354  const HashTable<word>& patchMap,
355  const wordList& cuttingPatches,
356  const procMapMethod& mapMethod = procMapMethod::pmAABB,
357  const bool normalise = true
358  );
359 
360 
361  //- Destructor
362  virtual ~meshToMesh();
363 
364 
365  // Member Functions
366 
367  // Access
368 
369  //- Return const access to the source mesh
370  inline const polyMesh& srcRegion() const;
371 
372  //- Return const access to the target mesh
373  inline const polyMesh& tgtRegion() const;
374 
375  //- Return const access to the source to target cell addressing
376  inline const labelListList& srcToTgtCellAddr() const;
377 
378  //- Return const access to the target to source cell addressing
379  inline const labelListList& tgtToSrcCellAddr() const;
380 
381  //- Return const access to the source to target cell weights
382  inline const scalarListList& srcToTgtCellWght() const;
383 
384  //- Return const access to the target to source cell weights
385  inline const scalarListList& tgtToSrcCellWght() const;
386 
387  //- Return const access to the source to target offset vectors
388  inline const pointListList& srcToTgtCellVec() const;
389 
390  //- Return const access to the target to source offset vectors
391  inline const pointListList& tgtToSrcCellVec() const;
392 
393  //- Return const access to the overlap volume
394  inline scalar V() const;
395 
396  //- Conversion between mesh and patch interpolation methods
398  (
399  const interpolationMethod method
400  );
401 
402  //- Return the list of AMIs between source and target patches
404  patchAMIs() const;
405 
406 
407  // Explicit access. Can probably be done with combine operator.
408 
409  //- Source map pointer - valid if no singleMeshProc
410  inline const autoPtr<mapDistribute>& srcMap() const;
411 
412  //- Target map pointer - valid if no singleMeshProc
413  inline const autoPtr<mapDistribute>& tgtMap() const;
414 
415 
416  // Evaluation
417 
418  // Source-to-target field mapping
419 
420  //- Map field from src to tgt mesh with defined operation.
421  // Values passed in via 'result' are used to initialise the
422  // return value
423  template<class Type, class CombineOp>
424  void mapSrcToTgt
425  (
426  const UList<Type>& srcFld,
427  const CombineOp& cop,
428  List<Type>& result
429  ) const;
430 
431  //- Map extrapolated field (using gradient) from src to tgt
432  // mesh with defined operation. Falls back to non-extrapolated
433  // mapping (above) if not constructed with method that supports
434  // getting offset vectors. Extrapolation only for internal
435  // values. Values passed in via 'result' are used to
436  // initialise the return value.
437  template<class Type, class CombineOp>
438  void mapSrcToTgt
439  (
440  const UList<Type>& srcField,
441  const UList<typename outerProduct<vector, Type>::type>&,
442  const CombineOp& cop,
443  List<Type>& result
444  ) const;
445 
446  //- Return the src field mapped to the tgt mesh with a defined
447  // operation. Initial values of the result are set to zero
448  template<class Type, class CombineOp>
450  (
451  const Field<Type>& srcFld,
452  const CombineOp& cop
453  ) const;
454 
455  //- Convenience function to map a tmp field to the tgt mesh
456  // with a defined operation
457  template<class Type, class CombineOp>
459  (
460  const tmp<Field<Type>>& tsrcFld,
461  const CombineOp& cop
462  ) const;
463 
464  //- Convenience function to map a field to the tgt mesh with a
465  // default operation (plusEqOp)
466  template<class Type>
468  (
469  const Field<Type>& srcFld
470  ) const;
471 
472  //- Convenience function to map a tmp field to the tgt mesh
473  // with a default operation (plusEqOp)
474  template<class Type>
476  (
477  const tmp<Field<Type>>& tsrcFld
478  ) const;
479 
480 
481  // Target-to-source field mapping
482 
483  //- Map field from tgt to src mesh with defined operation
484  // Values passed in via 'result' are used to initialise the
485  // return value
486  template<class Type, class CombineOp>
487  void mapTgtToSrc
488  (
489  const UList<Type>& tgtFld,
490  const CombineOp& cop,
491  List<Type>& result
492  ) const;
493 
494  //- Map extrapolated field (using gradient) from tgt to src
495  // mesh with defined operation. Falls back to non-extrapolated
496  // mapping (above) if not constructed with method that supports
497  // getting offset vectors. Extrapolation only for internal
498  // values. Values passed in via 'result' are used to
499  // initialise the return value
500  template<class Type, class CombineOp>
501  void mapTgtToSrc
502  (
503  const UList<Type>& srcField,
504  const UList<typename outerProduct<vector, Type>::type>&,
505  const CombineOp& cop,
506  List<Type>& result
507  ) const;
508 
509  //- Return the tgt field mapped to the src mesh with a defined
510  // operation. Initial values of the result are set to zero
511  template<class Type, class CombineOp>
513  (
514  const Field<Type>& tgtFld,
515  const CombineOp& cop
516  ) const;
517 
518  //- Convenience function to map a tmp field to the src mesh
519  // with a defined operation
520  template<class Type, class CombineOp>
522  (
523  const tmp<Field<Type>>& ttgtFld,
524  const CombineOp& cop
525  ) const;
526 
527  //- Convenience function to map a field to the src mesh with a
528  // default operation (plusEqOp)
529  template<class Type>
531  (
532  const Field<Type>& tgtFld
533  ) const;
534 
535  //- Convenience function to map a tmp field to the src mesh
536  // with a default operation (plusEqOp)
537  template<class Type>
539  (
540  const tmp<Field<Type>>& ttgtFld
541  ) const;
542 
543 
544  // Source-to-target volume field mapping
545 
546  //- Interpolate a field with a defined operation. Values
547  // passed in via 'result' are used to initialise the return
548  // value. Optionally uses gradient correction (internal
549  // field only) if interpolationMethod supports it
550  template<class Type, class CombineOp>
551  void mapSrcToTgt
552  (
553  const VolumeField<Type>& field,
554  const CombineOp& cop,
555  VolumeField<Type>& result,
556  const bool secondOrder = true
557  ) const;
558 
559  //- Interpolate a field with a defined operation. The initial
560  // values of the result are set to zero
561  template<class Type, class CombineOp>
563  (
564  const VolumeField<Type>& field,
565  const CombineOp& cop,
566  const bool secondOrder = true
567  ) const;
568 
569  //- Interpolate a tmp field with a defined operation. The
570  // initial values of the result are set to zero
571  template<class Type, class CombineOp>
573  (
574  const tmp<VolumeField<Type>>& tfield,
575  const CombineOp& cop,
576  const bool secondOrder = true
577  ) const;
578 
579  //- Convenience function to map a field with a default
580  // operation (plusEqOp)
581  template<class Type>
583  (
584  const VolumeField<Type>& field,
585  const bool secondOrder = true
586  ) const;
587 
588  //- Convenience function to map a tmp field with a default
589  // operation (plusEqOp)
590  template<class Type>
592  (
593  const tmp<VolumeField<Type>>& tfield,
594  const bool secondOrder = true
595  ) const;
596 
597 
598  // Target-to-source volume field mapping
599 
600  //- Interpolate a field with a defined operation. Values
601  // passed in via 'result' are used to initialise the return
602  // value. Optionally uses gradient correction (internal
603  // field only) if interpolationMethod supports it
604  template<class Type, class CombineOp>
605  void mapTgtToSrc
606  (
607  const VolumeField<Type>& field,
608  const CombineOp& cop,
609  VolumeField<Type>& result,
610  const bool secondOrder = true
611  ) const;
612 
613  //- Interpolate a field with a defined operation. The initial
614  // values of the result are set to zero
615  template<class Type, class CombineOp>
617  (
618  const VolumeField<Type>& field,
619  const CombineOp& cop,
620  const bool secondOrder = true
621  ) const;
622 
623  //- Interpolate a tmp field with a defined operation. The
624  // initial values of the result are set to zero
625  template<class Type, class CombineOp>
627  (
628  const tmp<VolumeField<Type>>&
629  tfield,
630  const CombineOp& cop,
631  const bool secondOrder = true
632  ) const;
633 
634  //- Convenience function to map a field with a default
635  // operation (plusEqOp)
636  template<class Type>
638  (
639  const VolumeField<Type>& field,
640  const bool secondOrder = true
641  ) const;
642 
643  //- Convenience function to map a tmp field with a default
644  // operation (plusEqOp)
645  template<class Type>
647  (
648  const tmp<VolumeField<Type>>& tfield,
649  const bool secondOrder = true
650  ) const;
651 };
652 
653 
654 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
655 
656 // Disable gradient 2nd order correction for tensor types
657 
658 template<>
659 void meshToMesh::mapInternalSrcToTgt
660 (
664  const bool
665 ) const;
666 template<>
667 void meshToMesh::mapInternalSrcToTgt
668 (
672  const bool
673 ) const;
674 template<>
675 void meshToMesh::mapInternalSrcToTgt
676 (
678  const plusEqOp<symmTensor>&,
680  const bool
681 ) const;
682 template<>
683 void meshToMesh::mapInternalSrcToTgt
684 (
686  const minusEqOp<symmTensor>&,
688  const bool
689 ) const;
690 template<>
691 void meshToMesh::mapInternalSrcToTgt
692 (
693  const VolumeField<tensor>&,
694  const plusEqOp<tensor>&,
696  const bool
697 ) const;
698 template<>
699 void meshToMesh::mapInternalSrcToTgt
700 (
701  const VolumeField<tensor>&,
702  const minusEqOp<tensor>&,
704  const bool
705 ) const;
706 template<>
707 void meshToMesh::mapInternalTgtToSrc
708 (
712  const bool
713 ) const;
714 template<>
715 void meshToMesh::mapInternalTgtToSrc
716 (
720  const bool
721 ) const;
722 template<>
723 void meshToMesh::mapInternalTgtToSrc
724 (
726  const plusEqOp<symmTensor>&,
728  const bool
729 ) const;
730 template<>
731 void meshToMesh::mapInternalTgtToSrc
732 (
734  const minusEqOp<symmTensor>&,
736  const bool
737 ) const;
738 template<>
739 void meshToMesh::mapInternalTgtToSrc
740 (
741  const VolumeField<tensor>&,
742  const plusEqOp<tensor>&,
744  const bool
745 ) const;
746 template<>
747 void meshToMesh::mapInternalTgtToSrc
748 (
749  const VolumeField<tensor>&,
750  const minusEqOp<tensor>&,
752  const bool
753 ) const;
754 
755 
756 // Disable fvPatchField value override after rmap
757 
758 template<>
759 void meshToMesh::mapAndOpSrcToTgt
760 (
761  const AMIPatchToPatchInterpolation& AMI,
762  const Field<scalar>& srcField,
763  Field<scalar>& tgtField,
764  const plusEqOp<scalar>& cop
765 ) const;
766 template<>
767 void meshToMesh::mapAndOpSrcToTgt
768 (
769  const AMIPatchToPatchInterpolation& AMI,
770  const Field<vector>& srcField,
771  Field<vector>& tgtField,
772  const plusEqOp<vector>& cop
773 ) const;
774 template<>
775 void meshToMesh::mapAndOpSrcToTgt
776 (
777  const AMIPatchToPatchInterpolation& AMI,
778  const Field<sphericalTensor>& srcField,
779  Field<sphericalTensor>& tgtField,
780  const plusEqOp<sphericalTensor>& cop
781 ) const;
782 template<>
783 void meshToMesh::mapAndOpSrcToTgt
784 (
785  const AMIPatchToPatchInterpolation& AMI,
786  const Field<symmTensor>& srcField,
787  Field<symmTensor>& tgtField,
788  const plusEqOp<symmTensor>& cop
789 ) const;
790 template<>
791 void meshToMesh::mapAndOpSrcToTgt
792 (
793  const AMIPatchToPatchInterpolation& AMI,
794  const Field<tensor>& srcField,
795  Field<tensor>& tgtField,
796  const plusEqOp<tensor>& cop
797 ) const;
798 
799 
800 template<>
801 void meshToMesh::mapAndOpTgtToSrc
802 (
803  const AMIPatchToPatchInterpolation& AMI,
804  Field<scalar>& srcField,
805  const Field<scalar>& tgtField,
806  const plusEqOp<scalar>& cop
807 ) const;
808 template<>
809 void meshToMesh::mapAndOpTgtToSrc
810 (
811  const AMIPatchToPatchInterpolation& AMI,
812  Field<vector>& srcField,
813  const Field<vector>& tgtField,
814  const plusEqOp<vector>& cop
815 ) const;
816 template<>
817 void meshToMesh::mapAndOpTgtToSrc
818 (
819  const AMIPatchToPatchInterpolation& AMI,
820  Field<sphericalTensor>& srcField,
821  const Field<sphericalTensor>& tgtField,
822  const plusEqOp<sphericalTensor>& cop
823 ) const;
824 template<>
825 void meshToMesh::mapAndOpTgtToSrc
826 (
827  const AMIPatchToPatchInterpolation& AMI,
828  Field<symmTensor>& srcField,
829  const Field<symmTensor>& tgtField,
830  const plusEqOp<symmTensor>& cop
831 ) const;
832 template<>
833 void meshToMesh::mapAndOpTgtToSrc
834 (
835  const AMIPatchToPatchInterpolation& AMI,
836  Field<tensor>& srcField,
837  const Field<tensor>& tgtField,
838  const plusEqOp<tensor>& cop
839 ) const;
840 
841 
842 } // End namespace Foam
843 
844 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
845 
846 #include "meshToMeshI.H"
847 
848 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
849 
850 #ifdef NoRepository
851  #include "meshToMeshTemplates.C"
852 #endif
853 
854 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
855 
856 #endif
857 
858 // ************************************************************************* //
const autoPtr< mapDistribute > & tgtMap() const
Target map pointer - valid if no singleMeshProc.
Definition: meshToMeshI.H:88
rDeltaTY field()
Forwards and collection of common volume field types.
static const Enum< interpolationMethod > interpolationMethodNames_
Definition: meshToMesh.H:77
static const Enum< procMapMethod > procMapMethodNames_
Definition: meshToMesh.H:88
const polyMesh & srcRegion() const
Return const access to the source mesh.
Definition: meshToMeshI.H:26
const PtrList< AMIPatchToPatchInterpolation > & patchAMIs() const
Return the list of AMIs between source and target patches.
Definition: meshToMeshI.H:95
A bounding box defined in terms of min/max extrema points.
Definition: boundBox.H:63
typeOfRank< typename pTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) >::type type
Definition: products.H:118
Generic GeometricField class.
Definition: areaFieldsFwd.H:50
Class to calculate the cell-addressing between two overlapping meshes.
Definition: meshToMesh.H:60
procMapMethod
Enumeration specifying processor parallel map construction method.
Definition: meshToMesh.H:82
const labelListList & srcToTgtCellAddr() const
Return const access to the source to target cell addressing.
Definition: meshToMeshI.H:38
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
Definition: globalIndex.H:62
const pointField & points
Generic templated field type.
Definition: Field.H:62
const autoPtr< mapDistribute > & srcMap() const
Source map pointer - valid if no singleMeshProc.
Definition: meshToMeshI.H:81
A class for handling words, derived from Foam::string.
Definition: word.H:63
const pointListList & tgtToSrcCellVec() const
Return const access to the target to source offset vectors.
Definition: meshToMeshI.H:68
scalar V() const
Return const access to the overlap volume.
Definition: meshToMeshI.H:74
A HashTable similar to std::unordered_map.
Definition: HashTable.H:102
static word interpolationMethodAMI(const interpolationMethod method)
Conversion between mesh and patch interpolation methods.
Definition: meshToMesh.C:639
TypeName("meshToMesh")
Run-time type information.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const labelListList & tgtToSrcCellAddr() const
Return const access to the target to source cell addressing.
Definition: meshToMeshI.H:44
Class containing processor-to-processor mapping information.
virtual ~meshToMesh()
Destructor.
Definition: meshToMesh.C:985
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
Definition: List.H:55
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
const scalarListList & srcToTgtCellWght() const
Return const access to the source to target cell weights.
Definition: meshToMeshI.H:50
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:73
interpolationMethod
Enumeration specifying interpolation method.
Definition: meshToMesh.H:69
A class for managing temporary objects.
Definition: HashPtrTable.H:50
void mapSrcToTgt(const UList< Type > &srcFld, const CombineOp &cop, List< Type > &result) const
Map field from src to tgt mesh with defined operation.
const polyMesh & tgtRegion() const
Return const access to the target mesh.
Definition: meshToMeshI.H:32
const pointListList & srcToTgtCellVec() const
Return const access to the source to target offset vectors.
Definition: meshToMeshI.H:62
labelList cellIDs
Namespace for OpenFOAM.
void mapTgtToSrc(const UList< Type > &tgtFld, const CombineOp &cop, List< Type > &result) const
Map field from tgt to src mesh with defined operation.
const scalarListList & tgtToSrcCellWght() const
Return const access to the target to source cell weights.
Definition: meshToMeshI.H:56