IOobject.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2017 OpenFOAM Foundation
9 Copyright (C) 2016-2022 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
27Class
28 Foam::IOobject
29
30Description
31 Defines the attributes of an object for which implicit
32 objectRegistry management is supported, and provides the infrastructure
33 for performing stream I/O.
34
35 An IOobject is constructed with an object name, a class name, an instance
36 path, a reference to a objectRegistry, and parameters determining its
37 storage status.
38
39 \par Read options
40
41 Define what is done on object construction and explicit reads:
42 - \par NO_READ
43 Do not read
44 - \par MUST_READ
45 Object must be read from Istream on construction. \n
46 Error if Istream does not exist or cannot be read.
47 Does not check timestamp or re-read.
48 - \par MUST_READ_IF_MODIFIED
49 Object must be read from Istream on construction. \n
50 Error if Istream does not exist or cannot be read. If object is
51 registered its timestamp will be checked every timestep and possibly
52 re-read.
53 - \par READ_IF_PRESENT
54 Read object from Istream, but only if Istream exists. \n
55 Error only if Istream exists but cannot be read.
56 Does not check timestamp or re-read.
57
58 \par Write options
59
60 Define what is done on object destruction and explicit writes:
61 - \par NO_WRITE
62 No automatic writing, but can be written explicitly
63 - \par AUTO_WRITE
64 Object is written automatically when requested to by the
65 objectRegistry.
66
67 When serializing, the IOobject characteristics are typically written
68 as a \c FoamFile header, which is a sub-dictionary with the following
69 type of content:
70
71 \table
72 Property | Description | Type | Reqd | Deflt
73 version | The base format version | float | no | 2.0
74 format | The stream format (ascii/binary) | word | yes |
75 arch | The architecture string | string | no |
76 note | Descriptive note about the object | string | no |
77 location | The relative location of the object | string | no |
78 class | The type of the object | word | yes |
79 object | The name of the object | word | yes |
80 \endtable
81
82Note
83 Specifying registered does not result in the IOobject itself being
84 registered. It is only serves as guidance for a regIOobject using it.
85
86See also
87 Foam::objectRegistry
88 Foam::regIOobject
89
90SourceFiles
91 IOobject.C
92 IOobjectReadHeader.C
93 IOobjectWriteHeader.C
94 IOobjectPrint.C
95
96\*---------------------------------------------------------------------------*/
97
98#ifndef Foam_IOobject_H
99#define Foam_IOobject_H
100
101#include "fileName.H"
102#include "typeInfo.H"
103#include "autoPtr.H"
104#include "IOstreamOption.H"
105#include "InfoProxy.H"
106#include "Enum.H"
107
108// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109
110namespace Foam
111{
112
113// Forward Declarations
114class Time;
115class dictionary;
116class objectRegistry;
117
118/*---------------------------------------------------------------------------*\
119 Class IOobject Declaration
120\*---------------------------------------------------------------------------*/
121
122class IOobject
123{
124public:
125
126 // Public Data Types
127
128 //- Enumeration defining the read options
129 enum readOption : char
130 {
131 NO_READ = 0,
132 MUST_READ = 1,
135 };
136
137 //- Enumeration defining the write options
138 enum writeOption : char
139 {
140 NO_WRITE = 0,
141 AUTO_WRITE = 0x10
142 };
143
144 //- Enumeration defining the valid states of an IOobject
145 enum objectState : char
146 {
147 GOOD,
148 BAD
149 };
150
151 //- Enumeration defining the file checking options
152 enum fileCheckTypes : char
153 {
154 timeStamp,
156 inotify,
158 };
159
160 //- Names for the fileCheckTypes
161 static const Enum<fileCheckTypes> fileCheckTypesNames;
162
163
164private:
165
166 // Static Data Members
167
168 //- Use an output file banner, enabled by default
169 static bool bannerEnabled_;
170
171
172 // Private Data
173
174 //- Name
175 word name_;
177 //- Class name read from header
178 word headerClassName_;
180 //- Optional note
181 string note_;
183 //- Instance path component
184 fileName instance_;
186 //- Local path component
187 fileName local_;
188
189 //- Read option
190 readOption rOpt_;
191
192 //- Write option
193 writeOption wOpt_;
195 //- Should object created with this IOobject be registered?
196 bool registerObject_;
197
198 //- Is object same for all processors?
199 bool globalObject_;
200
201 //- IOobject state
202 objectState objState_;
204 //- The sizeof (label) in bytes, possibly read from the header
205 unsigned char sizeofLabel_;
206
207 //- The sizeof (scalar) in bytes, possibly read from the header
208 unsigned char sizeofScalar_;
209
210 //- Reference to the objectRegistry
211 const objectRegistry& db_;
212
213
214protected:
215
216 // Protected Member Functions
217
218 //- Helper: write content for FoamFile IOobject header
219 //- with optional meta information.
220 static void writeHeaderContent
221 (
222 Ostream& os,
223 const IOobject& io,
224 const word& objectType,
225 const dictionary* metaDataDict = nullptr
226 );
227
228 //- Helper: write dictionary content for FoamFile header
229 //- with optional meta information.
230 static void writeHeaderContent
231 (
233 const IOobject& io,
234 const word& objectType,
235 IOstreamOption streamOpt,
236 const dictionary* metaDataDict = nullptr
237 );
238
239 //- Set the object state to bad
240 void setBad(const string& s);
241
242
243public:
244
245 //- Declare type-name, virtual type (with debug switch)
246 TypeName("IOobject");
247
248
249 // Static Data
250
251 //- Character for scoping object names (':' or '_')
252 // Change with caution.
253 static char scopeSeparator;
254
255 //- Type of file modification checking
257
258 //- Time skew (seconds) for file modification checks
259 static float fileModificationSkew;
260
261 //- Max number of times to poll for file modification changes
262 static int maxFileModificationPolls;
263
264
265 // Static Functions
266
267 //- Status of output file banner
268 static bool bannerEnabled() noexcept
269 {
270 return bannerEnabled_;
271 }
272
273 //- Enable/disable output file banner
274 // \return the previous value
275 static bool bannerEnabled(bool on) noexcept
276 {
277 bool old(bannerEnabled_);
278 bannerEnabled_ = on;
279 return old;
280 }
281
282 //- Split path into instance, local, name components
283 //
284 // The splitting behaviour is as follows:
285 // \verbatim
286 // input | instance | local | name
287 // ----------- | ---------- | ----- | ----
288 // a | | | a
289 // a/b | a | | b
290 // a/b/c/d | a | b/c | d
291 // /a/b/c | /a/b | | c
292 // ./a/b/c | PWD/a/b | | c
293 // ../a/b/c | PWD/../a/b | | c
294 // a/b/ | ERROR | |
295 // \endverbatim
296 // where PWD is the Foam::cwd() current working directory
297 static bool fileNameComponents
298 (
299 const fileName& path,
302 word& name
303 );
304
305 //- Create dot-delimited name.group string
306 // An empty group is ignored.
307 template<class StringType>
308 static inline word groupName(StringType base, const word& group);
310 //- Return group (extension part of name)
311 static word group(const word& name);
312
313 //- Return member (name without the extension)
314 static word member(const word& name);
316 //- Create scope:name or scope_name string
317 // An empty scope is ignored.
318 static inline word scopedName
319 (
320 const std::string& scope,
321 const word& name
322 );
323
324 //- Return the IOobject, but also consider an alternative file name.
325 //
326 // \param io The expected IOobject to use
327 // \param altFile Alternative fileName (ignored if empty).
328 // \param ioName The alternative name for the IOobject when
329 // the altFile resolves to a directory.
330 //
331 // \note If the alternative fileName is a non-empty string,
332 // it defines the location but uses all other properties of the
333 // expected IOobject.
334 // The location may be an absolute or a relative path.
335 // If it corresponds to a directory, the name of the
336 // expected IOobject will be used in its resolution.
337 // This expected name can provided via the ioName parameter.
338 static IOobject selectIO
339 (
340 const IOobject& io,
341 const fileName& altFile,
342 const word& ioName = ""
343 );
344
345
346 // Generated Methods
347
348 //- Copy construct
349 IOobject(const IOobject&) = default;
350
351 //- Destructor
352 virtual ~IOobject() = default;
353
354
355 // Constructors
356
357 //- Construct from name, instance, registry, io options
359 (
360 const word& name,
361 const fileName& instance,
362 const objectRegistry& registry,
363 readOption rOpt = NO_READ,
364 writeOption wOpt = NO_WRITE,
365 bool registerObject = true,
366 bool globalObject = false
367 );
368
369 //- Construct from name, instance, local, registry, io options
371 (
372 const word& name,
373 const fileName& instance,
374 const fileName& local,
375 const objectRegistry& registry,
376 readOption rOpt = NO_READ,
377 writeOption wOpt = NO_WRITE,
378 bool registerObject = true,
379 bool globalObject = false
380 );
381
382 //- Construct from path, registry, io options.
383 // Uses fileNameComponents() to split path into components.
384 // A path that starts with a '/' is regarded as a file system path.
385 // Paths starting with either './' or '../' are relative to
386 // current working directory (and replaced with absolute equivalents).
387 // All other paths are considered to be relative to the case.
389 (
390 const fileName& path,
391 const objectRegistry& registry,
392 readOption rOpt = NO_READ,
393 writeOption wOpt = NO_WRITE,
394 bool registerObject = true,
395 bool globalObject = false
396 );
397
398 //- Copy construct, resetting registry
399 IOobject(const IOobject& io, const objectRegistry& registry);
400
401 //- Copy construct, resetting name
402 IOobject(const IOobject& io, const word& name);
403
404 //- Copy construct, resetting name and local component
405 IOobject(const IOobject& io, const word& name, const fileName& local);
406
407 //- Copy construct, resetting read/write options
408 IOobject(const IOobject& io, readOption rOpt, writeOption wOpt);
409
410
411 //- Clone
413 {
414 return autoPtr<IOobject>::New(*this);
415 }
416
417 //- Clone resetting registry
418 autoPtr<IOobject> clone(const objectRegistry& registry) const
419 {
420 return autoPtr<IOobject>::New(*this, registry);
421 }
422
423
424 // Member Functions
425
426 // General Access
427
428 //- Return the local objectRegistry
429 const objectRegistry& db() const noexcept;
430
431 //- Return Time associated with the objectRegistry
432 const Time& time() const;
433
434 //- Return the object name
435 inline const word& name() const noexcept;
436
437 //- Return name of the class name read from header
438 inline const word& headerClassName() const noexcept;
439
440 //- Return non-constant access to the class name read from header
441 inline word& headerClassName() noexcept;
442
443 //- Return the optional note
444 inline const string& note() const noexcept;
445
446 //- Modifiable access to the optional note
447 inline string& note() noexcept;
448
449 //- Rename the object
450 virtual void rename(const word& newName)
451 {
452 name_ = newName;
453 }
454
455 //- Should object created with this IOobject be registered?
456 inline bool registerObject() const noexcept;
457
458 //- Change registration preference, return previous value
459 inline bool registerObject(bool on) noexcept;
460
461 //- Is object same for all processors?
462 inline bool globalObject() const noexcept;
463
464 //- Change global-object status, return previous value
465 inline bool globalObject(bool on) noexcept;
466
467 //- The sizeof (label) in bytes, possibly read from the header
468 inline unsigned labelByteSize() const noexcept;
469
470 //- The sizeof (scalar) in bytes, possibly read from the header
471 inline unsigned scalarByteSize() const noexcept;
472
473
474 // Checks
475
476 //- True if headerClassName() is non-empty (after reading)
477 inline bool hasHeaderClass() const noexcept;
478
479 //- Check if headerClassName() equals Type::typeName
480 template<class Type>
481 inline bool isHeaderClass() const;
482
483 //- Same as isHeaderClass()
484 template<class Type>
485 bool isHeaderClassName() const { return isHeaderClass<Type>(); }
486
487
488 // Meta-data
489
490 //- Return pointer to meta-data (if any) or nullptr
491 virtual const dictionary* findMetaData() const noexcept;
492
493
494 // Read/write options
495
496 //- The read option
498
499 //- Change the read option, return previous value
501
502 //- The write option
503 inline writeOption writeOpt() const noexcept;
504
505 //- Change the write option, return previous value
507
508
509 // Path components
510
511 //- Return group (extension part of name)
512 inline word group() const;
513
514 //- Return member (name without the extension)
515 inline word member() const;
516
517 //- Return the Time::rootPath()
518 const fileName& rootPath() const;
519
520 //- Return the Time::caseName()
521 const fileName& caseName() const;
522
523 //- Read access to instance path component
524 inline const fileName& instance() const noexcept;
525
526 //- Write access to instance path component
527 inline fileName& instance() noexcept;
528
529 //- Read access to local path component
530 inline const fileName& local() const noexcept;
531
532 //- The complete path
533 fileName path() const;
534
535 //- The complete path with alternative instance and local
537 (
538 const word& instance,
539 const fileName& local = fileName::null
540 ) const;
541
542 //- The complete path + object name
543 inline fileName objectPath() const;
544
545 //- The object path relative to the root
546 fileName objectRelPath() const;
547
548 //- Helper for filePath that searches locally.
549 // When search is false, simply use the current instance,
550 // otherwise search previous instances.
552 (
553 const word& typeName,
554 const bool search=true
555 ) const;
556
557 //- Helper for filePath that searches up if in parallel
558 // When search is false, simply use the current instance,
559 // otherwise search previous instances.
561 (
562 const word& typeName,
563 const bool search=true
564 ) const;
565
566
567 // Reading
568
569 //- Parse 'FoamFile' header contents and set the IOobject
570 //- characteristics and return the stream characteristics.
571 IOstreamOption parseHeader(const dictionary& headerDict);
572
573 //- Read header ('FoamFile' dictionary) and set the
574 //- IOobject and stream characteristics.
575 bool readHeader(Istream& is);
576
577 //- Read header (the 'FoamFile' dictionary) and set the
578 //- IOobject and stream characteristics.
579 // Saves the header content in the given dictionary.
580 bool readHeader(dictionary& headerDict, Istream& is);
581
582 //- Read header (uses typeFilePath to find file) and check its info.
583 // Optionally checks headerClassName against the type-name.
584 // When search is false, simply use the current instance,
585 // otherwise search previous instances.
586 template<class Type>
587 bool typeHeaderOk
588 (
589 const bool checkType = true,
590 const bool search = true,
591 const bool verbose = true
592 );
593
594 //- Helper: warn that type does not support re-reading
595 template<class Type>
596 void warnNoRereading() const;
597
598
599 // Writing
600
601 //- Write the standard OpenFOAM file/dictionary banner
602 // Optionally without editor syntax hint (eg, for logs)
603 static Ostream& writeBanner(Ostream& os, const bool noSyntaxHint=false);
604
605 //- Write the standard file section divider
606 static Ostream& writeDivider(Ostream& os);
607
608 //- Write the standard end file divider
610
611 //- Write header with current type()
612 bool writeHeader(Ostream& os) const;
613
614 //- Write header with override of type
615 bool writeHeader(Ostream& os, const word& objectType) const;
616
617 //- Write header into a dictionary with current type()
618 //- and given output format
619 void writeHeader(dictionary& dict, IOstreamOption streamOpt) const;
620
621 //- Write header into a dictionary with override of type
622 //- and given output format
623 void writeHeader
624 (
626 const word& objectType,
627 IOstreamOption streamOpt
628 ) const;
629
630
631 // Error Handling
632
633 //- Did last readHeader() succeed?
634 inline bool good() const noexcept;
635
636 //- Did last readHeader() fail?
637 inline bool bad() const noexcept;
638
639
640 // Info
641
642 //- Return info proxy, for printing information to a stream
643 InfoProxy<IOobject> info() const
644 {
645 return *this;
646 }
647
648
649 // Member Operators
650
651 //- Copy assignment, copies all values (except the registry)
652 void operator=(const IOobject& io);
653
654
655 // Housekeeping
656
657 //- Access to the read option
658 // \deprecated(2021-03) - use readOpt(readOption)
659 readOption& readOpt() noexcept { return rOpt_; }
660
661 //- Access to the write option
662 // \deprecated(2021-03) - use writeOpt(writeOption)
663 writeOption& writeOpt() noexcept { return wOpt_; }
664
665 //- Access to the register object option
666 // \deprecated(2021-03) - use registerObject(bool)
667 bool& registerObject() noexcept { return registerObject_; }
668
669 //- Access to the global object option
670 // \deprecated(2021-03) - use globalObject(bool)
671 bool& globalObject() noexcept { return globalObject_; }
672};
673
674
675//- Specialization for \c void always returns true (no headerClassName check).
676template<>
677inline bool IOobject::isHeaderClass<void>() const
678{
679 return true;
680}
681
682
683template<>
684Ostream& operator<<(Ostream& os, const InfoProxy<IOobject>& ip);
685
686
687//- Template function for obtaining global vs. local status
688template<class T>
689inline bool typeGlobal()
691 return false;
692}
693
694
695//- Template function for obtaining local or global filePath
696template<class T>
697inline fileName typeFilePath(const IOobject& io, const bool search = true)
698{
699 return
700 (
701 typeGlobal<T>()
702 ? io.globalFilePath(T::typeName, search)
703 : io.localFilePath(T::typeName, search)
704 );
705}
707
708// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
709
710} // End namespace Foam
711
712// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
713
714#include "IOobjectI.H"
715
716// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
717
718#ifdef NoRepository
719# include "IOobjectTemplates.C"
720#endif
721
722// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
723
724#endif
725
726// ************************************************************************* //
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition: Enum.H:61
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
objectState
Enumeration defining the valid states of an IOobject.
Definition: IOobject.H:193
const fileName & caseName() const
Return the Time::caseName()
Definition: IOobject.C:518
bool isHeaderClass() const
Check if headerClassName() equals Type::typeName.
Definition: IOobjectI.H:156
const word & name() const noexcept
Return the object name.
Definition: IOobjectI.H:65
bool readHeader(Istream &is)
const Time & time() const
Return Time associated with the objectRegistry.
Definition: IOobject.C:506
static bool bannerEnabled() noexcept
Status of output file banner.
Definition: IOobject.H:315
bool isHeaderClassName() const
Same as isHeaderClass()
Definition: IOobject.H:532
void warnNoRereading() const
Helper: warn that type does not support re-reading.
static Ostream & writeDivider(Ostream &os)
Write the standard file section divider.
readOption readOpt() const noexcept
The read option.
Definition: IOobjectI.H:164
bool globalObject() const noexcept
Is object same for all processors?
Definition: IOobjectI.H:121
virtual const dictionary * findMetaData() const noexcept
Return pointer to meta-data (if any) or nullptr.
unsigned scalarByteSize() const noexcept
The sizeof (scalar) in bytes, possibly read from the header.
Definition: IOobjectI.H:141
bool typeHeaderOk(const bool checkType=true, const bool search=true, const bool verbose=true)
Read header (uses typeFilePath to find file) and check its info.
static Ostream & writeEndDivider(Ostream &os)
Write the standard end file divider.
fileCheckTypes
Enumeration defining the file checking options.
Definition: IOobject.H:200
static Ostream & writeBanner(Ostream &os, const bool noSyntaxHint=false)
Write the standard OpenFOAM file/dictionary banner.
const objectRegistry & db() const noexcept
Return the local objectRegistry.
Definition: IOobject.C:500
bool good() const noexcept
Did last readHeader() succeed?
Definition: IOobjectI.H:222
bool bad() const noexcept
Did last readHeader() fail?
Definition: IOobjectI.H:228
autoPtr< IOobject > clone(const objectRegistry &registry) const
Clone resetting registry.
Definition: IOobject.H:465
bool registerObject() const noexcept
Should object created with this IOobject be registered?
Definition: IOobjectI.H:107
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
Definition: IOobjectI.H:47
static char scopeSeparator
Character for scoping object names (':' or '_')
Definition: IOobject.H:300
fileName globalFilePath(const word &typeName, const bool search=true) const
Helper for filePath that searches up if in parallel.
Definition: IOobject.C:593
bool hasHeaderClass() const noexcept
True if headerClassName() is non-empty (after reading)
Definition: IOobjectI.H:149
void operator=(const IOobject &io)
Copy assignment, copies all values (except the registry)
Definition: IOobject.C:624
IOobject(const IOobject &)=default
Copy construct.
static IOobject selectIO(const IOobject &io, const fileName &altFile, const word &ioName="")
Return the IOobject, but also consider an alternative file name.
Definition: IOobject.C:238
static bool fileNameComponents(const fileName &path, fileName &instance, fileName &local, word &name)
Split path into instance, local, name components.
Definition: IOobject.C:147
const fileName & local() const noexcept
Read access to local path component.
Definition: IOobjectI.H:208
static void writeHeaderContent(Ostream &os, const IOobject &io, const word &objectType, const dictionary *metaDataDict=nullptr)
fileName objectRelPath() const
The object path relative to the root.
Definition: IOobject.C:558
fileName localFilePath(const word &typeName, const bool search=true) const
Helper for filePath that searches locally.
Definition: IOobject.C:582
word group() const
Return group (extension part of name)
Definition: IOobjectI.H:71
IOstreamOption parseHeader(const dictionary &headerDict)
const fileName & instance() const noexcept
Read access to instance path component.
Definition: IOobjectI.H:196
writeOption
Enumeration defining the write options.
Definition: IOobject.H:186
TypeName("IOobject")
Declare type-name, virtual type (with debug switch)
static float fileModificationSkew
Time skew (seconds) for file modification checks.
Definition: IOobject.H:306
static fileCheckTypes fileModificationChecking
Type of file modification checking.
Definition: IOobject.H:303
virtual void rename(const word &newName)
Rename the object.
Definition: IOobject.H:497
unsigned labelByteSize() const noexcept
The sizeof (label) in bytes, possibly read from the header.
Definition: IOobjectI.H:135
static const Enum< fileCheckTypes > fileCheckTypesNames
Names for the fileCheckTypes.
Definition: IOobject.H:208
fileName path() const
The complete path.
Definition: IOobject.C:524
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
autoPtr< IOobject > clone() const
Clone.
Definition: IOobject.H:459
word member() const
Return member (name without the extension)
Definition: IOobjectI.H:77
const fileName & rootPath() const
Return the Time::rootPath()
Definition: IOobject.C:512
const string & note() const noexcept
Return the optional note.
Definition: IOobjectI.H:95
virtual ~IOobject()=default
Destructor.
word & headerClassName() noexcept
Return non-constant access to the class name read from header.
Definition: IOobjectI.H:89
static int maxFileModificationPolls
Max number of times to poll for file modification changes.
Definition: IOobject.H:309
fileName objectPath() const
The complete path + object name.
Definition: IOobjectI.H:214
bool writeHeader(Ostream &os) const
Write header with current type()
void setBad(const string &s)
Set the object state to bad.
Definition: IOobject.C:603
writeOption writeOpt() const noexcept
The write option.
Definition: IOobjectI.H:179
InfoProxy< IOobject > info() const
Return info proxy, for printing information to a stream.
Definition: IOobject.H:690
readOption
Enumeration defining the read options.
Definition: IOobject.H:177
@ MUST_READ_IF_MODIFIED
Definition: IOobject.H:180
The IOstreamOption is a simple container for options an IOstream can normally have.
A helper class for outputting values to Ostream.
Definition: InfoProxy.H:52
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:80
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A class for handling file names.
Definition: fileName.H:76
Registry of regIOobjects.
A class for handling words, derived from Foam::string.
Definition: word.H:68
OBJstream os(runTime.globalPath()/outputName)
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.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
fileName typeFilePath(const IOobject &io, const bool search=true)
Template function for obtaining local or global filePath.
Definition: IOobject.H:744
const direction noexcept
Definition: Scalar.H:223
bool typeGlobal()
Template function for obtaining global vs. local status.
Definition: IOobject.H:736
fileName search(const word &file, const fileName &directory)
Recursively search the given directory for the file.
Definition: fileName.C:624
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73