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"
99 
100 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
101 
102 namespace Foam
103 {
104 
105 class polyPatch;
106 class polyMesh;
107 class mapDistribute;
108 
109 /*---------------------------------------------------------------------------*\
110  Class mappedPatchBase Declaration
111 \*---------------------------------------------------------------------------*/
112 
113 class mappedPatchBase
114 {
115 public:
116 
117  // Type enumerations
118 
119  //- Mesh items to sample
120  enum sampleMode
121  {
128  };
129 
130  //- How to project face centres
131  enum offsetMode
132  {
135  NORMAL
136  };
137 
138  static const Enum<sampleMode> sampleModeNames_;
139 
140  static const Enum<offsetMode> offsetModeNames_;
141 
142 
143  //- Helper class for finding nearest
144  // Nearest:
145  // - point+local index
146  // - sqr(distance)
147  // - processor
149 
150  class nearestEqOp
151  {
152  public:
153 
154  void operator()(nearInfo& x, const nearInfo& y) const
155  {
156  if (y.first().hit())
157  {
158  if (!x.first().hit())
159  {
160  x = y;
161  }
162  else if (y.second().first() < x.second().first())
163  {
164  x = y;
165  }
166  }
167  }
168  };
169 
170  class maxProcEqOp
171  {
172  public:
173 
174  void operator()(nearInfo& x, const nearInfo& y) const
175  {
176  if (y.first().hit())
177  {
178  if (!x.first().hit())
179  {
180  x = y;
181  }
182  else if (y.second().second() > x.second().second())
183  {
184  x = y;
185  }
186  }
187  }
188  };
189 
190 
191  //- nearest + world
192  // Used to only look at entries from same world
194 
195  class nearestWorldEqOp
196  {
197  public:
198 
199  void operator()(nearInfoWorld& x, const nearInfoWorld& y) const
200  {
201  // Is there a hit and is it sampling the same world
202  const nearInfo& xi = x.first();
203  const nearInfo& yi = y.first();
204  if (yi.first().hit())
205  {
206  if (x.second() == y.second())
207  {
208  if (!xi.first().hit())
209  {
210  x = y;
211  }
212  else if (yi.second().first() < xi.second().first())
213  {
214  x = y;
215  }
216  }
217  }
218  }
219  };
220 
221 
222 protected:
223 
224  // Protected Data
225 
226  //- Patch to sample
227  const polyPatch& patch_;
228 
229  //- World to sample
230  mutable word sampleWorld_;
231 
232  //- Region to sample
233  mutable word sampleRegion_;
234 
235  //- What to sample
236  const sampleMode mode_;
237 
238  //- Patch (if in sampleMode NEARESTPATCH*)
239  mutable word samplePatch_;
240 
241  //- PatchGroup (if in sampleMode NEARESTPATCH*)
243 
244  //- Empty or location of database
246 
247  //- How to obtain samples
249 
250  //- Offset vector (uniform)
251  vector offset_;
252 
253  //- Offset vector (nonuniform)
255 
256  //- Offset distance (normal)
257  scalar distance_;
258 
259  //- Communicator
260  label communicator_;
261 
262  //- Same region
263  mutable bool sameRegion_;
264 
265 
266  // Derived information
267 
268  //- Communication schedule:
269  //
270  // - Cells/faces to sample per processor
271  // - Patch faces to receive per processor
272  // - schedule
274 
275 
276  // AMI interpolator (only for NEARESTPATCHFACEAMI)
277 
278  //- Flag to indicate that slave patch should be reversed for AMI
279  const bool AMIReverse_;
280 
281  //- Pointer to AMI interpolator
283 
284  //- Pointer to projection surface employed by AMI interpolator
286 
287  //- Dictionary storing projection surface description
289 
290 
291  // Protected Member Functions
292 
293  //- Add a world-world connection
294  bool addWorldConnection();
295 
296  //- Get the communicator for the world-world connection
297  label getWorldCommunicator() const;
298 
299  //- Lookup mesh
300  const polyMesh& lookupMesh(const word& region) const;
301 
302  //- Lookup patch
303  const polyPatch& lookupPatch
304  (
305  const word& sampleRegion,
306  const word& samplePatch
307  ) const;
308 
309 
310  //- Get the points from face-centre-decomposition face centres
311  //- and project them onto the face-diagonal-decomposition triangles.
312  tmp<pointField> facePoints(const polyPatch&) const;
313 
314  //- Collect single list of samples and originating processor+face +
315  //- wanted world
316  void collectSamples
317  (
318  const label mySampleWorld, // My wanted sampling world
319  const pointField& facePoints,
320  pointField& samples, // Per sample: coordinate
321  labelList& patchFaceWorlds, // Per sample: wanted world
322  labelList& patchFaceProcs, // Per sample: originating proc
323  labelList& patchFaces, // Per sample: originating face
324  pointField& patchFc
325  ) const;
326 
327  //- Find (local) cells/faces containing samples
328  void findLocalSamples
329  (
330  const sampleMode mode,
331  const label sampleWorld, // my world as index
332  const word& sampleRegion,
333  const word& samplePatch,
334  const pointField& samplePoints,
335 
336  List<nearInfoWorld>& nearest
337  ) const;
338 
339  //- Find (global) cells/faces containing samples
340  void findSamples
341  (
342  const sampleMode mode, // search mode
343  const label myWorldIndex, // my world (in index form)
344 
345  const pointField&,
346  const labelList& wantedWorlds,
347  const labelList& origProcs, // per sample the originating proc
348 
349  labelList& sampleProcs, // processor containing sample
350  labelList& sampleIndices, // local index of cell/face
351  pointField& sampleLocations // actual representative location
352  ) const;
353 
354  //- Get the sample points given the face points
356 
357  //- Calculate mapping
358  void calcMapping() const;
359 
360  //- Calculate AMI interpolator
361  void calcAMI() const;
362 
363 
364  // Database Handling
365 
366  //- Read optional database name from dictionary
368 
369  //- Lookup (sub)objectRegistry by following names of sub registries.
370  //- Creates non-existing intermediate ones.
371  static const objectRegistry& subRegistry
372  (
373  const objectRegistry& obr,
374  const wordList& names,
375  const label index
376  );
377 
378  //- Attempt to detect an IOField<Type> and write to dictionary
379  template<class Type>
380  static bool writeIOField
381  (
382  const regIOobject& obj,
384  );
385 
386  //- Attempt to read an IOField<Type> and store on objectRegistry
387  template<class Type>
388  static bool constructIOField
389  (
390  const word& name,
391  token& tok,
392  Istream& is,
393  objectRegistry& obr
394  );
395 
396 public:
397 
398  //- Runtime type information
399  TypeName("mappedPatchBase");
400 
401 
402  // Constructors
403 
404  //- Construct from patch
405  explicit mappedPatchBase(const polyPatch&);
406 
407  //- Construct with offsetMode=non-uniform
409  (
410  const polyPatch& pp,
411  const word& sampleRegion,
412  const sampleMode sampleMode,
413  const word& samplePatch,
414  const vectorField& offsets
415  );
416 
417  //- Construct from offsetMode=uniform
419  (
420  const polyPatch& pp,
421  const word& sampleRegion,
422  const sampleMode sampleMode,
423  const word& samplePatch,
424  const vector& uniformOffset
425  );
426 
427  //- Construct from offsetMode=normal and distance
429  (
430  const polyPatch& pp,
431  const word& sampleRegion,
432  const sampleMode sampleMode,
433  const word& samplePatch,
434  const scalar normalDistance
435  );
436 
437  //- Construct from dictionary
438  mappedPatchBase(const polyPatch&, const dictionary&);
439 
440  //- Construct from dictionary and (collocated) sample mode
441  // (only for nearestPatchFace, nearestPatchFaceAMI, nearestPatchPoint)
442  // Assumes zero offset.
443  mappedPatchBase(const polyPatch&, const sampleMode, const dictionary&);
444 
445  //- Construct as copy, resetting patch
446  mappedPatchBase(const polyPatch&, const mappedPatchBase&);
447 
448  //- Construct as copy, resetting patch, map original data
450  (
451  const polyPatch&,
452  const mappedPatchBase&,
453  const labelUList& mapAddressing
454  );
455 
456 
457  //- Destructor
458  virtual ~mappedPatchBase();
459 
460 
461  // Member Functions
462 
463  // Edit
464 
465  void clearOut();
466 
467  //- Change to normal offset with given distance
468  void setOffset(const scalar normalDist);
469 
470  //- Change to uniform offset with value
471  void setOffset(const vector& uniformOffset);
472 
473  //- Change to non-uniform offsets
474  void setOffset(const vectorField& offsets);
475 
476 
477  // Access
478 
479  //- What to sample
480  inline sampleMode mode() const noexcept;
481 
482  //- World to sample
483  inline const word& sampleWorld() const noexcept;
484 
485  //- Region to sample
486  inline const word& sampleRegion() const;
487 
488  //- Patch (only if NEARESTPATCHFACE)
489  inline const word& samplePatch() const;
490 
491  //- PatchGroup (only if NEARESTPATCHFACE)
492  inline const word& coupleGroup() const;
493 
494  //- Return size of mapped mesh/patch/boundary
495  inline label sampleSize() const;
496 
497  //- Offset vector (from patch faces to destination mesh objects)
498  inline const vector& offset() const noexcept;
499 
500  //- Offset vectors (from patch faces to destination mesh objects)
501  inline const vectorField& offsets() const noexcept;
502 
503  //- Get the communicator (worldComm or world-to-world)
504  inline label getCommunicator() const;
505 
506  //- Identical to getCommunicator()
507  inline label comm() const;
508 
509  //- Is sample world the local world?
510  inline bool sameWorld() const;
511 
512  //- Is my world ordered before the sampleWorld?
513  inline bool masterWorld() const;
514 
515  //- Cached sampleRegion != mesh.name()
516  inline bool sameRegion() const noexcept;
517 
518  //- Return reference to the parallel distribution map
519  inline const mapDistribute& map() const;
520 
521  //- Return reference to the AMI interpolator
522  inline const AMIPatchToPatchInterpolation& AMI
523  (
524  const bool forceUpdate = false
525  ) const;
526 
527  //- Is it owner
528  inline bool owner() const;
529 
530  //- Return a pointer to the AMI projection surface
531  const autoPtr<Foam::searchableSurface>& surfPtr() const;
532 
533  //- Get the region mesh
534  const polyMesh& sampleMesh() const;
535 
536  //- Get the patch on the region
537  const polyPatch& samplePolyPatch() const;
538 
539 
540  // Helpers
541 
542  //- Get the sample points
543  tmp<pointField> samplePoints() const;
544 
545  //- Get a point on the face given a face decomposition method:
546  // face-centre-tet : face centre. Returns index of face.
547  // face-planes : face centre. Returns index of face.
548  // face-diagonal : intersection of ray from cellcentre to
549  // facecentre with any of the triangles.
550  // Returns index (0..size-2) of triangle.
551  static pointIndexHit facePoint
552  (
553  const polyMesh&,
554  const label facei,
555  const polyMesh::cellDecomposition
556  );
557 
558 
559  // For database storage
560 
561  inline const fileName& sampleDatabasePath() const
562  {
563  return *sampleDatabasePtr_;
564  }
565 
566  inline bool sampleDatabase() const
567  {
568  return bool(sampleDatabasePtr_);
569  }
570 
571  //- Helper: return path to store data to be sent to processor i
572  static fileName sendPath(const fileName& root, const label proci);
573 
574  virtual fileName sendPath(const label proci) const;
575 
576  //- Helper: return path to store data to be received from
577  //- processor i
578  static fileName receivePath
579  (
580  const fileName& root,
581  const label proci
582  );
583 
584  virtual fileName receivePath(const label proci) const;
585 
586  //- Lookup (sub)objectRegistry from '/' separated path (relative to
587  //- objectRegistry). Creates non-existing intermediate ones.
588  static const objectRegistry& subRegistry
589  (
590  const objectRegistry& obr,
591  const fileName& path
592  );
593 
594  //- Store an IOField on the objectRegistry relative to obr
595  template<class Type>
596  static void storeField
597  (
598  objectRegistry& obr,
599  const word& fieldName,
600  const Field<Type>& values
601  );
602 
603  //- Convert objectRegistry contents into dictionary
604  static void writeDict
605  (
606  const objectRegistry& obr,
608  );
609 
610  //- (recursively) construct and register IOFields from dictionary
611  static void readDict(const dictionary& d, objectRegistry& obr);
612 
613 
614  // Distribute
615 
616  //- Wrapper around map/interpolate data distribution
617  template<class Type>
618  void distribute(List<Type>& lst) const;
619 
620  //- Wrapper around map/interpolate data distribution with operation
621  template<class Type, class CombineOp>
622  void distribute(List<Type>& lst, const CombineOp& cop) const;
623 
624  //- Wrapper around map/interpolate data distribution
625  template<class Type>
626  void reverseDistribute(List<Type>& lst) const;
627 
628  //- Wrapper around map/interpolate data distribution with operation
629  template<class Type, class CombineOp>
630  void reverseDistribute(List<Type>& lst, const CombineOp& cop) const;
631 
632 
633  // I/O
634 
635  //- Write as a dictionary
636  virtual void write(Ostream& os) const;
637 };
638 
639 
640 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
641 
642 } // End namespace Foam
643 
644 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
645 
646 #include "mappedPatchBaseI.H"
647 
648 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
649 
650 #ifdef NoRepository
651  #include "mappedPatchBaseTemplates.C"
652 #endif
653 
654 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
655 
656 #endif
657 
658 // ************************************************************************* //
Foam::coupleGroupIdentifier
Encapsulates using "patchGroups" to specify coupled patch.
Definition: coupleGroupIdentifier.H:57
Foam::mappedPatchBase::clearOut
void clearOut()
Definition: mappedPatchBase.C:1573
Foam::Enum< sampleMode >
Foam::mappedPatchBase::communicator_
label communicator_
Communicator.
Definition: mappedPatchBase.H:259
pointIndexHit.H
Foam::mappedPatchBase::sendPath
static fileName sendPath(const fileName &root, const label proci)
Helper: return path to store data to be sent to processor i.
Definition: mappedPatchBase.C:1828
Foam::mappedPatchBase::readDict
static void readDict(const dictionary &d, objectRegistry &obr)
(recursively) construct and register IOFields from dictionary
Definition: mappedPatchBase.C:1901
Foam::mappedPatchBase::UNIFORM
single offset vector
Definition: mappedPatchBase.H:132
Foam::mappedPatchBase::AMIReverse_
const bool AMIReverse_
Flag to indicate that slave patch should be reversed for AMI.
Definition: mappedPatchBase.H:278
Foam::mappedPatchBase::writeIOField
static bool writeIOField(const regIOobject &obj, dictionary &dict)
Attempt to detect an IOField<Type> and write to dictionary.
Definition: mappedPatchBaseTemplates.C:225
Foam::mappedPatchBase::subRegistry
static const objectRegistry & subRegistry(const objectRegistry &obr, const wordList &names, const label index)
Definition: mappedPatchBase.C:1195
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::fileName
A class for handling file names.
Definition: fileName.H:73
Foam::mappedPatchBase::NEARESTPATCHFACEAMI
nearest patch face + AMI interpolation
Definition: mappedPatchBase.H:123
Foam::mappedPatchBase::setOffset
void setOffset(const scalar normalDist)
Change to normal offset with given distance.
Definition: mappedPatchBase.C:1583
Foam::mappedPatchBase::offsets
const vectorField & offsets() const noexcept
Offset vectors (from patch faces to destination mesh objects)
Definition: mappedPatchBaseI.H:141
Tuple2.H
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::mappedPatchBase::map
const mapDistribute & map() const
Return reference to the parallel distribution map.
Definition: mappedPatchBaseI.H:199
Foam::HashTableOps::values
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
Definition: HashOps.H:149
Foam::mappedPatchBase::NEARESTFACE
nearest face
Definition: mappedPatchBase.H:125
Foam::mappedPatchBase::sampleWorld_
word sampleWorld_
World to sample.
Definition: mappedPatchBase.H:229
Foam::mappedPatchBase::samplePolyPatch
const polyPatch & samplePolyPatch() const
Get the patch on the region.
Definition: mappedPatchBase.C:1662
coupleGroupIdentifier.H
Foam::mappedPatchBase::NEARESTPATCHPOINT
nearest point on selected patch
Definition: mappedPatchBase.H:124
Foam::mappedPatchBase::storeField
static void storeField(objectRegistry &obr, const word &fieldName, const Field< Type > &values)
Store an IOField on the objectRegistry relative to obr.
Definition: mappedPatchBaseTemplates.C:315
Foam::mappedPatchBase::mappedPatchBase
mappedPatchBase(const polyPatch &)
Construct from patch.
Definition: mappedPatchBase.C:1215
Foam::mappedPatchBase::lookupMesh
const polyMesh & lookupMesh(const word &region) const
Lookup mesh.
Definition: mappedPatchBase.C:1614
Foam::mappedPatchBase::offset_
vector offset_
Offset vector (uniform)
Definition: mappedPatchBase.H:250
Foam::mappedPatchBase::findLocalSamples
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.
Definition: mappedPatchBase.C:280
mappedPatchBaseTemplates.C
Foam::mappedPatchBase::mode_
const sampleMode mode_
What to sample.
Definition: mappedPatchBase.H:235
Foam::mappedPatchBase::offsetModeNames_
static const Enum< offsetMode > offsetModeNames_
Definition: mappedPatchBase.H:139
Foam::mappedPatchBase::writeDict
static void writeDict(const objectRegistry &obr, dictionary &dict)
Convert objectRegistry contents into dictionary.
Definition: mappedPatchBase.C:1862
Foam::token
A token holds an item read from Istream.
Definition: token.H:68
Foam::mappedPatchBase::sameWorld
bool sameWorld() const
Is sample world the local world?
Definition: mappedPatchBaseI.H:169
Foam::mappedPatchBase::findSamples
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.
Definition: mappedPatchBase.C:587
Foam::mappedPatchBase::sampleDatabase
bool sampleDatabase() const
Definition: mappedPatchBase.H:565
Foam::mappedPatchBase::samplePatch_
word samplePatch_
Patch (if in sampleMode NEARESTPATCH*)
Definition: mappedPatchBase.H:238
Foam::mappedPatchBase::nearInfoWorld
Tuple2< nearInfo, label > nearInfoWorld
nearest + world
Definition: mappedPatchBase.H:192
Foam::mappedPatchBase
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
Definition: mappedPatchBase.H:112
Foam::mappedPatchBase::nearestEqOp
Definition: mappedPatchBase.H:149
Foam::mappedPatchBase::NEARESTONLYCELL
nearest cell (even if not containing cell)
Definition: mappedPatchBase.H:126
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::mappedPatchBase::coupleGroup_
const coupleGroupIdentifier coupleGroup_
PatchGroup (if in sampleMode NEARESTPATCH*)
Definition: mappedPatchBase.H:241
Foam::mappedPatchBase::~mappedPatchBase
virtual ~mappedPatchBase()
Destructor.
Definition: mappedPatchBase.C:1567
Foam::mappedPatchBase::nearestWorldEqOp::operator()
void operator()(nearInfoWorld &x, const nearInfoWorld &y) const
Definition: mappedPatchBase.H:198
Foam::mappedPatchBase::sampleModeNames_
static const Enum< sampleMode > sampleModeNames_
Definition: mappedPatchBase.H:137
Foam::mappedPatchBase::surfPtr
const autoPtr< Foam::searchableSurface > & surfPtr() const
Return a pointer to the AMI projection surface.
Definition: mappedPatchBase.C:1061
Foam::mappedPatchBase::constructIOField
static bool constructIOField(const word &name, token &tok, Istream &is, objectRegistry &obr)
Attempt to read an IOField<Type> and store on objectRegistry.
Definition: mappedPatchBaseTemplates.C:260
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
Foam::mappedPatchBase::mapPtr_
autoPtr< mapDistribute > mapPtr_
Communication schedule:
Definition: mappedPatchBase.H:272
Foam::mappedPatchBase::sampleRegion_
word sampleRegion_
Region to sample.
Definition: mappedPatchBase.H:232
Foam::mappedPatchBase::nearestWorldEqOp
Definition: mappedPatchBase.H:194
Foam::mappedPatchBase::samplePoints
tmp< pointField > samplePoints() const
Get the sample points.
Definition: mappedPatchBase.C:1716
Foam::mappedPatchBase::nearestEqOp::operator()
void operator()(nearInfo &x, const nearInfo &y) const
Definition: mappedPatchBase.H:153
Foam::mappedPatchBase::sampleSize
label sampleSize() const
Return size of mapped mesh/patch/boundary.
Definition: mappedPatchBaseI.H:100
Foam::mappedPatchBase::sampleMesh
const polyMesh & sampleMesh() const
Get the region mesh.
Definition: mappedPatchBase.C:1649
Foam::PointIndexHit
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
Definition: PointIndexHit.H:52
Foam::mappedPatchBase::surfPtr_
autoPtr< searchableSurface > surfPtr_
Pointer to projection surface employed by AMI interpolator.
Definition: mappedPatchBase.H:284
Foam::Field< vector >
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::mappedPatchBase::getCommunicator
label getCommunicator() const
Get the communicator (worldComm or world-to-world)
Definition: mappedPatchBaseI.H:147
Foam::mappedPatchBase::comm
label comm() const
Identical to getCommunicator()
Definition: mappedPatchBaseI.H:158
Foam::mappedPatchBase::distribute
void distribute(List< Type > &lst) const
Wrapper around map/interpolate data distribution.
Definition: mappedPatchBaseTemplates.C:30
Foam::searchableSurface
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
Definition: searchableSurface.H:69
Foam::mapDistribute
Class containing processor-to-processor mapping information.
Definition: mapDistribute.H:163
Foam::mappedPatchBase::mode
sampleMode mode() const noexcept
What to sample.
Definition: mappedPatchBaseI.H:30
Foam::mappedPatchBase::nearInfo
Tuple2< pointIndexHit, Tuple2< scalar, label > > nearInfo
Helper class for finding nearest.
Definition: mappedPatchBase.H:147
samples
scalarField samples(nIntervals, Zero)
Foam::mappedPatchBase::sameRegion
bool sameRegion() const noexcept
Cached sampleRegion != mesh.name()
Definition: mappedPatchBaseI.H:193
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::mappedPatchBase::offsets_
vectorField offsets_
Offset vector (nonuniform)
Definition: mappedPatchBase.H:253
AMIPatchToPatchInterpolation.H
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
Foam::mappedPatchBase::receivePath
static fileName receivePath(const fileName &root, const label proci)
Definition: mappedPatchBase.C:1845
Foam::mappedPatchBase::distance_
scalar distance_
Offset distance (normal)
Definition: mappedPatchBase.H:256
Foam::mappedPatchBase::calcAMI
void calcAMI() const
Calculate AMI interpolator.
Definition: mappedPatchBase.C:1093
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::mappedPatchBase::masterWorld
bool masterWorld() const
Is my world ordered before the sampleWorld?
Definition: mappedPatchBaseI.H:180
Foam::mappedPatchBase::collectSamples
void collectSamples(const label mySampleWorld, const pointField &facePoints, pointField &samples, labelList &patchFaceWorlds, labelList &patchFaceProcs, labelList &patchFaces, pointField &patchFc) const
Definition: mappedPatchBase.C:180
Foam::mappedPatchBase::coupleGroup
const word & coupleGroup() const
PatchGroup (only if NEARESTPATCHFACE)
Definition: mappedPatchBaseI.H:94
Foam::mappedPatchBase::sampleRegion
const word & sampleRegion() const
Region to sample.
Definition: mappedPatchBaseI.H:42
Foam::mappedPatchBase::sampleWorld
const word & sampleWorld() const noexcept
World to sample.
Definition: mappedPatchBaseI.H:36
Foam::mappedPatchBase::maxProcEqOp::operator()
void operator()(nearInfo &x, const nearInfo &y) const
Definition: mappedPatchBase.H:173
Foam::mappedPatchBase::TypeName
TypeName("mappedPatchBase")
Runtime type information.
pointField.H
Foam::mappedPatchBase::calcMapping
void calcMapping() const
Calculate mapping.
Definition: mappedPatchBase.C:735
Foam::mappedPatchBase::addWorldConnection
bool addWorldConnection()
Add a world-world connection.
Definition: mappedPatchBase.C:123
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::regIOobject
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:73
Foam::mappedPatchBase::NEARESTPATCHFACE
nearest face on selected patch
Definition: mappedPatchBase.H:122
Foam::mappedPatchBase::sampleDatabasePtr_
const autoPtr< fileName > sampleDatabasePtr_
Empty or location of database.
Definition: mappedPatchBase.H:244
Foam::Vector< scalar >
Foam::List< label >
Foam::AMIInterpolation
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
Definition: AMIInterpolation.H:79
Foam::mappedPatchBase::AMI
const AMIPatchToPatchInterpolation & AMI(const bool forceUpdate=false) const
Return reference to the AMI interpolator.
Definition: mappedPatchBaseI.H:221
Foam::UList< label >
Foam::mappedPatchBase::write
virtual void write(Ostream &os) const
Write as a dictionary.
Definition: mappedPatchBase.C:1942
path
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
bool
bool
Definition: EEqn.H:20
x
x
Definition: LISASMDCalcMethod2.H:52
Foam::mappedPatchBase::offsetMode_
offsetMode offsetMode_
How to obtain samples.
Definition: mappedPatchBase.H:247
Foam::mappedPatchBase::readDatabase
static autoPtr< fileName > readDatabase(const dictionary &dict)
Read optional database name from dictionary.
Definition: mappedPatchBase.C:90
Foam::mappedPatchBase::NEARESTCELL
nearest cell containing sample
Definition: mappedPatchBase.H:121
Foam::Tuple2::second
const T2 & second() const noexcept
Return second.
Definition: Tuple2.H:130
Foam::mappedPatchBase::offsetMode
offsetMode
How to project face centres.
Definition: mappedPatchBase.H:130
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
mappedPatchBaseI.H
Foam::mappedPatchBase::facePoints
tmp< pointField > facePoints(const polyPatch &) const
Definition: mappedPatchBase.C:152
Foam::mappedPatchBase::getWorldCommunicator
label getWorldCommunicator() const
Get the communicator for the world-world connection.
Definition: mappedPatchBase.C:138
Foam::mappedPatchBase::surfDict_
dictionary surfDict_
Dictionary storing projection surface description.
Definition: mappedPatchBase.H:287
Foam::mappedPatchBase::maxProcEqOp
Definition: mappedPatchBase.H:169
Foam::mappedPatchBase::AMIPtr_
autoPtr< AMIPatchToPatchInterpolation > AMIPtr_
Pointer to AMI interpolator.
Definition: mappedPatchBase.H:281
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::mappedPatchBase::patch_
const polyPatch & patch_
Patch to sample.
Definition: mappedPatchBase.H:226
Foam::mappedPatchBase::sampleDatabasePath
const fileName & sampleDatabasePath() const
Definition: mappedPatchBase.H:560
Foam::mappedPatchBase::sameRegion_
bool sameRegion_
Same region.
Definition: mappedPatchBase.H:262
Foam::Tuple2
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
Definition: stringOps.H:60
Foam::mappedPatchBase::NORMAL
use face normal + distance
Definition: mappedPatchBase.H:134
Foam::mappedPatchBase::NONUNIFORM
per-face offset vector
Definition: mappedPatchBase.H:133
Foam::mappedPatchBase::owner
bool owner() const
Is it owner.
Definition: mappedPatchBaseI.H:241
Foam::mappedPatchBase::lookupPatch
const polyPatch & lookupPatch(const word &sampleRegion, const word &samplePatch) const
Lookup patch.
Definition: mappedPatchBase.C:1629
Foam::PtrListOps::names
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
Foam::mappedPatchBase::facePoint
static pointIndexHit facePoint(const polyMesh &, const label facei, const polyMesh::cellDecomposition)
Get a point on the face given a face decomposition method:
Definition: mappedPatchBase.C:1723
Foam::Tuple2::first
const T1 & first() const noexcept
Return first.
Definition: Tuple2.H:118
Foam::mappedPatchBase::sampleMode
sampleMode
Mesh items to sample.
Definition: mappedPatchBase.H:119
Foam::mappedPatchBase::offset
const vector & offset() const noexcept
Offset vector (from patch faces to destination mesh objects)
Definition: mappedPatchBaseI.H:135
y
scalar y
Definition: LISASMDCalcMethod1.H:14
Foam::mappedPatchBase::samplePatch
const word & samplePatch() const
Patch (only if NEARESTPATCHFACE)
Definition: mappedPatchBaseI.H:68
Foam::mappedPatchBase::reverseDistribute
void reverseDistribute(List< Type > &lst) const
Wrapper around map/interpolate data distribution.
Definition: mappedPatchBaseTemplates.C:148