Loading...
Searching...
No Matches
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-2023 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::meshToMesh
29
30Description
31 Class to calculate the cell-addressing between two overlapping meshes
32
33 Mapping is performed using a run-time selectable interpolation mothod
34
35SeeAlso
36 meshToMeshMethod
37
38SourceFiles
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
58namespace Foam
59{
61/*---------------------------------------------------------------------------*\
62 Class meshToMesh Declaration
63\*---------------------------------------------------------------------------*/
64
65class meshToMesh
66{
67public:
68
69 // Public data types
70
71 //- Enumeration specifying interpolation method
73 {
78 };
79
81
82 //- Enumeration specifying processor parallel map construction method
83 enum class procMapMethod
84 {
86 pmLOD
87 };
88
90
91private:
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.
141 //- The value is -1 for distributed 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,
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 (
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 (
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 (
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
307public:
308
309 //- Run-time type information
310 TypeName("meshToMesh");
311
312
313 //- Construct from source and target meshes
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
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
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
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 // Mapping
408
409 //- Distributed across processors (singleMeshProc == -1)
410 inline bool distributed() const noexcept;
411
412 //- Pointer to the source map (if distributed).
413 //- Can be checked as a bool.
414 inline const mapDistribute* hasSrcMap() const noexcept;
415
416 //- Pointer to the target map (if distributed).
417 //- Can be checked as a bool.
418 inline const mapDistribute* hasTgtMap() const noexcept;
419
420 //- Source map pointer - valid if no singleMeshProc
421 inline const autoPtr<mapDistribute>& srcMap() const noexcept;
422
423 //- Target map pointer - valid if no singleMeshProc
424 inline const autoPtr<mapDistribute>& tgtMap() const noexcept;
425
426
427 // Evaluation
428
429 // Source-to-target field mapping
430
431 //- Map field from src to tgt mesh with defined operation.
432 // Values passed in via 'result' are used to initialise the
433 // return value
434 template<class Type, class CombineOp>
435 void mapSrcToTgt
436 (
437 const UList<Type>& srcFld,
438 const CombineOp& cop,
439 List<Type>& result
440 ) const;
441
442 //- Map extrapolated field (using gradient) from src to tgt
443 // mesh with defined operation. Falls back to non-extrapolated
444 // mapping (above) if not constructed with method that supports
445 // getting offset vectors. Extrapolation only for internal
446 // values. Values passed in via 'result' are used to
447 // initialise the return value.
448 template<class Type, class CombineOp>
449 void mapSrcToTgt
450 (
451 const UList<Type>& srcField,
452 const UList<typename outerProduct<vector, Type>::type>&,
453 const CombineOp& cop,
454 List<Type>& result
455 ) const;
456
457 //- Return the src field mapped to the tgt mesh with a defined
458 // operation. Initial values of the result are set to zero
459 template<class Type, class CombineOp>
460 tmp<Field<Type>> mapSrcToTgt
461 (
462 const Field<Type>& srcFld,
463 const CombineOp& cop
464 ) const;
465
466 //- Convenience function to map a tmp field to the tgt mesh
467 // with a defined operation
468 template<class Type, class CombineOp>
469 tmp<Field<Type>> mapSrcToTgt
470 (
471 const tmp<Field<Type>>& tsrcFld,
472 const CombineOp& cop
473 ) const;
474
475 //- Convenience function to map a field to the tgt mesh with a
476 // default operation (plusEqOp)
477 template<class Type>
478 tmp<Field<Type>> mapSrcToTgt
479 (
480 const Field<Type>& srcFld
481 ) const;
482
483 //- Convenience function to map a tmp field to the tgt mesh
484 // with a default operation (plusEqOp)
485 template<class Type>
486 tmp<Field<Type>> mapSrcToTgt
487 (
488 const tmp<Field<Type>>& tsrcFld
489 ) const;
490
491
492 // Target-to-source field mapping
493
494 //- Map field from tgt to src mesh with defined operation
495 // Values passed in via 'result' are used to initialise the
496 // return value
497 template<class Type, class CombineOp>
498 void mapTgtToSrc
499 (
500 const UList<Type>& tgtFld,
501 const CombineOp& cop,
502 List<Type>& result
503 ) const;
504
505 //- Map extrapolated field (using gradient) from tgt to src
506 // mesh with defined operation. Falls back to non-extrapolated
507 // mapping (above) if not constructed with method that supports
508 // getting offset vectors. Extrapolation only for internal
509 // values. Values passed in via 'result' are used to
510 // initialise the return value
511 template<class Type, class CombineOp>
512 void mapTgtToSrc
513 (
514 const UList<Type>& srcField,
515 const UList<typename outerProduct<vector, Type>::type>&,
516 const CombineOp& cop,
517 List<Type>& result
518 ) const;
519
520 //- Return the tgt field mapped to the src mesh with a defined
521 // operation. Initial values of the result are set to zero
522 template<class Type, class CombineOp>
523 tmp<Field<Type>> mapTgtToSrc
524 (
525 const Field<Type>& tgtFld,
526 const CombineOp& cop
527 ) const;
528
529 //- Convenience function to map a tmp field to the src mesh
530 // with a defined operation
531 template<class Type, class CombineOp>
532 tmp<Field<Type>> mapTgtToSrc
533 (
534 const tmp<Field<Type>>& ttgtFld,
535 const CombineOp& cop
536 ) const;
537
538 //- Convenience function to map a field to the src mesh with a
539 // default operation (plusEqOp)
540 template<class Type>
541 tmp<Field<Type>> mapTgtToSrc
542 (
543 const Field<Type>& tgtFld
544 ) const;
545
546 //- Convenience function to map a tmp field to the src mesh
547 // with a default operation (plusEqOp)
548 template<class Type>
549 tmp<Field<Type>> mapTgtToSrc
550 (
551 const tmp<Field<Type>>& ttgtFld
552 ) const;
553
554
555 // Source-to-target volume field mapping
556
557 //- Interpolate a field with a defined operation. Values
558 // passed in via 'result' are used to initialise the return
559 // value. Optionally uses gradient correction (internal
560 // field only) if interpolationMethod supports it
561 template<class Type, class CombineOp>
562 void mapSrcToTgt
563 (
564 const VolumeField<Type>& field,
565 const CombineOp& cop,
566 VolumeField<Type>& result,
567 const bool secondOrder = true
568 ) const;
569
570 //- Interpolate a field with a defined operation. The initial
571 // values of the result are set to zero
572 template<class Type, class CombineOp>
574 (
575 const VolumeField<Type>& field,
576 const CombineOp& cop,
577 const bool secondOrder = true
578 ) const;
579
580 //- Interpolate a tmp field with a defined operation. The
581 // initial values of the result are set to zero
582 template<class Type, class CombineOp>
584 (
585 const tmp<VolumeField<Type>>& tfield,
586 const CombineOp& cop,
587 const bool secondOrder = true
588 ) const;
590 //- Convenience function to map a field with a default
591 // operation (plusEqOp)
592 template<class Type>
594 (
595 const VolumeField<Type>& field,
596 const bool secondOrder = true
597 ) const;
598
599 //- Convenience function to map a tmp field with a default
600 // operation (plusEqOp)
601 template<class Type>
603 (
604 const tmp<VolumeField<Type>>& tfield,
605 const bool secondOrder = true
606 ) const;
607
608
609 // Target-to-source volume field mapping
610
611 //- Interpolate a field with a defined operation. Values
612 // passed in via 'result' are used to initialise the return
613 // value. Optionally uses gradient correction (internal
614 // field only) if interpolationMethod supports it
615 template<class Type, class CombineOp>
616 void mapTgtToSrc
617 (
618 const VolumeField<Type>& field,
619 const CombineOp& cop,
620 VolumeField<Type>& result,
621 const bool secondOrder = true
622 ) const;
623
624 //- Interpolate a field with a defined operation. The initial
625 // values of the result are set to zero
626 template<class Type, class CombineOp>
628 (
629 const VolumeField<Type>& field,
630 const CombineOp& cop,
631 const bool secondOrder = true
632 ) const;
633
634 //- Interpolate a tmp field with a defined operation. The
635 // initial values of the result are set to zero
636 template<class Type, class CombineOp>
638 (
639 const tmp<VolumeField<Type>>&
640 tfield,
641 const CombineOp& cop,
642 const bool secondOrder = true
643 ) const;
644
645 //- Convenience function to map a field with a default
646 // operation (plusEqOp)
647 template<class Type>
649 (
650 const VolumeField<Type>& field,
651 const bool secondOrder = true
652 ) const;
653
654 //- Convenience function to map a tmp field with a default
655 // operation (plusEqOp)
656 template<class Type>
658 (
659 const tmp<VolumeField<Type>>& tfield,
660 const bool secondOrder = true
661 ) const;
662};
663
664
665// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
666
667// Disable gradient 2nd order correction for tensor types
668
669template<>
670void meshToMesh::mapInternalSrcToTgt
671(
675 const bool
676) const;
677template<>
678void meshToMesh::mapInternalSrcToTgt
679(
683 const bool
684) const;
685template<>
686void meshToMesh::mapInternalSrcToTgt
687(
688 const VolumeField<symmTensor>&,
689 const plusEqOp<symmTensor>&,
691 const bool
692) const;
693template<>
694void meshToMesh::mapInternalSrcToTgt
695(
696 const VolumeField<symmTensor>&,
697 const minusEqOp<symmTensor>&,
699 const bool
700) const;
701template<>
702void meshToMesh::mapInternalSrcToTgt
703(
704 const VolumeField<tensor>&,
707 const bool
708) const;
709template<>
710void meshToMesh::mapInternalSrcToTgt
711(
712 const VolumeField<tensor>&,
713 const minusEqOp<tensor>&,
715 const bool
716) const;
717template<>
718void meshToMesh::mapInternalTgtToSrc
719(
723 const bool
724) const;
725template<>
726void meshToMesh::mapInternalTgtToSrc
727(
731 const bool
732) const;
733template<>
734void meshToMesh::mapInternalTgtToSrc
736 const VolumeField<symmTensor>&,
737 const plusEqOp<symmTensor>&,
739 const bool
740) const;
741template<>
742void meshToMesh::mapInternalTgtToSrc
743(
744 const VolumeField<symmTensor>&,
745 const minusEqOp<symmTensor>&,
747 const bool
748) const;
749template<>
750void meshToMesh::mapInternalTgtToSrc
751(
752 const VolumeField<tensor>&,
753 const plusEqOp<tensor>&,
755 const bool
756) const;
757template<>
758void meshToMesh::mapInternalTgtToSrc
759(
760 const VolumeField<tensor>&,
763 const bool
764) const;
765
766
767// Disable fvPatchField value override after rmap
768
769template<>
770void meshToMesh::mapAndOpSrcToTgt
771(
773 const Field<scalar>& srcField,
774 Field<scalar>& tgtField,
775 const plusEqOp<scalar>& cop
776) const;
777template<>
778void meshToMesh::mapAndOpSrcToTgt
779(
781 const Field<vector>& srcField,
782 Field<vector>& tgtField,
783 const plusEqOp<vector>& cop
784) const;
785template<>
786void meshToMesh::mapAndOpSrcToTgt
787(
789 const Field<sphericalTensor>& srcField,
790 Field<sphericalTensor>& tgtField,
791 const plusEqOp<sphericalTensor>& cop
792) const;
793template<>
794void meshToMesh::mapAndOpSrcToTgt
795(
797 const Field<symmTensor>& srcField,
798 Field<symmTensor>& tgtField,
799 const plusEqOp<symmTensor>& cop
800) const;
801template<>
802void meshToMesh::mapAndOpSrcToTgt
803(
805 const Field<tensor>& srcField,
806 Field<tensor>& tgtField,
807 const plusEqOp<tensor>& cop
808) const;
809
810
811template<>
812void meshToMesh::mapAndOpTgtToSrc
813(
815 Field<scalar>& srcField,
816 const Field<scalar>& tgtField,
817 const plusEqOp<scalar>& cop
818) const;
819template<>
820void meshToMesh::mapAndOpTgtToSrc
821(
823 Field<vector>& srcField,
824 const Field<vector>& tgtField,
825 const plusEqOp<vector>& cop
826) const;
827template<>
828void meshToMesh::mapAndOpTgtToSrc
829(
832 const Field<sphericalTensor>& tgtField,
833 const plusEqOp<sphericalTensor>& cop
834) const;
835template<>
836void meshToMesh::mapAndOpTgtToSrc
837(
839 Field<symmTensor>& srcField,
840 const Field<symmTensor>& tgtField,
841 const plusEqOp<symmTensor>& cop
842) const;
843template<>
844void meshToMesh::mapAndOpTgtToSrc
845(
847 Field<tensor>& srcField,
848 const Field<tensor>& tgtField,
849 const plusEqOp<tensor>& cop
850) const;
851
852
853} // End namespace Foam
854
855// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
857#include "meshToMeshI.H"
858
859// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
860
861#ifdef NoRepository
862 #include "meshToMeshTemplates.C"
863#endif
865// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
866
867#endif
868
869// ************************************************************************* //
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...
Definition Enum.H:57
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Definition Field.H:172
A HashTable similar to std::unordered_map.
Definition HashTable.H:124
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition List.H:72
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition PtrList.H:67
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition UList.H:89
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A bounding box defined in terms of min/max extrema points.
Definition boundBox.H:71
Calculates a non-overlapping list of offsets based on an input size (eg, number of cells) from differ...
Definition globalIndex.H:77
Class containing processor-to-processor mapping information.
Class to calculate the cell-addressing between two overlapping meshes.
Definition meshToMesh.H:61
virtual ~meshToMesh()
Destructor.
Definition meshToMesh.C:985
interpolationMethod
Enumeration specifying interpolation method.
Definition meshToMesh.H:70
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.
Definition meshToMeshI.H:38
scalar V() const
Return const access to the overlap volume.
Definition meshToMeshI.H:74
bool distributed() const noexcept
Distributed across processors (singleMeshProc == -1).
Definition meshToMeshI.H:80
const mapDistribute * hasTgtMap() const noexcept
Pointer to the target map (if distributed). Can be checked as a bool.
Definition meshToMeshI.H:94
procMapMethod
Enumeration specifying processor parallel map construction method.
Definition meshToMesh.H:83
const scalarListList & srcToTgtCellWght() const
Return const access to the source to target cell weights.
Definition meshToMeshI.H:50
const scalarListList & tgtToSrcCellWght() const
Return const access to the target to source cell weights.
Definition meshToMeshI.H:56
const pointListList & srcToTgtCellVec() const
Return const access to the source to target offset vectors.
Definition meshToMeshI.H:62
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.
Definition meshToMeshI.H:87
const labelListList & tgtToSrcCellAddr() const
Return const access to the target to source cell addressing.
Definition meshToMeshI.H:44
const pointListList & tgtToSrcCellVec() const
Return const access to the target to source offset vectors.
Definition meshToMeshI.H:68
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.
Definition meshToMeshI.H:26
static word interpolationMethodAMI(const interpolationMethod method)
Conversion between mesh and patch interpolation methods.
Definition meshToMesh.C:639
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_
Definition meshToMesh.H:59
static const Enum< interpolationMethod > interpolationMethodNames_
Definition meshToMesh.H:77
const autoPtr< mapDistribute > & tgtMap() const noexcept
Target map pointer - valid if no singleMeshProc.
const polyMesh & tgtRegion() const
Return const access to the target mesh.
Definition meshToMeshI.H:32
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
A class for managing temporary objects.
Definition tmp.H:75
A class for handling words, derived from Foam::string.
Definition word.H:66
rDeltaTY field()
const pointField & points
Namespace for OpenFOAM.
List< scalarList > scalarListList
List of scalarList.
Definition scalarList.H:35
List< word > wordList
List of word.
Definition fileName.H:60
GeometricField< Type, fvPatchField, volMesh > VolumeField
A volume field for a given type.
List< labelList > labelListList
List of labelList.
Definition labelList.H:38
List< label > labelList
A List of labels.
Definition List.H:62
List< face > faceList
List of faces.
Definition faceListFwd.H:41
Tensor< scalar > tensor
Definition symmTensor.H:57
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.
Definition List.H:60
const direction noexcept
Definition scalarImpl.H:265
vectorField pointField
pointField is a vectorField.
Vector< scalar > vector
Definition vector.H:57
SphericalTensor< scalar > sphericalTensor
SphericalTensor of scalars, i.e. SphericalTensor<scalar>.
List< pointList > pointListList
List of pointList.
Definition pointList.H:35
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
Definition symmTensor.H:55
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68
Forwards and collection of common volume field types.