Loading...
Searching...
No Matches
AMICache.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) 2025 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26\*---------------------------------------------------------------------------*/
27
28#include "AMICache.H"
31
32/* * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * */
33
34namespace Foam
35{
37}
38
40
41// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
42
43Foam::scalar Foam::AMICache::getRotationAngle(const point& globalPoint) const
44{
45 if (!coordSysPtr_)
46 {
48 << "No co-ordinate system available for theta evaluation"
49 << abort(FatalError);
50 }
51
52
53 scalar theta = coordSysPtr_->localPosition(globalPoint).y();
54
55 // Ensure 0 < theta < 2pi
57 {
58 theta = 0;
59 }
60 else if (theta < 0)
61 {
63 }
65 return theta;
66}
67
68
69// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
70
71Foam::AMICache::AMICache(const dictionary& dict, const bool toSource)
72:
73 size_(dict.getOrDefault<label>("cacheSize", 0)),
74 rotationAxis_(dict.getOrDefault<vector>("rotationAxis", Zero)),
75 rotationCentre_(dict.getOrDefault<point>("rotationCentre", Zero)),
76 nThetaStencilMax_(dict.getOrDefault<label>("nThetaStencilMax", 2)),
77 forceCache_(dict.getOrDefault<bool>("forceCache", false)),
78 complete_(false),
79 toSource_(toSource),
80 index0_(-1),
81 index1_(-1),
82 interpWeight_(0),
83 coordSysPtr_(nullptr),
84 theta_(),
85 cachedSrcAddress_(),
86 cachedSrcWeights_(),
87 cachedSrcWeightsSum_(),
88 cachedSrcMapPtr_(),
89 cachedTgtAddress_(),
90 cachedTgtWeights_(),
91 cachedTgtWeightsSum_(),
92 cachedTgtMapPtr_()
93{
94 if (size_ != 0)
95 {
96 theta_.resize(size_, GREAT);
97 cachedSrcAddress_.resize(size_);
98 cachedSrcWeights_.resize(size_);
99 cachedSrcWeightsSum_.resize(size_);
100 cachedSrcMapPtr_.resize(size_);
101 cachedTgtAddress_.resize(size_);
102 cachedTgtWeights_.resize(size_);
103 cachedTgtWeightsSum_.resize(size_);
104 cachedTgtMapPtr_.resize(size_);
105 }
106}
107
108
109Foam::AMICache::AMICache(const bool toSource)
110:
111 size_(0),
112 rotationAxis_(Zero),
113 rotationCentre_(Zero),
114 nThetaStencilMax_(2),
115 forceCache_(false),
116 complete_(false),
117 toSource_(toSource),
118 index0_(-1),
119 index1_(-1),
120 interpWeight_(0),
121 coordSysPtr_(nullptr),
122 theta_(),
123 cachedSrcAddress_(),
124 cachedSrcWeights_(),
125 cachedSrcWeightsSum_(),
126 cachedSrcMapPtr_(),
127 cachedTgtAddress_(),
128 cachedTgtWeights_(),
129 cachedTgtWeightsSum_(),
130 cachedTgtMapPtr_()
131{}
132
133
135:
136 size_(cache.size_),
137 rotationAxis_(cache.rotationAxis_),
138 rotationCentre_(cache.rotationCentre_),
139 nThetaStencilMax_(cache.nThetaStencilMax_),
140 forceCache_(cache.forceCache_),
141 complete_(cache.complete_),
142 toSource_(cache.toSource_),
143 index0_(cache.index0_),
144 index1_(cache.index1_),
145 interpWeight_(cache.interpWeight_),
146 coordSysPtr_(nullptr), // Need to clone as cylindricalCS
147 theta_(cache.theta_),
148 cachedSrcAddress_(cache.cachedSrcAddress_),
149 cachedSrcWeights_(cache.cachedSrcWeights_),
150 cachedSrcWeightsSum_(cache.cachedSrcWeightsSum_),
151 cachedSrcMapPtr_(cache.cachedSrcMapPtr_.size()), // Need to clone
152 cachedTgtAddress_(cache.cachedTgtAddress_),
153 cachedTgtWeights_(cache.cachedTgtWeights_),
154 cachedTgtWeightsSum_(cache.cachedTgtWeightsSum_),
155 cachedTgtMapPtr_(cache.cachedTgtMapPtr_.size()) // Need to clone
156{
157 if (cache.coordSysPtr_)
158 {
159 coordSysPtr_.reset(new coordSystem::cylindrical(cache.coordSysPtr_()));
160 }
161
162 forAll(cachedSrcMapPtr_, cachei)
163 {
164 cachedSrcMapPtr_[cachei].reset(cache.cachedSrcMapPtr_[cachei].clone());
165 }
166
167 forAll(cachedTgtMapPtr_, cachei)
168 {
169 cachedTgtMapPtr_[cachei].reset(cache.cachedTgtMapPtr_[cachei].clone());
170 }
171}
172
173
175(
176 const AMICache& cache,
177 const AMIInterpolation& fineAMI,
178 const labelList& sourceRestrictAddressing,
179 const labelList& targetRestrictAddressing
180)
181:
182 size_(cache.size_),
183 rotationAxis_(cache.rotationAxis_),
184 rotationCentre_(cache.rotationCentre_),
185 nThetaStencilMax_(cache.nThetaStencilMax_),
186 forceCache_(cache.forceCache_),
187 complete_(cache.complete_),
188 toSource_(cache.toSource_),
189 index0_(cache.index0_),
190 index1_(cache.index1_),
191 interpWeight_(cache.interpWeight_),
192 coordSysPtr_(nullptr),
193 theta_(cache.theta_),
194 cachedSrcAddress_(cache.size_),
195 cachedSrcWeights_(cache.size_),
196 cachedSrcWeightsSum_(cache.size_),
197 cachedSrcMapPtr_(cache.size_),
198 cachedTgtAddress_(cache.size_),
199 cachedTgtWeights_(cache.size_),
200 cachedTgtWeightsSum_(cache.size_),
201 cachedTgtMapPtr_(cache.size_)
202{
203 if (size_ > 0 && fineAMI.comm() != -1)
204 {
205 for (label cachei : {index0_, index1_})
206 {
207 if (cachei == -1) continue;
208
209 scalarField dummySrcMagSf;
210 labelListList srcAddress;
211 scalarListList srcWeights;
212 scalarField srcWeightsSum;
213 autoPtr<mapDistribute> tgtMapPtr;
214
215 AMIInterpolation::agglomerate
216 (
217 cache.cachedTgtMapPtr()[cachei],
218 fineAMI.srcMagSf(),
219 cache.cachedSrcAddress()[cachei],
220 cache.cachedSrcWeights()[cachei],
221
222 sourceRestrictAddressing,
223 targetRestrictAddressing,
224
225 dummySrcMagSf,
226 srcAddress,
227 srcWeights,
228 srcWeightsSum,
229 tgtMapPtr,
230 fineAMI.comm()
231 );
232
233 scalarField dummyTgtMagSf;
234 labelListList tgtAddress;
235 scalarListList tgtWeights;
236 scalarField tgtWeightsSum;
237 autoPtr<mapDistribute> srcMapPtr;
238
239 AMIInterpolation::agglomerate
240 (
241 cache.cachedSrcMapPtr()[cachei],
242 fineAMI.tgtMagSf(),
243 cache.cachedTgtAddress()[cachei],
244 cache.cachedTgtWeights()[cachei],
245
246 targetRestrictAddressing,
247 sourceRestrictAddressing,
248
249 dummyTgtMagSf,
250 tgtAddress,
251 tgtWeights,
252 tgtWeightsSum,
253 srcMapPtr,
254 fineAMI.comm()
255 );
256
257 cachedSrcAddress_[cachei] = srcAddress;
258 cachedSrcWeights_[cachei] = srcWeights;
259 cachedSrcWeightsSum_[cachei] = srcWeightsSum;
260 cachedSrcMapPtr_[cachei] = srcMapPtr.clone();
261
262 cachedTgtAddress_[cachei] = tgtAddress;
263 cachedTgtWeights_[cachei] = tgtWeights;
264 cachedTgtWeightsSum_[cachei] = tgtWeightsSum;
265 cachedTgtMapPtr_[cachei] = tgtMapPtr.clone();
266 }
267 }
268}
269
270
271Foam::AMICache::AMICache(Istream& is)
272:
273 size_(readLabel(is)),
274
275 rotationAxis_(is),
276 rotationCentre_(is),
277 nThetaStencilMax_(readLabel(is)),
278 forceCache_(readBool(is)),
279
280 complete_(readBool(is)),
281 toSource_(readBool(is)),
282
283 index0_(-1),
284 index1_(-1),
285 interpWeight_(0),
286 coordSysPtr_(nullptr),
287 theta_(),
288 cachedSrcAddress_(),
289 cachedSrcWeights_(),
290 cachedSrcWeightsSum_(),
291 cachedSrcMapPtr_(),
292 cachedTgtAddress_(),
293 cachedTgtWeights_(),
294 cachedTgtWeightsSum_(),
295 cachedTgtMapPtr_()
296{
297 const bitSet goodMap(is);
298
299 if (goodMap.size())
300 {
301 is >> index0_
302 >> index1_
303 >> interpWeight_
304 >> theta_;
305
306 const bool goodCoord(readBool(is));
307 if (goodCoord)
308 {
309 coordSysPtr_.reset(new coordSystem::cylindrical(is));
310 }
311
312 is >> cachedSrcAddress_
313 >> cachedSrcWeights_
314 >> cachedSrcWeightsSum_;
315
316 cachedSrcMapPtr_.setSize(goodMap.size());
317 forAll(goodMap, cachei)
318 {
319 if (goodMap[cachei])
320 {
321 cachedSrcMapPtr_[cachei].reset(new mapDistribute(is));
322 }
323 }
324
325 is >> cachedTgtAddress_
326 >> cachedTgtWeights_
327 >> cachedTgtWeightsSum_;
328
329 cachedTgtMapPtr_.setSize(goodMap.size());
330 forAll(goodMap, cachei)
331 {
332 if (goodMap[cachei])
333 {
334 cachedTgtMapPtr_[cachei].reset(new mapDistribute(is));
335 }
337 }
338}
339
340
341// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
342
344(
345 const AMIInterpolation& ami,
346 const point& globalPoint
347)
348{
349 DebugPout<< "-- addToCache" << endl;
350
351
352 if (!active())
353 {
354 DebugInfo<< "-- addToCache - deactivated" << endl;
355 return;
356 }
357
358 if (!coordSysPtr_)
359 {
361 << "Creating rotation co-ordinate system:"
362 << " rotationCentre:" << rotationCentre_
363 << " rotationAxis:" << rotationAxis_
364 << " p:" << globalPoint
365 << endl;
366
367 coordSysPtr_.reset
368 (
369 new coordSystem::cylindrical(rotationCentre_, rotationAxis_)
370 );
371 DebugPout<< "Coord sys:" << coordSysPtr_() << endl;
372 }
373
374 // Check if cache is complete
375 if (!complete_)
376 {
377 complete_ = true;
378 forAll(theta_, bini)
379 {
380 if (!validIndex(bini))
381 {
382 complete_ = false;
383 break;
384 }
385 }
386 }
387
388 if (!complete_)
389 {
390 const scalar theta = getRotationAngle(globalPoint);
391 const label bini = thetaIndex(theta);
392
393 DebugPout<< " -- bini:" << bini << " for theta:" << theta << endl;
394
395 // Check if already have entry for this bin
396 if (!validIndex(bini))
397 {
398 DebugPout<< " -- setting cache at index " << bini << endl;
399
400 // New entry
401 theta_[bini] = theta;
402
403 cachedSrcAddress_[bini] = ami.srcAddress();
404 cachedSrcWeights_[bini] = ami.srcWeights();
405 cachedSrcWeightsSum_[bini] = ami.srcWeightsSum();
406
407 if (ami.hasSrcMap())
408 {
409 cachedSrcMapPtr_[bini] = ami.srcMap().clone();
410 }
411
412 cachedTgtAddress_[bini] = ami.tgtAddress();
413 cachedTgtWeights_[bini] = ami.tgtWeights();
414 cachedTgtWeightsSum_[bini] = ami.tgtWeightsSum();
415
416 if (ami.hasTgtMap())
417 {
418 cachedTgtMapPtr_[bini] = ami.tgtMap().clone();
419 }
420 }
421 }
422}
423
424
425bool Foam::AMICache::restoreCache(const point& globalPoint)
426{
427 DebugPout<< "-- restoreCache" << endl;
428
429 index0_ = -1;
430 index1_ = -1;
431 interpWeight_ = -1;
432
433 if (!coordSysPtr_ || size_ == -1)
434 {
435 return false;
436 }
437
438 const scalar theta = getRotationAngle(globalPoint);
439 const label bini = thetaIndex(theta);
440
441 DebugPout<< " -- bini:" << bini << " for theta:" << theta << endl;
442
443 if (!validIndex(bini) && forceCache_)
444 {
446 << " -- no cache available at bini - forcing evaluation" << endl;
447 return false;
448 }
449
450 // Maximum angle in radians for which to search for cached bins
452
453 if
454 (
455 validIndex(bini)
456 && (
457 mag(theta - theta_[bini]) < cacheThetaTolerance_
458 || mag(theta - twoPi - theta_[bini]) < cacheThetaTolerance_
459 )
460 )
461 {
462 // Hit cached value - no interpolation needed
463 // index1_ = -1 indicates no interpolation
464 index0_ = bini;
465 index1_ = -1;
466 interpWeight_ = 0;
467
469 << " -- t0:" << theta_[index0_] << " theta:" << theta
470 << " i0:" << index0_ << " i1:" << index1_
471 << " w:" << interpWeight_ << endl;
472 return true;
473 }
474 else
475 {
476 // Find indices and values bracketing theta
477 const label nBin = theta_.size();
478
479 // Participating theta values and bin addresses
480 // - Note we add wrap-around values at start and end
481 DynamicList<scalar> thetap(nBin+2);
482 DynamicList<label> binAddresses(nBin+2);
483
484 // Initialise wrap-around values
485 thetap.push_back(0);
486 binAddresses.push_back(-1);
487
488 // Add valid cached values
489 // - Note if the complete_ flag is set we could skip the validIndex
490 // check or avoid the need to copy the values across
491 forAll(theta_, thetai)
492 {
493 if (validIndex(thetai))
494 {
495 thetap.push_back(theta_[thetai]);
496 binAddresses.push_back(thetai);
497 }
498 }
499
500 // Check that we have enough data points for interpolation
501 // - We added storage for lower wrap-around value, and we then need
502 // at least 2 additional values for the interpolation
503 if (thetap.size() < 3)
504 {
505 DebugPout<< " -- no cache available" << endl;
506 return false;
507 }
508
509 // Set wrap-around values if we have sufficient data
510 thetap[0] = thetap.last() - twoPi;
511 binAddresses[0] = binAddresses.last();
512 thetap.push_back(thetap[1] + twoPi);
513 binAddresses.push_back(binAddresses[1]);
514
515 // Find the lower and upper indices in the thetap list bracketing theta
516 label loweri = labelMax;
517 label upperi = labelMax;
518 forAll(thetap, i)
519 {
520 if (thetap[i] <= theta)
521 {
522 loweri = i;
523 }
524 else
525 {
526 upperi = i;
527 break;
528 }
529 }
530
531 if (loweri == labelMax || upperi == labelMax)
532 {
533 DebugPout<< " -- no cache available" << endl;
534 return false;
535 }
536
537 // Ensure distances are valid
538 if (upperi == loweri)
539 {
540 // Should not get here - go back to direct hit?
542 << " -- no cache available: theta:" << theta
543 << " lower:" << loweri << " upper:" << upperi << endl;
544 return false;
545 }
546
547 // Check that bin distances are valid
548 // - Note: bin addresses wrap around
549 label lowerBin = binAddresses[loweri];
550 label upperBin = binAddresses[upperi];
551 if (bini > binAddresses[upperi])
552 {
553 upperBin += size_;
554 }
555 if (bini < binAddresses[loweri])
556 {
557 lowerBin -= size_;
558 }
559
560 if
561 (
562 (bini - lowerBin) > nThetaStencilMax_
563 || (upperBin - bini) > nThetaStencilMax_
564 )
565 {
567 << " -- no cache available within nThetaStencilMax_:"
568 << " bini:" << bini << " lower:" << lowerBin
569 << " upper:" << upperBin << endl;
570 return false;
571 }
572
573 index0_ = binAddresses[loweri];
574 index1_ = binAddresses[upperi];
575 interpWeight_ =
576 (theta - thetap[loweri])/(thetap[upperi] - thetap[loweri]);
577
579 << theta_.size()
580 << " -- t0:" << theta_[index0_] << " theta:" << theta
581 << " t1:" << theta_[index1_]
582 << " i0:" << index0_ << " i1:" << index1_
583 << " w:" << interpWeight_ << endl;
584
585 if (debug > 1)
586 {
588 << "Cached values for index0" << nl
589 << " - src addressing:" << cachedSrcAddress_[index0_] << nl
590 << " - src weights:" << cachedSrcWeights_[index0_] << nl
591 << " - tgt addressing:" << cachedTgtAddress_[index0_] << nl
592 << " - tgt weights:" << cachedTgtWeights_[index0_] << nl
593 << "Cached values for index1" << nl
594 << " - src addressing:" << cachedSrcAddress_[index1_] << nl
595 << " - src weights:" << cachedSrcWeights_[index1_] << nl
596 << " - tgt addressing:" << cachedTgtAddress_[index1_] << nl
597 << " - tgt weights:" << cachedTgtWeights_[index1_] << nl
598 << endl;
599 }
600
601
602 return true;
603 }
605 // If we get here then no valid cache found within stencil
606 DebugPout<< " -- no cache available" << endl;
607 return false;
608}
609
610
612{
613 if (size_ > 0)
614 {
615 os.writeEntry("cacheSize", size_);
616 os.writeEntry("rotationAxis", rotationAxis_);
617 os.writeEntry("rotationCentre", rotationCentre_);
618 os.writeEntry("nThetaStencilMax", nThetaStencilMax_);
619 os.writeEntry("forceCache", forceCache_);
620 }
621}
622
623
624bool Foam::AMICache::writeData(Ostream& os) const
625{
626 os << token::SPACE<< size_
627 << token::SPACE<< rotationAxis_
628 << token::SPACE<< rotationCentre_
629 << token::SPACE<< nThetaStencilMax_
630 << token::SPACE<< forceCache_
631 << token::SPACE<< complete_
632 << token::SPACE<< toSource_;
633
634 bitSet goodMap(cachedSrcMapPtr_.size());
635 forAll(goodMap, cachei)
636 {
637 goodMap.set(cachei, cachedSrcMapPtr_[cachei].good());
638 }
639 os << token::SPACE << goodMap;
640
641 if (goodMap.size())
642 {
643 os << token::SPACE << index0_
644 << token::SPACE << index1_
645 << token::SPACE << interpWeight_
646 << token::SPACE << theta_;
647
648 os << token::SPACE << coordSysPtr_.good();
649
650 if (coordSysPtr_.good())
651 {
652 os << token::SPACE << coordSysPtr_();
653 }
654
655 os << token::SPACE << cachedSrcAddress_
656 << token::SPACE << cachedSrcWeights_
657 << token::SPACE << cachedSrcWeightsSum_;
658
659 for (const auto& index : goodMap)
660 {
661 os << token::SPACE << cachedSrcMapPtr_[index]();
662 }
663
664 os << token::SPACE << cachedTgtAddress_
665 << token::SPACE << cachedTgtWeights_
666 << token::SPACE << cachedTgtWeightsSum_;
667
668 for (const auto& index : goodMap)
669 {
670 os << token::SPACE << cachedTgtMapPtr_[index]();
671 }
672 }
673
674 return true;
675}
676
677
678// ************************************************************************* //
Provides caching of weights and addressing to AMIInterpolation.
Definition AMICache.H:54
constexpr bool active() const noexcept
Return true if cache is active.
Definition AMICache.H:235
bool writeData(Ostream &os) const
Write AMI raw.
Definition AMICache.C:617
static scalar cacheThetaTolerance_
Tolerance used when caching the AMI to identify e.g. if the current rotation angle has already been c...
Definition AMICache.H:63
void write(Ostream &os) const
Write AMI as a dictionary.
Definition AMICache.C:604
constexpr label size() const noexcept
Return cache size.
Definition AMICache.H:248
label thetaIndex(const scalar theta) const noexcept
Return bin index for angle theta.
Definition AMICache.H:417
bool validIndex(const label bini) const
Return true of the cache index is set for bini.
Definition AMICache.H:408
void addToCache(const AMIInterpolation &ami, const point &globalPoint)
Add AMI weights and addressing to the cache.
Definition AMICache.C:337
const List< scalar > & theta() const noexcept
Return list of cached rotation angles.
Definition AMICache.H:273
bool restoreCache(const point &globalPoint)
Restore AMI weights and addressing from the cache.
Definition AMICache.C:418
AMICache(const bool toSource=true)
Null constructor.
Definition AMICache.C:102
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
const mapDistribute & srcMap() const
Source map - valid only if singlePatchProc = -1 This gets source data into a form to be consumed by t...
const scalarField & srcWeightsSum() const
Return const access to normalisation factor of source patch weights (i.e. the sum before normalisatio...
label comm() const noexcept
Communicator (local or otherwise) for parallel operations.
const mapDistribute * hasTgtMap() const noexcept
Pointer to the target map (if distributed). Can be checked as a bool.
const mapDistribute & tgtMap() const
Target map - valid only if singlePatchProc=-1. This gets target data into a form to be consumed by sr...
const scalarListList & tgtWeights() const
Return const access to target patch weights.
const labelListList & srcAddress() const
Return const access to source patch addressing.
const scalarField & tgtWeightsSum() const
Return const access to normalisation factor of target patch weights (i.e. the sum before normalisatio...
const scalarListList & srcWeights() const
Return const access to source patch weights.
const mapDistribute * hasSrcMap() const noexcept
Pointer to the source map (if distributed). Can be checked as a bool.
const labelListList & tgtAddress() const
Return const access to target patch addressing.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition DynamicList.H:68
void push_back(const T &val)
Copy append an element to the end of this list.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
void resize(const label len)
Adjust allocated size of list.
Definition ListI.H:153
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
label size() const noexcept
Number of entries.
Definition PackedList.H:392
void size(const label n)
Older name for setAddressableSize.
Definition UList.H:118
T & last()
Access last element of the list, position [size()-1].
Definition UList.H:971
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition bitSet.H:61
void set(const bitSet &bitset)
Set specified bits from another bitset.
Definition bitSetI.H:502
A cylindrical coordinate system (r-theta-z). The coordinate system angle theta is always in radians.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Class containing processor-to-processor mapping information.
autoPtr< mapDistribute > clone() const
Clone.
@ SPACE
Space [isspace].
Definition token.H:144
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition error.H:600
OBJstream os(runTime.globalPath()/outputName)
#define DebugInfo
Report an information message using Foam::Info.
#define DebugPout
Report an information message using Foam::Pout.
constexpr scalar twoPi(2 *M_PI)
Namespace for handling debugging switches.
Definition debug.C:45
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
label readLabel(const char *buf)
Parse entire buffer as a label, skipping leading/trailing whitespace.
Definition label.H:63
constexpr label labelMax
Definition label.H:55
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition Ostream.H:519
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
errorManip< error > abort(error &err)
Definition errorManip.H:139
vector point
Point is a vector.
Definition point.H:37
static constexpr const zero Zero
Global zero (0).
Definition zero.H:127
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
Vector< scalar > vector
Definition vector.H:57
bool readBool(Istream &is)
Read bool from stream using Foam::Switch(Istream&).
Definition bool.C:72
constexpr char nl
The newline '\n' character (0x0a).
Definition Ostream.H:50
dictionary dict
volScalarField & e
#define forAll(list, i)
Loop across all elements in list.
Definition stdFoam.H:299