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-2018 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 meshToMesh_H
46 #define 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  (
163  const CombineOp& cop,
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  (
174  const CombineOp& cop,
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,
281  List<labelList>& cellIDs,
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  (
554  const CombineOp& cop,
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  (
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  (
575  tfield,
576  const CombineOp& cop,
577  const bool secondOrder = true
578  ) const;
579 
580  //- Convenience function to map a field with a default
581  // operation (plusEqOp)
582  template<class Type>
584  (
586  const bool secondOrder = true
587  ) const;
588 
589  //- Convenience function to map a tmp field with a default
590  // operation (plusEqOp)
591  template<class Type>
593  (
595  tfield,
596  const bool secondOrder = true
597  ) const;
598 
599 
600  // Target-to-source volume field mapping
601 
602  //- Interpolate a field with a defined operation. Values
603  // passed in via 'result' are used to initialise the return
604  // value. Optionally uses gradient correction (internal
605  // field only) if interpolationMethod supports it
606  template<class Type, class CombineOp>
607  void mapTgtToSrc
608  (
610  const CombineOp& cop,
612  const bool secondOrder = true
613  ) const;
614 
615  //- Interpolate a field with a defined operation. The initial
616  // values of the result are set to zero
617  template<class Type, class CombineOp>
619  (
621  const CombineOp& cop,
622  const bool secondOrder = true
623  ) const;
624 
625  //- Interpolate a tmp field with a defined operation. The
626  // initial values of the result are set to zero
627  template<class Type, class CombineOp>
629  (
631  tfield,
632  const CombineOp& cop,
633  const bool secondOrder = true
634  ) const;
635 
636  //- Convenience function to map a field with a default
637  // operation (plusEqOp)
638  template<class Type>
640  (
642  const bool secondOrder = true
643  ) const;
644 
645  //- Convenience function to map a tmp field with a default
646  // operation (plusEqOp)
647  template<class Type>
649  (
651  tfield,
652  const bool secondOrder = true
653  ) const;
654 };
655 
656 
657 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
658 
659 // Disable gradient 2nd order correction for tensor types
660 
661 template<>
662 void meshToMesh::mapInternalSrcToTgt
663 (
667  const bool
668 ) const;
669 template<>
670 void meshToMesh::mapInternalSrcToTgt
671 (
675  const bool
676 ) const;
677 template<>
678 void meshToMesh::mapInternalSrcToTgt
679 (
681  const plusEqOp<symmTensor>&,
683  const bool
684 ) const;
685 template<>
686 void meshToMesh::mapInternalSrcToTgt
687 (
689  const minusEqOp<symmTensor>&,
691  const bool
692 ) const;
693 template<>
694 void meshToMesh::mapInternalSrcToTgt
695 (
697  const plusEqOp<tensor>&,
699  const bool
700 ) const;
701 template<>
702 void meshToMesh::mapInternalSrcToTgt
703 (
705  const minusEqOp<tensor>&,
707  const bool
708 ) const;
709 template<>
710 void meshToMesh::mapInternalTgtToSrc
711 (
715  const bool
716 ) const;
717 template<>
718 void meshToMesh::mapInternalTgtToSrc
719 (
723  const bool
724 ) const;
725 template<>
726 void meshToMesh::mapInternalTgtToSrc
727 (
729  const plusEqOp<symmTensor>&,
731  const bool
732 ) const;
733 template<>
734 void meshToMesh::mapInternalTgtToSrc
735 (
737  const minusEqOp<symmTensor>&,
739  const bool
740 ) const;
741 template<>
742 void meshToMesh::mapInternalTgtToSrc
743 (
745  const plusEqOp<tensor>&,
747  const bool
748 ) const;
749 template<>
750 void meshToMesh::mapInternalTgtToSrc
751 (
753  const minusEqOp<tensor>&,
755  const bool
756 ) const;
757 
758 
759 // Disable fvPatchField value override after rmap
760 
761 template<>
762 void meshToMesh::mapAndOpSrcToTgt
763 (
764  const AMIPatchToPatchInterpolation& AMI,
765  const Field<scalar>& srcField,
766  Field<scalar>& tgtField,
767  const plusEqOp<scalar>& cop
768 ) const;
769 template<>
770 void meshToMesh::mapAndOpSrcToTgt
771 (
772  const AMIPatchToPatchInterpolation& AMI,
773  const Field<vector>& srcField,
774  Field<vector>& tgtField,
775  const plusEqOp<vector>& cop
776 ) const;
777 template<>
778 void meshToMesh::mapAndOpSrcToTgt
779 (
780  const AMIPatchToPatchInterpolation& AMI,
781  const Field<sphericalTensor>& srcField,
782  Field<sphericalTensor>& tgtField,
783  const plusEqOp<sphericalTensor>& cop
784 ) const;
785 template<>
786 void meshToMesh::mapAndOpSrcToTgt
787 (
788  const AMIPatchToPatchInterpolation& AMI,
789  const Field<symmTensor>& srcField,
790  Field<symmTensor>& tgtField,
791  const plusEqOp<symmTensor>& cop
792 ) const;
793 template<>
794 void meshToMesh::mapAndOpSrcToTgt
795 (
796  const AMIPatchToPatchInterpolation& AMI,
797  const Field<tensor>& srcField,
798  Field<tensor>& tgtField,
799  const plusEqOp<tensor>& cop
800 ) const;
801 
802 
803 template<>
804 void meshToMesh::mapAndOpTgtToSrc
805 (
806  const AMIPatchToPatchInterpolation& AMI,
807  Field<scalar>& srcField,
808  const Field<scalar>& tgtField,
809  const plusEqOp<scalar>& cop
810 ) const;
811 template<>
812 void meshToMesh::mapAndOpTgtToSrc
813 (
814  const AMIPatchToPatchInterpolation& AMI,
815  Field<vector>& srcField,
816  const Field<vector>& tgtField,
817  const plusEqOp<vector>& cop
818 ) const;
819 template<>
820 void meshToMesh::mapAndOpTgtToSrc
821 (
822  const AMIPatchToPatchInterpolation& AMI,
823  Field<sphericalTensor>& srcField,
824  const Field<sphericalTensor>& tgtField,
825  const plusEqOp<sphericalTensor>& cop
826 ) const;
827 template<>
828 void meshToMesh::mapAndOpTgtToSrc
829 (
830  const AMIPatchToPatchInterpolation& AMI,
831  Field<symmTensor>& srcField,
832  const Field<symmTensor>& tgtField,
833  const plusEqOp<symmTensor>& cop
834 ) const;
835 template<>
836 void meshToMesh::mapAndOpTgtToSrc
837 (
838  const AMIPatchToPatchInterpolation& AMI,
839  Field<tensor>& srcField,
840  const Field<tensor>& tgtField,
841  const plusEqOp<tensor>& cop
842 ) const;
843 
844 
845 } // End namespace Foam
846 
847 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
848 
849 #include "meshToMeshI.H"
850 
851 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
852 
853 #ifdef NoRepository
854  #include "meshToMeshTemplates.C"
855 #endif
856 
857 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
858 
859 #endif
860 
861 // ************************************************************************* //
volFieldsFwd.H
Foam::meshToMesh::interpolationMethodNames_
static const Enum< interpolationMethod > interpolationMethodNames_
Definition: meshToMesh.H:79
Foam::meshToMesh::interpolationMethodAMI
static word interpolationMethodAMI(const interpolationMethod method)
Conversion between mesh and patch interpolation methods.
Definition: meshToMesh.C:643
Foam::Enum< interpolationMethod >
Foam::meshToMesh::mapTgtToSrc
void mapTgtToSrc(const UList< Type > &tgtFld, const CombineOp &cop, List< Type > &result) const
Map field from tgt to src mesh with defined operation.
Definition: meshToMeshTemplates.C:269
Foam::meshToMesh::tgtToSrcCellWght
const scalarListList & tgtToSrcCellWght() const
Return const access to the target to source cell weights.
Definition: meshToMeshI.H:63
Foam::meshToMesh::TypeName
TypeName("meshToMesh")
Run-time type information.
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::meshToMesh::patchAMIs
const PtrList< AMIPatchToPatchInterpolation > & patchAMIs() const
Return the list of AMIs between source and target patches.
Definition: meshToMeshI.H:102
Foam::meshToMesh::V
scalar V() const
Return const access to the overlap volume.
Definition: meshToMeshI.H:81
Foam::minusEqOp
Definition: ops.H:73
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::meshToMesh::interpolationMethod::imCellVolumeWeight
Foam::outerProduct::type
typeOfRank< typename pTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) >::type type
Definition: products.H:114
Foam::meshToMesh::interpolationMethod::imDirect
Foam::meshToMesh::procMapMethodNames_
static const Enum< procMapMethod > procMapMethodNames_
Definition: meshToMesh.H:88
Foam::meshToMesh::~meshToMesh
virtual ~meshToMesh()
Destructor.
Definition: meshToMesh.C:989
Foam::meshToMesh::interpolationMethod::imCorrectedCellVolumeWeight
polyMesh.H
Foam::meshToMesh::mapSrcToTgt
void mapSrcToTgt(const UList< Type > &srcFld, const CombineOp &cop, List< Type > &result) const
Map field from src to tgt mesh with defined operation.
Definition: meshToMeshTemplates.C:54
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::meshToMesh::srcToTgtCellAddr
const labelListList & srcToTgtCellAddr() const
Return const access to the source to target cell addressing.
Definition: meshToMeshI.H:45
Foam::meshToMesh::srcToTgtCellVec
const pointListList & srcToTgtCellVec() const
Return const access to the source to target offset vectors.
Definition: meshToMeshI.H:69
Foam::meshToMesh
Class to calculate the cell-addressing between two overlapping meshes.
Definition: meshToMesh.H:64
Foam::Field
Generic templated field type.
Definition: Field.H:63
meshToMeshI.H
Foam::meshToMesh::procMapMethod::pmLOD
treeBoundBox.H
Foam::meshToMesh::procMapMethod
procMapMethod
Enumeration specifying processor parallel map construction method.
Definition: meshToMesh.H:82
Foam::mapDistribute
Class containing processor-to-processor mapping information.
Definition: mapDistribute.H:163
pointList.H
field
rDeltaTY field()
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
Foam::meshToMesh::tgtMap
const autoPtr< mapDistribute > & tgtMap() const
Target map pointer - valid if no singleMeshProc.
Definition: meshToMeshI.H:95
fld
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))
Definition: gmvOutputLagrangian.H:23
meshToMeshTemplates.C
AMIPatchToPatchInterpolation.H
Foam::meshToMesh::srcRegion
const polyMesh & srcRegion() const
Return const access to the source mesh.
Definition: meshToMeshI.H:33
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::globalIndex
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
Definition: globalIndex.H:68
Foam::meshToMesh::procMapMethod::pmAABB
Foam::HashTable
A HashTable similar to std::unordered_map.
Definition: HashTable.H:105
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
mapDistribute.H
Foam::meshToMesh::interpolationMethod
interpolationMethod
Enumeration specifying interpolation method.
Definition: meshToMesh.H:71
Foam::List< label >
Foam::AMIInterpolation
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
Definition: AMIInterpolation.H:79
Foam::UList< Type >
Foam::meshToMesh::interpolationMethod::imMapNearest
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::meshToMesh::tgtRegion
const polyMesh & tgtRegion() const
Return const access to the target mesh.
Definition: meshToMeshI.H:39
Foam::boundBox
A bounding box defined in terms of min/max extrema points.
Definition: boundBox.H:63
Foam::meshToMesh::tgtToSrcCellAddr
const labelListList & tgtToSrcCellAddr() const
Return const access to the target to source cell addressing.
Definition: meshToMeshI.H:51
Foam::plusEqOp
Definition: ops.H:72
Foam::meshToMesh::srcMap
const autoPtr< mapDistribute > & srcMap() const
Source map pointer - valid if no singleMeshProc.
Definition: meshToMeshI.H:88
Foam::GeometricField< Type, fvPatchField, volMesh >
Foam::meshToMesh::srcToTgtCellWght
const scalarListList & srcToTgtCellWght() const
Return const access to the source to target cell weights.
Definition: meshToMeshI.H:57
Foam::meshToMesh::tgtToSrcCellVec
const pointListList & tgtToSrcCellVec() const
Return const access to the target to source offset vectors.
Definition: meshToMeshI.H:75
Enum.H