FvFaceCellWave.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "FvFaceCellWave.H"
27 #include "processorFvPatch.H"
28 #include "cyclicFvPatch.H"
29 #include "CompactListList.H"
30 #include "OPstream.H"
31 #include "IPstream.H"
32 #include "PstreamReduceOps.H"
33 
34 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35 
36 template<class Type, class TrackingData>
38 
39 template<class Type, class TrackingData>
41 
42 template<class Type, class TrackingData>
44 
45 
46 // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
47 
48 template<class Type, class TrackingData>
49 template<class ListList>
52 (
53  const ListList& ll
54 )
55 {
56  labelList s(ll.size());
57  forAll(ll, i)
58  {
59  s[i] = ll[i].size();
60  }
61  return s;
62 }
63 
64 
65 template<class Type, class TrackingData>
66 template<class ListList, class Value>
68 (
69  const labelList& s,
70  const Value& value
71 )
72 {
73  ListList ll(s.size());
74  forAll(s, i)
75  {
76  ll[i] = typename ListList::value_type(s[i], value);
77  }
78  return ll;
79 }
80 
81 
82 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
83 
84 template<class Type, class TrackingData>
86 (
87  const labelPair& patchAndFacei
88 ) const
89 {
90  return
91  patchAndFacei.first() == -1
92  ? internalFaceInfo_[patchAndFacei.second()]
93  : patchFaceInfo_[patchAndFacei.first()][patchAndFacei.second()];
94 }
95 
96 
97 template<class Type, class TrackingData>
99 (
100  const labelPair& patchAndFacei
101 )
102 {
103  return
104  patchAndFacei.first() == -1
105  ? internalFaceInfo_[patchAndFacei.second()]
106  : patchFaceInfo_[patchAndFacei.first()][patchAndFacei.second()];
107 }
108 
109 
110 template<class Type, class TrackingData>
112 (
113  const labelPair& patchAndFacei
114 )
115 const
116 {
117  return
118  patchAndFacei.first() == -1
119  ? internalFaceChanged_[patchAndFacei.second()]
120  : patchFaceChanged_[patchAndFacei.first()][patchAndFacei.second()];
121 }
122 
123 
124 template<class Type, class TrackingData>
125 Foam::PackedBoolList::iteratorBase
127 (
128  const labelPair& patchAndFacei
129 )
130 {
131  return
132  patchAndFacei.first() == -1
133  ? internalFaceChanged_[patchAndFacei.second()]
134  : patchFaceChanged_[patchAndFacei.first()][patchAndFacei.second()];
135 }
136 
137 
138 template<class Type, class TrackingData>
140 (
141  const label celli,
142  const labelPair& neighbourPatchAndFacei,
143  const Type& neighbourInfo,
144  const scalar tol,
145  Type& cellInfo
146 )
147 {
148  bool propagate =
150  (
151  mesh_,
152  celli,
153  neighbourPatchAndFacei,
154  neighbourInfo,
155  tol,
156  td_
157  );
158 
159  if (propagate)
160  {
161  if (!cellChanged_[celli])
162  {
163  cellChanged_[celli] = true;
164  changedCells_.append(celli);
165  }
166  }
167 
168  return propagate;
169 }
170 
171 
172 template<class Type, class TrackingData>
174 (
175  const labelPair& patchAndFacei,
176  const label neighbourCelli,
177  const Type& neighbourInfo,
178  const scalar tol,
179  Type& faceInfo
180 )
181 {
182  bool propagate =
183  faceInfo.updateFace
184  (
185  mesh_,
186  patchAndFacei,
187  neighbourCelli,
188  neighbourInfo,
189  tol,
190  td_
191  );
192 
193  if (propagate)
194  {
195  PackedBoolList::iteratorBase changed = faceChanged(patchAndFacei);
196 
197  if (!changed)
198  {
199  changed = true;
200  changedPatchAndFaces_.append(patchAndFacei);
201  }
202  }
203 
204  return propagate;
205 }
206 
207 
208 template<class Type, class TrackingData>
210 (
211  const labelPair& patchAndFacei,
212  const Type& neighbourInfo,
213  const scalar tol,
214  Type& faceInfo
215 )
216 {
217  bool propagate =
218  faceInfo.updateFace
219  (
220  mesh_,
221  patchAndFacei,
222  neighbourInfo,
223  tol,
224  td_
225  );
226 
227  if (propagate)
228  {
229  PackedBoolList::iteratorBase changed = faceChanged(patchAndFacei);
230 
231  if (!changed)
232  {
233  changed = true;
234  changedPatchAndFaces_.append(patchAndFacei);
235  }
236  }
237 
238  return propagate;
239 }
240 
241 
242 template<class Type, class TrackingData>
244 (
245  const fvPatch& patch
246 ) const
247 {
248  const cyclicFvPatch& nbrPatch =
249  refCast<const cyclicFvPatch>(patch).nbrPatch();
250 
251  forAll(patch, patchFacei)
252  {
253  const Type& info = faceInfo({patch.index(), patchFacei});
254  const Type& nbrInfo = faceInfo({nbrPatch.index(), patchFacei});
255 
256  const bool changed = faceChanged({patch.index(), patchFacei});
257  const bool nbrChanged = faceChanged({nbrPatch.index(), patchFacei});
258 
259  if (!info.sameGeometry(mesh_, nbrInfo, geomTol_, td_))
260  {
262  << " faceInfo:" << info
263  << " otherfaceInfo:" << nbrInfo
264  << abort(FatalError);
265  }
266 
267  if (changed != nbrChanged)
268  {
270  << " faceInfo:" << info
271  << " otherfaceInfo:" << nbrInfo
272  << " changedFace:" << changed
273  << " otherchangedFace:" << nbrChanged
274  << abort(FatalError);
275  }
276  }
277 }
278 
279 
280 template<class Type, class TrackingData>
281 template<class PatchType>
283 {
284  forAll(mesh_.boundary(), patchi)
285  {
286  if (isA<PatchType>(mesh_.boundary()[patchi]))
287  {
288  return true;
289  }
290  }
291 
292  return false;
293 }
294 
295 
296 template<class Type, class TrackingData>
298 (
299  const fvPatch& patch,
300  const label nFaces,
301  const labelList& changedPatchFaces,
302  const List<Type>& changedPatchFacesInfo
303 )
304 {
305  for (label changedFacei = 0; changedFacei < nFaces; changedFacei ++)
306  {
307  const label patchFacei = changedPatchFaces[changedFacei];
308 
309  Type& info = faceInfo({patch.index(), patchFacei});
310  const Type& neighbourInfo = changedPatchFacesInfo[changedFacei];
311 
312  if (!info.equal(neighbourInfo, td_))
313  {
314  updateFace
315  (
316  {patch.index(), patchFacei},
317  neighbourInfo,
318  propagationTol_,
319  info
320  );
321  }
322  }
323 }
324 
325 
326 template<class Type, class TrackingData>
329 (
330  const fvPatch& patch,
331  labelList& changedPatchFaces,
332  List<Type>& changedPatchFacesInfo
333 ) const
334 {
335  // Construct compact patchFace change arrays for a single patch.
336  // changedPatchFaces in local patch numbering. Return length of arrays.
337 
338  label i = 0;
339 
340  forAll(patch, patchFacei)
341  {
342  if (patchFaceChanged_[patch.index()][patchFacei])
343  {
344  changedPatchFaces[i] = patchFacei;
345  changedPatchFacesInfo[i] = faceInfo({patch.index(), patchFacei});
346  i ++;
347  }
348  }
349 
350  return i;
351 }
352 
353 
354 template<class Type, class TrackingData>
356 (
357  const fvPatch& patch,
358  const label nFaces,
359  const labelList& patchFaces,
360  const transformer& transform,
361  List<Type>& faceInfo
362 )
363 {
364  for (label i = 0; i < nFaces; i++)
365  {
366  faceInfo[i].transform(patch, patchFaces[i], transform, td_);
367  }
368 }
369 
370 
371 template<class Type, class TrackingData>
373 {
374  // Transfer information to/from neighbouring processors
375 
376  // Which patches are processor patches
377  const labelList& procPatches = mesh_.globalData().processorPatches();
378 
379  // Send all
380  PstreamBuffers pBufs(Pstream::commsTypes::nonBlocking);
381  forAll(procPatches, i)
382  {
383  const label patchi = procPatches[i];
384 
385  const processorFvPatch& procPatch =
386  refCast<const processorFvPatch>(mesh_.boundary()[patchi]);
387 
388  // Allocate buffers
389  label nSendFaces;
390  labelList sendFaces(procPatch.size());
391  List<Type> sendFacesInfo(procPatch.size());
392 
393  // Determine which faces changed on current patch
394  nSendFaces =
395  getChangedPatchFaces
396  (
397  procPatch,
398  sendFaces,
399  sendFacesInfo
400  );
401 
402  if (debug & 2)
403  {
404  Pout<< " Processor patch " << patchi << ' ' << procPatch.name()
405  << " communicating with " << procPatch.neighbProcNo()
406  << " Sending:" << nSendFaces
407  << endl;
408  }
409 
410  // Send
411  UOPstream toNeighbour(procPatch.neighbProcNo(), pBufs);
412  toNeighbour
413  << SubList<label>(sendFaces, nSendFaces)
414  << SubList<Type>(sendFacesInfo, nSendFaces);
415  }
416 
417  pBufs.finishedSends();
418 
419  // Receive all
420  forAll(procPatches, i)
421  {
422  const label patchi = procPatches[i];
423 
424  const processorFvPatch& procPatch =
425  refCast<const processorFvPatch>(mesh_.boundary()[patchi]);
426 
427  // Allocate buffers
428  labelList receiveFaces;
429  List<Type> receiveFacesInfo;
430 
431  // Receive
432  {
433  UIPstream fromNeighbour(procPatch.neighbProcNo(), pBufs);
434  fromNeighbour >> receiveFaces >> receiveFacesInfo;
435  }
436 
437  if (debug & 2)
438  {
439  Pout<< " Processor patch " << patchi << ' ' << procPatch.name()
440  << " communicating with " << procPatch.neighbProcNo()
441  << " Receiving:" << receiveFaces.size()
442  << endl;
443  }
444 
445  // Transform info across the interface
446  transform
447  (
448  procPatch,
449  receiveFaces.size(),
450  receiveFaces,
451  procPatch.transform(),
452  receiveFacesInfo
453  );
454 
455  // Merge received info
456  mergeFaceInfo
457  (
458  procPatch,
459  receiveFaces.size(),
460  receiveFaces,
461  receiveFacesInfo
462  );
463  }
464 }
465 
466 
467 template<class Type, class TrackingData>
468 void
470 {
471  // Transfer information across cyclics
472 
473  forAll(mesh_.boundary(), patchi)
474  {
475  const fvPatch& patch = mesh_.boundary()[patchi];
476 
477  if (!isA<cyclicFvPatch>(patch)) continue;
478 
479  const cyclicFvPatch& cycPatch = refCast<const cyclicFvPatch>(patch);
480  const cyclicFvPatch& nbrCycPatch = cycPatch.nbrPatch();
481 
482  // Allocate buffers
483  label nReceiveFaces;
484  labelList receiveFaces(patch.size());
485  List<Type> receiveFacesInfo(patch.size());
486 
487  // Determine which faces changed
488  nReceiveFaces =
489  getChangedPatchFaces
490  (
491  nbrCycPatch,
492  receiveFaces,
493  receiveFacesInfo
494  );
495 
496  if (debug & 2)
497  {
498  Pout<< " Cyclic patch " << patchi << ' ' << cycPatch.name()
499  << " Changed : " << nReceiveFaces
500  << endl;
501  }
502 
503  // Transform info across the interface
504  transform
505  (
506  cycPatch,
507  nReceiveFaces,
508  receiveFaces,
509  cycPatch.transform(),
510  receiveFacesInfo
511  );
512 
513  // Merge into existing faces
514  mergeFaceInfo
515  (
516  cycPatch,
517  nReceiveFaces,
518  receiveFaces,
519  receiveFacesInfo
520  );
521 
522  if (debug)
523  {
524  checkCyclic(cycPatch);
525  }
526  }
527 }
528 
529 
530 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
531 
532 template<class Type, class TrackingData>
534 (
535  const fvMesh& mesh,
536  List<Type>& internalFaceInfo,
537  List<List<Type>>& patchFaceInfo,
539  TrackingData& td
540 )
541 :
542  mesh_(mesh),
543  internalFaceInfo_(internalFaceInfo),
544  patchFaceInfo_(patchFaceInfo),
545  cellInfo_(cellInfo),
546  td_(td),
547  internalFaceChanged_
548  (
549  mesh_.nInternalFaces(),
550  false
551  ),
552  patchFaceChanged_
553  (
554  sizesListList<List<PackedBoolList>, bool>
555  (
556  listListSizes(mesh_.boundary()),
557  false
558  )
559  ),
560  cellChanged_
561  (
562  mesh_.nCells(),
563  false
564  ),
565  changedPatchAndFaces_(mesh_.nInternalFaces()),
566  changedCells_(mesh_.nCells()),
567  hasCyclicPatches_(hasPatch<cyclicFvPatch>())
568 {
569  if
570  (
573  || cellInfo.size() != mesh_.nCells()
574  )
575  {
577  << "Storage does not match the size of the mesh:" << endl
578  << " internalFaceInfo:" << internalFaceInfo.size() << endl
579  << " mesh_.nInternalFaces():" << mesh_.nInternalFaces() << endl
580  << " patchFaceInfo[i]:" << listListSizes(patchFaceInfo)
581  << endl
582  << "mesh_.boundary()[i].size():" << listListSizes(mesh_.boundary())
583  << endl
584  << " cellInfo:" << cellInfo.size() << endl
585  << " mesh_.nCells():" << mesh_.nCells()
586  << exit(FatalError);
587  }
588 }
589 
590 
591 template<class Type, class TrackingData>
593 (
594  const fvMesh& mesh,
595  const List<labelPair>& initialChangedPatchAndFaces,
596  const List<Type>& initialChangedFacesInfo,
597  List<Type>& internalFaceInfo,
598  List<List<Type>>& patchFaceInfo,
600  const label maxIter,
601  TrackingData& td
602 )
603 :
605  (
606  mesh,
607  internalFaceInfo,
608  patchFaceInfo,
609  cellInfo,
610  td
611  )
612 {
613  // Copy initial changed faces data
614  setFaceInfo(initialChangedPatchAndFaces, initialChangedFacesInfo);
615 
616  // Iterate until nothing changes
617  const label iter = iterate(maxIter);
618 
619  // Error if incomplete
620  if ((maxIter > 0) && (iter >= maxIter))
621  {
623  << "Maximum number of iterations reached. Increase maxIter." << endl
624  << " maxIter:" << maxIter << endl
625  << " changedCells_.size():" << changedCells_.size() << endl
626  << "changedPatchAndFaces_.size():" << changedPatchAndFaces_.size()
627  << endl << exit(FatalError);
628  }
629 }
630 
631 
632 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
633 
634 template<class Type, class TrackingData>
636 (
637  const List<labelPair>& changedPatchAndFaces,
638  const List<Type>& changedFacesInfo
639 )
640 {
641  forAll(changedPatchAndFaces, i)
642  {
643  const labelPair& patchAndFacei = changedPatchAndFaces[i];
644 
645  Type& info = faceInfo(patchAndFacei);
646  PackedBoolList::iteratorBase changed = faceChanged(patchAndFacei);
647 
648  // Copy info for this face
649  info = changedFacesInfo[i];
650 
651  // Mark this face as changed
652  changed = true;
653  changedPatchAndFaces_.append(patchAndFacei);
654  }
655 }
656 
657 
658 template<class Type, class TrackingData>
660 {
661  const labelList& owner = mesh_.owner();
662  const labelList& neighbour = mesh_.neighbour();
663 
664  forAll(changedPatchAndFaces_, changedFacei)
665  {
666  const labelPair& patchAndFacei = changedPatchAndFaces_[changedFacei];
667  const label patchi = patchAndFacei.first();
668  const label facei = patchAndFacei.second();
669 
670  if (!faceChanged(patchAndFacei))
671  {
673  << "Patch and face " << patchAndFacei
674  << " not marked as having been changed"
675  << abort(FatalError);
676  }
677 
678  const Type& info = faceInfo(patchAndFacei);
679 
680  // Propagate to the owner
681  {
682  const label ownerCelli =
683  patchi == -1
684  ? owner[facei]
685  : mesh_.boundary()[patchi].faceCells()[facei];
686 
687  Type& ownerInfo = cellInfo_[ownerCelli];
688 
689  if (!ownerInfo.equal(info, td_))
690  {
691  updateCell
692  (
693  ownerCelli,
694  {patchi, facei},
695  info,
696  propagationTol_,
697  ownerInfo
698  );
699  }
700  }
701 
702  // Propagate to the neighbour
703  if (patchi == -1)
704  {
705  const label neighbourCelli = neighbour[facei];
706 
707  Type& neighbourInfo = cellInfo_[neighbourCelli];
708 
709  if (!neighbourInfo.equal(info, td_))
710  {
711  updateCell
712  (
713  neighbourCelli,
714  {patchi, facei},
715  info,
716  propagationTol_,
717  neighbourInfo
718  );
719  }
720  }
721 
722  // Reset status of face
723  faceChanged(patchAndFacei) = false;
724  }
725 
726  // Handled all changed faces by now
727  changedPatchAndFaces_.clear();
728 
729  if (debug & 2)
730  {
731  Pout<< " Changed cells : " << changedCells_.size() << endl;
732  }
733 
734  return returnReduce(changedCells_.size(), sumOp<label>());
735 }
736 
737 
738 template<class Type, class TrackingData>
740 {
741  const cellList& cells = mesh_.cells();
742 
743  forAll(changedCells_, changedCelli)
744  {
745  const label celli = changedCells_[changedCelli];
746 
747  if (!cellChanged_[celli])
748  {
750  << "Cell " << celli << " not marked as having been changed"
751  << abort(FatalError);
752  }
753 
754  const Type& info = cellInfo_[celli];
755 
756  // Propagate to connected faces
757  forAll(cells[celli], cellFacei)
758  {
759  // Get the patch (if any) and face index
760  label polyFacei = cells[celli][cellFacei];
761 
762  // Get the FV patches and faces associated with this poly face
763  labelUList patches, faces;
764  if (polyFacei < mesh_.nInternalFaces())
765  {
766  static label noPatchi = -1;
767  patches.shallowCopy(labelUList(&noPatchi, 1));
768  faces.shallowCopy(labelUList(&polyFacei, 1));
769  }
770  else
771  {
772  const label polyBFacei = polyFacei - mesh_.nInternalFaces();
773  patches.shallowCopy(mesh_.polyBFacePatches()[polyBFacei]);
774  faces.shallowCopy(mesh_.polyBFacePatchFaces()[polyBFacei]);
775  }
776 
777  // Propagate into the connected FV faces
778  forAll(patches, i)
779  {
780  Type& connectedInfo = faceInfo({patches[i], faces[i]});
781 
782  if (!connectedInfo.equal(info, td_))
783  {
784  updateFace
785  (
786  {patches[i], faces[i]},
787  celli,
788  info,
789  propagationTol_,
790  connectedInfo
791  );
792  }
793  }
794  }
795 
796  // Reset status of cell
797  cellChanged_[celli] = false;
798  }
799 
800  // Handled all changed cells by now
801  changedCells_.clear();
802 
803  if (hasCyclicPatches_)
804  {
805  // Transfer changed faces across cyclics
806  handleCyclicPatches();
807  }
808 
809  if (Pstream::parRun())
810  {
811  // Transfer changed faces from neighbouring processors.
812  handleProcPatches();
813  }
814 
815  if (debug & 2)
816  {
817  Pout<< " Changed faces : "
818  << changedPatchAndFaces_.size() << endl;
819  }
820 
821  return returnReduce(changedPatchAndFaces_.size(), sumOp<label>());
822 }
823 
824 
825 template<class Type, class TrackingData>
827 (
828  const label maxIter
829 )
830 {
831  if (hasCyclicPatches_)
832  {
833  // Transfer changed faces across cyclics
834  handleCyclicPatches();
835  }
836 
837  if (Pstream::parRun())
838  {
839  // Transfer changed faces from neighbouring processors.
840  handleProcPatches();
841  }
842 
843  label iter = 0;
844 
845  while (iter < maxIter)
846  {
847  if (debug) Info<< " Iteration " << iter << endl;
848 
849  label nCells = faceToCell();
850 
851  if (debug) Info<< " Total changed cells : " << nCells << endl;
852 
853  if (nCells == 0)
854  {
855  break;
856  }
857 
858  label nFaces = cellToFace();
859 
860  if (debug) Info<< " Total changed faces : " << nFaces << nl;
861 
862  if (nFaces == 0)
863  {
864  break;
865  }
866 
867  ++iter;
868  }
869 
870  return iter;
871 }
872 
873 
874 // ************************************************************************* //
Inter-processor communication reduction functions.
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
Wave propagation of information through grid. Every iteration information goes through one layer of c...
DynamicList< labelPair > changedPatchAndFaces_
List of changed patch and faces.
DynamicList< label > changedCells_
List of changed cells.
void setFaceInfo(const List< labelPair > &changedPatchAndFaces, const List< Type > &changedFacesInfo)
Set initial changed faces.
void mergeFaceInfo(const fvPatch &patch, const label nFaces, const labelList &, const List< Type > &)
Merge received patch data into global data.
const fvMesh & mesh_
Reference to mesh.
label getChangedPatchFaces(const fvPatch &patch, labelList &changedPatchFaces, List< Type > &changedPatchFacesInfo) const
Extract info for single patch only.
void handleProcPatches()
Merge data from across processor boundaries.
static labelList listListSizes(const ListList &ll)
...
bool updateFace(const labelPair &patchAndFacei, const label neighbourCelli, const Type &neighbourInfo, const scalar tol, Type &faceInfo)
Updates faceInfo with information from neighbour. Updates all.
bool hasPatch() const
Has cyclic patch?
void checkCyclic(const fvPatch &patch) const
Debugging: check info on both sides of cyclic.
const Type & faceInfo(const labelPair &patchAndFacei) const
...
bool faceChanged(const labelPair &patchAndFacei) const
...
void transform(const fvPatch &patch, const label nFaces, const labelList &patchFaces, const transformer &transform, List< Type > &faceInfo)
Transform across an interface.
virtual label iterate(const label maxIter)
Iterate until no changes or maxIter reached. Returns actual.
void handleCyclicPatches()
Merge data from across cyclics.
FvFaceCellWave(const fvMesh &mesh, List< Type > &internalFaceInfo, List< List< Type >> &patchFaceInfo, List< Type > &cellInfo, TrackingData &td=defaultTrackingData_)
static ListList sizesListList(const labelList &s, const Value &value)
...
bool updateCell(const label celli, const labelPair &neighbourPatchAndFacei, const Type &neighbourInfo, const scalar tol, Type &cellInfo)
Updates cellInfo with information from neighbour. Updates all.
virtual label faceToCell()
Propagate from face to cell. Returns total number of cells.
List< List< Type > > & patchFaceInfo()
Access patchFaceInfo.
virtual label cellToFace()
Propagate from cell to face. Returns total number of faces.
List< Type > & internalFaceInfo()
Access internalFaceInfo.
void append(const T &)
Append an element at the end of the list.
Definition: ListI.H:178
void size(const label)
Override size to be inconsistent with allocated storage.
Definition: ListI.H:164
void clear()
Clear the list, i.e. set size to zero.
Definition: ListI.H:125
A bit-packed bool list.
const Type & second() const
Return second.
Definition: Pair.H:110
const Type & first() const
Return first.
Definition: Pair.H:98
Buffers for inter-processor communications streams (UOPstream, UIPstream).
void finishedSends(const bool block=true)
Mark all sends as having been done. This will start receives.
A List obtained as a section of another List.
Definition: SubList.H:56
Input inter-processor communications stream operating on external buffer.
Definition: UIPstream.H:57
void shallowCopy(const UList< T > &)
Copy the pointer held by the given UList.
Definition: UListI.H:156
Output inter-processor communications stream operating on external buffer.
Definition: UOPstream.H:58
static bool & parRun()
Is this a parallel run?
Definition: UPstream.H:399
Holds information regarding type of cell. Used in inside/outside determination in cellClassification.
Definition: cellInfo.H:67
bool updateCell(const polyMesh &, const label thisCelli, const label neighbourFacei, const cellInfo &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring face.
Definition: cellInfoI.H:143
A topoSetSource to select a faceSet from cells.
Definition: cellToFace.H:56
Cyclic-plane patch.
Definition: cyclicFvPatch.H:55
virtual const transformer & transform() const
Return transformation between the coupled patches.
virtual const cyclicFvPatch & nbrPatch() const
Return processor number.
A topoSetSource to select cells based on usage in faces.
Definition: faceToCell.H:52
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:99
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
Definition: fvMesh.C:857
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
virtual label size() const
Return size.
Definition: fvPatch.H:138
label index() const
Return the index of this patch in the fvBoundaryMesh.
Definition: fvPatch.H:156
virtual const word & name() const
Return name.
Definition: fvPatch.H:126
label nCells() const
label nInternalFaces() const
virtual const transformer & transform() const
Return transformation between the coupled patches.
virtual int neighbProcNo() const
Return neighbour processor number.
Vector-tensor class used to perform translations, rotations and scaling operations in 3D space.
Definition: transformer.H:84
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:334
label patchi
const cellShapeList & cells
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const fvPatchList & patches
const dimensionedScalar e
Elementary charge.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:257
errorManip< error > abort(error &err)
Definition: errorManip.H:131
messageStream Info
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
dimensionSet transform(const dimensionSet &)
Definition: dimensionSet.C:504
prefixOSstream Pout(cout, "Pout")
Definition: IOstreams.H:53
error FatalError
UList< label > labelUList
Definition: UList.H:65
static const char nl
Definition: Ostream.H:266
faceListList boundary(nPatches)