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 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 
116 public:
117 
118  // Type enumerations
119 
120  //- Mesh items to sample
121  enum sampleMode
122  {
129  };
130 
131  //- How to project face centres
132  enum offsetMode
133  {
136  NORMAL
137  };
138 
139  static const Enum<sampleMode> sampleModeNames_;
140 
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 
151  class nearestEqOp
152  {
153 
154  public:
155 
156  void operator()(nearInfo& x, const nearInfo& y) const
157  {
158  if (y.first().hit())
159  {
160  if (!x.first().hit())
161  {
162  x = y;
163  }
164  else if (y.second().first() < x.second().first())
165  {
166  x = y;
167  }
168  }
169  }
170  };
171 
172  class maxProcEqOp
173  {
174 
175  public:
176 
177  void operator()(nearInfo& x, const nearInfo& y) const
178  {
179  if (y.first().hit())
180  {
181  if (!x.first().hit())
182  {
183  x = y;
184  }
185  else if (y.second().second() > x.second().second())
186  {
187  x = y;
188  }
189  }
190  }
191  };
192 
193 
194  //- nearest + world
195  // Used to only look at entries from same world
197 
198  class nearestWorldEqOp
199  {
200 
201  public:
202 
203  void operator()(nearInfoWorld& x, const nearInfoWorld& y) const
204  {
205  // Is there a hit and is it sampling the same world
206  const nearInfo& xi = x.first();
207  const nearInfo& yi = y.first();
208  if (yi.first().hit())
209  {
210  if (x.second() == y.second())
211  {
212  if (!xi.first().hit())
213  {
214  x = y;
215  }
216  else if (yi.second().first() < xi.second().first())
217  {
218  x = y;
219  }
220  }
221  }
222  }
223  };
224 
225 
226 protected:
227 
228  // Protected data
229 
230  //- Patch to sample
231  const polyPatch& patch_;
232 
233  //- World to sample
234  mutable word sampleWorld_;
235 
236  //- Region to sample
237  mutable word sampleRegion_;
238 
239  //- What to sample
240  const sampleMode mode_;
241 
242  //- Patch (if in sampleMode NEARESTPATCH*)
243  mutable word samplePatch_;
244 
245  //- PatchGroup (if in sampleMode NEARESTPATCH*)
247 
248  //- Empty or location of database
250 
251  //- How to obtain samples
253 
254  //- Offset vector (uniform)
255  vector offset_;
256 
257  //- Offset vector (nonuniform)
259 
260  //- Offset distance (normal)
261  scalar distance_;
262 
263  //- Communicator
264  label comm_;
265 
266  //- Same region
267  mutable bool sameRegion_;
268 
269 
270  // Derived information
271 
272  //- Communication schedule:
273  //
274  // - Cells/faces to sample per processor
275  // - Patch faces to receive per processor
276  // - schedule
278 
279 
280  // AMI interpolator (only for NEARESTPATCHFACEAMI)
281 
282  //- Flag to indicate that slave patch should be reversed for AMI
283  const bool AMIReverse_;
284 
285  //- Pointer to AMI interpolator
287 
288  //- Pointer to projection surface employed by AMI interpolator
290 
291  //- Dictionary storing projection surface description
293 
294 
295  // Protected Member Functions
296 
297  //- Optionally allocate a world-local communicator
298  static label communicator(const word& sampleWorld);
299 
300  //- Lookup mesh
301  const polyMesh& lookupMesh(const word& region) const;
302 
303  //- Lookup patch
304  const polyPatch& lookupPatch
305  (
306  const word& sampleRegion,
307  const word& samplePatch
308  ) const;
309 
310 
311  //- Get the points from face-centre-decomposition face centres
312  // and project them onto the face-diagonal-decomposition triangles.
313  tmp<pointField> facePoints(const polyPatch&) const;
314 
315  //- Collect single list of samples and originating processor+face +
316  // wanted world
317  void collectSamples
318  (
319  const label mySampleWorld, // My wanted sampling world
320  const pointField& facePoints,
321  pointField& samples, // Per sample: coordinate
322  labelList& patchFaceWorlds, // Per sample: wanted world
323  labelList& patchFaceProcs, // Per sample: originating proc
324  labelList& patchFaces, // Per sample: originating face
325  pointField& patchFc
326  ) const;
327 
328  //- Find (local) cells/faces containing samples
329  void findLocalSamples
330  (
331  const sampleMode mode,
332  const label sampleWorld, // my world as index
333  const word& sampleRegion,
334  const word& samplePatch,
335  const pointField& samplePoints,
336 
337  List<nearInfoWorld>& nearest
338  ) const;
339 
340  //- Find (global) cells/faces containing samples
341  void findSamples
342  (
343  const sampleMode mode, // search mode
344  const label myWorldIndex, // my world (in index form)
345 
346  const pointField&,
347  const labelList& wantedWorlds,
348  const labelList& origProcs, // per sample the originating proc
349 
350  labelList& sampleProcs, // processor containing sample
351  labelList& sampleIndices, // local index of cell/face
352  pointField& sampleLocations // actual representative location
353  ) const;
354 
355  //- Get the sample points given the face points
357 
358  //- Calculate mapping
359  void calcMapping() const;
360 
361  //- Calculate AMI interpolator
362  void calcAMI() const;
363 
364 
365  // Database handling
366 
367  //- Read optional database name from dictionary
369 
370  //- Lookup (sub)objectRegistry by following names of sub registries.
371  //- Creates non-existing intermediate ones.
372  static const objectRegistry& subRegistry
373  (
374  const objectRegistry& obr,
375  const wordList& names,
376  const label index
377  );
378 
379  //- Attempt to detect an IOField<Type> and write to dictionary
380  template<class Type>
381  static bool writeIOField
382  (
383  const regIOobject& obj,
385  );
386 
387  //- Attempt to read an IOField<Type> and store on objectRegistry
388  template<class Type>
389  static bool constructIOField
390  (
391  const word& name,
392  token& tok,
393  Istream& is,
394  objectRegistry& obr
395  );
396 
397 public:
398 
399  //- Runtime type information
400  TypeName("mappedPatchBase");
401 
402 
403  // Constructors
404 
405  //- Construct from patch
406  explicit mappedPatchBase(const polyPatch&);
407 
408  //- Construct with offsetMode=non-uniform
410  (
411  const polyPatch& pp,
412  const word& sampleRegion,
413  const sampleMode sampleMode,
414  const word& samplePatch,
415  const vectorField& offsets
416  );
417 
418  //- Construct from offsetMode=uniform
420  (
421  const polyPatch& pp,
422  const word& sampleRegion,
423  const sampleMode sampleMode,
424  const word& samplePatch,
425  const vector& offset
426  );
427 
428  //- Construct from offsetMode=normal and distance
430  (
431  const polyPatch& pp,
432  const word& sampleRegion,
433  const sampleMode sampleMode,
434  const word& samplePatch,
435  const scalar distance
436  );
437 
438  //- Construct from dictionary
439  mappedPatchBase(const polyPatch&, const dictionary&);
440 
441  //- Construct from dictionary and (collocated) sample mode
442  // (only for nearestPatchFace, nearestPatchFaceAMI, nearestPatchPoint)
443  // Assumes zero offset.
444  mappedPatchBase(const polyPatch&, const sampleMode, const dictionary&);
445 
446  //- Construct as copy, resetting patch
447  mappedPatchBase(const polyPatch&, const mappedPatchBase&);
448 
449  //- Construct as copy, resetting patch, map original data
451  (
452  const polyPatch&,
453  const mappedPatchBase&,
454  const labelUList& mapAddressing
455  );
456 
457 
458  //- Destructor
459  virtual ~mappedPatchBase();
460 
461 
462  // Member functions
463 
464  void clearOut();
465 
466  // Access
467 
468  //- What to sample
469  inline const sampleMode& mode() const;
470 
471  //- World to sample
472  inline const word& sampleWorld() const;
473 
474  //- Region to sample
475  inline const word& sampleRegion() const;
476 
477  //- Patch (only if NEARESTPATCHFACE)
478  inline const word& samplePatch() const;
479 
480  //- PatchGroup (only if NEARESTPATCHFACE)
481  inline const word& coupleGroup() const;
482 
483  //- Return size of mapped mesh/patch/boundary
484  inline label sampleSize() const;
485 
486  //- Offset vector (from patch faces to destination mesh objects)
487  inline const vector& offset() const;
488 
489  //- Offset vector (from patch faces to destination mesh objects)
490  inline const vectorField& offsets() const;
491 
492  //- Communicator
493  inline label comm() const;
494 
495  //- Is world the local world
496  inline bool sameWorld() const;
497 
498  //- Cached sampleRegion != mesh.name()
499  inline bool sameRegion() const;
500 
501  //- Return reference to the parallel distribution map
502  inline const mapDistribute& map() const;
503 
504  //- Return reference to the AMI interpolator
505  inline const AMIPatchToPatchInterpolation& AMI
506  (
507  const bool forceUpdate = false
508  ) const;
509 
510  //- Return a pointer to the AMI projection surface
512 
513  //- Get the region mesh
514  const polyMesh& sampleMesh() const;
515 
516  //- Get the patch on the region
517  const polyPatch& samplePolyPatch() const;
518 
519 
520  // Helpers
521 
522  //- Get the sample points
524 
525  //- Get a point on the face given a face decomposition method:
526  // face-centre-tet : face centre. Returns index of face.
527  // face-planes : face centre. Returns index of face.
528  // face-diagonal : intersection of ray from cellcentre to
529  // facecentre with any of the triangles.
530  // Returns index (0..size-2) of triangle.
531  static pointIndexHit facePoint
532  (
533  const polyMesh&,
534  const label facei,
536  );
537 
538  // For database storage
539 
540  inline const fileName& sampleDatabasePath() const
541  {
542  return *sampleDatabasePtr_;
543  }
544 
545  inline bool sampleDatabase() const
546  {
547  return sampleDatabasePtr_.valid();
548  }
549 
550  //- Helper: return path to store data to be sent to processor i
551  static fileName sendPath(const fileName& root, const label proci);
552 
553  virtual fileName sendPath(const label proci) const;
554 
555  //- Helper: return path to store data to be received from
556  //- processor i
557  static fileName receivePath
558  (
559  const fileName& root,
560  const label proci
561  );
562 
563  virtual fileName receivePath(const label proci) const;
564 
565  //- Lookup (sub)objectRegistry from '/' separated path (relative to
566  //- objectRegistry). Creates non-existing intermediate ones.
567  static const objectRegistry& subRegistry
568  (
569  const objectRegistry& obr,
570  const fileName& path
571  );
572 
573  //- Store an IOField on the objectRegistry relative to obr
574  template<class Type>
575  static void storeField
576  (
577  objectRegistry& obr,
578  const word& fieldName,
579  const Field<Type>& values
580  );
581 
582  //- Convert objectRegistry contents into dictionary
583  static void writeDict
584  (
585  const objectRegistry& obr,
587  );
588 
589  //- (recursively) construct and register IOFields from dictionary
590  static void readDict(const dictionary& d, objectRegistry& obr);
591 
592 
593  // Distribute
594 
595  //- Wrapper around map/interpolate data distribution
596  template<class Type>
597  void distribute(List<Type>& lst) const;
598 
599  //- Wrapper around map/interpolate data distribution with operation
600  template<class Type, class CombineOp>
601  void distribute(List<Type>& lst, const CombineOp& cop) const;
602 
603  //- Wrapper around map/interpolate data distribution
604  template<class Type>
605  void reverseDistribute(List<Type>& lst) const;
606 
607  //- Wrapper around map/interpolate data distribution with operation
608  template<class Type, class CombineOp>
609  void reverseDistribute(List<Type>& lst, const CombineOp& cop) const;
610 
611 
612  // I/O
613 
614  //- Write as a dictionary
615  virtual void write(Ostream&) const;
616 };
617 
618 
619 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
620 
621 } // End namespace Foam
622 
623 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
624 
625 #include "mappedPatchBaseI.H"
626 
627 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
628 
629 #ifdef NoRepository
630  #include "mappedPatchBaseTemplates.C"
631 #endif
632 
633 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
634 
635 #endif
636 
637 // ************************************************************************* //
Foam::coupleGroupIdentifier
Encapsulates using "patchGroups" to specify coupled patch.
Definition: coupleGroupIdentifier.H:58
Foam::mappedPatchBase::write
virtual void write(Ostream &) const
Write as a dictionary.
Definition: mappedPatchBase.C:1898
Foam::mappedPatchBase::clearOut
void clearOut()
Definition: mappedPatchBase.C:1560
Foam::Enum< sampleMode >
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:1784
Foam::mappedPatchBase::readDict
static void readDict(const dictionary &d, objectRegistry &obr)
(recursively) construct and register IOFields from dictionary
Definition: mappedPatchBase.C:1857
Foam::polyMesh::cellDecomposition
cellDecomposition
Enumeration defining the decomposition of the cell for.
Definition: polyMesh.H:100
Foam::mappedPatchBase::UNIFORM
single offset vector
Definition: mappedPatchBase.H:133
Foam::mappedPatchBase::AMIReverse_
const bool AMIReverse_
Flag to indicate that slave patch should be reversed for AMI.
Definition: mappedPatchBase.H:282
Foam::mappedPatchBase::writeIOField
static bool writeIOField(const regIOobject &obj, dictionary &dict)
Attempt to detect an IOField<Type> and write to dictionary.
Definition: mappedPatchBaseTemplates.C:167
Foam::mappedPatchBase::subRegistry
static const objectRegistry & subRegistry(const objectRegistry &obr, const wordList &names, const label index)
Definition: mappedPatchBase.C:1183
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::mappedPatchBase::NEARESTPATCHFACEAMI
nearest patch face + AMI interpolation
Definition: mappedPatchBase.H:124
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:167
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:126
Foam::mappedPatchBase::sampleWorld_
word sampleWorld_
World to sample.
Definition: mappedPatchBase.H:233
Foam::mappedPatchBase::samplePolyPatch
const polyPatch & samplePolyPatch() const
Get the patch on the region.
Definition: mappedPatchBase.C:1619
coupleGroupIdentifier.H
Foam::mappedPatchBase::NEARESTPATCHPOINT
nearest point on selected patch
Definition: mappedPatchBase.H:125
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:257
Foam::mappedPatchBase::mappedPatchBase
mappedPatchBase(const polyPatch &)
Construct from patch.
Definition: mappedPatchBase.C:1203
Foam::mappedPatchBase::lookupMesh
const polyMesh & lookupMesh(const word &region) const
Lookup mesh.
Definition: mappedPatchBase.C:1571
Foam::mappedPatchBase::offset_
vector offset_
Offset vector (uniform)
Definition: mappedPatchBase.H:254
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:288
mappedPatchBaseTemplates.C
Foam::mappedPatchBase::mode_
const sampleMode mode_
What to sample.
Definition: mappedPatchBase.H:239
Foam::mappedPatchBase::offsetModeNames_
static const Enum< offsetMode > offsetModeNames_
Definition: mappedPatchBase.H:140
Foam::mappedPatchBase::writeDict
static void writeDict(const objectRegistry &obr, dictionary &dict)
Convert objectRegistry contents into dictionary.
Definition: mappedPatchBase.C:1818
Foam::token
A token holds an item read from Istream.
Definition: token.H:68
Foam::mappedPatchBase::sameWorld
bool sameWorld() const
Is world the local world.
Definition: mappedPatchBaseI.H:153
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:592
Foam::mappedPatchBase::sampleDatabase
bool sampleDatabase() const
Definition: mappedPatchBase.H:544
Foam::mappedPatchBase::samplePatch_
word samplePatch_
Patch (if in sampleMode NEARESTPATCH*)
Definition: mappedPatchBase.H:242
Foam::mappedPatchBase::nearInfoWorld
Tuple2< nearInfo, label > nearInfoWorld
nearest + world
Definition: mappedPatchBase.H:195
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:150
Foam::mappedPatchBase::NEARESTONLYCELL
nearest cell (even if not containing cell)
Definition: mappedPatchBase.H:127
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:245
Foam::mappedPatchBase::~mappedPatchBase
virtual ~mappedPatchBase()
Destructor.
Definition: mappedPatchBase.C:1554
Foam::mappedPatchBase::nearestWorldEqOp::operator()
void operator()(nearInfoWorld &x, const nearInfoWorld &y) const
Definition: mappedPatchBase.H:202
Foam::mappedPatchBase::offset
const vector & offset() const
Offset vector (from patch faces to destination mesh objects)
Definition: mappedPatchBaseI.H:135
Foam::mappedPatchBase::sampleModeNames_
static const Enum< sampleMode > sampleModeNames_
Definition: mappedPatchBase.H:138
Foam::mappedPatchBase::surfPtr
const autoPtr< Foam::searchableSurface > & surfPtr() const
Return a pointer to the AMI projection surface.
Definition: mappedPatchBase.C:1064
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:202
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
Foam::mappedPatchBase::mapPtr_
autoPtr< mapDistribute > mapPtr_
Communication schedule:
Definition: mappedPatchBase.H:276
Foam::mappedPatchBase::sampleRegion_
word sampleRegion_
Region to sample.
Definition: mappedPatchBase.H:236
Foam::mappedPatchBase::nearestWorldEqOp
Definition: mappedPatchBase.H:197
Foam::mappedPatchBase::samplePoints
tmp< pointField > samplePoints() const
Get the sample points.
Definition: mappedPatchBase.C:1673
Foam::mappedPatchBase::nearestEqOp::operator()
void operator()(nearInfo &x, const nearInfo &y) const
Definition: mappedPatchBase.H:155
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:1606
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:288
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::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::mappedPatchBase::comm
label comm() const
Communicator.
Definition: mappedPatchBaseI.H:147
Foam::mappedPatchBase::distribute
void distribute(List< Type > &lst) const
Wrapper around map/interpolate data distribution.
Definition: mappedPatchBaseTemplates.C:29
Foam::mapDistribute
Class containing processor-to-processor mapping information.
Definition: mapDistribute.H:163
Foam::mappedPatchBase::nearInfo
Tuple2< pointIndexHit, Tuple2< scalar, label > > nearInfo
Helper class for finding nearest.
Definition: mappedPatchBase.H:148
samples
scalarField samples(nIntervals, Zero)
Foam::mappedPatchBase::comm_
label comm_
Communicator.
Definition: mappedPatchBase.H:263
Foam::mappedPatchBase::sampleWorld
const word & sampleWorld() const
World to sample.
Definition: mappedPatchBaseI.H:36
Foam::mappedPatchBase::mode
const sampleMode & mode() const
What to sample.
Definition: mappedPatchBaseI.H:30
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::mappedPatchBase::offsets_
vectorField offsets_
Offset vector (nonuniform)
Definition: mappedPatchBase.H:257
AMIPatchToPatchInterpolation.H
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::mappedPatchBase::receivePath
static fileName receivePath(const fileName &root, const label proci)
Definition: mappedPatchBase.C:1801
Foam::mappedPatchBase::distance_
scalar distance_
Offset distance (normal)
Definition: mappedPatchBase.H:260
Foam::mappedPatchBase::calcAMI
void calcAMI() const
Calculate AMI interpolator.
Definition: mappedPatchBase.C:1096
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::mappedPatchBase::collectSamples
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 +.
Definition: mappedPatchBase.C:201
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::maxProcEqOp::operator()
void operator()(nearInfo &x, const nearInfo &y) const
Definition: mappedPatchBase.H:176
Foam::distance
scalar distance(const vector &p1, const vector &p2)
Definition: curveTools.C:12
Foam::mappedPatchBase::TypeName
TypeName("mappedPatchBase")
Runtime type information.
pointField.H
Foam::mappedPatchBase::calcMapping
void calcMapping() const
Calculate mapping.
Definition: mappedPatchBase.C:742
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:71
Foam::mappedPatchBase::NEARESTPATCHFACE
nearest face on selected patch
Definition: mappedPatchBase.H:123
Foam::mappedPatchBase::sampleDatabasePtr_
const autoPtr< fileName > sampleDatabasePtr_
Empty or location of database.
Definition: mappedPatchBase.H:248
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:189
Foam::UList< label >
path
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
x
x
Definition: LISASMDCalcMethod2.H:52
Foam::mappedPatchBase::offsetMode_
offsetMode offsetMode_
How to obtain samples.
Definition: mappedPatchBase.H:251
Foam::mappedPatchBase::readDatabase
static autoPtr< fileName > readDatabase(const dictionary &dict)
Read optional database name from dictionary.
Definition: mappedPatchBase.C:89
Foam::mappedPatchBase::NEARESTCELL
nearest cell containing sample
Definition: mappedPatchBase.H:122
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:131
Foam::mappedPatchBase::sameRegion
bool sameRegion() const
Cached sampleRegion != mesh.name()
Definition: mappedPatchBaseI.H:161
mappedPatchBaseI.H
Foam::mappedPatchBase::facePoints
tmp< pointField > facePoints(const polyPatch &) const
Get the points from face-centre-decomposition face centres.
Definition: mappedPatchBase.C:173
Foam::mappedPatchBase::surfDict_
dictionary surfDict_
Dictionary storing projection surface description.
Definition: mappedPatchBase.H:291
Foam::mappedPatchBase::maxProcEqOp
Definition: mappedPatchBase.H:171
Foam::mappedPatchBase::AMIPtr_
autoPtr< AMIPatchToPatchInterpolation > AMIPtr_
Pointer to AMI interpolator.
Definition: mappedPatchBase.H:285
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:230
Foam::mappedPatchBase::sampleDatabasePath
const fileName & sampleDatabasePath() const
Definition: mappedPatchBase.H:539
Foam::mappedPatchBase::sameRegion_
bool sameRegion_
Same region.
Definition: mappedPatchBase.H:266
Foam::Tuple2
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
Definition: Tuple2.H:57
Foam::mappedPatchBase::NORMAL
use face normal + distance
Definition: mappedPatchBase.H:135
Foam::mappedPatchBase::NONUNIFORM
per-face offset vector
Definition: mappedPatchBase.H:134
Foam::mappedPatchBase::lookupPatch
const polyPatch & lookupPatch(const word &sampleRegion, const word &samplePatch) const
Lookup patch.
Definition: mappedPatchBase.C:1586
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:1680
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:120
Foam::mappedPatchBase::communicator
static label communicator(const word &sampleWorld)
Optionally allocate a world-local communicator.
Definition: mappedPatchBase.C:123
y
scalar y
Definition: LISASMDCalcMethod1.H:14
Foam::mappedPatchBase::offsets
const vectorField & offsets() const
Offset vector (from patch faces to destination mesh objects)
Definition: mappedPatchBaseI.H:141
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:96