searchableSurfaceCollection.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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2017 OpenFOAM Foundation
9 Copyright (C) 2016-2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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\*---------------------------------------------------------------------------*/
28
31#include "Time.H"
32#include "ListOps.H"
33
34// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35
36namespace Foam
37{
40 (
43 dict
44 );
46 (
49 dict,
50 collection
51 );
52}
53
54
55// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
56
57void Foam::searchableSurfaceCollection::findNearest
58(
59 const pointField& samples,
60 scalarField& minDistSqr,
61 List<pointIndexHit>& nearestInfo,
62 labelList& nearestSurf
63) const
64{
65 // Initialise
66 nearestInfo.setSize(samples.size());
67 nearestInfo = pointIndexHit();
68 nearestSurf.setSize(samples.size());
69 nearestSurf = -1;
70
71 List<pointIndexHit> hitInfo(samples.size());
72
73 const scalarField localMinDistSqr(samples.size(), GREAT);
74
75 forAll(subGeom_, surfI)
76 {
77 subGeom_[surfI].findNearest
78 (
79 cmptDivide // Transform then divide
80 (
81 transform_[surfI].localPosition(samples),
82 scale_[surfI]
83 ),
84 localMinDistSqr,
85 hitInfo
86 );
87
88 forAll(hitInfo, pointi)
89 {
90 if (hitInfo[pointi].hit())
91 {
92 // Rework back into global coordinate sys. Multiply then
93 // transform
94 point globalPt = transform_[surfI].globalPosition
95 (
97 (
98 hitInfo[pointi].rawPoint(),
99 scale_[surfI]
100 )
101 );
102
103 scalar distSqr = magSqr(globalPt - samples[pointi]);
104
105 if (distSqr < minDistSqr[pointi])
106 {
107 minDistSqr[pointi] = distSqr;
108 nearestInfo[pointi].setPoint(globalPt);
109 nearestInfo[pointi].setHit();
110 nearestInfo[pointi].setIndex
111 (
112 hitInfo[pointi].index()
113 + indexOffset_[surfI]
114 );
115 nearestSurf[pointi] = surfI;
116 }
117 }
118 }
119 }
120}
121
122
123// Sort hits into per-surface bins. Misses are rejected. Maintains map back
124// to position
125void Foam::searchableSurfaceCollection::sortHits
126(
127 const List<pointIndexHit>& info,
128 List<List<pointIndexHit>>& surfInfo,
129 labelListList& infoMap
130) const
131{
132 // Count hits per surface.
133 labelList nHits(subGeom_.size(), Zero);
134
135 forAll(info, pointi)
136 {
137 if (info[pointi].hit())
138 {
139 label index = info[pointi].index();
140 label surfI = findLower(indexOffset_, index+1);
141 nHits[surfI]++;
142 }
143 }
144
145 // Per surface the hit
146 surfInfo.setSize(subGeom_.size());
147 // Per surface the original position
148 infoMap.setSize(subGeom_.size());
149
150 forAll(surfInfo, surfI)
151 {
152 surfInfo[surfI].setSize(nHits[surfI]);
153 infoMap[surfI].setSize(nHits[surfI]);
154 }
155 nHits = 0;
156
157 forAll(info, pointi)
158 {
159 if (info[pointi].hit())
160 {
161 label index = info[pointi].index();
162 label surfI = findLower(indexOffset_, index+1);
163
164 // Store for correct surface and adapt indices back to local
165 // ones
166 label localI = nHits[surfI]++;
167 surfInfo[surfI][localI] = pointIndexHit
168 (
169 info[pointi].hit(),
170 info[pointi].rawPoint(),
171 index-indexOffset_[surfI]
172 );
173 infoMap[surfI][localI] = pointi;
174 }
175 }
176}
177
178
179// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
180
182(
183 const IOobject& io,
184 const dictionary& dict
185)
186:
188 instance_(dict.size()),
189 scale_(dict.size()),
190 transform_(dict.size()),
191 subGeom_(dict.size()),
192 mergeSubRegions_(dict.get<bool>("mergeSubRegions")),
193 indexOffset_(dict.size()+1)
194{
195 Info<< "SearchableCollection : " << name() << endl;
196
197 label surfI = 0;
198 label startIndex = 0;
199 for (const entry& dEntry : dict)
200 {
201 if (dEntry.isDict())
202 {
203 instance_[surfI] = dEntry.keyword();
204
205 const dictionary& sDict = dEntry.dict();
206
207 sDict.readEntry("scale", scale_[surfI]);
208
209 const dictionary& coordDict = sDict.subDict("transform");
210
211 const dictionary* compatDict =
212 coordDict.findDict
213 (
214 coordinateSystem::typeName_(),
216 );
217
218 if (compatDict)
219 {
220 // Deprecated form
221 if (error::master())
222 {
223 std::cerr
224 << "--> FOAM IOWarning :" << nl
225 << " Found [v1806] '"
226 << coordinateSystem::typeName_()
227 << "' entry within transform dictionary" << nl
228 << std::endl;
229 error::warnAboutAge("sub-dictionary", 1806);
230 }
231
232 transform_.set(surfI, new coordSystem::cartesian(*compatDict));
233 }
234 else
235 {
236 transform_.set(surfI, new coordSystem::cartesian(coordDict));
237 }
238
239 const word subGeomName(sDict.get<word>("surface"));
240 //Pout<< "Trying to find " << subGeomName << endl;
241
243 io.db().lookupObjectRef<searchableSurface>(subGeomName);
244
245 // I don't know yet how to handle the globalSize combined with
246 // regionOffset. Would cause non-consecutive indices locally
247 // if all indices offset by globalSize() of the local region...
248 if (s.size() != s.globalSize())
249 {
251 << "Cannot use a distributed surface in a collection."
252 << exit(FatalError);
253 }
254
255 subGeom_.set(surfI, &s);
256
257 indexOffset_[surfI] = startIndex;
258 startIndex += subGeom_[surfI].size();
259
260 Info<< " instance : " << instance_[surfI] << endl;
261 Info<< " surface : " << s.name() << endl;
262 Info<< " scale : " << scale_[surfI] << endl;
263 Info<< " transform: " << transform_[surfI] << endl;
264
265 surfI++;
266 }
267 }
268 indexOffset_[surfI] = startIndex;
269
270 instance_.setSize(surfI);
271 scale_.setSize(surfI);
272 transform_.setSize(surfI);
273 subGeom_.setSize(surfI);
274 indexOffset_.setSize(surfI+1);
275
276 // Bounds is the overall bounds - prepare for min/max ops
278
279 forAll(subGeom_, surfI)
280 {
281 const boundBox& surfBb = subGeom_[surfI].bounds();
282
283 // Transform back to global coordinate sys.
284 const point surfBbMin = transform_[surfI].globalPosition
285 (
287 (
288 surfBb.min(),
289 scale_[surfI]
290 )
291 );
292 const point surfBbMax = transform_[surfI].globalPosition
293 (
295 (
296 surfBb.max(),
297 scale_[surfI]
298 )
299 );
300
301 bounds().min() = min(bounds().min(), surfBbMin);
302 bounds().max() = max(bounds().max(), surfBbMax);
303 }
304}
305
306
307// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
308
310{}
311
312
313// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
314
316{
317 if (regions_.empty())
318 {
319 regionOffset_.setSize(subGeom_.size());
320
321 DynamicList<word> allRegions;
322 forAll(subGeom_, surfI)
323 {
324 regionOffset_[surfI] = allRegions.size();
325
326 if (mergeSubRegions_)
327 {
328 // Single name regardless how many regions subsurface has
329 allRegions.append(instance_[surfI] + "_" + Foam::name(surfI));
330 }
331 else
332 {
333 const wordList& subRegions = subGeom_[surfI].regions();
334
335 for (const word& regionName : subRegions)
336 {
337 allRegions.append(instance_[surfI] + "_" + regionName);
338 }
339 }
340 }
341 regions_.transfer(allRegions);
342 }
343 return regions_;
344}
345
346
348{
349 return indexOffset_.last();
350}
351
352
355{
356 auto tctrs = tmp<pointField>::New(size());
357 auto& ctrs = tctrs.ref();
358
359 // Append individual coordinates
360 label coordI = 0;
361
362 forAll(subGeom_, surfI)
363 {
364 const pointField subCoords(subGeom_[surfI].coordinates());
365
366 forAll(subCoords, i)
367 {
368 ctrs[coordI++] = transform_[surfI].globalPosition
369 (
371 (
372 subCoords[i],
373 scale_[surfI]
374 )
375 );
376 }
377 }
378
379 return tctrs;
380}
381
382
384(
385 pointField& centres,
386 scalarField& radiusSqr
387) const
388{
389 centres.setSize(size());
390 radiusSqr.setSize(centres.size());
391
392 // Append individual coordinates
393 label coordI = 0;
394
395 forAll(subGeom_, surfI)
396 {
397 scalar maxScale = cmptMax(scale_[surfI]);
398
399 pointField subCentres;
400 scalarField subRadiusSqr;
401 subGeom_[surfI].boundingSpheres(subCentres, subRadiusSqr);
402
403 forAll(subCentres, i)
404 {
405 centres[coordI] = transform_[surfI].globalPosition
406 (
408 (
409 subCentres[i],
410 scale_[surfI]
411 )
412 );
413 radiusSqr[coordI] = maxScale*subRadiusSqr[i];
414 coordI++;
415 }
416 }
417}
418
419
422{
423 // Get overall size
424 label nPoints = 0;
425
426 forAll(subGeom_, surfI)
427 {
428 nPoints += subGeom_[surfI].points()().size();
429 }
430
431 auto tpts = tmp<pointField>::New(nPoints);
432 auto& pts = tpts.ref();
433
434 // Append individual coordinates
435 nPoints = 0;
436
437 forAll(subGeom_, surfI)
438 {
439 const pointField subCoords(subGeom_[surfI].points());
440
441 forAll(subCoords, i)
442 {
443 pts[nPoints++] = transform_[surfI].globalPosition
444 (
446 (
447 subCoords[i],
448 scale_[surfI]
449 )
450 );
451 }
452 }
453
454 return tpts;
455}
456
457
458void Foam::searchableSurfaceCollection::findNearest
459(
460 const pointField& samples,
461 const scalarField& nearestDistSqr,
462 List<pointIndexHit>& nearestInfo
463) const
464{
465 // How to scale distance?
466 scalarField minDistSqr(nearestDistSqr);
467
468 labelList nearestSurf;
469 findNearest
470 (
471 samples,
472 minDistSqr,
473 nearestInfo,
474 nearestSurf
475 );
476}
477
478
480(
481 const pointField& start,
482 const pointField& end,
484) const
485{
486 info.setSize(start.size());
487 info = pointIndexHit();
488
489 // Current nearest (to start) intersection
490 pointField nearest(end);
491
492 List<pointIndexHit> hitInfo(start.size());
493
494 forAll(subGeom_, surfI)
495 {
496 // Starting point
498 (
499 transform_[surfI].localPosition
500 (
501 start
502 ),
503 scale_[surfI]
504 );
505
506 // Current best end point
508 (
509 transform_[surfI].localPosition
510 (
511 nearest
512 ),
513 scale_[surfI]
514 );
515
516 subGeom_[surfI].findLine(e0, e1, hitInfo);
517
518 forAll(hitInfo, pointi)
519 {
520 if (hitInfo[pointi].hit())
521 {
522 // Transform back to global coordinate sys.
523 nearest[pointi] = transform_[surfI].globalPosition
524 (
526 (
527 hitInfo[pointi].rawPoint(),
528 scale_[surfI]
529 )
530 );
531 info[pointi] = hitInfo[pointi];
532 info[pointi].rawPoint() = nearest[pointi];
533 info[pointi].setIndex
534 (
535 hitInfo[pointi].index()
536 + indexOffset_[surfI]
537 );
538 }
539 }
540 }
541
542
543 // Debug check
544 if (false)
545 {
546 forAll(info, pointi)
547 {
548 if (info[pointi].hit())
549 {
550 vector n(end[pointi] - start[pointi]);
551 scalar magN = mag(n);
552
553 if (magN > SMALL)
554 {
555 n /= mag(n);
556
557 scalar s = ((info[pointi].rawPoint()-start[pointi])&n);
558
559 if (s < 0 || s > 1)
560 {
562 << "point:" << info[pointi]
563 << " s:" << s
564 << " outside vector "
565 << " start:" << start[pointi]
566 << " end:" << end[pointi]
567 << abort(FatalError);
568 }
569 }
570 }
571 }
572 }
573}
574
575
577(
578 const pointField& start,
579 const pointField& end,
581) const
582{
583 // To be done ...
584 findLine(start, end, info);
585}
586
587
589(
590 const pointField& start,
591 const pointField& end,
593) const
594{
595 // To be done. Assume for now only one intersection.
596 List<pointIndexHit> nearestInfo;
597 findLine(start, end, nearestInfo);
598
599 info.setSize(start.size());
600 forAll(info, pointi)
601 {
602 if (nearestInfo[pointi].hit())
603 {
604 info[pointi].setSize(1);
605 info[pointi][0] = nearestInfo[pointi];
606 }
607 else
608 {
609 info[pointi].clear();
610 }
611 }
612}
613
614
616(
617 const List<pointIndexHit>& info,
618 labelList& region
619) const
620{
621 if (subGeom_.size() == 0)
622 {}
623 else if (subGeom_.size() == 1)
624 {
625 if (mergeSubRegions_)
626 {
627 region.setSize(info.size());
628 region = regionOffset_[0];
629 }
630 else
631 {
632 subGeom_[0].getRegion(info, region);
633 }
634 }
635 else
636 {
637 // Multiple surfaces. Sort by surface.
638
639 // Per surface the hit
640 List<List<pointIndexHit>> surfInfo;
641 // Per surface the original position
642 List<List<label>> infoMap;
643 sortHits(info, surfInfo, infoMap);
644
645 region.setSize(info.size());
646 region = -1;
647
648 // Do region tests
649
650 if (mergeSubRegions_)
651 {
652 // Actually no need for surfInfo. Just take region for surface.
653 forAll(infoMap, surfI)
654 {
655 const labelList& map = infoMap[surfI];
656 forAll(map, i)
657 {
658 region[map[i]] = regionOffset_[surfI];
659 }
660 }
661 }
662 else
663 {
664 forAll(infoMap, surfI)
665 {
666 labelList surfRegion;
667 subGeom_[surfI].getRegion(surfInfo[surfI], surfRegion);
668
669 const labelList& map = infoMap[surfI];
670 forAll(map, i)
671 {
672 region[map[i]] = regionOffset_[surfI] + surfRegion[i];
673 }
674 }
675 }
676 }
677}
678
679
681(
682 const List<pointIndexHit>& info,
683 vectorField& normal
684) const
685{
686 if (subGeom_.size() == 0)
687 {}
688 else if (subGeom_.size() == 1)
689 {
690 subGeom_[0].getNormal(info, normal);
691 }
692 else
693 {
694 // Multiple surfaces. Sort by surface.
695
696 // Per surface the hit
697 List<List<pointIndexHit>> surfInfo;
698 // Per surface the original position
699 List<List<label>> infoMap;
700 sortHits(info, surfInfo, infoMap);
701
702 normal.setSize(info.size());
703
704 // Do region tests
705 forAll(surfInfo, surfI)
706 {
707 vectorField surfNormal;
708 subGeom_[surfI].getNormal(surfInfo[surfI], surfNormal);
709
710 // Transform back to global coordinate sys.
711 surfNormal = transform_[surfI].globalVector(surfNormal);
712
713 const labelList& map = infoMap[surfI];
714 forAll(map, i)
715 {
716 normal[map[i]] = surfNormal[i];
717 }
718 }
719 }
720}
721
722
724(
725 const pointField& points,
726 List<volumeType>& volType
727) const
728{
730 << "Volume type not supported for collection."
731 << exit(FatalError);
732}
733
734
736(
737 const List<treeBoundBox>& bbs,
738 const bool keepNonLocal,
740 autoPtr<mapDistribute>& pointMap
741)
742{
743 forAll(subGeom_, surfI)
744 {
745 // Note:Transform the bounding boxes? Something like
746 // pointField bbPoints =
747 // cmptDivide
748 // (
749 // transform_[surfI].localPosition(bbs[i].points()),
750 // scale_[surfI]
751 // );
752 // treeBoundBox newBb(bbPoints);
753
754 // Note: what to do with faceMap, pointMap from multiple surfaces?
755 subGeom_[surfI].distribute
756 (
757 bbs,
758 keepNonLocal,
759 faceMap,
760 pointMap
761 );
762 }
763}
764
765
767{
768 forAll(subGeom_, surfI)
769 {
770 subGeom_[surfI].setField
771 (
772 static_cast<const labelList&>
773 (
775 (
776 values,
777 subGeom_[surfI].size(),
778 indexOffset_[surfI]
779 )
780 )
781 );
782 }
783}
784
785
787(
788 const List<pointIndexHit>& info,
789 labelList& values
790) const
791{
792 if (subGeom_.size() == 0)
793 {}
794 else if (subGeom_.size() == 1)
795 {
796 subGeom_[0].getField(info, values);
797 }
798 else
799 {
800 // Multiple surfaces. Sort by surface.
801
802 // Per surface the hit
803 List<List<pointIndexHit>> surfInfo;
804 // Per surface the original position
805 List<List<label>> infoMap;
806 sortHits(info, surfInfo, infoMap);
807
808 // Do surface tests
809 forAll(surfInfo, surfI)
810 {
811 labelList surfValues;
812 subGeom_[surfI].getField(surfInfo[surfI], surfValues);
813
814 if (surfValues.size())
815 {
816 // Size values only when we have a surface that supports it.
817 values.setSize(info.size());
818
819 const labelList& map = infoMap[surfI];
820 forAll(map, i)
821 {
822 values[map[i]] = surfValues[i];
823 }
824 }
825 }
826 }
827}
828
829
830// ************************************************************************* //
Various functions to operate on Lists.
label n
Macros for easy insertion into run-time selection tables.
#define addNamedToRunTimeSelectionTable(baseType, thisType, argNames, lookupName)
Add to construction table with 'lookupName' as the key.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition: DynamicList.H:72
void append(const T &val)
Copy append an element to the end of this list.
Definition: DynamicListI.H:503
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
const word & name() const noexcept
Return the object name.
Definition: IOobjectI.H:65
const objectRegistry & db() const noexcept
Return the local objectRegistry.
Definition: IOobject.C:500
void setSize(const label n)
Alias for resize()
Definition: List.H:218
void clear()
Clear the list, i.e. set size to zero.
Definition: ListI.H:116
A List obtained as a section of another List.
Definition: SubList.H:70
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
void size(const label n)
Older name for setAddressableSize.
Definition: UList.H:114
const T * set(const label i) const
Definition: UPtrList.H:248
void setSize(const label n)
Alias for resize()
Definition: UPtrList.H:261
label size() const noexcept
The number of elements in the list.
Definition: UPtrListI.H:106
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A bounding box defined in terms of min/max extrema points.
Definition: boundBox.H:64
const point & min() const
Minimum describing the bounding box.
Definition: boundBoxI.H:91
const point & max() const
Maximum describing the bounding box.
Definition: boundBoxI.H:97
static const boundBox invertedBox
A large inverted boundBox: min/max == +/- ROOTVGREAT.
Definition: boundBox.H:86
A Cartesian coordinate system.
Definition: cartesianCS.H:72
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
dictionary * findDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
Find and return a sub-dictionary pointer if present.
Definition: dictionaryI.H:127
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
Definition: dictionary.C:460
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
A keyword and a list of tokens is an 'entry'.
Definition: entry.H:70
static bool warnAboutAge(const int version) noexcept
Test if an age warning should be emitted.
Definition: error.C:55
@ LITERAL
String literal.
Definition: keyType.H:81
Type & lookupObjectRef(const word &name, const bool recursive=false) const
Set of transformed searchableSurfaces. Does not do boolean operations so when meshing might find part...
virtual void findLine(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Find first intersection on segment from start to end.
virtual void distribute(const List< treeBoundBox > &, const bool keepNonLocal, autoPtr< mapDistribute > &faceMap, autoPtr< mapDistribute > &pointMap)
Set bounds of surface. Bounds currently set as list of.
virtual void findLineAll(const pointField &start, const pointField &end, List< List< pointIndexHit > > &) const
Get all intersections in order from start to end.
virtual void findLineAny(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Return any intersection on segment from start to end.
virtual label size() const
Range of local indices that can be returned.
virtual void boundingSpheres(pointField &centres, scalarField &radiusSqr) const
Get bounding spheres (centre and radius squared), one per element.
virtual void getVolumeType(const pointField &points, List< volumeType > &volType) const
Determine type (inside/outside/mixed) for point.
virtual void setField(const labelList &values)
WIP. Store element-wise field.
virtual void getField(const List< pointIndexHit > &, labelList &) const
WIP. From a set of hits (points and.
virtual void getNormal(const List< pointIndexHit > &, vectorField &normal) const
From a set of points and indices get the normal.
virtual void getRegion(const List< pointIndexHit > &, labelList &region) const
From a set of points and indices get the region.
virtual const wordList & regions() const
Names of regions.
virtual tmp< pointField > coordinates() const
Get representative set of element coordinates.
virtual tmp< pointField > points() const
Get the points that define the surface.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
virtual const boundBox & bounds() const
Return const reference to boundBox.
splitCell * master() const
Definition: splitCell.H:113
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition: className.H:121
bool
Definition: EEqn.H:20
Foam::word regionName(Foam::polyMesh::defaultRegion)
PtrList< coordinateSystem > coordinates(solidRegions.size())
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
const pointField & points
label nPoints
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.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))
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
Namespace for OpenFOAM.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:47
List< label > labelList
A List of labels.
Definition: List.H:66
PointIndexHit< point > pointIndexHit
A PointIndexHit for 3D points.
Definition: pointIndexHit.H:46
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
messageStream Info
Information stream (stdout output on master, null elsewhere)
label findLower(const ListType &input, const T &val, const label start, const ComparePredicate &comp)
vector point
Point is a vector.
Definition: point.H:43
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
List< labelList > labelListList
A List of labelList.
Definition: labelList.H:56
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:33
errorManip< error > abort(error &err)
Definition: errorManip.H:144
void cmptMax(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
error FatalError
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
constexpr char nl
The newline '\n' character (0x0a)
Definition: Ostream.H:53
dictionary dict
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333
scalarField samples(nIntervals, Zero)