mappedPatchBase.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) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2020-2021 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::mappedPatchBase
29 
30 Description
31  Determines a mapping between patch face centres and mesh cell or face
32  centres and processors they're on.
33 
34  If constructed from dictionary:
35  \verbatim
36  // Optional world to sample (default is all)
37  //sampleWorld solidSim;
38 
39  // Optional explicit coupling (requires functionObject to synchronise
40  // databases. Default is close coupling (bc to bc)
41  //sampleDatabase true;
42 
43  // Region to sample (default is region0)
44  sampleRegion region0;
45 
46  // What to sample:
47  // - nearestCell : sample cell containing point
48  // - nearestOnlyCell : nearest sample cell (even if not containing
49  // point)
50  // - nearestPatchFace : nearest face on selected patch
51  // - nearestPatchFaceAMI : nearest face on selected patch
52  - patches need not conform
53  - uses AMI interpolation
54  // - nearestFace : nearest boundary face on any patch
55  // - nearestPatchPoint : nearest patch point (for coupled points
56  // this might be any of the points so you have
57  // to guarantee the point data is synchronised
58  // beforehand)
59  sampleMode nearestCell;
60 
61  // If sampleMode is nearestPatchFace : patch to find faces of
62  samplePatch movingWall;
63 
64  // If sampleMode is nearestPatchFace : specify patchgroup to find
65  // samplePatch and sampleRegion (if not provided)
66  coupleGroup baffleGroup;
67 
68  // How to supply offset (w.r.t. my patch face centres):
69  // - uniform : single offset vector
70  // - nonuniform : per-face offset vector
71  // - normal : using supplied distance and face normal
72  offsetMode uniform;
73 
74  // According to offsetMode (see above) supply one of
75  // offset, offsets or distance
76  offset (1 0 0);
77  \endverbatim
78 
79  Note: if offsetMode is \c normal it uses outwards pointing normals. So
80  supply a negative distance if sampling inside the domain.
81 
82 Note
83  Storage is not optimal. It temporary collects all (patch)face centres
84  on all processors to keep the addressing calculation simple.
85 
86 SourceFiles
87  mappedPatchBase.C
88 
89 \*---------------------------------------------------------------------------*/
90 
91 #ifndef mappedPatchBase_H
92 #define mappedPatchBase_H
93 
94 #include "pointField.H"
95 #include "Tuple2.H"
96 #include "pointIndexHit.H"
98 #include "coupleGroupIdentifier.H"
100 
101 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
102 
103 namespace Foam
104 {
105 
106 class polyPatch;
107 class polyMesh;
108 class mapDistribute;
110 /*---------------------------------------------------------------------------*\
111  Class mappedPatchBase Declaration
112 \*---------------------------------------------------------------------------*/
113 
114 class mappedPatchBase
115 {
116 public:
117 
118  // Type enumerations
119 
120  //- Mesh items to sample
122  {
127  NEARESTFACE,
129  };
130 
131  //- How to project face centres
132  enum offsetMode
133  {
136  NORMAL
137  };
139  static const Enum<sampleMode> sampleModeNames_;
141  static const Enum<offsetMode> offsetModeNames_;
142 
143 
144  //- Helper class for finding nearest
145  // Nearest:
146  // - point+local index
147  // - sqr(distance)
148  // - processor
150 
152  {
153  public:
154 
155  void operator()(nearInfo& x, const nearInfo& y) const
156  {
157  if (y.first().hit())
158  {
159  if (!x.first().hit())
160  {
161  x = y;
162  }
163  else if (y.second().first() < x.second().first())
164  {
165  x = y;
166  }
167  }
168  }
169  };
170 
171  class maxProcEqOp
172  {
173  public:
174 
175  void operator()(nearInfo& x, const nearInfo& y) const
176  {
177  if (y.first().hit())
178  {
179  if (!x.first().hit())
180  {
181  x = y;
182  }
183  else if (y.second().second() > x.second().second())
184  {
185  x = y;
186  }
187  }
188  }
189  };
190 
191 
192  //- nearest + world
193  // Used to only look at entries from same world
194  typedef Tuple2<nearInfo, label> nearInfoWorld;
195 
196  class nearestWorldEqOp
197  {
198  public:
200  void operator()(nearInfoWorld& x, const nearInfoWorld& y) const
201  {
202  // Is there a hit and is it sampling the same world
203  const nearInfo& xi = x.first();
204  const nearInfo& yi = y.first();
205  if (yi.first().hit())
206  {
207  if (x.second() == y.second())
208  {
209  if (!xi.first().hit())
210  {
211  x = y;
212  }
213  else if (yi.second().first() < xi.second().first())
214  {
215  x = y;
216  }
217  }
218  }
219  }
220  };
221 
222 
223 protected:
224 
225  // Protected Data
226 
227  //- Patch to sample
228  const polyPatch& patch_;
229 
230  //- World to sample
231  mutable word sampleWorld_;
232 
233  //- Region to sample
234  mutable word sampleRegion_;
236  //- What to sample
237  const sampleMode mode_;
238 
239  //- Patch (if in sampleMode NEARESTPATCH*)
241 
242  //- PatchGroup (if in sampleMode NEARESTPATCH*)
244 
245  //- Empty or location of database
247 
248  //- How to obtain samples
251  //- Offset vector (uniform)
252  vector offset_;
253 
254  //- Offset vector (nonuniform)
256 
257  //- Offset distance (normal)
258  scalar distance_;
259 
260  //- Communicator
261  label communicator_;
262 
263  //- Same region
264  mutable bool sameRegion_;
266 
267  // Derived information
268 
269  //- Communication schedule:
270  //
271  // - Cells/faces to sample per processor
272  // - Patch faces to receive per processor
273  // - schedule
276 
277  // AMI interpolator (only for NEARESTPATCHFACEAMI)
278 
279  //- Flag to indicate that slave patch should be reversed for AMI
280  const bool AMIReverse_;
281 
282  //- Pointer to AMI interpolator
284 
285  //- Pointer to projection surface employed by AMI interpolator
287 
288  //- Dictionary storing projection surface description
291 
292  // Mesh update IOobjects
293 
294  //- Local mesh update time
296 
297  //- Sample mesh update time
300 
301 
302  // Protected Member Functions
303 
304  //- Add a world-world connection
305  bool addWorldConnection();
306 
307  //- Get the communicator for the world-world connection
308  label getWorldCommunicator() const;
309 
310  //- Lookup mesh
311  const polyMesh& lookupMesh(const word& region) const;
312 
313  //- Lookup patch
314  const polyPatch& lookupPatch
315  (
317  const word& samplePatch
318  ) const;
319 
320 
321  //- Get the points from face-centre-decomposition face centres
322  //- and project them onto the face-diagonal-decomposition triangles.
323  tmp<pointField> facePoints(const polyPatch&) const;
324 
325  //- Collect single list of samples and originating processor+face +
326  //- wanted world
327  void collectSamples
328  (
329  const label mySampleWorld, // My wanted sampling world
330  const pointField& facePoints,
331  pointField& samples, // Per sample: coordinate
332  labelList& patchFaceWorlds, // Per sample: wanted world
333  labelList& patchFaceProcs, // Per sample: originating proc
334  labelList& patchFaces, // Per sample: originating face
335  pointField& patchFc
336  ) const;
337 
338  //- Find (local) cells/faces containing samples
340  (
341  const sampleMode mode,
342  const label sampleWorld, // my world as index
343  const word& sampleRegion,
344  const word& samplePatch,
346 
347  List<nearInfoWorld>& nearest
348  ) const;
349 
350  //- Find (global) cells/faces containing samples
351  void findSamples
352  (
353  const sampleMode mode, // search mode
354  const label myWorldIndex, // my world (in index form)
355 
356  const pointField&,
357  const labelList& wantedWorlds,
358  const labelList& origProcs, // per sample the originating proc
359 
360  labelList& sampleProcs, // processor containing sample
361  labelList& sampleIndices, // local index of cell/face
362  pointField& sampleLocations // actual representative location
363  ) const;
364 
365  //- Get the sample points given the face points
367 
368  //- Calculate mapping
369  void calcMapping() const;
370 
371  //- Calculate AMI interpolator
372  void calcAMI() const;
373 
374 
375  // Database Handling
376 
377  //- Read optional database name from dictionary
379 
380  //- Lookup (sub)objectRegistry by following names of sub registries.
381  //- Creates non-existing intermediate ones.
382  static const objectRegistry& subRegistry
383  (
384  const objectRegistry& obr,
385  const wordList& names,
386  const label index
387  );
388 
389  //- Attempt to detect an IOField<Type> and write to dictionary
390  template<class Type>
391  static bool writeIOField
392  (
393  const regIOobject& obj,
395  );
396 
397  //- Attempt to read an IOField<Type> and store on objectRegistry
398  template<class Type>
399  static bool constructIOField
400  (
401  const word& name,
402  token& tok,
403  Istream& is,
404  objectRegistry& obr
405  );
406 
407 public:
408 
409  //- Runtime type information
410  TypeName("mappedPatchBase");
411 
412 
413  // Constructors
414 
415  //- Construct from patch
416  explicit mappedPatchBase(const polyPatch&);
417 
418  //- Construct with offsetMode=non-uniform
420  (
421  const polyPatch& pp,
422  const word& sampleRegion,
423  const sampleMode sampleMode,
424  const word& samplePatch,
425  const vectorField& offsets
426  );
427 
428  //- Construct from offsetMode=uniform
430  (
431  const polyPatch& pp,
432  const word& sampleRegion,
433  const sampleMode sampleMode,
434  const word& samplePatch,
435  const vector& uniformOffset
436  );
437 
438  //- Construct from offsetMode=normal and distance
440  (
441  const polyPatch& pp,
442  const word& sampleRegion,
443  const sampleMode sampleMode,
444  const word& samplePatch,
445  const scalar normalDistance
446  );
447 
448  //- Construct from dictionary
449  mappedPatchBase(const polyPatch&, const dictionary&);
450 
451  //- Construct from dictionary and (collocated) sample mode
452  // (only for nearestPatchFace, nearestPatchFaceAMI, nearestPatchPoint)
453  // Assumes zero offset.
454  mappedPatchBase(const polyPatch&, const sampleMode, const dictionary&);
455 
456  //- Construct as copy, resetting patch
457  mappedPatchBase(const polyPatch&, const mappedPatchBase&);
458 
459  //- Construct as copy, resetting patch, map original data
461  (
462  const polyPatch&,
463  const mappedPatchBase&,
464  const labelUList& mapAddressing
465  );
466 
467 
468  //- Destructor
469  virtual ~mappedPatchBase();
470 
471 
472  // Member Functions
473 
474  // Edit
475 
476  void clearOut();
477 
478  //- Change to normal offset with given distance
479  void setOffset(const scalar normalDist);
480 
481  //- Change to uniform offset with value
482  void setOffset(const vector& uniformOffset);
483 
484  //- Change to non-uniform offsets
485  void setOffset(const vectorField& offsets);
486 
487 
488  // Access
489 
490  //- What to sample
491  inline sampleMode mode() const noexcept;
492 
493  //- World to sample
494  inline const word& sampleWorld() const noexcept;
495 
496  //- Region to sample
497  inline const word& sampleRegion() const;
498 
499  //- Patch (only if NEARESTPATCHFACE)
500  inline const word& samplePatch() const;
501 
502  //- PatchGroup (only if NEARESTPATCHFACE)
503  inline const word& coupleGroup() const;
504 
505  //- Return size of mapped mesh/patch/boundary
506  inline label sampleSize() const;
507 
508  //- Offset vector (from patch faces to destination mesh objects)
509  inline const vector& offset() const noexcept;
510 
511  //- Offset vectors (from patch faces to destination mesh objects)
512  inline const vectorField& offsets() const noexcept;
513 
514  //- Get the communicator (worldComm or world-to-world)
515  inline label getCommunicator() const;
516 
517  //- Identical to getCommunicator()
518  inline label comm() const;
519 
520  //- Is sample world the local world?
521  inline bool sameWorld() const;
522 
523  //- Is my world ordered before the sampleWorld?
524  inline bool masterWorld() const;
525 
526  //- Cached sampleRegion != mesh.name()
527  inline bool sameRegion() const noexcept;
528 
529  //- Local mesh update time
531 
532  //- Sample mesh upate time
534 
535  inline bool upToDate() const;
536 
537  //- Return reference to the parallel distribution map
538  inline const mapDistribute& map() const;
539 
540  //- Return reference to the AMI interpolator
541  inline const AMIPatchToPatchInterpolation& AMI
542  (
543  const bool forceUpdate = false
544  ) const;
545 
546  //- Is it owner
547  inline bool owner() const;
548 
549  //- Return a pointer to the AMI projection surface
550  const autoPtr<Foam::searchableSurface>& surfPtr() const;
551 
552  //- Get the region mesh
553  const polyMesh& sampleMesh() const;
554 
555  //- Get the patch on the region
556  const polyPatch& samplePolyPatch() const;
557 
558 
559  // Helpers
560 
561  //- Get the sample points
562  tmp<pointField> samplePoints() const;
563 
564  //- Get a point on the face given a face decomposition method:
565  // face-centre-tet : face centre. Returns index of face.
566  // face-planes : face centre. Returns index of face.
567  // face-diagonal : intersection of ray from cellcentre to
568  // facecentre with any of the triangles.
569  // Returns index (0..size-2) of triangle.
570  static pointIndexHit facePoint
571  (
572  const polyMesh&,
573  const label facei,
574  const polyMesh::cellDecomposition
575  );
576 
577 
578  // For database storage
579 
580  inline const fileName& sampleDatabasePath() const
581  {
582  return *sampleDatabasePtr_;
583  }
584 
585  inline bool sampleDatabase() const
586  {
587  return bool(sampleDatabasePtr_);
588  }
589 
590  //- Helper: return path to store data to be sent to processor i
591  static fileName sendPath(const fileName& root, const label proci);
592 
593  virtual fileName sendPath(const label proci) const;
594 
595  //- Helper: return path to store data to be received from
596  //- processor i
597  static fileName receivePath
598  (
599  const fileName& root,
600  const label proci
601  );
602 
603  virtual fileName receivePath(const label proci) const;
604 
605  //- Lookup (sub)objectRegistry from '/' separated path (relative to
606  //- objectRegistry). Creates non-existing intermediate ones.
607  static const objectRegistry& subRegistry
608  (
609  const objectRegistry& obr,
610  const fileName& path
611  );
612 
613  //- Store an IOField on the objectRegistry relative to obr
614  template<class Type>
615  static void storeField
616  (
617  objectRegistry& obr,
618  const word& fieldName,
619  const Field<Type>& values
620  );
621 
622  //- Convert objectRegistry contents into dictionary
623  static void writeDict
624  (
625  const objectRegistry& obr,
626  dictionary& dict
627  );
628 
629  //- (recursively) construct and register IOFields from dictionary
630  static void readDict(const dictionary& d, objectRegistry& obr);
631 
632 
633  // Distribute
634 
635  //- Wrapper around map/interpolate data distribution
636  template<class Type>
637  void distribute(List<Type>& lst) const;
638 
639  //- Wrapper around map/interpolate data distribution with operation
640  template<class Type, class CombineOp>
641  void distribute(List<Type>& lst, const CombineOp& cop) const;
642 
643  //- Wrapper around map/interpolate data distribution
644  template<class Type>
645  void reverseDistribute(List<Type>& lst) const;
646 
647  //- Wrapper around map/interpolate data distribution with operation
648  template<class Type, class CombineOp>
649  void reverseDistribute(List<Type>& lst, const CombineOp& cop) const;
650 
651 
652  // I/O
653 
654  //- Write as a dictionary
655  virtual void write(Ostream& os) const;
656 };
657 
658 
659 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
660 
661 } // End namespace Foam
662 
663 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
664 
665 #include "mappedPatchBaseI.H"
666 
667 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
668 
669 #ifdef NoRepository
670  #include "mappedPatchBaseTemplates.C"
671 #endif
672 
673 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
674 
675 #endif
676 
677 // ************************************************************************* //
label getWorldCommunicator() const
Get the communicator for the world-world connection.
bool sampleDatabase() const
const autoPtr< fileName > sampleDatabasePtr_
Empty or location of database.
word samplePatch_
Patch (if in sampleMode NEARESTPATCH*)
use face normal + distance
nearest point on selected patch
Tuple2< nearInfo, label > nearInfoWorld
nearest + world
dictionary dict
void operator()(nearInfoWorld &x, const nearInfoWorld &y) const
const polyMesh & lookupMesh(const word &region) const
Lookup mesh.
nearest face on selected patch
vector offset_
Offset vector (uniform)
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
List of names generated by calling name() for each list item and filtered for matches.
A class for handling file names.
Definition: fileName.H:72
const vector & offset() const noexcept
Offset vector (from patch faces to destination mesh objects)
void operator()(nearInfo &x, const nearInfo &y) const
autoPtr< AMIPatchToPatchInterpolation > AMIPtr_
Pointer to AMI interpolator.
static const Enum< offsetMode > offsetModeNames_
word sampleRegion_
Region to sample.
static bool constructIOField(const word &name, token &tok, Istream &is, objectRegistry &obr)
Attempt to read an IOField<Type> and store on objectRegistry.
autoPtr< mapDistribute > mapPtr_
Communication schedule:
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
tmp< pointField > samplePoints() const
Get the sample points.
const polyPatch & patch_
Patch to sample.
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
Definition: stringOps.H:54
const polyMesh & sampleMesh() const
Get the region mesh.
const polyPatch & lookupPatch(const word &sampleRegion, const word &samplePatch) const
Lookup patch.
bool sameRegion_
Same region.
autoPtr< searchableSurface > surfPtr_
Pointer to projection surface employed by AMI interpolator.
const coupleGroupIdentifier coupleGroup_
PatchGroup (if in sampleMode NEARESTPATCH*)
virtual ~mappedPatchBase()
Destructor.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
A token holds an item read from Istream.
Definition: token.H:65
Various UniformDimensionedField types.
static fileName sendPath(const fileName &root, const label proci)
Helper: return path to store data to be sent to processor i.
autoPtr< uniformDimensionedScalarField > updateMeshTimePtr_
Local mesh update time.
uniformDimensionedScalarField & updateMeshTime() const
Sample mesh upate time.
scalarField samples(nIntervals, Zero)
static const objectRegistry & subRegistry(const objectRegistry &obr, const wordList &names, const label index)
Lookup (sub)objectRegistry by following names of sub registries. Creates non-existing intermediate on...
void setOffset(const scalar normalDist)
Change to normal offset with given distance.
This class describes the interaction of an object (often a face) and a point. It carries the info of ...
Definition: pointIndexHit.H:44
Base class of (analytical or triangulated) surface. Encapsulates all the search routines. WIP.
uniformDimensionedScalarField & updateSampleMeshTime() const
Local mesh update time.
const mapDistribute & map() const
Return reference to the parallel distribution map.
vectorField offsets_
Offset vector (nonuniform)
scalar distance_
Offset distance (normal)
nearest patch face + AMI interpolation
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
Definition: HashOps.H:164
static void writeDict(const objectRegistry &obr, dictionary &dict)
Convert objectRegistry contents into dictionary.
scalar y
bool sameWorld() const
Is sample world the local world?
word sampleWorld_
World to sample.
static fileName receivePath(const fileName &root, const label proci)
Helper: return path to store data to be received from processor i.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition: exprTraits.C:127
bool masterWorld() const
Is my world ordered before the sampleWorld?
A class for handling words, derived from Foam::string.
Definition: word.H:63
TypeName("mappedPatchBase")
Runtime type information.
void findSamples(const sampleMode mode, const label myWorldIndex, const pointField &, const labelList &wantedWorlds, const labelList &origProcs, labelList &sampleProcs, labelList &sampleIndices, pointField &sampleLocations) const
Find (global) cells/faces containing samples.
void calcMapping() const
Calculate mapping.
const AMIPatchToPatchInterpolation & AMI(const bool forceUpdate=false) const
Return reference to the AMI interpolator.
Determines a mapping between patch face centres and mesh cell or face centres and processors they&#39;re ...
offsetMode offsetMode_
How to obtain samples.
Encapsulates using "patchGroups" to specify coupled patch.
tmp< pointField > facePoints(const polyPatch &) const
Get the points from face-centre-decomposition face centres and project them onto the face-diagonal-de...
const autoPtr< Foam::searchableSurface > & surfPtr() const
Return a pointer to the AMI projection surface.
static const Enum< sampleMode > sampleModeNames_
const direction noexcept
Definition: Scalar.H:258
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
const fileName & sampleDatabasePath() const
OBJstream os(runTime.globalPath()/outputName)
label sampleSize() const
Return size of mapped mesh/patch/boundary.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
virtual void write(Ostream &os) const
Write as a dictionary.
static pointIndexHit facePoint(const polyMesh &, const label facei, const polyMesh::cellDecomposition)
Get a point on the face given a face decomposition method:
static autoPtr< fileName > readDatabase(const dictionary &dict)
Read optional database name from dictionary.
offsetMode
How to project face centres.
dictionary surfDict_
Dictionary storing projection surface description.
autoPtr< uniformDimensionedScalarField > updateSampleMeshTimePtr_
Sample mesh update time.
void operator()(nearInfo &x, const nearInfo &y) const
void distribute(List< Type > &lst) const
Wrapper around map/interpolate data distribution.
label comm() const
Identical to getCommunicator()
label getCommunicator() const
Get the communicator (worldComm or world-to-world)
sampleMode mode() const noexcept
What to sample.
bool owner() const
Is it owner.
Class containing processor-to-processor mapping information.
void calcAMI() const
Calculate AMI interpolator.
Tuple2< pointIndexHit, Tuple2< scalar, label > > nearInfo
Helper class for finding nearest.
bool sameRegion() const noexcept
Cached sampleRegion != mesh.name()
const word & coupleGroup() const
PatchGroup (only if NEARESTPATCHFACE)
nearest cell containing sample
const T2 & second() const noexcept
Access the second element.
Definition: Tuple2.H:142
sampleMode
Mesh items to sample.
nearest cell (even if not containing cell)
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
const word & sampleWorld() const noexcept
World to sample.
const bool AMIReverse_
Flag to indicate that slave patch should be reversed for AMI.
static void readDict(const dictionary &d, objectRegistry &obr)
(recursively) construct and register IOFields from dictionary
static bool writeIOField(const regIOobject &obj, dictionary &dict)
Attempt to detect an IOField<Type> and write to dictionary.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:66
const word & samplePatch() const
Patch (only if NEARESTPATCHFACE)
void reverseDistribute(List< Type > &lst) const
Wrapper around map/interpolate data distribution.
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:74
void collectSamples(const label mySampleWorld, const pointField &facePoints, pointField &samples, labelList &patchFaceWorlds, labelList &patchFaceProcs, labelList &patchFaces, pointField &patchFc) const
Collect single list of samples and originating processor+face + wanted world.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Registry of regIOobjects.
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:69
const T1 & first() const noexcept
Access the first element.
Definition: Tuple2.H:132
const word & sampleRegion() const
Region to sample.
label communicator_
Communicator.
const polyPatch & samplePolyPatch() const
Get the patch on the region.
static void storeField(objectRegistry &obr, const word &fieldName, const Field< Type > &values)
Store an IOField on the objectRegistry relative to obr.
bool addWorldConnection()
Add a world-world connection.
mappedPatchBase(const polyPatch &)
Construct from patch.
void findLocalSamples(const sampleMode mode, const label sampleWorld, const word &sampleRegion, const word &samplePatch, const pointField &samplePoints, List< nearInfoWorld > &nearest) const
Find (local) cells/faces containing samples.
const vectorField & offsets() const noexcept
Offset vectors (from patch faces to destination mesh objects)
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
Namespace for OpenFOAM.
const sampleMode mode_
What to sample.