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  // polyPatch callbacks
305 
306  //- Initialise the calculation of the patch geometry
307  virtual void initGeometry(PstreamBuffers&)
308  {}
309 
310  //- Calculate the patch geometry
311  virtual void calcGeometry(PstreamBuffers&)
312  {}
313 
314  //- Initialise the patches for moving points
315  virtual void initMovePoints(PstreamBuffers&, const pointField&)
316  {}
317 
318  //- Correct patches after moving points
319  virtual void movePoints(PstreamBuffers&, const pointField&)
320  {}
322  //- Initialise the update of the patch topology
323  virtual void initUpdateMesh(PstreamBuffers&)
324  {}
325 
326  //- Update of the patch topology
327  virtual void updateMesh(PstreamBuffers&);
328 
329 
330  //- Add a world-world connection
332 
333  //- Get the communicator for the world-world connection
334  label getWorldCommunicator() const;
335 
336  //- Lookup mesh
337  const polyMesh& lookupMesh(const word& region) const;
338 
339  //- Lookup patch
340  const polyPatch& lookupPatch
341  (
342  const word& sampleRegion,
343  const word& samplePatch
344  ) const;
346 
347  //- Get the points from face-centre-decomposition face centres
348  //- and project them onto the face-diagonal-decomposition triangles.
349  tmp<pointField> facePoints(const polyPatch&) const;
350 
351  //- Collect single list of samples and originating processor+face +
352  //- wanted world
353  void collectSamples
354  (
355  const label mySampleWorld, // My wanted sampling world
356  const pointField& facePoints,
357  pointField& samples, // Per sample: coordinate
358  labelList& patchFaceWorlds, // Per sample: wanted world
359  labelList& patchFaceProcs, // Per sample: originating proc
360  labelList& patchFaces, // Per sample: originating face
361  pointField& patchFc
362  ) const;
363 
364  //- Find (local) cells/faces containing samples
365  void findLocalSamples
366  (
368  const label sampleWorld, // my world as index
369  const word& sampleRegion,
370  const word& samplePatch,
371  const pointField& samplePoints,
372 
374  ) const;
375 
376  //- Find (global) cells/faces containing samples
377  void findSamples
378  (
379  const sampleMode mode, // search mode
380  const label myWorldIndex, // my world (in index form)
381 
382  const pointField&,
383  const labelList& wantedWorlds,
384  const labelList& origProcs, // per sample the originating proc
385 
386  labelList& sampleProcs, // processor containing sample
387  labelList& sampleIndices, // local index of cell/face
388  pointField& sampleLocations // actual representative location
389  ) const;
390 
391  //- Get the sample points given the face points
393 
394  //- Calculate mapping
395  void calcMapping() const;
396 
397  //- Calculate AMI interpolator
398  void calcAMI() const;
399 
400 
401  // Database Handling
402 
403  //- Read optional database name from dictionary
405 
406  //- Lookup (sub)objectRegistry by following names of sub registries.
407  //- Creates non-existing intermediate ones.
408  static const objectRegistry& subRegistry
409  (
410  const objectRegistry& obr,
411  const wordList& names,
412  const label index
413  );
414 
415  //- Attempt to detect an IOField<Type> and write to dictionary
416  template<class Type>
417  static bool writeIOField
418  (
419  const regIOobject& obj,
421  );
422 
423  //- Attempt to read an IOField<Type> and store on objectRegistry
424  template<class Type>
425  static bool constructIOField
426  (
427  const word& name,
428  token& tok,
429  Istream& is,
430  objectRegistry& obr
431  );
432 
433 public:
434 
435  //- Runtime type information
436  TypeName("mappedPatchBase");
437 
438 
439  // Constructors
440 
441  //- Construct from patch
442  explicit mappedPatchBase(const polyPatch&);
443 
444  //- Construct with offsetMode=non-uniform
446  (
447  const polyPatch& pp,
448  const word& sampleRegion,
449  const sampleMode sampleMode,
450  const word& samplePatch,
451  const vectorField& offsets
452  );
453 
454  //- Construct from offsetMode=uniform
456  (
457  const polyPatch& pp,
458  const word& sampleRegion,
459  const sampleMode sampleMode,
460  const word& samplePatch,
461  const vector& uniformOffset
462  );
463 
464  //- Construct from offsetMode=normal and distance
466  (
467  const polyPatch& pp,
468  const word& sampleRegion,
469  const sampleMode sampleMode,
470  const word& samplePatch,
471  const scalar normalDistance
472  );
473 
474  //- Construct from dictionary
475  mappedPatchBase(const polyPatch&, const dictionary&);
476 
477  //- Construct from dictionary and (collocated) sample mode
478  // (only for nearestPatchFace, nearestPatchFaceAMI, nearestPatchPoint)
479  // Assumes zero offset.
480  mappedPatchBase(const polyPatch&, const sampleMode, const dictionary&);
481 
482  //- Construct as copy, resetting patch
483  mappedPatchBase(const polyPatch&, const mappedPatchBase&);
484 
485  //- Construct as copy, resetting patch, map original data
487  (
488  const polyPatch&,
489  const mappedPatchBase&,
490  const labelUList& mapAddressing
491  );
492 
493 
494  //- Destructor
495  virtual ~mappedPatchBase();
496 
497 
498  // Member Functions
499 
500  // Edit
501 
502  void clearOut();
503 
504  //- Change to normal offset with given distance
505  void setOffset(const scalar normalDist);
506 
507  //- Change to uniform offset with value
508  void setOffset(const vector& uniformOffset);
509 
510  //- Change to non-uniform offsets
511  void setOffset(const vectorField& offsets);
512 
513 
514  // Access
515 
516  //- What to sample
517  inline sampleMode mode() const noexcept;
518 
519  //- World to sample
520  inline const word& sampleWorld() const noexcept;
521 
522  //- Region to sample
523  inline const word& sampleRegion() const;
524 
525  //- Patch (only if NEARESTPATCHFACE)
526  inline const word& samplePatch() const;
527 
528  //- PatchGroup (only if NEARESTPATCHFACE)
529  inline const word& coupleGroup() const;
530 
531  //- Return size of mapped mesh/patch/boundary
532  inline label sampleSize() const;
533 
534  //- Offset vector (from patch faces to destination mesh objects)
535  inline const vector& offset() const noexcept;
536 
537  //- Offset vectors (from patch faces to destination mesh objects)
538  inline const vectorField& offsets() const noexcept;
539 
540  //- Get the communicator (worldComm or world-to-world)
541  inline label getCommunicator() const;
542 
543  //- Identical to getCommunicator()
544  inline label comm() const;
545 
546  //- Is sample world the local world?
547  inline bool sameWorld() const;
548 
549  //- Is my world ordered before the sampleWorld?
550  inline bool masterWorld() const;
551 
552  //- Cached sampleRegion != mesh.name()
553  inline bool sameRegion() const noexcept;
554 
555  //- Local mesh update time
557 
558  //- Sample mesh upate time
560 
561  bool upToDate() const;
562 
563  //- Return reference to the parallel distribution map
564  inline const mapDistribute& map() const;
565 
566  //- Return reference to the AMI interpolator
567  inline const AMIPatchToPatchInterpolation& AMI
568  (
569  const bool forceUpdate = false
570  ) const;
571 
572  //- Is it owner
573  inline bool owner() const;
574 
575  //- Return a pointer to the AMI projection surface
576  const autoPtr<Foam::searchableSurface>& surfPtr() const;
577 
578  //- Get the region mesh
579  const polyMesh& sampleMesh() const;
580 
581  //- Get the patch on the region
582  const polyPatch& samplePolyPatch() const;
583 
584 
585  // Helpers
586 
587  //- Get the sample points
588  tmp<pointField> samplePoints() const;
589 
590  //- Get a point on the face given a face decomposition method:
591  // face-centre-tet : face centre. Returns index of face.
592  // face-planes : face centre. Returns index of face.
593  // face-diagonal : intersection of ray from cellcentre to
594  // facecentre with any of the triangles.
595  // Returns index (0..size-2) of triangle.
596  static pointIndexHit facePoint
597  (
598  const polyMesh&,
599  const label facei,
600  const polyMesh::cellDecomposition
601  );
602 
603 
604  // For database storage
605 
606  inline const fileName& sampleDatabasePath() const
607  {
608  return *sampleDatabasePtr_;
609  }
610 
611  inline bool sampleDatabase() const
612  {
613  return bool(sampleDatabasePtr_);
614  }
615 
616  //- Helper: return path to store data to be sent to processor i
617  static fileName sendPath(const fileName& root, const label proci);
618 
619  virtual fileName sendPath(const label proci) const;
620 
621  //- Helper: return path to store data to be received from
622  //- processor i
623  static fileName receivePath
624  (
625  const fileName& root,
626  const label proci
627  );
628 
629  virtual fileName receivePath(const label proci) const;
630 
631  //- Lookup (sub)objectRegistry from '/' separated path (relative to
632  //- objectRegistry). Creates non-existing intermediate ones.
633  static const objectRegistry& subRegistry
634  (
635  const objectRegistry& obr,
636  const fileName& path
637  );
638 
639  //- Store an IOField on the objectRegistry relative to obr
640  template<class Type>
641  static void storeField
642  (
643  objectRegistry& obr,
644  const word& fieldName,
645  const Field<Type>& values
646  );
647 
648  //- Convert objectRegistry contents into dictionary
649  static void writeDict
650  (
651  const objectRegistry& obr,
652  dictionary& dict
653  );
654 
655  //- (recursively) construct and register IOFields from dictionary
656  static void readDict(const dictionary& d, objectRegistry& obr);
657 
658 
659  // Distribute
660 
661  //- Wrapper around map/interpolate data distribution
662  template<class Type>
663  void distribute(List<Type>& lst) const;
664 
665  //- Wrapper around map/interpolate data distribution with operation
666  template<class Type, class CombineOp>
667  void distribute(List<Type>& lst, const CombineOp& cop) const;
668 
669  //- Wrapper around map/interpolate data distribution
670  template<class Type>
671  void reverseDistribute(List<Type>& lst) const;
672 
673  //- Wrapper around map/interpolate data distribution with operation
674  template<class Type, class CombineOp>
675  void reverseDistribute(List<Type>& lst, const CombineOp& cop) const;
676 
677 
678  // I/O
679 
680  //- Write as a dictionary
681  virtual void write(Ostream& os) const;
682 };
683 
684 
685 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
686 
687 } // End namespace Foam
688 
689 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
690 
691 #include "mappedPatchBaseI.H"
692 
693 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
694 
695 #ifdef NoRepository
696  #include "mappedPatchBaseTemplates.C"
697 #endif
698 
699 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
700 
701 #endif
702 
703 // ************************************************************************* //
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.
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:38
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_
virtual void initGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
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.
virtual void initMovePoints(PstreamBuffers &, const pointField &)
Initialise the patches for moving points.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
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.
virtual void movePoints(PstreamBuffers &, const pointField &)
Correct patches after moving points.
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:68
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:75
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.
virtual void updateMesh(PstreamBuffers &)
Update of the patch topology.
const polyPatch & samplePolyPatch() const
Get the patch on the region.
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
virtual void initUpdateMesh(PstreamBuffers &)
Initialise the update of the patch topology.
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.