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 | Copyright (C) 2012-2014 OpenFOAM Foundation
6  \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::meshToMesh
26 
27 Description
28  Class to calculate the cell-addressing between two overlapping meshes
29 
30  Mapping is performed using a run-time selectable interpolation mothod
31 
32 SeeAlso
33  meshToMeshMethod
34 
35 SourceFiles
36  meshToMesh.C
37  meshToMeshParallelOps.C
38  meshToMeshTemplates.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef meshToMesh_H
43 #define meshToMesh_H
44 
45 #include "polyMesh.H"
46 #include "treeBoundBox.H"
47 #include "mapDistribute.H"
48 #include "volFieldsFwd.H"
49 #include "NamedEnum.H"
51 #include "pointList.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 
58 /*---------------------------------------------------------------------------*\
59  Class meshToMesh Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 class meshToMesh
63 {
64 public:
65 
66  // Public data types
67 
68  //- Enumeration specifying interpolation method
70  {
75  };
76 
79 
80 private:
81 
82  // Private data
83 
84  //- Reference to the source mesh
85  const polyMesh& srcRegion_;
86 
87  //- Reference to the target mesh
88  const polyMesh& tgtRegion_;
89 
90  //- List of target patch IDs per source patch (local index)
92 
93  //- List of source patch IDs per target patch (local index)
95 
96  //- List of AMIs between source and target patches
98 
99  //- Cutting patches whose values are set using a zero-gradient condition
101 
102  //- Source to target cell addressing
104 
105  //- Target to source cell addressing
107 
108  //- Source to target cell interplation weights
110 
111  //- Target to source cell interpolation weights
113 
114  // Vectors from cell centre to overlap volume for 2nd order correction
115  // (only set for corrected methods)
116 
117  //- Source to target cell offset vectors
119 
120  //- Target to source cell offset vectors
122 
123  //- Cell total volume in overlap region [m3]
124  scalar V_;
125 
126  //- Index of processor that holds all of both sides. -1 in all other
127  // cases
129 
130  //- Source map pointer - parallel running only
132 
133  //- Target map pointer - parallel running only
135 
136 
137  // Private Member Functions
138 
139  //- Helper function to add a constant offset to a list
140  template<class Type>
141  void add(UList<Type>& fld, const label offset) const;
142 
143  //- Helper function to interpolate internal field. Optionally uses
144  // gradient. Template specialisations for tensor types below
145  template<class Type, class CombineOp>
147  (
149  const CombineOp& cop,
151  const bool secondOrder
152  ) const;
153 
154  //- Helper function to interpolate internal field. Optionally uses
155  // gradient. Template specialisations for tensor types below
156  template<class Type, class CombineOp>
158  (
160  const CombineOp& cop,
162  const bool secondOrder
163  ) const;
164 
165  //- Helper function to interpolate patch field. Template
166  // specialisations below
167  template<class Type, class CombineOp>
168  void mapAndOpSrcToTgt
169  (
170  const AMIPatchToPatchInterpolation& AMI,
171  const Field<Type>& srcField,
172  Field<Type>& tgtField,
173  const CombineOp& cop
174  ) const;
175 
176  //- Helper function to interpolate patch field. Template
177  // specialisations below
178  template<class Type, class CombineOp>
179  void mapAndOpTgtToSrc
180  (
181  const AMIPatchToPatchInterpolation& AMI,
182  Field<Type>& srcField,
183  const Field<Type>& tgtField,
184  const CombineOp& cop
185  ) const;
186 
187  //- Return src cell IDs for the overlap region
188  labelList maskCells(const polyMesh& src, const polyMesh& tgt) const;
189 
190  //- Normalise the interpolation weights
191  void normaliseWeights
192  (
193  const word& descriptor,
194  const labelListList& addr,
195  scalarListList& wght
196  ) const;
197 
198  //- Calculate the addressing between overlapping regions of src and tgt
199  // meshes
200  void calcAddressing
201  (
202  const word& methodName,
203  const polyMesh& src,
204  const polyMesh& tgt
205  );
206 
207  //- Calculate - main driver function
208  void calculate(const word& methodName);
209 
210  //- Calculate patch overlap
211  void calculatePatchAMIs(const word& amiMethodName);
212 
213  //- Constructor helper
215  (
216  const word& methodName,
217  const word& AMIMethodName,
218  const bool interpAllPatches
219  );
220 
221  //- Constructor helper
223  (
224  const word& methodName,
225  const word& AMIMethodName,
226  const HashTable<word>& patchMap,
227  const wordList& cuttingPatches
228  );
229 
230  // Parallel operations
231 
232  //- Determine whether the meshes are split across multiple pocessors
234  (
235  const polyMesh& src,
236  const polyMesh& tgt
237  ) const;
238 
239  //- Determine which processor bounding-boxes overlap
241  (
242  const List<treeBoundBoxList>& procBb,
243  const boundBox& bb,
244  boolList& overlaps
245  ) const;
246 
247  //- Calculate the mapping between processors
249  (
250  const polyMesh& src,
251  const polyMesh& tgt
252  ) const;
253 
254  //- Distribute mesh info from 'my' processor to others
255  void distributeCells
256  (
257  const mapDistribute& map,
258  const polyMesh& tgtMesh,
259  const globalIndex& globalI,
261  List<label>& nInternalFaces,
262  List<faceList>& faces,
263  List<labelList>& faceOwner,
264  List<labelList>& faceNeighbour,
265  List<labelList>& cellIDs,
266  List<labelList>& nbrProcIDs,
267  List<labelList>& procLocalFaceIDs
268  ) const;
269 
270  //- Collect pieces of tgt mesh from other procssors and restructure
272  (
273  const mapDistribute& map,
274  const polyMesh& tgt,
275  const globalIndex& globalI,
276  pointField& tgtPoints,
277  faceList& tgtFaces,
278  labelList& tgtFaceOwners,
279  labelList& tgtFaceNeighbours,
280  labelList& tgtCellIDs
281  ) const;
282 
283 
284  //- Disallow default bitwise copy construct
285  meshToMesh(const meshToMesh&);
286 
287  //- Disallow default bitwise assignment
288  void operator=(const meshToMesh&);
289 
290 
291 public:
292 
293  //- Run-time type information
294  TypeName("meshToMesh");
295 
296 
297  //- Construct from source and target meshes
298  meshToMesh
299  (
300  const polyMesh& src,
301  const polyMesh& tgt,
302  const interpolationMethod& method,
303  const bool interpAllPatches = true
304  );
305 
306  //- Construct from source and target meshes, generic mapping methods
307  meshToMesh
308  (
309  const polyMesh& src,
310  const polyMesh& tgt,
311  const word& methodName, // internal mapping
312  const word& AMIMethodName, // boundary mapping
313  const bool interpAllPatches = true
314  );
315 
316  //- Construct from source and target meshes
317  meshToMesh
318  (
319  const polyMesh& src,
320  const polyMesh& tgt,
321  const interpolationMethod& method,
322  const HashTable<word>& patchMap,
323  const wordList& cuttingPatches
324  );
325 
326 
327  //- Construct from source and target meshes, generic mapping methods
328  meshToMesh
329  (
330  const polyMesh& src,
331  const polyMesh& tgt,
332  const word& methodName, // internal mapping
333  const word& AMIMethodName, // boundary mapping
334  const HashTable<word>& patchMap,
335  const wordList& cuttingPatches
336  );
337 
338 
339  //- Destructor
340  virtual ~meshToMesh();
341 
342 
343  // Member Functions
344 
345  // Access
346 
347  //- Return const access to the source mesh
348  inline const polyMesh& srcRegion() const;
349 
350  //- Return const access to the target mesh
351  inline const polyMesh& tgtRegion() const;
352 
353  //- Return const access to the source to target cell addressing
354  inline const labelListList& srcToTgtCellAddr() const;
355 
356  //- Return const access to the target to source cell addressing
357  inline const labelListList& tgtToSrcCellAddr() const;
358 
359  //- Return const access to the source to target cell weights
360  inline const scalarListList& srcToTgtCellWght() const;
361 
362  //- Return const access to the target to source cell weights
363  inline const scalarListList& tgtToSrcCellWght() const;
364 
365  //- Return const access to the source to target offset vectors
366  inline const pointListList& srcToTgtCellVec() const;
367 
368  //- Return const access to the target to source offset vectors
369  inline const pointListList& tgtToSrcCellVec() const;
370 
371  //- Return const access to the overlap volume
372  inline scalar V() const;
373 
374  //- Conversion between mesh and patch interpolation methods
377  (
378  const interpolationMethod method
379  );
380 
381  //- Return the list of AMIs between source and target patches
383  patchAMIs() const;
384 
385 
386  // Evaluation
387 
388  // Source-to-target field mapping
389 
390  //- Map field from src to tgt mesh with defined operation.
391  // Values passed in via 'result' are used to initialise the
392  // return value
393  template<class Type, class CombineOp>
394  void mapSrcToTgt
395  (
396  const UList<Type>& srcFld,
397  const CombineOp& cop,
398  List<Type>& result
399  ) const;
400 
401  //- Map extrapolated field (using gradient) from src to tgt
402  // mesh with defined operation. Falls back to non-extrapolated
403  // mapping (above) if not constructed with method that supports
404  // getting offset vectors. Extrapolation only for internal
405  // values. Values passed in via 'result' are used to
406  // initialise the return value.
407  template<class Type, class CombineOp>
408  void mapSrcToTgt
409  (
410  const UList<Type>& srcField,
411  const UList<typename outerProduct<vector, Type>::type>&,
412  const CombineOp& cop,
413  List<Type>& result
414  ) const;
415 
416  //- Return the src field mapped to the tgt mesh with a defined
417  // operation. Initial values of the result are set to zero
418  template<class Type, class CombineOp>
420  (
421  const Field<Type>& srcFld,
422  const CombineOp& cop
423  ) const;
424 
425  //- Convenience function to map a tmp field to the tgt mesh
426  // with a defined operation
427  template<class Type, class CombineOp>
429  (
430  const tmp<Field<Type> >& tsrcFld,
431  const CombineOp& cop
432  ) const;
433 
434  //- Convenience function to map a field to the tgt mesh with a
435  // default operation (plusEqOp)
436  template<class Type>
438  (
439  const Field<Type>& srcFld
440  ) const;
441 
442  //- Convenience function to map a tmp field to the tgt mesh
443  // with a default operation (plusEqOp)
444  template<class Type>
446  (
447  const tmp<Field<Type> >& tsrcFld
448  ) const;
449 
450 
451  // Target-to-source field mapping
452 
453  //- Map field from tgt to src mesh with defined operation
454  // Values passed in via 'result' are used to initialise the
455  // return value
456  template<class Type, class CombineOp>
457  void mapTgtToSrc
458  (
459  const UList<Type>& tgtFld,
460  const CombineOp& cop,
461  List<Type>& result
462  ) const;
463 
464  //- Map extrapolated field (using gradient) from tgt to src
465  // mesh with defined operation. Falls back to non-extrapolated
466  // mapping (above) if not constructed with method that supports
467  // getting offset vectors. Extrapolation only for internal
468  // values. Values passed in via 'result' are used to
469  // initialise the return value
470  template<class Type, class CombineOp>
471  void mapTgtToSrc
472  (
473  const UList<Type>& srcField,
474  const UList<typename outerProduct<vector, Type>::type>&,
475  const CombineOp& cop,
476  List<Type>& result
477  ) const;
478 
479  //- Return the tgt field mapped to the src mesh with a defined
480  // operation. Initial values of the result are set to zero
481  template<class Type, class CombineOp>
483  (
484  const Field<Type>& tgtFld,
485  const CombineOp& cop
486  ) const;
487 
488  //- Convenience function to map a tmp field to the src mesh
489  // with a defined operation
490  template<class Type, class CombineOp>
492  (
493  const tmp<Field<Type> >& ttgtFld,
494  const CombineOp& cop
495  ) const;
496 
497  //- Convenience function to map a field to the src mesh with a
498  // default operation (plusEqOp)
499  template<class Type>
501  (
502  const Field<Type>& tgtFld
503  ) const;
504 
505  //- Convenience function to map a tmp field to the src mesh
506  // with a default operation (plusEqOp)
507  template<class Type>
509  (
510  const tmp<Field<Type> >& ttgtFld
511  ) const;
512 
513 
514  // Source-to-target volume field mapping
515 
516  //- Interpolate a field with a defined operation. Values
517  // passed in via 'result' are used to initialise the return
518  // value. Optionallly uses gradient correction (internal
519  // field only) if interpolationMethod supports it
520  template<class Type, class CombineOp>
521  void mapSrcToTgt
522  (
524  const CombineOp& cop,
526  const bool secondOrder = true
527  ) const;
528 
529  //- Interpolate a field with a defined operation. The initial
530  // values of the result are set to zero
531  template<class Type, class CombineOp>
533  (
535  const CombineOp& cop,
536  const bool secondOrder = true
537  ) const;
538 
539  //- Interpolate a tmp field with a defined operation. The
540  // initial values of the result are set to zero
541  template<class Type, class CombineOp>
543  (
545  tfield,
546  const CombineOp& cop,
547  const bool secondOrder = true
548  ) const;
549 
550  //- Convenience function to map a field with a default
551  // operation (plusEqOp)
552  template<class Type>
554  (
556  const bool secondOrder = true
557  ) const;
558 
559  //- Convenience function to map a tmp field with a default
560  // operation (plusEqOp)
561  template<class Type>
563  (
565  tfield,
566  const bool secondOrder = true
567  ) const;
568 
569 
570  // Target-to-source volume field mapping
571 
572  //- Interpolate a field with a defined operation. Values
573  // passed in via 'result' are used to initialise the return
574  // value. Optionallly uses gradient correction (internal
575  // field only) if interpolationMethod supports it
576  template<class Type, class CombineOp>
577  void mapTgtToSrc
578  (
580  const CombineOp& cop,
582  const bool secondOrder = true
583  ) const;
584 
585  //- Interpolate a field with a defined operation. The initial
586  // values of the result are set to zero
587  template<class Type, class CombineOp>
589  (
591  const CombineOp& cop,
592  const bool secondOrder = true
593  ) const;
594 
595  //- Interpolate a tmp field with a defined operation. The
596  // initial values of the result are set to zero
597  template<class Type, class CombineOp>
599  (
601  tfield,
602  const CombineOp& cop,
603  const bool secondOrder = true
604  ) const;
605 
606  //- Convenience function to map a field with a default
607  // operation (plusEqOp)
608  template<class Type>
610  (
612  const bool secondOrder = true
613  ) const;
614 
615  //- Convenience function to map a tmp field with a default
616  // operation (plusEqOp)
617  template<class Type>
619  (
621  tfield,
622  const bool secondOrder = true
623  ) const;
624 };
625 
626 
627 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
628 
629 // Disable gradient 2nd order correction for tensor types
630 
631 template<>
633 (
637  const bool
638 ) const;
639 template<>
641 (
645  const bool
646 ) const;
647 template<>
649 (
651  const plusEqOp<symmTensor>&,
653  const bool
654 ) const;
655 template<>
657 (
659  const minusEqOp<symmTensor>&,
661  const bool
662 ) const;
663 template<>
665 (
667  const plusEqOp<tensor>&,
669  const bool
670 ) const;
671 template<>
673 (
675  const minusEqOp<tensor>&,
677  const bool
678 ) const;
679 template<>
681 (
685  const bool
686 ) const;
687 template<>
689 (
693  const bool
694 ) const;
695 template<>
697 (
699  const plusEqOp<symmTensor>&,
701  const bool
702 ) const;
703 template<>
705 (
707  const minusEqOp<symmTensor>&,
709  const bool
710 ) const;
711 template<>
713 (
715  const plusEqOp<tensor>&,
717  const bool
718 ) const;
719 template<>
721 (
723  const minusEqOp<tensor>&,
725  const bool
726 ) const;
727 
728 
729 // Disable fvPatchField value override after rmap
730 
731 template<>
733 (
734  const AMIPatchToPatchInterpolation& AMI,
735  const Field<scalar>& srcField,
736  Field<scalar>& tgtField,
737  const plusEqOp<scalar>& cop
738 ) const;
739 template<>
741 (
742  const AMIPatchToPatchInterpolation& AMI,
743  const Field<vector>& srcField,
744  Field<vector>& tgtField,
745  const plusEqOp<vector>& cop
746 ) const;
747 template<>
749 (
750  const AMIPatchToPatchInterpolation& AMI,
751  const Field<sphericalTensor>& srcField,
752  Field<sphericalTensor>& tgtField,
753  const plusEqOp<sphericalTensor>& cop
754 ) const;
755 template<>
757 (
758  const AMIPatchToPatchInterpolation& AMI,
759  const Field<symmTensor>& srcField,
760  Field<symmTensor>& tgtField,
761  const plusEqOp<symmTensor>& cop
762 ) const;
763 template<>
765 (
766  const AMIPatchToPatchInterpolation& AMI,
767  const Field<tensor>& srcField,
768  Field<tensor>& tgtField,
769  const plusEqOp<tensor>& cop
770 ) const;
771 
772 
773 template<>
775 (
776  const AMIPatchToPatchInterpolation& AMI,
777  Field<scalar>& srcField,
778  const Field<scalar>& tgtField,
779  const plusEqOp<scalar>& cop
780 ) const;
781 template<>
783 (
784  const AMIPatchToPatchInterpolation& AMI,
785  Field<vector>& srcField,
786  const Field<vector>& tgtField,
787  const plusEqOp<vector>& cop
788 ) const;
789 template<>
791 (
792  const AMIPatchToPatchInterpolation& AMI,
793  Field<sphericalTensor>& srcField,
794  const Field<sphericalTensor>& tgtField,
795  const plusEqOp<sphericalTensor>& cop
796 ) const;
797 template<>
799 (
800  const AMIPatchToPatchInterpolation& AMI,
801  Field<symmTensor>& srcField,
802  const Field<symmTensor>& tgtField,
803  const plusEqOp<symmTensor>& cop
804 ) const;
805 template<>
807 (
808  const AMIPatchToPatchInterpolation& AMI,
809  Field<tensor>& srcField,
810  const Field<tensor>& tgtField,
811  const plusEqOp<tensor>& cop
812 ) const;
813 
814 
815 } // End namespace Foam
816 
817 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
818 
819 #include "meshToMeshI.H"
820 
821 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
822 
823 #ifdef NoRepository
824  #include "meshToMeshTemplates.C"
825 #endif
826 
827 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
828 
829 #endif
830 
831 // ************************************************************************* //
Foam::AMIInterpolation::interpolationMethod
interpolationMethod
Enumeration specifying interpolation method.
Definition: AMIInterpolation.H:86
volFieldsFwd.H
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:296
Foam::meshToMesh::tgtToSrcCellWght
const scalarListList & tgtToSrcCellWght() const
Return const access to the target to source cell weights.
Definition: meshToMeshI.H:60
Foam::meshToMesh::singleMeshProc_
label singleMeshProc_
Index of processor that holds all of both sides. -1 in all other.
Definition: meshToMesh.H:127
Foam::meshToMesh::TypeName
TypeName("meshToMesh")
Run-time type information.
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::meshToMesh::meshToMesh
meshToMesh(const meshToMesh &)
Disallow default bitwise copy construct.
Foam::meshToMesh::patchAMIs
const PtrList< AMIPatchToPatchInterpolation > & patchAMIs() const
Return the list of AMIs between source and target patches.
Definition: meshToMeshI.H:85
Foam::meshToMesh::V
scalar V() const
Return const access to the overlap volume.
Definition: meshToMeshI.H:78
Foam::minusEqOp
Definition: ops.H:72
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::meshToMesh::distributeAndMergeCells
void distributeAndMergeCells(const mapDistribute &map, const polyMesh &tgt, const globalIndex &globalI, pointField &tgtPoints, faceList &tgtFaces, labelList &tgtFaceOwners, labelList &tgtFaceNeighbours, labelList &tgtCellIDs) const
Collect pieces of tgt mesh from other procssors and restructure.
Definition: meshToMeshParallelOps.C:504
Foam::meshToMesh::calculatePatchAMIs
void calculatePatchAMIs(const word &amiMethodName)
Calculate patch overlap.
Definition: meshToMesh.C:653
Foam::meshToMesh::tgtPatchID_
List< label > tgtPatchID_
List of source patch IDs per target patch (local index)
Definition: meshToMesh.H:93
Foam::meshToMesh::mapAndOpSrcToTgt
void mapAndOpSrcToTgt(const AMIPatchToPatchInterpolation &AMI, const Field< Type > &srcField, Field< Type > &tgtField, const CombineOp &cop) const
Helper function to interpolate patch field. Template.
Definition: meshToMeshTemplates.C:527
Foam::meshToMesh::constructNoCuttingPatches
void constructNoCuttingPatches(const word &methodName, const word &AMIMethodName, const bool interpAllPatches)
Constructor helper.
Definition: meshToMesh.C:700
Foam::meshToMesh::distributeCells
void distributeCells(const mapDistribute &map, const polyMesh &tgtMesh, const globalIndex &globalI, List< pointField > &points, List< label > &nInternalFaces, List< faceList > &faces, List< labelList > &faceOwner, List< labelList > &faceNeighbour, List< labelList > &cellIDs, List< labelList > &nbrProcIDs, List< labelList > &procLocalFaceIDs) const
Distribute mesh info from 'my' processor to others.
Definition: meshToMeshParallelOps.C:264
NamedEnum.H
Foam::outerProduct::type
typeOfRank< typename pTraits< arg1 >::cmptType, int(pTraits< arg1 >::rank)+int(pTraits< arg2 >::rank) >::type type
Definition: products.H:72
Foam::meshToMesh::imDirect
@ imDirect
Definition: meshToMesh.H:70
Foam::meshToMesh::~meshToMesh
virtual ~meshToMesh()
Destructor.
Definition: meshToMesh.C:938
polyMesh.H
Foam::meshToMesh::calcDistribution
label calcDistribution(const polyMesh &src, const polyMesh &tgt) const
Determine whether the meshes are split across multiple pocessors.
Definition: meshToMeshParallelOps.C:38
Foam::meshToMesh::tgtToSrcCellWght_
scalarListList tgtToSrcCellWght_
Target to source cell interpolation weights.
Definition: meshToMesh.H:111
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:83
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::meshToMesh::srcToTgtCellWght_
scalarListList srcToTgtCellWght_
Source to target cell interplation weights.
Definition: meshToMesh.H:108
Foam::meshToMesh::srcRegion_
const polyMesh & srcRegion_
Reference to the source mesh.
Definition: meshToMesh.H:84
Foam::meshToMesh::srcToTgtCellAddr
const labelListList & srcToTgtCellAddr() const
Return const access to the source to target cell addressing.
Definition: meshToMeshI.H:42
Foam::meshToMesh::srcToTgtCellVec
const pointListList & srcToTgtCellVec() const
Return const access to the source to target offset vectors.
Definition: meshToMeshI.H:66
Foam::meshToMesh::calcProcMap
autoPtr< mapDistribute > calcProcMap(const polyMesh &src, const polyMesh &tgt) const
Calculate the mapping between processors.
Definition: meshToMeshParallelOps.C:117
Foam::meshToMesh::interpolationMethodNames_
static const NamedEnum< interpolationMethod, 4 > interpolationMethodNames_
Definition: meshToMesh.H:77
Foam::meshToMesh::tgtToSrcCellVec_
pointListList tgtToSrcCellVec_
Target to source cell offset vectors.
Definition: meshToMesh.H:120
Foam::meshToMesh::maskCells
labelList maskCells(const polyMesh &src, const polyMesh &tgt) const
Return src cell IDs for the overlap region.
Definition: meshToMesh.C:324
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::meshToMesh
Class to calculate the cell-addressing between two overlapping meshes.
Definition: meshToMesh.H:61
Foam::Field< Type >
meshToMeshI.H
Foam::meshToMesh::mapInternalSrcToTgt
void mapInternalSrcToTgt(const GeometricField< Type, fvPatchField, volMesh > &field, const CombineOp &cop, GeometricField< Type, fvPatchField, volMesh > &result, const bool secondOrder) const
Helper function to interpolate internal field. Optionally uses.
Definition: meshToMeshTemplates.C:501
treeBoundBox.H
Foam::meshToMesh::tgtToSrcCellAddr_
labelListList tgtToSrcCellAddr_
Target to source cell addressing.
Definition: meshToMesh.H:105
Foam::mapDistribute
Class containing processor-to-processor mapping information.
Definition: mapDistribute.H:152
pointList.H
Foam::meshToMesh::calcAddressing
void calcAddressing(const word &methodName, const polyMesh &src, const polyMesh &tgt)
Calculate the addressing between overlapping regions of src and tgt.
Definition: meshToMesh.C:388
Foam::meshToMesh::imCellVolumeWeight
@ imCellVolumeWeight
Definition: meshToMesh.H:72
Foam::PtrList
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:61
Foam::meshToMesh::srcPatchID_
List< label > srcPatchID_
List of target patch IDs per source patch (local index)
Definition: meshToMesh.H:90
Foam::meshToMesh::calcOverlappingProcs
label calcOverlappingProcs(const List< treeBoundBoxList > &procBb, const boundBox &bb, boolList &overlaps) const
Determine which processor bounding-boxes overlap.
Definition: meshToMeshParallelOps.C:87
meshToMeshTemplates.C
Foam::meshToMesh::tgtMapPtr_
autoPtr< mapDistribute > tgtMapPtr_
Target map pointer - parallel running only.
Definition: meshToMesh.H:133
AMIPatchToPatchInterpolation.H
Foam::meshToMesh::srcToTgtCellVec_
pointListList srcToTgtCellVec_
Source to target cell offset vectors.
Definition: meshToMesh.H:117
Foam::meshToMesh::patchAMIs_
PtrList< AMIPatchToPatchInterpolation > patchAMIs_
List of AMIs between source and target patches.
Definition: meshToMesh.H:96
Foam::meshToMesh::operator=
void operator=(const meshToMesh &)
Disallow default bitwise assignment.
fld
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< ' ';}gmvFile<< nl;forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Foam::plusEqOp
Definition: ops.H:71
Foam::meshToMesh::constructFromCuttingPatches
void constructFromCuttingPatches(const word &methodName, const word &AMIMethodName, const HashTable< word > &patchMap, const wordList &cuttingPatches)
Constructor helper.
Definition: meshToMesh.C:750
Foam::meshToMesh::srcRegion
const polyMesh & srcRegion() const
Return const access to the source mesh.
Definition: meshToMeshI.H:30
Foam::meshToMesh::V_
scalar V_
Cell total volume in overlap region [m3].
Definition: meshToMesh.H:123
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::globalIndex
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
Definition: globalIndex.H:63
Foam::meshToMesh::tgtRegion_
const polyMesh & tgtRegion_
Reference to the target mesh.
Definition: meshToMesh.H:87
Foam::meshToMesh::srcToTgtCellAddr_
labelListList srcToTgtCellAddr_
Source to target cell addressing.
Definition: meshToMesh.H:102
Foam::meshToMesh::imMapNearest
@ imMapNearest
Definition: meshToMesh.H:71
Foam::HashTable
An STL-conforming hash table.
Definition: HashTable.H:61
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::meshToMesh::calculate
void calculate(const word &methodName)
Calculate - main driver function.
Definition: meshToMesh.C:423
mapDistribute.H
Foam::meshToMesh::interpolationMethod
interpolationMethod
Enumeration specifying interpolation method.
Definition: meshToMesh.H:68
Foam::List< label >
Foam::meshToMesh::add
void add(UList< Type > &fld, const label offset) const
Helper function to add a constant offset to a list.
Definition: meshToMeshTemplates.C:69
Foam::AMIInterpolation
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
Definition: AMIInterpolation.H:77
Foam::meshToMesh::interpolationMethodAMI
static AMIPatchToPatchInterpolation::interpolationMethod interpolationMethodAMI(const interpolationMethod method)
Conversion between mesh and patch interpolation methods.
Definition: meshToMesh.C:621
Foam::UList< Type >
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::meshToMesh::srcMapPtr_
autoPtr< mapDistribute > srcMapPtr_
Source map pointer - parallel running only.
Definition: meshToMesh.H:130
Foam::meshToMesh::tgtRegion
const polyMesh & tgtRegion() const
Return const access to the target mesh.
Definition: meshToMeshI.H:36
Foam::meshToMesh::imCorrectedCellVolumeWeight
@ imCorrectedCellVolumeWeight
Definition: meshToMesh.H:73
Foam::boundBox
A bounding box defined in terms of the points at its extremities.
Definition: boundBox.H:55
Foam::meshToMesh::tgtToSrcCellAddr
const labelListList & tgtToSrcCellAddr() const
Return const access to the target to source cell addressing.
Definition: meshToMeshI.H:48
Foam::meshToMesh::cuttingPatches_
List< label > cuttingPatches_
Cutting patches whose values are set using a zero-gradient condition.
Definition: meshToMesh.H:99
Foam::meshToMesh::mapAndOpTgtToSrc
void mapAndOpTgtToSrc(const AMIPatchToPatchInterpolation &AMI, Field< Type > &srcField, const Field< Type > &tgtField, const CombineOp &cop) const
Helper function to interpolate patch field. Template.
Definition: meshToMeshTemplates.C:766
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::meshToMesh::srcToTgtCellWght
const scalarListList & srcToTgtCellWght() const
Return const access to the source to target cell weights.
Definition: meshToMeshI.H:54
Foam::meshToMesh::normaliseWeights
void normaliseWeights(const word &descriptor, const labelListList &addr, scalarListList &wght) const
Normalise the interpolation weights.
Definition: meshToMesh.C:361
Foam::NamedEnum< interpolationMethod, 4 >
Foam::meshToMesh::mapInternalTgtToSrc
void mapInternalTgtToSrc(const GeometricField< Type, fvPatchField, volMesh > &field, const CombineOp &cop, GeometricField< Type, fvPatchField, volMesh > &result, const bool secondOrder) const
Helper function to interpolate internal field. Optionally uses.
Definition: meshToMeshTemplates.C:740
Foam::meshToMesh::tgtToSrcCellVec
const pointListList & tgtToSrcCellVec() const
Return const access to the target to source offset vectors.
Definition: meshToMeshI.H:72