shellSurfaces.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
6  \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
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 "shellSurfaces.H"
27 #include "searchableSurface.H"
28 #include "boundBox.H"
29 #include "triSurfaceMesh.H"
30 #include "refinementSurfaces.H"
31 #include "searchableSurfaces.H"
32 #include "orientedSurface.H"
33 #include "pointIndexHit.H"
34 #include "volumeType.H"
35 
36 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
37 
38 
39 namespace Foam
40 {
41 
42 template<>
43 const char*
44 NamedEnum<shellSurfaces::refineMode, 3>::
45 names[] =
46 {
47  "inside",
48  "outside",
49  "distance"
50 };
51 
53 
54 } // End namespace Foam
55 
56 
57 
58 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
59 
61 (
62  const label shellI,
63  const List<Tuple2<scalar, label> >& distLevels
64 )
65 {
66  if (modes_[shellI] != DISTANCE && distLevels.size() != 1)
67  {
69  << "For refinement mode "
70  << refineModeNames_[modes_[shellI]]
71  << " specify only one distance+level."
72  << " (its distance gets discarded)"
73  << exit(FatalError);
74  }
75  // Extract information into separate distance and level
76  distances_[shellI].setSize(distLevels.size());
77  levels_[shellI].setSize(distLevels.size());
78 
79  forAll(distLevels, j)
80  {
81  distances_[shellI][j] = distLevels[j].first();
82  levels_[shellI][j] = distLevels[j].second();
83 
84  // Check in incremental order
85  if (j > 0)
86  {
87  if
88  (
89  (distances_[shellI][j] <= distances_[shellI][j-1])
90  || (levels_[shellI][j] > levels_[shellI][j-1])
91  )
92  {
94  << "For refinement mode "
95  << refineModeNames_[modes_[shellI]]
96  << " : Refinement should be specified in order"
97  << " of increasing distance"
98  << " (and decreasing refinement level)." << endl
99  << "Distance:" << distances_[shellI][j]
100  << " refinementLevel:" << levels_[shellI][j]
101  << exit(FatalError);
102  }
103  }
104  }
105 
106  const searchableSurface& shell = allGeometry_[shells_[shellI]];
107 
108  if (modes_[shellI] == DISTANCE)
109  {
110  Info<< "Refinement level according to distance to "
111  << shell.name() << endl;
112  forAll(levels_[shellI], j)
113  {
114  Info<< " level " << levels_[shellI][j]
115  << " for all cells within " << distances_[shellI][j]
116  << " metre." << endl;
117  }
118  }
119  else
120  {
121  if (!shell.hasVolumeType())
122  {
124  << "Shell " << shell.name()
125  << " does not support testing for "
126  << refineModeNames_[modes_[shellI]] << endl
127  << "Probably it is not closed."
128  << exit(FatalError);
129  }
130 
131  if (modes_[shellI] == INSIDE)
132  {
133  Info<< "Refinement level " << levels_[shellI][0]
134  << " for all cells inside " << shell.name() << endl;
135  }
136  else
137  {
138  Info<< "Refinement level " << levels_[shellI][0]
139  << " for all cells outside " << shell.name() << endl;
140  }
141  }
142 }
143 
144 
146 (
147  const dictionary& shellDict,
148  const label shellI,
149  const List<FixedList<label, 3> >& levels
150 )
151 {
152  const searchableSurface& shell = allGeometry_[shells_[shellI]];
153 
154  forAll(levels, regionI)
155  {
156  const FixedList<label, 3>& info = levels[regionI];
157 
158  if (info[2] > 0)
159  {
160  if (modes_[shellI] == DISTANCE)
161  {
162  FatalIOErrorInFunction(shellDict)
163  << "'gapLevel' specification cannot be used with mode "
164  << refineModeNames_[DISTANCE]
165  << " for shell " << shell.name()
166  << exit(FatalIOError);
167  }
168  }
169  }
170 
171  // Hardcode for region 0
172  if (levels[0][0] > 0)
173  {
174  Info<< "Refinement level up to " << levels[0][2]
175  << " for all cells in gaps for shell "
176  << shell.name() << endl;
177  }
178 }
179 
180 
181 
182 // Specifically orient triSurfaces using a calculated point outside.
183 // Done since quite often triSurfaces not of consistent orientation which
184 // is (currently) necessary for sideness calculation
186 {
187  // Determine outside point.
188  boundBox overallBb = boundBox::invertedBox;
189 
190  bool hasSurface = false;
191 
192  forAll(shells_, shellI)
193  {
194  const searchableSurface& s = allGeometry_[shells_[shellI]];
195 
196  if (modes_[shellI] != DISTANCE && isA<triSurfaceMesh>(s))
197  {
198  const triSurfaceMesh& shell = refCast<const triSurfaceMesh>(s);
199 
200  if (shell.triSurface::size())
201  {
202  const pointField& points = shell.points();
203 
204  hasSurface = true;
205 
206  boundBox shellBb(points[0], points[0]);
207  // Assume surface is compact!
208  forAll(points, i)
209  {
210  const point& pt = points[i];
211  shellBb.min() = min(shellBb.min(), pt);
212  shellBb.max() = max(shellBb.max(), pt);
213  }
214 
215  overallBb.min() = min(overallBb.min(), shellBb.min());
216  overallBb.max() = max(overallBb.max(), shellBb.max());
217  }
218  }
219  }
220 
221  if (hasSurface)
222  {
223  const point outsidePt = overallBb.max() + overallBb.span();
224 
225  //Info<< "Using point " << outsidePt << " to orient shells" << endl;
226 
227  forAll(shells_, shellI)
228  {
229  const searchableSurface& s = allGeometry_[shells_[shellI]];
230 
231  if (modes_[shellI] != DISTANCE && isA<triSurfaceMesh>(s))
232  {
233  triSurfaceMesh& shell = const_cast<triSurfaceMesh&>
234  (
235  refCast<const triSurfaceMesh>(s)
236  );
237 
238  // Flip surface so outsidePt is outside.
239  bool anyFlipped = orientedSurface::orient
240  (
241  shell,
242  outsidePt,
243  true
244  );
245 
246  if (anyFlipped)
247  {
248  // orientedSurface will have done a clearOut of the surface.
249  // we could do a clearout of the triSurfaceMeshes::trees()
250  // but these aren't affected by orientation
251  // (except for cached
252  // sideness which should not be set at this point.
253  // !!Should check!)
254 
255  Info<< "shellSurfaces : Flipped orientation of surface "
256  << s.name()
257  << " so point " << outsidePt << " is outside." << endl;
258  }
259  }
260  }
261  }
262 }
263 
264 
265 // Find maximum level of a shell.
267 (
268  const pointField& pt,
269  const label shellI,
270  labelList& maxLevel
271 ) const
272 {
273  const labelList& levels = levels_[shellI];
274 
275  if (modes_[shellI] == DISTANCE)
276  {
277  // Distance mode.
278 
279  const scalarField& distances = distances_[shellI];
280 
281  // Collect all those points that have a current maxLevel less than
282  // (any of) the shell. Also collect the furthest distance allowable
283  // to any shell with a higher level.
284 
285  pointField candidates(pt.size());
286  labelList candidateMap(pt.size());
287  scalarField candidateDistSqr(pt.size());
288  label candidateI = 0;
289 
290  forAll(maxLevel, pointI)
291  {
292  forAllReverse(levels, levelI)
293  {
294  if (levels[levelI] > maxLevel[pointI])
295  {
296  candidates[candidateI] = pt[pointI];
297  candidateMap[candidateI] = pointI;
298  candidateDistSqr[candidateI] = sqr(distances[levelI]);
299  candidateI++;
300  break;
301  }
302  }
303  }
304  candidates.setSize(candidateI);
305  candidateMap.setSize(candidateI);
306  candidateDistSqr.setSize(candidateI);
307 
308  // Do the expensive nearest test only for the candidate points.
310  allGeometry_[shells_[shellI]].findNearest
311  (
312  candidates,
313  candidateDistSqr,
314  nearInfo
315  );
316 
317  // Update maxLevel
318  forAll(nearInfo, i)
319  {
320  if (nearInfo[i].hit())
321  {
322  // Check which level it actually is in.
323  label minDistI = findLower
324  (
325  distances,
326  mag(nearInfo[i].hitPoint()-candidates[i])
327  );
328 
329  label pointI = candidateMap[i];
330 
331  // pt is inbetween shell[minDistI] and shell[minDistI+1]
332  maxLevel[pointI] = levels[minDistI+1];
333  }
334  }
335  }
336  else
337  {
338  // Inside/outside mode
339 
340  // Collect all those points that have a current maxLevel less than the
341  // shell.
342 
343  pointField candidates(pt.size());
344  labelList candidateMap(pt.size());
345  label candidateI = 0;
346 
347  forAll(maxLevel, pointI)
348  {
349  if (levels[0] > maxLevel[pointI])
350  {
351  candidates[candidateI] = pt[pointI];
352  candidateMap[candidateI] = pointI;
353  candidateI++;
354  }
355  }
356  candidates.setSize(candidateI);
357  candidateMap.setSize(candidateI);
358 
359  // Do the expensive nearest test only for the candidate points.
360  List<volumeType> volType;
361  allGeometry_[shells_[shellI]].getVolumeType(candidates, volType);
362 
363  forAll(volType, i)
364  {
365  label pointI = candidateMap[i];
366 
367  if
368  (
369  (
370  modes_[shellI] == INSIDE
371  && volType[i] == volumeType::INSIDE
372  )
373  || (
374  modes_[shellI] == OUTSIDE
375  && volType[i] == volumeType::OUTSIDE
376  )
377  )
378  {
379  maxLevel[pointI] = levels[0];
380  }
381  }
382  }
383 }
384 
385 
387 (
388  const pointField& pt,
389  const labelList& ptLevel,
390  const label shellI,
391  labelList& gapShell,
392  List<FixedList<label, 3> >& gapInfo,
393  List<volumeType>& gapMode
394 ) const
395 {
396  //TBD: hardcoded for region 0 information
397  const FixedList<label, 3>& info = extendedGapLevel_[shellI][0];
398  volumeType mode = extendedGapMode_[shellI][0];
399 
400  if (info[2] == 0)
401  {
402  return;
403  }
404 
405 
406  // Collect all those points that have a current maxLevel less than the
407  // shell.
408 
409  labelList candidateMap(pt.size());
410  label candidateI = 0;
411 
412  forAll(ptLevel, pointI)
413  {
414  if (ptLevel[pointI] >= info[1] && ptLevel[pointI] < info[2])
415  {
416  candidateMap[candidateI++] = pointI;
417  }
418  }
419  candidateMap.setSize(candidateI);
420 
421  // Do the expensive nearest test only for the candidate points.
422  List<volumeType> volType;
423  allGeometry_[shells_[shellI]].getVolumeType
424  (
425  pointField(pt, candidateMap),
426  volType
427  );
428 
429  forAll(volType, i)
430  {
431  label pointI = candidateMap[i];
432 
433  bool isInside = (volType[i] == volumeType::INSIDE);
434 
435  if
436  (
437  (
438  (modes_[shellI] == INSIDE && isInside)
439  || (modes_[shellI] == OUTSIDE && !isInside)
440  )
441  && info[2] > gapInfo[pointI][2]
442  )
443  {
444  gapShell[pointI] = shellI;
445  gapInfo[pointI] = info;
446  gapMode[pointI] = mode;
447  }
448  }
449 }
450 
451 
453 (
454  const pointField& pt,
455  const label shellI,
456  labelList& minLevel,
457  labelList& shell
458 ) const
459 {
460  const labelList& levels = levels_[shellI];
461 
462  if (modes_[shellI] == DISTANCE)
463  {
464  // Distance mode.
465 
466  const scalarField& distances = distances_[shellI];
467 
468  // Collect all those points that have a current level equal/greater
469  // (any of) the shell. Also collect the furthest distance allowable
470  // to any shell with a higher level.
471 
472  pointField candidates(pt.size());
473  labelList candidateMap(pt.size());
474  scalarField candidateDistSqr(pt.size());
475  label candidateI = 0;
476 
477  forAll(shell, pointI)
478  {
479  if (shell[pointI] == -1)
480  {
481  forAllReverse(levels, levelI)
482  {
483  if (levels[levelI] <= minLevel[pointI])
484  {
485  candidates[candidateI] = pt[pointI];
486  candidateMap[candidateI] = pointI;
487  candidateDistSqr[candidateI] = sqr(distances[levelI]);
488  candidateI++;
489  break;
490  }
491  }
492  }
493  }
494  candidates.setSize(candidateI);
495  candidateMap.setSize(candidateI);
496  candidateDistSqr.setSize(candidateI);
497 
498  // Do the expensive nearest test only for the candidate points.
500  allGeometry_[shells_[shellI]].findNearest
501  (
502  candidates,
503  candidateDistSqr,
504  nearInfo
505  );
506 
507  // Update maxLevel
508  forAll(nearInfo, i)
509  {
510  if (nearInfo[i].hit())
511  {
512  // Check which level it actually is in.
513  label minDistI = findLower
514  (
515  distances,
516  mag(nearInfo[i].hitPoint()-candidates[i])
517  );
518 
519  label pointI = candidateMap[i];
520 
521  // pt is inbetween shell[minDistI] and shell[minDistI+1]
522  shell[pointI] = shellI;
523  minLevel[pointI] = levels[minDistI+1];
524  }
525  }
526  }
527  else
528  {
529  // Inside/outside mode
530 
531  // Collect all those points that have a current maxLevel less than the
532  // shell.
533 
534  pointField candidates(pt.size());
535  labelList candidateMap(pt.size());
536  label candidateI = 0;
537 
538  forAll(shell, pointI)
539  {
540  if (shell[pointI] == -1 && levels[0] <= minLevel[pointI])
541  {
542  candidates[candidateI] = pt[pointI];
543  candidateMap[candidateI] = pointI;
544  candidateI++;
545  }
546  }
547  candidates.setSize(candidateI);
548  candidateMap.setSize(candidateI);
549 
550  // Do the expensive nearest test only for the candidate points.
551  List<volumeType> volType;
552  allGeometry_[shells_[shellI]].getVolumeType(candidates, volType);
553 
554  forAll(volType, i)
555  {
556  if
557  (
558  (
559  modes_[shellI] == INSIDE
560  && volType[i] == volumeType::INSIDE
561  )
562  || (
563  modes_[shellI] == OUTSIDE
564  && volType[i] == volumeType::OUTSIDE
565  )
566  )
567  {
568  label pointI = candidateMap[i];
569  shell[pointI] = shellI;
570  minLevel[pointI] = levels[0];
571  }
572  }
573  }
574 }
575 
576 
577 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
578 
580 (
581  const searchableSurfaces& allGeometry,
582  const dictionary& shellsDict
583 )
584 :
585  allGeometry_(allGeometry)
586 {
587  // Wilcard specification : loop over all surfaces and try to find a match.
588 
589  // Count number of shells.
590  label shellI = 0;
591  forAll(allGeometry.names(), geomI)
592  {
593  const word& geomName = allGeometry_.names()[geomI];
594 
595  if (shellsDict.found(geomName))
596  {
597  shellI++;
598  }
599  }
600 
601 
602  // Size lists
603  shells_.setSize(shellI);
604  modes_.setSize(shellI);
605  distances_.setSize(shellI);
606  levels_.setSize(shellI);
607 
608  extendedGapLevel_.setSize(shellI);
609  extendedGapMode_.setSize(shellI);
610 
611  FixedList<label, 3> nullGapLevel;
612  nullGapLevel[0] = 0;
613  nullGapLevel[1] = 0;
614  nullGapLevel[2] = 0;
615 
616 
617  HashSet<word> unmatchedKeys(shellsDict.toc());
618  shellI = 0;
619 
620  forAll(allGeometry_.names(), geomI)
621  {
622  const word& geomName = allGeometry_.names()[geomI];
623 
624  const entry* ePtr = shellsDict.lookupEntryPtr(geomName, false, true);
625 
626  if (ePtr)
627  {
628  const dictionary& dict = ePtr->dict();
629  unmatchedKeys.erase(ePtr->keyword());
630 
631  shells_[shellI] = geomI;
632  modes_[shellI] = refineModeNames_.read(dict.lookup("mode"));
633 
634  // Read pairs of distance+level
635  setAndCheckLevels(shellI, dict.lookup("levels"));
636 
637 
638 
639  // Gap specification
640  // ~~~~~~~~~~~~~~~~~
641 
642 
643  // Shell-wide gap level specification
644  const searchableSurface& surface = allGeometry_[geomI];
645  const wordList& regionNames = surface.regions();
646 
647  FixedList<label, 3> gapSpec
648  (
650  (
651  "gapLevel",
652  nullGapLevel
653  )
654  );
655  extendedGapLevel_[shellI].setSize(regionNames.size());
656  extendedGapLevel_[shellI] = gapSpec;
657 
658  volumeType gapModeSpec
659  (
661  [
663  (
664  "gapMode",
666  )
667  ]
668  );
669  extendedGapMode_[shellI].setSize(regionNames.size());
670  extendedGapMode_[shellI] = gapModeSpec;
671 
672 
673  // Override on a per-region basis?
674 
675  if (dict.found("regions"))
676  {
677  const dictionary& regionsDict = dict.subDict("regions");
678  forAll(regionNames, regionI)
679  {
680  if (regionsDict.found(regionNames[regionI]))
681  {
682  // Get the dictionary for region
683  const dictionary& regionDict = regionsDict.subDict
684  (
685  regionNames[regionI]
686  );
687  FixedList<label, 3> gapSpec
688  (
689  regionDict.lookupOrDefault
690  (
691  "gapLevel",
692  nullGapLevel
693  )
694  );
695  extendedGapLevel_[shellI][regionI] = gapSpec;
696 
697  volumeType gapModeSpec
698  (
700  [
701  regionDict.lookupOrDefault<word>
702  (
703  "gapMode",
705  )
706  ]
707  );
708  extendedGapMode_[shellI][regionI] = gapModeSpec;
709  }
710  }
711  }
712 
713 
714  checkGapLevels(dict, shellI, extendedGapLevel_[shellI]);
715 
716  shellI++;
717  }
718  }
719 
720  if (unmatchedKeys.size() > 0)
721  {
723  (
724  shellsDict
725  ) << "Not all entries in refinementRegions dictionary were used."
726  << " The following entries were not used : "
727  << unmatchedKeys.sortedToc()
728  << endl;
729  }
730 
731  // Orient shell surfaces before any searching is done. Note that this
732  // only needs to be done for inside or outside. Orienting surfaces
733  // constructs lots of addressing which we want to avoid.
734  orient();
735 }
736 
737 
738 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
739 
740 // Highest shell level
742 {
743  label overallMax = 0;
744  forAll(levels_, shellI)
745  {
746  overallMax = max(overallMax, max(levels_[shellI]));
747  }
748  return overallMax;
749 }
750 
751 
753 {
754  labelList surfaceMax(extendedGapLevel_.size(), 0);
755 
756  forAll(extendedGapLevel_, shellI)
757  {
758  const List<FixedList<label, 3> >& levels = extendedGapLevel_[shellI];
759  forAll(levels, i)
760  {
761  surfaceMax[shellI] = max(surfaceMax[shellI], levels[i][2]);
762  }
763  }
764  return surfaceMax;
765 }
766 
767 
769 (
770  const pointField& pt,
771  const labelList& ptLevel,
772  labelList& maxLevel
773 ) const
774 {
775  // Maximum level of any shell. Start off with level of point.
776  maxLevel = ptLevel;
777 
778  forAll(shells_, shellI)
779  {
780  findHigherLevel(pt, shellI, maxLevel);
781  }
782 }
783 
784 
786 (
787  const pointField& pt,
788  const labelList& ptLevel,
789  labelList& gapShell,
790  List<FixedList<label, 3> >& gapInfo,
791  List<volumeType>& gapMode
792 ) const
793 {
794  gapShell.setSize(pt.size());
795  gapShell = -1;
796 
797  FixedList<label, 3> nullGapLevel;
798  nullGapLevel[0] = 0;
799  nullGapLevel[1] = 0;
800  nullGapLevel[2] = 0;
801 
802  gapInfo.setSize(pt.size());
803  gapInfo = nullGapLevel;
804 
805  gapMode.setSize(pt.size());
806  gapMode = volumeType::MIXED;
807 
808  forAll(shells_, shellI)
809  {
810  findHigherGapLevel(pt, ptLevel, shellI, gapShell, gapInfo, gapMode);
811  }
812 }
813 
814 
816 (
817  const pointField& pt,
818  const labelList& ptLevel,
819  List<FixedList<label, 3> >& gapInfo,
820  List<volumeType>& gapMode
821 ) const
822 {
823  labelList gapShell;
824  findHigherGapLevel(pt, ptLevel, gapShell, gapInfo, gapMode);
825 }
826 
827 
829 (
830  const pointField& pt,
831  const labelList& ptLevel,
832  labelList& shell
833 ) const
834 {
835  shell.setSize(pt.size());
836  shell = -1;
837 
838  labelList minLevel(ptLevel);
839 
840  forAll(shells_, shellI)
841  {
842  findLevel(pt, shellI, minLevel, shell);
843  }
844 }
845 
846 
847 // ************************************************************************* //
shellSurfaces.H
Foam::entry
A keyword and a list of tokens is an 'entry'.
Definition: entry.H:65
Foam::pointField
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:42
Foam::volumeType::MIXED
@ MIXED
Definition: volumeType.H:62
Foam::shellSurfaces::setAndCheckLevels
void setAndCheckLevels(const label shellI, const List< Tuple2< scalar, label > > &)
Helper function for initialisation of levels.
Definition: shellSurfaces.C:61
Foam::volumeType::OUTSIDE
@ OUTSIDE
Definition: volumeType.H:64
Foam::volumeType::INSIDE
@ INSIDE
Definition: volumeType.H:63
pointIndexHit.H
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::boundBox::max
const point & max() const
Maximum describing the bounding box.
Definition: boundBoxI.H:60
searchableSurface.H
Foam::entry::keyword
const keyType & keyword() const
Return keyword.
Definition: entry.H:120
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:406
Foam::shellSurfaces::findLevel
void findLevel(const pointField &pt, const label shellI, labelList &minLevel, labelList &shell) const
Find first shell with a level lower or equal to minLevel. Update.
Definition: shellSurfaces.C:453
Foam::boundBox::invertedBox
static const boundBox invertedBox
A very large inverted boundBox: min/max == +/- VGREAT.
Definition: boundBox.H:79
Foam::shellSurfaces::DISTANCE
@ DISTANCE
Definition: shellSurfaces.H:63
Foam::dictionary::lookup
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Definition: dictionary.C:449
Foam::dictionary::lookupOrDefault
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
Definition: dictionaryTemplates.C:33
Foam::shellSurfaces::maxGapLevel
labelList maxGapLevel() const
Highest shell gap level.
Definition: shellSurfaces.C:752
Foam::FatalIOError
IOerror FatalIOError
Foam::triSurfaceMesh
IOoject and searching on triSurface.
Definition: triSurfaceMesh.H:63
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::mag
dimensioned< scalar > mag(const dimensioned< Type > &)
Foam::HashSet
A HashTable with keys but without contents.
Definition: HashSet.H:59
Foam::mode
mode_t mode(const fileName &)
Return the file mode.
Definition: POSIX.C:573
Foam::searchableSurface::hasVolumeType
virtual bool hasVolumeType() const =0
Whether supports volume type below.
Foam::volumeType::names
static const NamedEnum< volumeType, 4 > names
Definition: volumeType.H:80
Foam::nearInfo
Tuple2< scalar, label > nearInfo
Private class for finding nearest.
Definition: sampledTriSurfaceMesh.C:64
Foam::shellSurfaces::shells_
labelList shells_
Indices of surfaces that are shells.
Definition: shellSurfaces.H:75
Foam::boundBox::span
vector span() const
The bounding box span (from minimum to maximum)
Definition: boundBoxI.H:84
searchableSurfaces.H
Foam::shellSurfaces::modes_
List< refineMode > modes_
Per shell whether to refine inside or outside.
Definition: shellSurfaces.H:78
volumeType.H
Foam::label
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
Foam::volumeType
Definition: volumeType.H:54
Foam::dictionary::found
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
Definition: dictionary.C:304
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::shellSurfaces::allGeometry_
const searchableSurfaces & allGeometry_
Reference to all geometry.
Definition: shellSurfaces.H:72
Foam::Info
messageStream Info
refinementSurfaces.H
Foam::searchableSurface
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
Definition: searchableSurface.H:66
Foam::HashTable< nil, word, string::hash >::erase
bool erase(const iterator &)
Erase a hashedEntry specified by given iterator.
Foam::IOobject::name
const word & name() const
Return name.
Definition: IOobject.H:273
Foam::findLower
label findLower(const ListType &, typename ListType::const_reference, const label start, const BinaryOp &bop)
Find last element < given value in sorted list and return index,.
Foam::boundBox::min
const point & min() const
Minimum describing the bounding box.
Definition: boundBoxI.H:54
Foam::shellSurfaces::orient
void orient()
Definition: shellSurfaces.C:185
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::FatalError
error FatalError
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::FixedList::setSize
void setSize(const label)
Dummy setSize function.
Definition: FixedListI.H:177
Foam::HashTable< nil, word, string::hash >::size
label size() const
Return number of elements in table.
Definition: HashTableI.H:65
forAllReverse
#define forAllReverse(list, i)
Reverse loop across all elements in list.
Definition: UList.H:418
Foam::triSurfaceMesh::points
virtual tmp< pointField > points() const
Get the points that define the surface.
Definition: triSurfaceMesh.C:433
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::entry::dict
virtual const dictionary & dict() const =0
Return dictionary if this entry is a dictionary.
Foam::HashTable< nil, word, string::hash >::sortedToc
List< Key > sortedToc() const
Return the table of contents as a sorted list.
Definition: HashTable.C:216
s
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.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
Foam::max
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
Foam::shellSurfaces::findHigherGapLevel
void findHigherGapLevel(const pointField &pt, const labelList &ptLevel, const label shellI, labelList &gapShell, List< FixedList< label, 3 > > &gapInfo, List< volumeType > &gapMode) const
Update highest min gap level.
Definition: shellSurfaces.C:387
boundBox.H
Foam::List::setSize
void setSize(const label)
Reset size of List.
Foam::dictionary::lookupEntryPtr
const entry * lookupEntryPtr(const word &, bool recursive, bool patternMatch) const
Find and return an entry data stream pointer if present.
Definition: dictionary.C:343
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:318
Foam::sqr
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Definition: dimensionedSymmTensor.C:49
Foam::shellSurfaces::findHigherLevel
void findHigherLevel(const pointField &pt, const label shellI, labelList &maxLevel) const
Find first shell with a level higher than maxLevel.
Definition: shellSurfaces.C:267
Foam::Vector< scalar >
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::searchableSurfaces
Container for searchableSurfaces.
Definition: searchableSurfaces.H:53
Foam::FixedList< label, 3 >
Foam::shellSurfaces::refineModeNames_
static const NamedEnum< refineMode, 3 > refineModeNames_
refineMode names
Definition: shellSurfaces.H:99
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::surface
Definition: surface.H:55
Foam::boundBox
A bounding box defined in terms of the points at its extremities.
Definition: boundBox.H:55
FatalIOErrorInFunction
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:330
Foam::shellSurfaces::checkGapLevels
void checkGapLevels(const dictionary &, const label shellI, const List< FixedList< label, 3 > > &levels)
Helper function for checking of gap information.
Definition: shellSurfaces.C:146
Foam::orientedSurface::orient
static bool orient(triSurface &, const point &, const bool orientOutside)
Flip faces such that normals are consistent with point:
Definition: orientedSurface.C:446
Foam::dictionary::toc
wordList toc() const
Return the table of contents.
Definition: dictionary.C:697
Foam::searchableSurfaces::names
const wordList & names() const
Definition: searchableSurfaces.H:117
Foam::List::size
void size(const label)
Override size to be inconsistent with allocated storage.
IOWarningInFunction
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
Definition: messageStream.H:271
Foam::Tuple2
A 2-tuple for storing two objects of different types.
Definition: Tuple2.H:47
Foam::shellSurfaces::shellSurfaces
shellSurfaces(const searchableSurfaces &allGeometry, const dictionary &shellsDict)
Construct from geometry and dictionary.
Definition: shellSurfaces.C:580
Foam::shellSurfaces::maxLevel
label maxLevel() const
Highest shell level.
Definition: shellSurfaces.C:741
Foam::dictionary::subDict
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
Definition: dictionary.C:631
triSurfaceMesh.H
Foam::min
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
orientedSurface.H
Foam::NamedEnum
Initialise the NamedEnum HashTable from the static list of names.
Definition: NamedEnum.H:52