Loading...
Searching...
No Matches
dictionary Class Reference

A list of keyword definitions, which are a keyword followed by a number of values (eg, words and numbers) or by a sub-dictionary. Since the dictionary format is used extensively throughout OpenFOAM for input/output files, there are many examples of its use. More...

#include <dictionary.H>

Inheritance diagram for dictionary:
Collaboration diagram for dictionary:

Classes

class  Searcher
 Generic const/non-const dictionary entry searcher. More...

Public Types

typedef Searcher< true > const_searcher
 Searcher with const access.
typedef Searcher< false > searcher
 Searcher with non-const access.
Public Types inherited from UILList< DLListBase, T >
typedef T value_type
 Type of values stored.
typedef Tpointer
 Pointer for value_type.
typedef const Tconst_pointer
 Const pointer for value_type.
typedef Treference
 Reference for value_type.
typedef const Tconst_reference
 Const reference for value_type.
typedef label size_type
 The type that can represent the container size.
typedef label difference_type
 The difference between iterator objects.
using base_iterator
using const_base_iterator

Public Member Functions

 ClassName ("dictionary")
 dictionary ()
 Default construct, a top-level empty dictionary.
 dictionary (const fileName &name)
 Construct top-level empty dictionary with given name.
 dictionary (const fileName &name, const dictionary &parentDict, Istream &is, bool keepHeader=false)
 Construct given the entry name, parent dictionary and Istream, reading entries until EOF, optionally keeping the header.
 dictionary (Istream &is)
 Construct top-level dictionary from Istream (discards the header). Reads entries until EOF or when the first token is a '{' character, it will stop reading at the matching '}' character.
 dictionary (Istream &is, bool keepHeader)
 Construct top-level dictionary from Istream, reading entries until EOF, optionally keeping the header.
 dictionary (const dictionary &parentDict, const dictionary &dict)
 Copy construct given the parent dictionary.
 dictionary (const dictionary &dict)
 Copy construct top-level dictionary.
 dictionary (const dictionary *dict)
 Construct top-level dictionary as copy from pointer to dictionary.
 dictionary (const dictionary &parentDict, dictionary &&dict)
 Move construct for given parent dictionary.
 dictionary (dictionary &&dict)
 Move construct top-level dictionary.
autoPtr< dictionaryclone () const
 Construct and return clone.
virtual ~dictionary ()
 Destructor.
const fileNamename () const noexcept
 The dictionary name.
fileNamename () noexcept
 The dictionary name for modification (use with caution).
word dictName () const
 The local dictionary name (final part of scoped name).
fileName relativeName (const bool caseTag=false) const
 The dictionary name relative to the case.
bool isNullDict () const noexcept
 The dictionary is actually dictionary::null (root dictionary).
const dictionaryparent () const noexcept
 Return the parent dictionary.
const dictionarytopDict () const
 Return the top of the tree.
label startLineNumber () const
 Return line number of first token in dictionary.
label endLineNumber () const
 Return line number of last token in dictionary.
SHA1Digest digest () const
 Return the SHA1 digest of the dictionary contents.
tokenList tokens () const
 Return the dictionary as a list of tokens.
const entryfindEntry (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Find an entry (const access) with the given keyword.
entryfindEntry (const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
 Find an entry (non-const access) with the given keyword.
bool found (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Find an entry (const access) with the given keyword.
const entryfindScoped (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Search for a scoped entry (const access) with the given keyword.
const dictionaryfindDict (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Find and return a sub-dictionary pointer if present (and it is a dictionary) otherwise return nullptr.
dictionaryfindDict (const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
 Find and return a sub-dictionary pointer if present (and it is a dictionary) otherwise return nullptr.
ITstreamfindStream (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Find and return an entry stream if present (and it is a stream) otherwise return nullptr.
const entrylookupEntry (const word &keyword, enum keyType::option matchOpt) const
 Search for an entry (const access) with the given keyword.
ITstreamlookup (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Find and return an entry data stream. FatalIOError if not found, or not a stream.
template<class T>
T get (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.
template<class T>
T getOrDefault (const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
 Find and return a T, or return the given default value. FatalIOError if it is found and the number of tokens is incorrect.
template<class T>
T getOrAdd (const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX)
 Find and return a T, or return the given default value and add it to dictionary. FatalIOError if it is found and the number of tokens is incorrect.
template<class T>
bool readEntry (const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, IOobjectOption::readOption readOpt=IOobjectOption::MUST_READ) const
 Find entry and assign to T val. FatalIOError if it is found and the number of tokens is incorrect, or it is mandatory and not found.
template<class T>
bool readIfPresent (const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
 Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens is incorrect.
template<class T, class Predicate>
T getCheck (const word &keyword, const Predicate &pred, enum keyType::option matchOpt=keyType::REGEX) const
 Find and return a T with additional checking FatalIOError if not found, or if the number of tokens is incorrect.
template<class T, class Predicate>
T getCheckOrDefault (const word &keyword, const T &deflt, const Predicate &pred, enum keyType::option matchOpt=keyType::REGEX) const
 Find and return a T, or return the given default value. FatalIOError if it is found and the number of tokens is incorrect.
template<class T, class Predicate>
T getCheckOrAdd (const word &keyword, const T &deflt, const Predicate &pred, enum keyType::option matchOpt=keyType::REGEX)
 Find and return a T, or return the given default value and add it to dictionary. FatalIOError if it is found and the number of tokens is incorrect.
template<class T, class Predicate>
bool readCheck (const word &keyword, T &val, const Predicate &pred, enum keyType::option matchOpt=keyType::REGEX, IOobjectOption::readOption readOpt=IOobjectOption::MUST_READ) const
 Find entry and assign to T val. FatalIOError if it is found and the number of tokens is incorrect, or it is mandatory and not found.
template<class T, class Predicate>
bool readCheckIfPresent (const word &keyword, T &val, const Predicate &pred, enum keyType::option matchOpt=keyType::REGEX) const
 Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens is incorrect.
const dictionarysubDict (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Find and return a sub-dictionary.
dictionarysubDict (const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
 Find and return a sub-dictionary for manipulation.
dictionarysubDictOrAdd (const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
 Find and return a sub-dictionary for manipulation.
dictionary subOrEmptyDict (const word &keyword, enum keyType::option matchOpt=keyType::REGEX, const bool mandatory=false) const
 Find and return a sub-dictionary as a copy, otherwise return an empty dictionary.
const dictionaryoptionalSubDict (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Find and return a sub-dictionary, otherwise return this dictionary.
wordList toc () const
 Return the table of contents.
wordList sortedToc () const
 Return the sorted table of contents.
template<class Compare>
wordList sortedToc (const Compare &comp) const
 Return table of contents sorted using the specified comparator.
List< keyTypekeys (bool patterns=false) const
 Return the list of available keys or patterns.
bool substituteKeyword (const word &keyword, bool mergeEntry=false)
 Substitute the given keyword (which is prefixed by '$').
bool substituteScopedKeyword (const word &keyword, bool mergeEntry=false)
 Substitute the given scoped keyword (which is prefixed by '$').
entryadd (entry *entryPtr, bool mergeEntry=false)
 Add a new entry.
entryadd (const entry &e, bool mergeEntry=false)
 Add an entry.
entryadd (const keyType &k, const word &v, bool overwrite=false)
 Add a word entry.
entryadd (const keyType &k, const string &v, bool overwrite=false)
 Add a string entry.
entryadd (const keyType &k, const label v, bool overwrite=false)
 Add a label entry.
entryadd (const keyType &k, const scalar v, bool overwrite=false)
 Add a scalar entry.
entryadd (const keyType &k, const dictionary &d, bool mergeEntry=false)
 Add a dictionary entry.
template<class T>
entryadd (const keyType &k, const T &v, bool overwrite=false)
 Add a T entry.
entryset (entry *entryPtr)
 Assign a new entry, overwriting any existing entry.
entryset (const entry &e)
 Assign a new entry, overwriting any existing entry.
entryset (const keyType &k, const dictionary &v)
 Assign a dictionary entry, overwriting any existing entry.
entryset (const keyType &k, std::nullptr_t)
 Assign an empty primitive entry, overwriting any existing entry.
entryset (const keyType &k, const UList< token > &tokens)
 Assign a primitive entry from a list of tokens, overwriting any existing entry.
entryset (const keyType &k, List< token > &&tokens)
 Assign a primitive entry from a list of tokens, overwriting any existing entry.
template<class T>
entryset (const keyType &k, const T &v)
 Assign a T entry, overwriting any existing entry.
bool remove (const word &keyword)
 Remove an entry specified by keyword.
bool changeKeyword (const keyType &oldKeyword, const keyType &newKeyword, bool overwrite=false)
 Change the keyword for an entry,.
bool merge (const dictionary &dict)
 Merge entries from the given dictionary.
void clear ()
 Clear the dictionary.
void transfer (dictionary &dict)
 Transfer the contents of the argument and annul the argument.
void checkITstream (const ITstream &is, const word &keyword) const
 Check after reading if the input token stream has unconsumed tokens remaining or if there were no tokens in the first place.
bool read (Istream &is)
 Read dictionary from Istream (discards the header). Reads entries until EOF or when the first token is a '{' character, it will stop reading at the matching '}' character.
bool read (Istream &is, bool keepHeader)
 Read dictionary from Istream (optionally keeping the header) Reads entries until EOF or when the first token is a '{' character, it will stop reading at the matching '}' character.
void writeEntry (Ostream &os) const
 Write sub-dictionary with its dictName as its header.
void writeEntry (const keyType &keyword, Ostream &os) const
 Write sub-dictionary with the keyword as its header.
void writeEntries (Ostream &os, const bool extraNewLine=false) const
 Write dictionary entries.
void write (Ostream &os, const bool subDict=true) const
 Write dictionary, normally with sub-dictionary formatting.
const_searcher csearch (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Search dictionary for given keyword.
const_searcher search (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Search dictionary for given keyword.
searcher search (const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
 Search dictionary for given keyword.
const_searcher csearchScoped (const word &keyword, enum keyType::option matchOpt) const
 Search using scoping.
const_searcher searchScoped (const word &keyword, enum keyType::option matchOpt) const
 Search using dot or slash scoping.
searcher searchScoped (const word &keyword, enum keyType::option matchOpt)
 Search using dot or slash scoping.
const dictionarycfindScopedDict (const fileName &dictPath) const
 Locate a sub-dictionary using slash-scoping.
const dictionaryfindScopedDict (const fileName &dictPath) const
 Locate a sub-dictionary using slash-scoping.
dictionaryfindScopedDict (const fileName &dictPath)
 Locate a sub-dictionary using slash-scoping.
dictionarymakeScopedDict (const fileName &dictPath)
 Locate existing or create sub-dictionary using slash-scoping.
const_searcher csearchCompat (const word &keyword, std::initializer_list< std::pair< const char *, int > > compat, enum keyType::option matchOpt=keyType::REGEX) const
 Search dictionary for given keyword and any compatibility names.
const entryfindCompat (const word &keyword, std::initializer_list< std::pair< const char *, int > > compat, enum keyType::option matchOpt) const
 Find and return an entry pointer if present, or return a nullptr, using any compatibility names if needed.
bool foundCompat (const word &keyword, std::initializer_list< std::pair< const char *, int > > compat, enum keyType::option matchOpt=keyType::REGEX) const
 Search dictionary for given keyword and any compatibility names.
const entrylookupEntryCompat (const word &keyword, std::initializer_list< std::pair< const char *, int > > compat, enum keyType::option matchOpt) const
 Find and return an entry if present, otherwise FatalIOError, using any compatibility names if needed.
ITstreamlookupCompat (const word &keyword, std::initializer_list< std::pair< const char *, int > > compat, enum keyType::option matchOpt=keyType::REGEX) const
 Find and return an entry data stream, using any compatibility names if needed.
template<class T>
T getCompat (const word &keyword, std::initializer_list< std::pair< const char *, int > > compat, enum keyType::option matchOpt=keyType::REGEX) const
 Find and return a T using any compatibility names if needed. FatalIOError if not found, or if there are excess tokens.
template<class T>
T getOrDefaultCompat (const word &keyword, std::initializer_list< std::pair< const char *, int > > compat, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
 Find and return a T, or return the given default value using any compatibility names if needed.
template<class T>
bool readCompat (const word &keyword, std::initializer_list< std::pair< const char *, int > > compat, T &val, enum keyType::option matchOpt=keyType::REGEX, IOobjectOption::readOption readOpt=IOobjectOption::MUST_READ) const
 Find entry and assign to T val using any compatibility names if needed. FatalIOError if there are excess tokens.
template<class T>
bool readIfPresentCompat (const word &keyword, std::initializer_list< std::pair< const char *, int > > compat, T &val, enum keyType::option matchOpt=keyType::REGEX) const
 Find an entry if present, and assign to T val using any compatibility names if needed. FatalIOError if it is found and there are excess tokens.
void operator= (const dictionary &rhs)
 Copy assignment.
void operator+= (const dictionary &rhs)
 Include entries from the given dictionary.
void operator|= (const dictionary &rhs)
 Conditionally include entries from the given dictionary.
void operator<<= (const dictionary &rhs)
 Unconditionally include entries from the given dictionary.
bool getBool (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Same as get<bool>(const word&, keyType::option).
label getLabel (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Same as get<label>(const word&, keyType::option).
scalar getScalar (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Same as get<scalar>(const word&, keyType::option).
string getString (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Same as get<string>(const word&, keyType::option).
word getWord (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Same as get<word>(const word&, keyType::option).
fileName getFileName (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Same as get<fileName>(const word&, keyType::option).
bool isDict (const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
 Check for existence of a sub-dictionary. Generally prefer findDict() for more flexibility.
template<class T>
T lookupOrDefault (const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
 Same as getOrDefault().
template<class T>
T lookupOrAddDefault (const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX)
 Same as getOrAdd().
ITstreamoperator[] (const word &keyword) const
 Deprecated(2018-07) - use lookup() method.
bool found (const word &keyword, bool recursive, bool patternMatch=true) const
 Deprecated(2018-10).
entrylookupEntryPtr (const word &keyword, bool recursive, bool patternMatch)
 Deprecated(2018-10).
const entrylookupEntryPtr (const word &keyword, bool recursive, bool patternMatch) const
 Deprecated(2018-10).
const entrylookupScopedEntryPtr (const word &keyword, bool recursive, bool patternMatch) const
 Deprecated(2018-10).
const dictionarysubDictPtr (const word &keyword) const
 Deprecated(2018-10).
dictionarysubDictPtr (const word &keyword)
 Deprecated(2018-10) Find and return a sub-dictionary pointer if present.
const entrylookupEntry (const word &keyword, bool recursive, bool patternMatch) const
 Deprecated(2018-10).
ITstreamlookup (const word &keyword, bool recursive, bool patternMatch=true) const
 Deprecated(2018-10).
template<class T>
T lookupOrDefault (const word &keyword, const T &deflt, bool recursive, bool patternMatch=true) const
 Deprecated(2018-10).
template<class T>
T lookupOrAddDefault (const word &keyword, const T &deflt, bool recursive, bool patternMatch=true)
 Deprecated(2018-10).
template<class T>
bool readIfPresent (const word &keyword, T &val, bool recursive, bool patternMatch=true) const
 Deprecated(2018-10).
template<class T>
T lookupType (const word &keyword, bool recursive=false, bool patternMatch=true) const
 Deprecated(2018-10) find and return a T.
template<class Compare>
Foam::wordList sortedToc (const Compare &comp) const
template<class T>
Foam::entryadd (const keyType &k, const T &v, bool overwrite)
template<class T>
Foam::entryset (const keyType &k, const T &v)
Public Member Functions inherited from ILList< DLListBase, T >
 ILList ()=default
 Default construct.
 ILList (T *item)
 Construct and add initial item pointer.
 ILList (Istream &is)
 Construct from Istream.
 ILList (const ILList< DLListBase, T > &lst)
 Copy construct using the 'clone()' method for each element.
 ILList (ILList< DLListBase, T > &&lst)
 Move construct.
 ILList (const ILList< DLListBase, T > &lst, const CloneArg &cloneArg)
 Copy constructor with additional argument for clone 'clone()'.
 ILList (Istream &is, const INew &inew)
 Construct from Istream using given Istream constructor class.
 ~ILList ()
 Destructor. Calls clear().
void clear ()
 Clear the contents of the list.
void pop_front (label n=1)
 Remove first element(s) from the list (deletes pointers).
bool erase (T *item)
 Remove the specified element from the list and delete it.
void transfer (ILList< DLListBase, T > &lst)
 Transfer the contents of the argument into this List and annul the argument list.
void operator= (const ILList< DLListBase, T > &lst)
 Copy assignment using the 'clone()' method for each element.
void operator= (ILList< DLListBase, T > &&lst)
 Move assignment.
Public Member Functions inherited from UILList< DLListBase, T >
 UILList ()=default
 Default construct.
 UILList (T *item)
 Construct and add initial item pointer.
 UILList (const UILList< DLListBase, T > &list)
 Construct as copy.
Tfront ()
 The first entry in the list.
const Tfront () const
 The first entry in the list (const access).
Tback ()
 The last entry in the list.
const Tback () const
 The last entry in the list (const access).
TremoveHead ()
 Remove and return head.
Tremove (T *item)
 Remove and return element.
Tremove (iterator &iter)
 Remove and return item specified by iterator.
void operator= (const UILList< DLListBase, T > &lst)
 Copy assignment.
bool operator== (const UILList< DLListBase, T > &lst) const
 Equality. True both lists are element-wise equal.
bool operator!= (const UILList< DLListBase, T > &lst) const
 The opposite of the equality operation. Takes linear time.
OstreamwriteList (Ostream &os, const label shortLen=0) const
 Write UILList with line-breaks when length exceeds shortLen.
iterator begin ()
 Iterator to first item in list with non-const access.
const_iterator cbegin () const
 Iterator to first item in list with const access.
reverse_iterator rbegin ()
 Iterator to last item in list with non-const access.
const_reverse_iterator crbegin () const
 Iterator to last item in list with const access.
const_iterator begin () const
 Iterator to first item in list with const access.
const_reverse_iterator rbegin () const
 Iterator to last item in list with const access.
const iterator & end ()
 End of list for forward iterators.
const const_iterator & cend () const
 End of list for forward iterators.
const reverse_iterator & rend ()
 End of list for reverse iterators.
const const_reverse_iterator & crend () const
 End of list for reverse iterators.
const const_iterator & end () const
 End of list for forward iterators.
const const_reverse_iterator & rend () const
 End of list for reverse iterators.
Tfirst ()
 The first entry in the list.
const Tfirst () const
 The first entry in the list (const access).
Tlast ()
 The last entry in the list.
const Tlast () const
 The last entry in the list (const access).
Public Member Functions inherited from DLListBase
 DLListBase ()=default
 Default construct.
 DLListBase (const DLListBase &)=delete
 No copy construct.
void operator= (const DLListBase &)=delete
 No copy assignment.
 ~DLListBase ()=default
 Destructor.
bool empty () const noexcept
 True if the list is empty.
label size () const noexcept
 The number of elements in list.
linkfront ()
 Return first entry.
const linkfront () const
 Return const access to first entry.
linkback ()
 Return last entry.
const linkback () const
 Return const access to last entry.
void push_front (link *item)
 Add at front of list.
void push_back (link *item)
 Add at back of list.
bool swapUp (link *item)
 Swap this element with the one above unless it is at the top.
bool swapDown (link *item)
 Swap this element with the one below unless it is at the bottom.
linkremoveHead ()
 Remove and return first entry.
linkremove (link *item)
 Remove and return element.
linkremove (iterator &iter)
 Remove and return element specified by iterator.
linkreplace (link *oldLink, link *newLink)
 Replace oldLink with newLink and return element.
linkreplace (iterator &oldIter, link *newitem)
 Replace oldIter with newItem and return element.
void clear ()
 Clear the list.
void swap (DLListBase &lst)
 Swap the contents of the list.
void transfer (DLListBase &lst)
 Transfer the contents of the argument into this list and annul the argument list.
iterator begin ()
 Iterator to first item in list with non-const access.
const_iterator cbegin () const
 Iterator to first item in list with const access.
const_iterator crbegin () const
 Iterator to last item in list with const access.
const iteratorend ()
 End of list for iterators.
const const_iteratorcend () const
 End of list for iterators.
const const_iteratorcrend () const
 End of list for reverse iterators.
linkfirst ()
 Return first entry.
const linkfirst () const
 Return const access to first entry.
linklast ()
 Return last entry.
const linklast () const
 Return const access to last entry.
void prepend (link *item)
 Add at front of list.
void append (link *item)
 Add at back of list.

Static Public Member Functions

static int reportOptional () noexcept
 Return the state of reporting optional (default) entries.
static int reportOptional (const int level) noexcept
 Change the state of reporting optional (default) entries.
static autoPtr< dictionaryNew (Istream &is)
 Construct top-level dictionary on freestore from Istream.

Public Attributes

friend const_searcher
 Declare friendship with the searcher classes.
friend searcher

Static Public Attributes

static int writeOptionalEntries
 Report optional keywords and values if not present in dictionary.
static const dictionary null
 An empty dictionary, which is also the parent for all dictionaries.
static refPtr< OSstreamreportingOutput
 Output location when reporting default values.

Friends

class entry
 Declare friendship with the entry class for IO.
Istreamoperator>> (Istream &is, dictionary &dict)
 Read dictionary from Istream.
Ostreamoperator<< (Ostream &os, const dictionary &dict)
 Write dictionary to Ostream.

Additional Inherited Members

Protected Member Functions inherited from DLListBase
template<class IteratorType>
IteratorType iterator_first () const
 Return iterator to first item or end-iterator if list is empty.
template<class IteratorType>
IteratorType iterator_last () const
 Return iterator to last item or end-iterator if list is empty.
Static Protected Member Functions inherited from DLListBase
template<class IteratorType>
static const IteratorType & iterator_end ()
 Factory method to return an iterator end.
template<class IteratorType>
static const IteratorType & iterator_rend ()
 Factory method to return an iterator reverse end.

Detailed Description

A list of keyword definitions, which are a keyword followed by a number of values (eg, words and numbers) or by a sub-dictionary. Since the dictionary format is used extensively throughout OpenFOAM for input/output files, there are many examples of its use.

Dictionary keywords are a plain word or a pattern (regular expression). The general order for searching is as follows:

  • exact match
  • pattern match (in reverse order)
  • optional recursion into the enclosing (parent) dictionaries

The dictionary class is the base class for IOdictionary and also serves as a bootstrap dictionary for the objectRegistry data dictionaries.

Note
Within dictionaries, entries can be referenced by using the '$' syntax familiar from shell programming. Similarly, the '/' separator is used when referencing sub-dictionary entries:
  • "./" : the current dictionary
  • "../" : the parent dictionary
  • "../../" : the grandparent dictionary
An initial '/' anchor specifies that the path starts from the top-level entry. It is also possible to use the '${}' syntax for clarity.

For example,

key1        val1;
key2        $key1;    // Use key1 value from current scope
key3        $./key1;  // Use key1 value from current scope

subdict1
{
    key1        val1b;
    key2        $../key1;  // Use key1 value from parent
    subdict2
    {
        key2    val2;
        key3    $../../key1;  // Use key1 value from grandparent
    }
}

key4        $/subdict1/subdict2/key3;  // Lookup with absolute scoping

Prior to OpenFOAM-v1712, a dot-scoping (.) syntax was used, which is still supported (AUG-2023) but deprecated in favour of the less ambiguous slash-scoping (/) syntax. With dot-scoping, an initial '^' anchor, or an initial (:), was used to specify that the path starts from the top-level entry.

Source files
See also

Definition at line 130 of file dictionary.H.

Member Typedef Documentation

◆ const_searcher

typedef Searcher<true> const_searcher

Searcher with const access.

Definition at line 325 of file dictionary.H.

◆ searcher

typedef Searcher<false> searcher

Searcher with non-const access.

Definition at line 330 of file dictionary.H.

Constructor & Destructor Documentation

◆ dictionary() [1/10]

dictionary ( )

Default construct, a top-level empty dictionary.

Definition at line 68 of file dictionary.C.

References dictionary(), and null.

Referenced by add(), add(), baseIOdictionary::baseIOdictionary(), baseIOdictionary::baseIOdictionary(), caseInfo::caseInfo(), cellSizeFunction::cellSizeFunction(), cfindScopedDict(), dictionaryEntry::clone(), faceAreaWeightModel::coeffDict(), adjointRASModel::coeffDict(), relaxationModel::coeffDict(), regionFaModel::coeffs(), regionModel::coeffs(), cellSizeFunction::coeffsDict(), surfaceCellSizeFunction::coeffsDict(), csearchScoped(), cellSizeFunction::declareRunTimeSelectionTable(), faceAreaWeightModel::declareRunTimeSelectionTable(), adjointRASModel::declareRunTimeSelectionTable(), initialPointsMethod::declareRunTimeSelectionTable(), radiationModel::declareRunTimeSelectionTable(), liquidFilmBase::declareRunTimeSelectionTable(), pyrolysisModel::declareRunTimeSelectionTable(), thermalBaffleModel::declareRunTimeSelectionTable(), relaxationModel::declareRunTimeSelectionTable(), SRFModel::declareRunTimeSelectionTable(), surfaceCellSizeFunction::declareRunTimeSelectionTable(), initialPointsMethod::detailsDict(), dictionary(), dictionary(), dictionary(), dictionary(), dictionary(), dictionary(), dictionary(), dictionary(), dictionary(), dictionary(), dictionaryEntry::dictionaryEntry(), dictionaryEntry::dictionaryEntry(), dictionaryEntry::dictionaryEntry(), dictionaryEntry::dictionaryEntry(), dictionaryEntry::dictionaryEntry(), faceAreaWeightModel::faceAreaWeightModel(), fieldDictionary::fieldDictionary(), findDict(), findScopedDict(), properties::foundObjectProperty(), properties::getObjectDict(), properties::getObjectProperty(), properties::getObjectResult(), properties::getObjectResultDict(), properties::hasResultObject(), properties::hasResultObjectEntry(), initialPointsMethod::initialPointsMethod(), liquidFilmBase::liquidFilmBase(), liquidFilmModel::liquidFilmModel(), makeScopedDict(), merge(), cellSizeFunction::New(), faceAreaWeightModel::New(), initialPointsMethod::New(), radiationModel::New(), radiationModel::New(), liquidFilmBase::New(), pyrolysisModel::New(), thermalBaffleModel::New(), relaxationModel::New(), surfaceCellSizeFunction::New(), properties::objectResultEntries(), properties::objectResultType(), operator+=(), operator<<, operator<<=(), baseIOdictionary::operator=(), operator=(), caseInfo::operator=(), liquidFilmBase::operator=(), operator>>, operator|=(), optionalSubDict(), properties::propertyDict(), pyrolysisModel::pyrolysisModel(), radiationModel::radiationModel(), caseInfo::read(), adjointRASModel::read(), pyrolysisModel::read(), regionModel::read(), regionModel::read(), thermalBaffleModel::read(), regionFaModel::regionFaModel(), regionModel::regionModel(), relaxationModel::relaxationModel(), set(), set(), set(), properties::setObjectProperty(), properties::setObjectResult(), sortedToc(), subDictOrAdd(), subDictPtr(), subDictPtr(), subOrEmptyDict(), surfaceCellSizeFunction::surfaceCellSizeFunction(), thermalBaffleModel::thermalBaffleModel(), topDict(), transfer(), caseInfo::TypeName(), liquidFilmModel::TypeName(), regionModel::TypeName(), caseInfo::write(), properties::writeAllResultEntries(), caseInfo::writeFileDicts(), caseInfo::writeFunctionObjects(), caseInfo::writeMeshStats(), caseInfo::writeMeta(), caseInfo::writePatches(), caseInfo::writeRegisteredDicts(), properties::writeResultEntries(), baseIOdictionary::~baseIOdictionary(), and caseInfo::~caseInfo().

Here is the call graph for this function:

◆ dictionary() [2/10]

dictionary ( const fileName & name)
explicit

Construct top-level empty dictionary with given name.

Definition at line 75 of file dictionary.C.

References dictionary(), name(), and null.

Here is the call graph for this function:

◆ dictionary() [3/10]

dictionary ( const fileName & name,
const dictionary & parentDict,
Istream & is,
bool keepHeader = false )

Construct given the entry name, parent dictionary and Istream, reading entries until EOF, optionally keeping the header.

Definition at line 27 of file dictionaryIO.C.

References dictionary(), name(), and read().

Here is the call graph for this function:

◆ dictionary() [4/10]

dictionary ( Istream & is)

Construct top-level dictionary from Istream (discards the header). Reads entries until EOF or when the first token is a '{' character, it will stop reading at the matching '}' character.

Note
this constructor should be explicit

Definition at line 42 of file dictionaryIO.C.

References dictionary().

Here is the call graph for this function:

◆ dictionary() [5/10]

dictionary ( Istream & is,
bool keepHeader )

Construct top-level dictionary from Istream, reading entries until EOF, optionally keeping the header.

Definition at line 48 of file dictionaryIO.C.

References dictionary(), name(), null, read(), and entry::resetInputMode().

Here is the call graph for this function:

◆ dictionary() [6/10]

dictionary ( const dictionary & parentDict,
const dictionary & dict )

Copy construct given the parent dictionary.

Definition at line 82 of file dictionary.C.

References dict, dictionary(), e, entry, name(), and autoPtr< T >::New().

Here is the call graph for this function:

◆ dictionary() [7/10]

dictionary ( const dictionary & dict)

Copy construct top-level dictionary.

Definition at line 105 of file dictionary.C.

References dict, dictionary(), e, entry, name(), autoPtr< T >::New(), and null.

Here is the call graph for this function:

◆ dictionary() [8/10]

dictionary ( const dictionary * dict)
explicit

Construct top-level dictionary as copy from pointer to dictionary.

A null pointer is treated like an empty dictionary.

Definition at line 127 of file dictionary.C.

References dict, dictionary(), null, and operator=().

Here is the call graph for this function:

◆ dictionary() [9/10]

dictionary ( const dictionary & parentDict,
dictionary && dict )

Move construct for given parent dictionary.

Definition at line 139 of file dictionary.C.

References fileName::concat(), dict, dictionary(), name(), and transfer().

Here is the call graph for this function:

◆ dictionary() [10/10]

dictionary ( dictionary && dict)

Move construct top-level dictionary.

Definition at line 153 of file dictionary.C.

References dict, dictionary(), null, and transfer().

Here is the call graph for this function:

◆ ~dictionary()

~dictionary ( )
virtual

Destructor.

Definition at line 173 of file dictionary.C.

Member Function Documentation

◆ ClassName()

ClassName ( "dictionary" )

◆ reportOptional() [1/2]

int reportOptional ( )
inlinestaticnoexcept

Return the state of reporting optional (default) entries.

0: no reporting, 1: report, 2: fatal if not set

Definition at line 25 of file dictionaryI.H.

References Foam::noexcept, and writeOptionalEntries.

◆ reportOptional() [2/2]

int reportOptional ( const int level)
inlinestaticnoexcept

Change the state of reporting optional (default) entries.

0: no reporting, 1: report, 2: fatal if not set

Returns
old level

Definition at line 31 of file dictionaryI.H.

References writeOptionalEntries.

◆ clone()

Foam::autoPtr< Foam::dictionary > clone ( ) const

Construct and return clone.

Definition at line 165 of file dictionary.C.

References autoPtr< T >::New().

Referenced by Foam::preservePatchTypes(), and refinementSurfaces::refinementSurfaces().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ New()

Foam::autoPtr< Foam::dictionary > New ( Istream & is)
static

Construct top-level dictionary on freestore from Istream.

Definition at line 62 of file dictionaryIO.C.

References autoPtr< T >::New().

Here is the call graph for this function:

◆ name() [1/2]

◆ name() [2/2]

Foam::fileName & name ( )
inlinenoexcept

The dictionary name for modification (use with caution).

Definition at line 47 of file dictionaryI.H.

References Foam::noexcept.

◆ dictName()

◆ relativeName()

Foam::fileName relativeName ( const bool caseTag = false) const

The dictionary name relative to the case.

Uses argList::envRelativePath to obtain FOAM_CASE

Parameters
caseTagreplace globalPath with <case> for later use with expand(), or prefix <case> if the file name was not an absolute location

Definition at line 179 of file dictionary.C.

References argList::envRelativePath(), and name.

Referenced by add(), checkITstream(), csearchCompat(), codeStream::evaluate(), includeEntry::execute(), includeEntry::execute(), includeEtcEntry::execute(), includeEtcEntry::execute(), lookupEntry(), lookupEntryCompat(), merge(), operator+=(), operator<<=(), operator|=(), optionalSubDict(), dictionaryEntry::relativeName(), subDict(), subDict(), subDictOrAdd(), and subOrEmptyDict().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isNullDict()

bool isNullDict ( ) const
inlinenoexcept

The dictionary is actually dictionary::null (root dictionary).

Definition at line 71 of file dictionaryI.H.

References Foam::noexcept, and null.

◆ parent()

const Foam::dictionary & parent ( ) const
inlinenoexcept

Return the parent dictionary.

Definition at line 77 of file dictionaryI.H.

References Foam::noexcept.

Referenced by profiling::create(), profiling::New(), profiling::operator=(), topDict(), and writeEntries().

Here is the caller graph for this function:

◆ topDict()

const Foam::dictionary & topDict ( ) const

Return the top of the tree.

Definition at line 185 of file dictionary.C.

References dictionary(), p, and parent().

Referenced by includeEntry::execute(), includeEntry::execute(), includeEtcEntry::execute(), includeEtcEntry::execute(), and codeStream::getFunction().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ startLineNumber()

Foam::label startLineNumber ( ) const

Return line number of first token in dictionary.

Definition at line 198 of file dictionary.C.

References DLListBase::empty(), UILList< DLListBase, T >::front(), and startLineNumber().

Referenced by startLineNumber(), dictionaryEntry::startLineNumber(), and codedBase::updateLibrary().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ endLineNumber()

Foam::label endLineNumber ( ) const

Return line number of last token in dictionary.

Definition at line 209 of file dictionary.C.

References UILList< DLListBase, T >::back(), DLListBase::empty(), and endLineNumber().

Referenced by endLineNumber(), and dictionaryEntry::endLineNumber().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ digest()

Foam::SHA1Digest digest ( ) const

Return the SHA1 digest of the dictionary contents.

Definition at line 220 of file dictionary.C.

References e, entry, and os().

Here is the call graph for this function:

◆ tokens()

Foam::tokenList tokens ( ) const

Return the dictionary as a list of tokens.

Definition at line 234 of file dictionary.C.

References e, entry, os(), and ITstream::parse().

Referenced by add(), set(), and set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findEntry() [1/2]

const Foam::entry * findEntry ( const word & keyword,
enum keyType::option matchOpt = keyType::REGEX ) const
inline

Find an entry (const access) with the given keyword.

Parameters
keywordthe keyword to search for
matchOptsearch mode (default: non-recursive with patterns)
Returns
pointer to the entry found or a nullptr.

Definition at line 83 of file dictionaryI.H.

References csearch().

Referenced by boundaryRadiationProperties::boundaryRadiationProperties(), dynamicCodeContext::findEntry(), found(), genericFaePatchField< Type >::genericFaePatchField(), genericFaPatchField< Type >::genericFaPatchField(), genericFvPatchField< Type >::genericFvPatchField(), genericFvsPatchField< Type >::genericFvsPatchField(), lookupEntry(), lookupEntryPtr(), lookupEntryPtr(), refinementSurfaces::refinementSurfaces(), caseInfo::writeFileDicts(), and caseInfo::writeRegisteredDicts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findEntry() [2/2]

Foam::entry * findEntry ( const word & keyword,
enum keyType::option matchOpt = keyType::REGEX )
inline

Find an entry (non-const access) with the given keyword.

Parameters
keywordthe keyword to search for
matchOptsearch mode (default: non-recursive with patterns)
Returns
pointer to the entry found or a nullptr.

Definition at line 93 of file dictionaryI.H.

References csearch(), and entry.

Here is the call graph for this function:

◆ found() [1/2]

bool found ( const word & keyword,
enum keyType::option matchOpt = keyType::REGEX ) const
inline

Find an entry (const access) with the given keyword.

Parameters
keywordthe keyword to search for
matchOptsearch mode (default: non-recursive with patterns)
Returns
True if entry was found

Definition at line 103 of file dictionaryI.H.

References findEntry().

Referenced by equationInitialResidualCondition::apply(), equationMaxIterCondition::apply(), DAC< CompType, ThermoType >::DAC(), designVariablesUpdate::designVariablesUpdate(), Foam::dimensionedConstant(), DRG< CompType, ThermoType >::DRG(), DRGEP< CompType, ThermoType >::DRGEP(), found(), properties::foundObjectProperty(), subModelBase::getModelDict(), subModelBase::getModelProperty(), adjointSolver::getObjectiveSensitivities(), properties::getObjectResult(), refinementParameters::getZoneInfo(), properties::hasResultObject(), properties::hasResultObjectEntry(), incompressibleInterPhaseTransportModel< Mixture >::incompressibleInterPhaseTransportModel(), oversetFvPatchField< Type >::initEvaluate(), solverInfo::initialiseResidualField(), ISAT< CompType, ThermoType >::ISAT(), waveModel::New(), properties::objectResultEntries(), properties::objectResultType(), PFA< CompType, ThermoType >::PFA(), Foam::preservePatchTypes(), tolerances::read(), volumetricBSplinesDesignVariables::readBounds(), levelSetDesignVariables::readField(), topODesignVariables::readField(), functionObjectList::readFunctionObject(), refinementSurfaces::refinementSurfaces(), rigidBodyMeshMotion::rigidBodyMeshMotion(), rigidBodyMeshMotionSolver::rigidBodyMeshMotionSolver(), rigidBodyModel::rigidBodyModel(), kEpsilonLopesdaCosta< BasicTurbulenceModel >::setCdSigma(), runTimeCondition::setConditionDict(), subModelBase::setModelProperty(), properties::setObjectResult(), kEpsilonLopesdaCosta< BasicTurbulenceModel >::setPorosityCoefficient(), sixDoFRigidBodyMotion::sixDoFRigidBodyMotion(), SQPBase::SQPBase(), inverseDistance::update(), solverInfo::updateSolverInfo(), volumetricBSplinesDesignVariables::volumetricBSplinesDesignVariables(), properties::writeResultEntries(), and writer::writeSolution().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findScoped()

const Foam::entry * findScoped ( const word & keyword,
enum keyType::option matchOpt = keyType::REGEX ) const
inline

Search for a scoped entry (const access) with the given keyword.

Allows scoping using '.'. Special handling for an absolute anchor (^) at start of the keyword and for '..' to ascend into the parent dictionaries.

Parameters
keywordthe keyword to search for
matchOptsearch mode (default: non-recursive with patterns)
Returns
pointer to the entry found or a nullptr.

Definition at line 113 of file dictionaryI.H.

References csearchScoped().

Referenced by lookupScopedEntryPtr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findDict() [1/2]

const Foam::dictionary * findDict ( const word & keyword,
enum keyType::option matchOpt = keyType::REGEX ) const
inline

◆ findDict() [2/2]

Foam::dictionary * findDict ( const word & keyword,
enum keyType::option matchOpt = keyType::REGEX )
inline

Find and return a sub-dictionary pointer if present (and it is a dictionary) otherwise return nullptr.

Parameters
keywordthe keyword to search for
matchOptsearch mode (default: non-recursive with patterns)
Returns
pointer to sub-dictionary found or a nullptr.

Definition at line 133 of file dictionaryI.H.

References csearch(), and dictionary().

Here is the call graph for this function:

◆ findStream()

Foam::ITstream * findStream ( const word & keyword,
enum keyType::option matchOpt = keyType::REGEX ) const
inline

Find and return an entry stream if present (and it is a stream) otherwise return nullptr.

Parameters
keywordthe keyword to search for
matchOptsearch mode (default: non-recursive with patterns)
Returns
pointer to ITstream or a nullptr

Definition at line 143 of file dictionaryI.H.

References csearch().

Referenced by solution::upgradeSolverDict().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lookupEntry() [1/2]

const Foam::entry & lookupEntry ( const word & keyword,
enum keyType::option matchOpt ) const

Search for an entry (const access) with the given keyword.

Parameters
keywordthe keyword to search for
matchOptsearch mode
Returns
return an entry if present, otherwise FatalIOError.

Definition at line 346 of file dictionary.C.

References entry, Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, findEntry(), Foam::nl, and relativeName().

Referenced by lduMatrix::preconditioner::getName(), lduMatrix::smoother::getName(), lookup(), lookupEntry(), lduMatrix::preconditioner::New(), and lduMatrix::smoother::New().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lookup() [1/2]

Foam::ITstream & lookup ( const word & keyword,
enum keyType::option matchOpt = keyType::REGEX ) const

Find and return an entry data stream. FatalIOError if not found, or not a stream.

Parameters
keywordthe keyword to search for
matchOptsearch mode (default: non-recursive with patterns)
Returns
entry stream or FatalIOError

Definition at line 366 of file dictionary.C.

References lookupEntry().

Referenced by equationMaxIterCondition::apply(), lookup(), multiphaseSystem::multiphaseSystem(), interpolation< Type >::New(), operator[](), cloudSolution::read(), dimensionSet::read(), regionModel::regionModel(), regionModel::regionModel(), twoPhaseSystem::twoPhaseSystem(), and solverInfo::updateSolverInfo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get()

template<class T>
T get ( const word & keyword,
enum keyType::option matchOpt = keyType::REGEX ) const

Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.

Parameters
keywordthe keyword to search for
matchOptsearch mode (default: non-recursive with patterns)

Definition at line 99 of file dictionaryTemplates.C.

References readEntry(), and Foam::T().

Referenced by geometric::add(), columnFvMeshInfo::addLocalPatches(), adjointRASModel::adjointRASModel(), basicChemistryModel::basicChemistryModel(), betaMaxDarcy::betaMaxDarcy(), CloudFunctionObjectList< CloudType >::CloudFunctionObjectList(), coalCloudList::coalCloudList(), componentDisplacementMotionSolver::componentDisplacementMotionSolver(), betaMax::computeLength(), DAC< CompType, ThermoType >::DAC(), Foam::dimensionedConstant(), directions::directions(), displacementComponentLaplacianFvMotionSolver::displacementComponentLaplacianFvMotionSolver(), displacementLaplacianFvMotionSolver::displacementLaplacianFvMotionSolver(), displacementLaplacianFvMotionSolver::displacementLaplacianFvMotionSolver(), displacementPointSmoothingMotionSolver::displacementPointSmoothingMotionSolver(), displacementPointSmoothingMotionSolver::displacementPointSmoothingMotionSolver(), displacementSmartPointSmoothingMotionSolver::displacementSmartPointSmoothingMotionSolver(), displacementSmartPointSmoothingMotionSolver::displacementSmartPointSmoothingMotionSolver(), argList::displayDoc(), dynamicInkJetFvMesh::dynamicInkJetFvMesh(), elasticityMotionSolver::elasticityMotionSolver(), thermalShell::evolveRegion(), faMesh::faMesh(), FreeStream< CloudType >::FreeStream(), fvDOM::fvDOM(), fvDOM::fvDOM(), graphFunctionObject::graphFunctionObject(), optimisationManager::initialize(), ISAT< CompType, ThermoType >::ISAT(), kinematicSingleLayer::kinematicSingleLayer(), laplacianMotionSolver::laplacianMotionSolver(), Foam::MULES::limiterCorr(), liquidFilmBase::liquidFilmBase(), lookupType(), displacementMeshMoverMotionSolver::meshMover(), mixerFvMesh::mixerFvMesh(), medialAxisMeshMover::move(), multiphaseInterSystem::multiphaseInterSystem(), basicSolidChemistryModel::New(), chemistryReductionMethod< CompType, ThermoType >::New(), chemistryTabulationMethod< CompType, ThermoType >::New(), decompositionMethod::New(), displacementMethod::New(), heatExchangerModel::New(), adjointTurbulenceModel::New(), laminarFlameSpeed::New(), LduMatrix< Type, DType, LUType >::preconditioner::New(), LduMatrix< Type, DType, LUType >::smoother::New(), LduMatrix< Type, DType, LUType >::solver::New(), lduMatrix::solver::New(), waveModel::New(), nullSpace::nullSpace(), NURBS3DVolume::NURBS3DVolume(), NURBS3DVolumeCylindrical::NURBS3DVolumeCylindrical(), objectiveFlowRate::objectiveFlowRate(), objectiveFlowRatePartition::objectiveFlowRatePartition(), objectiveForce::objectiveForce(), objectiveMoment::objectiveMoment(), objectiveNutSqr::objectiveNutSqr(), objectivePartialVolume::objectivePartialVolume(), objectivePowerDissipation::objectivePowerDissipation(), objectiveUniformityCellZone::objectiveUniformityCellZone(), optimisationManager::optimisationManager(), parProfilingSolver::parProfilingSolver(), IOobject::parseHeader(), plane::plane(), pLaplacianMotionSolver::pLaplacianMotionSolver(), powerLawLopesdaCostaZone::powerLawLopesdaCostaZone(), singleDirectionUniformBin::read(), uniformBin::read(), externalCoupled::read(), multiphaseMangrovesSource::read(), multiphaseMangrovesTurbulenceModel::read(), rotorDiskSource::read(), solutionControl::read(), targetCoeffTrim::read(), tolerances::read(), dynamicRefineFvMesh::readDict(), functionObjectList::readFunctionObject(), SIMPLEControl::readIters(), SIMPLEControlSingleRun::readIters(), waveGenerationModel::readWaveAngle(), waveGenerationModel::readWaveHeight(), refinementSurfaces::refinementSurfaces(), regionFaModel::regionFaModel(), regionModel::regionModel(), regionModel::regionModel(), rigidBodyModel::rigidBodyModel(), rpm::rpm(), searchableSurfaceCollection::searchableSurfaceCollection(), kEpsilonLopesdaCosta< BasicTurbulenceModel >::setCdSigma(), kEpsilonLopesdaCosta< BasicTurbulenceModel >::setPorosityCoefficient(), sixDoFRigidBodyMotionSolver::sixDoFRigidBodyMotionSolver(), solidBodyDisplacementLaplacianFvMotionSolver::solidBodyDisplacementLaplacianFvMotionSolver(), solidBodyDisplacementLaplacianFvMotionSolver::solidBodyDisplacementLaplacianFvMotionSolver(), populationBalanceModel::solve(), rigidBodyMeshMotion::solve(), rigidBodyMeshMotionSolver::solve(), MultiComponentPhaseModel< BasePhaseModel, phaseThermo >::solveYi(), SRFModel::SRFModel(), surfaceAlignedSBRStressFvMotionSolver::surfaceAlignedSBRStressFvMotionSolver(), thermalBaffle::thermalBaffle(), thermalBaffle::thermalBaffle(), thermoSingleLayer::thermoSingleLayer(), twoPhaseSystem::twoPhaseSystem(), dynamicRefineFvMesh::updateTopology(), velocityDisplacementMotionSolver::velocityDisplacementMotionSolver(), vibrationShellModel::vibrationShellModel(), WallLocalSpringSliderDashpot< CloudType >::WallLocalSpringSliderDashpot(), ensightWriter::writeCollated(), and ensightWriter::writeCollated().

Here is the call graph for this function:

◆ getOrDefault()

template<class T>
T getOrDefault ( const word & keyword,
const T & deflt,
enum keyType::option matchOpt = keyType::REGEX ) const

Find and return a T, or return the given default value. FatalIOError if it is found and the number of tokens is incorrect.

Parameters
keywordthe keyword to search for
defltthe default value to use
matchOptsearch mode (default: non-recursive with patterns)

Definition at line 140 of file dictionaryTemplates.C.

References checkITstream(), csearch(), entry, entry::stream(), Foam::T(), and writeOptionalEntries.

Referenced by adjointRASModel::adjointRASModel(), adjointSolver::adjointSolver(), adjointSpalartAllmaras::adjointSpalartAllmaras(), basicChemistryModel::basicChemistryModel(), basicThermo::basicThermo(), basicThermo::basicThermo(), basicThermo::basicThermo(), BFGS::BFGS(), combustionModel::combustionModel(), conjugateGradient::conjugateGradient(), constraintProjection::constraintProjection(), csvWriter::csvWriter(), DBFGS::DBFGS(), diffusion< ReactionThermo, ThermoType >::diffusion(), displacementComponentLaplacianFvMotionSolver::displacementComponentLaplacianFvMotionSolver(), dynamicTopODesignVariables::dynamicTopODesignVariables(), EDC< ReactionThermo >::EDC(), ensightSurfaceReader::ensightSurfaceReader(), faMesh::faMesh(), gnuplotWriter::gnuplotWriter(), gradAlpha::gradAlpha(), graphFunctionObject::graphFunctionObject(), incompressiblePrimalSolver::incompressiblePrimalSolver(), MMA::initialize(), isoAlpha::isoAlpha(), ISQP::ISQP(), kinematicSingleLayer::kinematicSingleLayer(), KinematicSurfaceFilm< CloudType >::KinematicSurfaceFilm(), KirchhoffShell::KirchhoffShell(), laminar< ReactionThermo >::laminar(), LBFGS::LBFGS(), levelSetDesignVariables::levelSetDesignVariables(), Foam::MULES::limiter(), Foam::MULES::limiterCorr(), liquidFilmBase::liquidFilmBase(), LocalInteraction< CloudType >::LocalInteraction(), lookupOrDefault(), lookupOrDefault(), MeshedSurface< Face >::MeshedSurface(), MMA::MMA(), tableReader< Type >::New(), nullSpace::nullSpace(), NURBS3DVolume::NURBS3DVolume(), objectiveTopOSolidVolume::objectiveTopOSolidVolume(), objectiveTopOVolume::objectiveTopOVolume(), outletMappedUniformInletFvPatchField< Type >::outletMappedUniformInletFvPatchField(), argList::parse(), pLaplacianMotionSolver::pLaplacianMotionSolver(), plicRDF::plicRDF(), quasiNewton::quasiNewton(), radiationModel::radiationModel(), radiationModel::radiationModel(), rawWriter::rawWriter(), singleDirectionUniformBin::read(), uniformBin::read(), multiFieldValue::read(), radiationModel::read(), sampledSurfaces::read(), SIMPLEControlOpt::read(), solverControl::read(), targetCoeffTrim::read(), adjointSensitivity::readDict(), temperatureDependent::readDict(), reconstructionSchemes::reconstructionSchemes(), refinementSurfaces::refinementSurfaces(), regionFaModel::regionFaModel(), rigidBodyMeshMotion::rigidBodyMeshMotion(), rigidBodyMeshMotionSolver::rigidBodyMeshMotionSolver(), Time::setMonitoring(), propellerInfo::setSampleDiskSurface(), simple::simple(), sixDoFRigidBodyMotionSolver::sixDoFRigidBodyMotionSolver(), populationBalanceModel::solve(), faMatrix< Type >::solve(), faMatrix< scalar >::solve(), fvMatrix< Type >::fvSolver::solve(), rigidBodyMeshMotion::solve(), velocityLaplacianFvMotionSolver::solve(), fvMatrix< Type >::solveCoupled(), shapeDesignVariables::solveMeshMovementEqn(), solver::solver(), fvMatrix< Type >::solveSegregated(), fvMatrix< scalar >::solveSegregated(), fvMatrix< Type >::solveSegregatedOrCoupled(), MultiComponentPhaseModel< BasePhaseModel, phaseThermo >::solveYi(), SQP::SQP(), SR1::SR1(), StandardChemistryModel< ReactionThermo, ThermoType >::StandardChemistryModel(), StandardWallInteraction< CloudType >::StandardWallInteraction(), surfaceAlignedSBRStressFvMotionSolver::surfaceAlignedSBRStressFvMotionSolver(), TDACChemistryModel< ReactionThermo, ThermoType >::TDACChemistryModel(), thermalBaffleModel::thermalBaffleModel(), thermalBaffleModel::thermalBaffleModel(), thermalShell::thermalShell(), thermalShellModel::thermalShellModel(), UnsortedMeshedSurface< Face >::UnsortedMeshedSurface(), inverseDistance::update(), turbulentMixingLengthDissipationRateInletFvPatchScalarField::updateCoeffs(), turbulentMixingLengthFrequencyInletFvPatchScalarField::updateCoeffs(), updateMethod::updateMethod(), dynamicRefineFvMesh::updateTopology(), vibrationShellModel::vibrationShellModel(), viewFactor::viewFactor(), viewFactor::viewFactor(), volumetricBSplinesDesignVariables::volumetricBSplinesDesignVariables(), vtkWriter::vtkWriter(), VTKedgeFormat::write(), ensightWriter::writeCollated(), ensightWriter::writeCollated(), and xmgraceWriter::xmgraceWriter().

Here is the call graph for this function:

◆ getOrAdd()

template<class T>
T getOrAdd ( const word & keyword,
const T & deflt,
enum keyType::option matchOpt = keyType::REGEX )

Find and return a T, or return the given default value and add it to dictionary. FatalIOError if it is found and the number of tokens is incorrect.

Parameters
keywordthe keyword to search for
defltthe default value to use
matchOptsearch mode (default: non-recursive with patterns)

Definition at line 170 of file dictionaryTemplates.C.

References Foam::add(), checkITstream(), csearch(), entry, entry::stream(), Foam::T(), and writeOptionalEntries.

Referenced by lookupOrAddDefault(), and lookupOrAddDefault().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readEntry()

template<class T>
bool readEntry ( const word & keyword,
T & val,
enum keyType::option matchOpt = keyType::REGEX,
IOobjectOption::readOption readOpt = IOobjectOption::MUST_READ ) const

Find entry and assign to T val. FatalIOError if it is found and the number of tokens is incorrect, or it is mandatory and not found.

Parameters
keywordthe keyword to search for
valthe value to read into
matchOptsearch mode (default: non-recursive with patterns)
readOptthe entry is required/optional (default: MUST_READ)
Returns
true if the entry was read

Definition at line 294 of file dictionaryTemplates.C.

References checkITstream(), csearch(), entry, Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, IOobjectOption::isReadRequired(), name, Foam::nl, IOobjectOption::NO_READ, entry::stream(), and Foam::T().

Referenced by fromFile::computeControlPoints(), argList::displayDoc(), ETAB< CloudType >::ETAB(), get(), InflationInjection< CloudType >::InflationInjection(), ISAT< CompType, ThermoType >::ISAT(), KinematicSurfaceFilm< CloudType >::KinematicSurfaceFilm(), multiBandZoneAbsorptionEmission::multiBandZoneAbsorptionEmission(), multiphaseSystem::multiphaseSystem(), decompositionMethod::nDomains(), PairSpringSliderDashpot< CloudType >::PairSpringSliderDashpot(), argList::parse(), PilchErdman< CloudType >::PilchErdman(), anisotropicFilter::read(), combustionModel::read(), multiphaseMangrovesSource::read(), multiphaseMangrovesTurbulenceModel::read(), adjointRASModel::read(), Casson::read(), laplaceFilter::read(), smoothDelta::read(), radiationModel::read(), phasePressureModel::read(), kinematicSingleLayer::read(), thermalBaffle::read(), thermalBaffle::read(), SRFModel::read(), targetCoeffTrim::read(), Arrhenius< ViscousModel >::read(), thermo::readControls(), dynamicRefineFvMesh::readDict(), mapDistributeBase::readDict(), mapDistributePolyMesh::readDict(), constant::readDict(), waveModel::readDict(), irregularMultiDirectional::readDict(), irregularWaveModel::readDict(), regularWaveModel::readDict(), streamFunction::readDict(), waveGenerationModel::readDict(), readIfPresent(), valueAverageBase::readState(), ReitzDiwakar< CloudType >::ReitzDiwakar(), ReitzKHRT< CloudType >::ReitzKHRT(), rigidBodyMeshMotion::rigidBodyMeshMotion(), rigidBodyMeshMotionSolver::rigidBodyMeshMotionSolver(), searchableSurfaceCollection::searchableSurfaceCollection(), reducedUnits::setRefValues(), SingleMixtureFraction< CloudType >::SingleMixtureFraction(), sixDoFRigidBodyMotionSolver::sixDoFRigidBodyMotionSolver(), surfaceFeatures::surfaceFeatures(), thermoCoupleProbes::thermoCoupleProbes(), WallLocalSpringSliderDashpot< CloudType >::WallLocalSpringSliderDashpot(), WallSpringSliderDashpot< CloudType >::WallSpringSliderDashpot(), writer::writeSolution(), and zoneCombustion< ReactionThermo >::zoneCombustion().

Here is the call graph for this function:

◆ readIfPresent() [1/2]

template<class T>
bool readIfPresent ( const word & keyword,
T & val,
enum keyType::option matchOpt = keyType::REGEX ) const

Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens is incorrect.

Parameters
keywordthe keyword to search for
valthe value to read into
matchOptsearch mode (default: non-recursive with patterns)
Returns
true if the entry was read

Definition at line 412 of file dictionaryTemplates.C.

References IOobjectOption::READ_IF_PRESENT, readEntry(), and Foam::T().

Referenced by abaqusWriter::abaqusWriter(), advectiveFvPatchField< Type >::advectiveFvPatchField(), basicThermo::basicThermo(), basicThermo::basicThermo(), basicThermo::basicThermo(), boundaryDataSurfaceReader::boundaryDataSurfaceReader(), valueAverageBase::calc(), cloudSolution::cloudSolution(), betaMax::computeLength(), coordSetWriter::coordSetWriter(), metisDecomp::decomposeSerial(), subModelBase::getBaseProperty(), subModelBase::getBaseProperty(), subModelBase::getModelProperty(), decomposedBlockData::getNumBlocks(), properties::getObjectProperty(), properties::getObjectResult(), refinementParameters::getZoneInfo(), graphFunctionObject::graphFunctionObject(), kinematicSingleLayer::info(), nastranWriter::nastranWriter(), decompositionMethod::nDomains(), decompositionMethod::New(), objectivePartialVolume::objectivePartialVolume(), IOobject::parseHeader(), ParticlePostProcessing< CloudType >::ParticlePostProcessing(), Foam::preservePatchTypes(), randomDecomp::randomDecomp(), singleDirectionUniformBin::read(), DeltaOmegaTildeDelta::read(), IDDESDelta::read(), maxDeltaxyz::read(), PrandtlDelta::read(), SLADelta::read(), vanDriestDelta::read(), mapDistribute::readDict(), Time::readDict(), decomposedBlockData::readHeader(), readIfPresent(), refinementSurfaces::refinementSurfaces(), Time::setControls(), propellerInfo::setSampleDiskSurface(), Time::setTime(), surfaceWriter::surfaceWriter(), surfaceZonesInfo::surfaceZonesInfo(), thermoSingleLayer::thermoSingleLayer(), kinematicSingleLayer::transferPrimaryRegionSourceFields(), updateMethod::updateMethod(), vanDriestDelta::vanDriestDelta(), and x3dWriter::x3dWriter().

Here is the call graph for this function:

◆ getCheck()

template<class T, class Predicate>
T getCheck ( const word & keyword,
const Predicate & pred,
enum keyType::option matchOpt = keyType::REGEX ) const

Find and return a T with additional checking FatalIOError if not found, or if the number of tokens is incorrect.

Parameters
keywordthe keyword to search for
predthe value check predicate
matchOptsearch mode (default: non-recursive with patterns)

Definition at line 112 of file dictionaryTemplates.C.

References readCheck(), and Foam::T().

Referenced by singleDirectionUniformBin::read(), and electricPotential::read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCheckOrDefault()

template<class T, class Predicate>
T getCheckOrDefault ( const word & keyword,
const T & deflt,
const Predicate & pred,
enum keyType::option matchOpt = keyType::REGEX ) const

Find and return a T, or return the given default value. FatalIOError if it is found and the number of tokens is incorrect.

Parameters
keywordthe keyword to search for
defltthe default value to use
predthe value check predicate
matchOptsearch mode (default: non-recursive with patterns)

Definition at line 201 of file dictionaryTemplates.C.

References checkITstream(), csearch(), entry, Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, name, entry::stream(), Foam::T(), and writeOptionalEntries.

Here is the call graph for this function:

◆ getCheckOrAdd()

template<class T, class Predicate>
T getCheckOrAdd ( const word & keyword,
const T & deflt,
const Predicate & pred,
enum keyType::option matchOpt = keyType::REGEX )

Find and return a T, or return the given default value and add it to dictionary. FatalIOError if it is found and the number of tokens is incorrect.

Parameters
keywordthe keyword to search for
defltthe default value to use
predthe value check predicate
matchOptsearch mode (default: non-recursive with patterns)

Definition at line 247 of file dictionaryTemplates.C.

References Foam::add(), checkITstream(), csearch(), entry, Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, name, entry::stream(), Foam::T(), and writeOptionalEntries.

Here is the call graph for this function:

◆ readCheck()

template<class T, class Predicate>
bool readCheck ( const word & keyword,
T & val,
const Predicate & pred,
enum keyType::option matchOpt = keyType::REGEX,
IOobjectOption::readOption readOpt = IOobjectOption::MUST_READ ) const

Find entry and assign to T val. FatalIOError if it is found and the number of tokens is incorrect, or it is mandatory and not found.

Parameters
keywordthe keyword to search for
valthe value to read into
predthe value check predicate
matchOptsearch mode (default: non-recursive with patterns)
readOptthe entry is required/optional (default: MUST_READ)
Returns
true if the entry was read

Definition at line 331 of file dictionaryTemplates.C.

References checkITstream(), csearch(), entry, Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, IOobjectOption::isReadRequired(), name, Foam::nl, IOobjectOption::NO_READ, entry::stream(), and Foam::T().

Referenced by getCheck(), and readCheckIfPresent().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readCheckIfPresent()

template<class T, class Predicate>
bool readCheckIfPresent ( const word & keyword,
T & val,
const Predicate & pred,
enum keyType::option matchOpt = keyType::REGEX ) const

Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens is incorrect.

Parameters
keywordthe keyword to search for
valthe value to read into
predthe value check predicate
matchOptsearch mode (default: non-recursive with patterns)
Returns
true if the entry read

Definition at line 431 of file dictionaryTemplates.C.

References IOobjectOption::READ_IF_PRESENT, readCheck(), and Foam::T().

Here is the call graph for this function:

◆ subDict() [1/2]

const Foam::dictionary & subDict ( const word & keyword,
enum keyType::option matchOpt = keyType::REGEX ) const

Find and return a sub-dictionary.

Fatal if the entry does not exist or is not a sub-dictionary.

Parameters
keywordthe keyword to search for
matchOptsearch mode (default: non-recursive with patterns)

Definition at line 440 of file dictionary.C.

References csearch(), dictionary::Searcher< Const >::dict(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, dictionary::Searcher< Const >::good(), Foam::nl, and relativeName().

Referenced by snappyLayerDriver::addLayers(), adjointSolver::adjointSolver(), adjointSolverManager::adjointSolverManager(), meshState::controlsDict(), meshState::controlsDict(), adjointSolver::designVarsDict(), Foam::dimensionedConstant(), Foam::dimensionedConstant(), displacementPointSmoothingMotionSolver::displacementPointSmoothingMotionSolver(), displacementPointSmoothingMotionSolver::displacementPointSmoothingMotionSolver(), displacementSmartPointSmoothingMotionSolver::displacementSmartPointSmoothingMotionSolver(), displacementSmartPointSmoothingMotionSolver::displacementSmartPointSmoothingMotionSolver(), argList::displayDoc(), dynamicTopODesignVariables::dynamicTopODesignVariables(), faMesh::faMesh(), subModelBase::getModelDict(), subModelBase::getModelProperty(), properties::getObjectDict(), properties::getObjectProperty(), properties::getObjectResult(), refinementParameters::getZoneInfo(), properties::hasResultObjectEntry(), incompressibleTwoPhaseMixture::incompressibleTwoPhaseMixture(), dynamicMultiMotionSolverFvMesh::init(), oversetFvPatchField< Type >::initEvaluate(), viewFactor::initialise(), optimisationManager::initialize(), cloudSolution::integrationSchemes(), cloudSolution::interpolationSchemes(), kinematicSingleLayer::kinematicSingleLayer(), levelSetDesignVariables::levelSetDesignVariables(), liquidFilmBase::liquidFilmBase(), liquidFilmModel::liquidFilmModel(), meshState::meshDict(), meshState::meshDict(), multiBandZoneAbsorptionEmission::multiBandZoneAbsorptionEmission(), multiSolidBodyMotionSolver::multiSolidBodyMotionSolver(), adjointSolverManager::nActiveAdjointSolvers(), basicSolidChemistryModel::New(), LESModel< BasicTurbulenceModel >::New(), waveModel::New(), objectiveManager::objectiveManager(), properties::objectResultEntries(), properties::objectResultNames(), properties::objectResultType(), phaseSystem::phaseSystem(), Foam::preservePatchTypes(), pyrolysisModelCollection::pyrolysisModelCollection(), runTimeControl::read(), multiphaseMangrovesSource::read(), multiphaseMangrovesTurbulenceModel::read(), incompressibleTwoPhaseMixture::read(), optimisationManager::read(), kinematicSingleLayer::read(), tolerances::read(), thermo::readControls(), adjointSolverManager::readDict(), refinementSurfaces::refinementSurfaces(), rigidBodyMeshMotion::rigidBodyMeshMotion(), rigidBodyMeshMotionSolver::rigidBodyMeshMotionSolver(), rigidBodyModel::rigidBodyModel(), searchableSurfaces::searchableSurfaces(), set(), runTimeCondition::setConditionDict(), subModelBase::setModelProperty(), properties::setObjectProperty(), properties::setObjectResult(), displacementLayeredMotionMotionSolver::solve(), meshState::solverPerformanceDict(), meshState::solverPerformanceDict(), cloudSolution::sourceTermDict(), steadyOptimisation::steadyOptimisation(), thermalBaffle::thermalBaffle(), thermalShell::thermalShell(), thermoSingleLayer::thermoSingleLayer(), topODesignVariables::topODesignVariables(), twoPhaseSystem::twoPhaseSystem(), inverseDistance::update(), vibrationShellModel::vibrationShellModel(), volBSplinesBase::volBSplinesBase(), wideBandAbsorptionEmission::wideBandAbsorptionEmission(), write(), properties::writeAllResultEntries(), and properties::writeResultEntries().

Here is the call graph for this function:

◆ subDict() [2/2]

Foam::dictionary & subDict ( const word & keyword,
enum keyType::option matchOpt = keyType::REGEX )

Find and return a sub-dictionary for manipulation.

Fatal if the entry does not exist or is not a sub-dictionary.

Parameters
keywordthe keyword to search for
matchOptsearch mode (default: non-recursive with patterns)

Definition at line 460 of file dictionary.C.

References dictionary::Searcher< Const >::dict(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, dictionary::Searcher< Const >::good(), Foam::nl, relativeName(), and Foam::search().

Here is the call graph for this function:

◆ subDictOrAdd()

Foam::dictionary & subDictOrAdd ( const word & keyword,
enum keyType::option matchOpt = keyType::REGEX )

Find and return a sub-dictionary for manipulation.

Fatal if the entry exist and is not a sub-dictionary.

Parameters
keywordthe keyword to search for
matchOptsearch mode (default: non-recursive with patterns)

Definition at line 480 of file dictionary.C.

References dictionary(), dictionary, dictionary::Searcher< Const >::dictPtr(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, dictionary::Searcher< Const >::good(), Foam::nl, relativeName(), Foam::search(), and set().

Referenced by meshState::meshState(), sensitivitySurface::smoothSensitivities(), caseInfo::write(), caseInfo::writeFileDicts(), and caseInfo::writeRegisteredDicts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ subOrEmptyDict()

Foam::dictionary subOrEmptyDict ( const word & keyword,
enum keyType::option matchOpt = keyType::REGEX,
const bool mandatory = false ) const

Find and return a sub-dictionary as a copy, otherwise return an empty dictionary.

Warn if the entry exists but is not a sub-dictionary.

Parameters
keywordthe keyword to search for
matchOptsearch mode (default: non-recursive with patterns)
mandatorythe keyword is mandatory (default: false)

Definition at line 520 of file dictionary.C.

References csearch(), dictionary(), dictionary, dictionary::Searcher< Const >::dictPtr(), Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, dictionary::Searcher< Const >::good(), IOWarningInFunction, Foam::nl, and relativeName().

Referenced by adjointRASModel::adjointRASModel(), coordSetWriter::coordSetWriter(), subModelBase::getModelDict(), incompressiblePrimalSolver::incompressiblePrimalSolver(), optimisationManager::optimisationManager(), radiationModel::radiationModel(), radiationModel::radiationModel(), radiationModel::read(), solverControl::read(), regionFaModel::regionFaModel(), regionModel::regionModel(), regionModel::regionModel(), and surfaceWriter::surfaceWriter().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ optionalSubDict()

◆ toc()

◆ sortedToc() [1/3]

◆ sortedToc() [2/3]

template<class Compare>
wordList sortedToc ( const Compare & comp) const

Return table of contents sorted using the specified comparator.

References add(), dictionary(), e, entry, k, keys(), sortedToc(), substituteKeyword(), substituteScopedKeyword(), and Foam::T().

Here is the call graph for this function:

◆ keys()

Foam::List< Foam::keyType > keys ( bool patterns = false) const

Return the list of available keys or patterns.

Definition at line 607 of file dictionary.C.

References e, entry, n, List< T >::resize(), and DLListBase::size().

Referenced by sortedToc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ substituteKeyword()

bool substituteKeyword ( const word & keyword,
bool mergeEntry = false )

Substitute the given keyword (which is prefixed by '$').

with the corresponding sub-dictionary entries

Definition at line 376 of file dictionary.C.

References Foam::add(), csearch(), dictionary::Searcher< Const >::dict(), e, entry, dictionary::Searcher< Const >::good(), and keyType::REGEX_RECURSIVE.

Referenced by sortedToc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ substituteScopedKeyword()

bool substituteScopedKeyword ( const word & keyword,
bool mergeEntry = false )

Substitute the given scoped keyword (which is prefixed by '$').

with the corresponding sub-dictionary entries

Definition at line 408 of file dictionary.C.

References Foam::add(), csearchScoped(), e, entry, and keyType::REGEX_RECURSIVE.

Referenced by entry::New(), and sortedToc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add() [1/9]

Foam::entry * add ( entry * entryPtr,
bool mergeEntry = false )

Add a new entry.

Parameters
entryPtrthe entry to add
mergeEntrydictionaries are interwoven and primitive entries are overwritten (default: false)
Returns
pointer to inserted entry, or place of merging or nullptr on failure

Definition at line 625 of file dictionary.C.

References fileName::concat(), entry::dict(), Foam::endl(), entry, IOWarningInFunction, isDict(), entry::isDict(), keyType::isPattern(), entry::keyword(), entry::name(), name, autoPtr< T >::New(), DLListBase::push_back(), relativeName(), UILList< DLListBase, T >::remove(), and DLListBase::replace().

Referenced by add(), snappyLayerDriver::addLayers(), Foam::addPatchTypeDetails(), adjointSimple::addTopOFvOptions(), adjointSolverManager::adjointSolverManager(), snappyLayerDriver::determineSidePatches(), faPatchData::dict(), Foam::dimensionedConstant(), refinementParameters::getZoneInfo(), optimisationManager::initialize(), voxelMeshSearch::makeMesh(), makeScopedDict(), namedBlock::namedBlock(), namedVertex::namedVertex(), entry::New(), Foam::preservePatchTypes(), multiRegion::read(), functionObjectList::readFunctionObject(), subModelBase::setBaseProperty(), runTimeCondition::setConditionDict(), subModelBase::setModelProperty(), properties::setObjectProperty(), properties::setObjectResult(), sensitivitySurface::smoothSensitivities(), rigidBodyMeshMotion::solve(), rigidBodyMeshMotionSolver::solve(), sixDoFRigidBodyMotionSolver::solve(), sortedToc(), kinematicSingleLayer::transferPrimaryRegionSourceFields(), sixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs(), solution::upgradeSolverDict(), thermoCoupleProbes::write(), surfaceFeatures::writeDict(), caseInfo::writeFunctionObjects(), caseInfo::writeMeta(), caseInfo::writePatches(), valueAverageBase::writeState(), abaqusWriter::writeTemplate(), and Time::writeTimeDict().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add() [2/9]

Foam::entry * add ( const entry & e,
bool mergeEntry = false )

Add an entry.

Parameters
ethe entry to add
mergeEntrydictionaries are interwoven and primitive entries are overwritten (default: false)
Returns
pointer to inserted entry, or place of merging or nullptr on failure

Definition at line 704 of file dictionary.C.

References Foam::add(), e, and entry.

Here is the call graph for this function:

◆ add() [3/9]

Foam::entry * add ( const keyType & k,
const word & v,
bool overwrite = false )

Add a word entry.

Parameters
overwriteforce overwrite of an existing entry.
Returns
pointer to inserted entry or nullptr on failure

Definition at line 710 of file dictionary.C.

References Foam::add(), and k.

Here is the call graph for this function:

◆ add() [4/9]

Foam::entry * add ( const keyType & k,
const string & v,
bool overwrite = false )

Add a string entry.

Parameters
overwriteforce overwrite of an existing entry.
Returns
pointer to inserted entry or nullptr on failure

Definition at line 721 of file dictionary.C.

References Foam::add(), and k.

Here is the call graph for this function:

◆ add() [5/9]

Foam::entry * add ( const keyType & k,
const label v,
bool overwrite = false )

Add a label entry.

Parameters
overwriteforce overwrite of an existing entry.
Returns
pointer to inserted entry or nullptr on failure

Definition at line 732 of file dictionary.C.

References Foam::add(), and k.

Here is the call graph for this function:

◆ add() [6/9]

Foam::entry * add ( const keyType & k,
const scalar v,
bool overwrite = false )

Add a scalar entry.

Parameters
overwriteforce overwrite of an existing entry.
Returns
pointer to inserted entry or nullptr on failure

Definition at line 743 of file dictionary.C.

References Foam::add(), and k.

Here is the call graph for this function:

◆ add() [7/9]

Foam::entry * add ( const keyType & k,
const dictionary & d,
bool mergeEntry = false )

Add a dictionary entry.

Parameters
mergeEntrymerge into an existing sub-dictionary
Returns
pointer to inserted entry, or place of merging or nullptr on failure

Definition at line 754 of file dictionary.C.

References Foam::add(), dictionary(), and k.

Here is the call graph for this function:

◆ add() [8/9]

template<class T>
entry * add ( const keyType & k,
const T & v,
bool overwrite = false )

Add a T entry.

Parameters
overwriteforce overwrite of existing entry
Returns
pointer to inserted entry or nullptr on failure

References add(), dictionary(), e, entry, k, set(), Foam::T(), and tokens().

Here is the call graph for this function:

◆ set() [1/8]

◆ set() [2/8]

Foam::entry * set ( const entry & e)

Assign a new entry, overwriting any existing entry.

Returns
pointer to inserted entry or nullptr on failure

Definition at line 787 of file dictionary.C.

References e, entry, and set().

Here is the call graph for this function:

◆ set() [3/8]

Foam::entry * set ( const keyType & k,
const dictionary & v )

Assign a dictionary entry, overwriting any existing entry.

Returns
pointer to inserted entry or nullptr on failure

Definition at line 793 of file dictionary.C.

References dictionary(), k, and set().

Here is the call graph for this function:

◆ set() [4/8]

Foam::entry * set ( const keyType & k,
std::nullptr_t  )

Assign an empty primitive entry, overwriting any existing entry.

Returns
pointer to entry or nullptr on failure

Definition at line 799 of file dictionary.C.

References k, and set().

Here is the call graph for this function:

◆ set() [5/8]

Foam::entry * set ( const keyType & k,
const UList< token > & tokens )

Assign a primitive entry from a list of tokens, overwriting any existing entry.

Returns
pointer to entry or nullptr on failure

Definition at line 805 of file dictionary.C.

References k, set(), and tokens().

Here is the call graph for this function:

◆ set() [6/8]

Foam::entry * set ( const keyType & k,
List< token > && tokens )

Assign a primitive entry from a list of tokens, overwriting any existing entry.

Returns
pointer to entry or nullptr on failure

Definition at line 811 of file dictionary.C.

References k, set(), and tokens().

Here is the call graph for this function:

◆ set() [7/8]

◆ remove()

bool remove ( const word & keyword)

Remove an entry specified by keyword.

Definition at line 576 of file dictionarySearch.C.

References UILList< DLListBase, T >::remove().

Referenced by properties::clearTrigger(), removeEntry::execute(), read(), set(), caseInfo::writeFileDicts(), and caseInfo::writeRegisteredDicts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ changeKeyword()

bool changeKeyword ( const keyType & oldKeyword,
const keyType & newKeyword,
bool overwrite = false )

Change the keyword for an entry,.

Parameters
overwriteforce overwrite of an existing entry.

Definition at line 604 of file dictionarySearch.C.

References fileName::concat(), Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, IOWarningInFunction, keyType::isPattern(), name, autoPtr< T >::New(), Foam::nl, and DLListBase::replace().

Referenced by CodedSource< Type >::redirectOption(), and set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ merge()

bool merge ( const dictionary & dict)

Merge entries from the given dictionary.

Also merge sub-dictionaries as required.

Definition at line 817 of file dictionary.C.

References Foam::abort(), Foam::add(), dict, dictionary(), e, entry, Foam::FatalIOError, FatalIOErrorInFunction, isDict(), merge(), Foam::nl, and relativeName().

Referenced by snappyLayerDriver::addLayers(), Foam::combineFormatOptions(), merge(), Time::readDict(), waveModel::readDict(), functionObjectList::readFunctionObject(), and set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clear()

void clear ( )

Clear the dictionary.

Definition at line 862 of file dictionary.C.

References ILList< DLListBase, T >::clear().

Referenced by writerCaching::clear(), set(), set(), Time::setMonitoring(), and caseInfo::write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ transfer()

void transfer ( dictionary & dict)

Transfer the contents of the argument and annul the argument.

Definition at line 871 of file dictionary.C.

References dict, dictionary(), name, and ILList< DLListBase, T >::transfer().

Referenced by dictionary(), dictionary(), and set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkITstream()

void checkITstream ( const ITstream & is,
const word & keyword ) const

Check after reading if the input token stream has unconsumed tokens remaining or if there were no tokens in the first place.

Emits FatalIOError

Definition at line 250 of file dictionary.C.

References JobInfo::constructed, Foam::exit(), Foam::FatalIOError, IOstream::lineNumber(), Foam::nl, ITstream::nRemainingTokens(), relativeName(), UList< T >::size(), and UList< T >::writeList().

Referenced by getCheckOrAdd(), getCheckOrDefault(), getOrAdd(), getOrDefault(), getOrDefaultCompat(), readCheck(), readCompat(), readEntry(), and set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read() [1/2]

bool read ( Istream & is)

Read dictionary from Istream (discards the header). Reads entries until EOF or when the first token is a '{' character, it will stop reading at the matching '}' character.

Definition at line 134 of file dictionaryIO.C.

References Foam::read().

Referenced by atmPlantCanopyTurbSource::atmPlantCanopyTurbSource(), dictionary(), dictionary(), calcEntry::execute(), codeStream::execute(), includeEntry::execute(), includeEtcEntry::execute(), Foam::operator>>(), IOobject::readHeader(), and set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read() [2/2]

bool read ( Istream & is,
bool keepHeader )

Read dictionary from Istream (optionally keeping the header) Reads entries until EOF or when the first token is a '{' character, it will stop reading at the matching '}' character.

Definition at line 70 of file dictionaryIO.C.

References IOstream::bad(), token::BEGIN_BLOCK, token::END_BLOCK, Foam::endl(), IOstream::eof(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, entry::GLOBAL, IOstream::good(), InfoInFunction, name, entry::New(), Foam::nl, Istream::putBack(), and remove().

Here is the call graph for this function:

◆ writeEntry() [1/2]

void writeEntry ( Ostream & os) const

Write sub-dictionary with its dictName as its header.

Definition at line 157 of file dictionaryIO.C.

References dictName(), os(), and writeEntries().

Referenced by Foam::operator<<(), set(), sensitivitySurface::smoothSensitivities(), dictionaryEntry::write(), quasiNewton::writeData(), Foam::writeEntryIfPresent(), and IOobject::writeHeaderContent().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeEntry() [2/2]

void writeEntry ( const keyType & keyword,
Ostream & os ) const

Write sub-dictionary with the keyword as its header.

Definition at line 165 of file dictionaryIO.C.

References os(), and writeEntries().

Here is the call graph for this function:

◆ writeEntries()

void writeEntries ( Ostream & os,
const bool extraNewLine = false ) const

Write dictionary entries.

Parameters
extraNewLineadds additional newline between entries for "top-level" dictionaries

Definition at line 173 of file dictionaryIO.C.

References e, Foam::endl(), entry, name, Foam::nl, null, os(), parent(), and WarningInFunction.

Referenced by set(), write(), writeEntry(), writeEntry(), and decomposedBlockData::writeHeader().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write()

void write ( Ostream & os,
const bool subDict = true ) const

Write dictionary, normally with sub-dictionary formatting.

Definition at line 204 of file dictionaryIO.C.

References Foam::nl, os(), subDict(), and writeEntries().

Referenced by set(), dictionaryListEntry::write(), baseIOdictionary::writeData(), fieldDictionary::writeData(), and surfaceFeatures::writeDict().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ csearch()

Foam::dictionary::const_searcher csearch ( const word & keyword,
enum keyType::option matchOpt = keyType::REGEX ) const

Search dictionary for given keyword.

Parameters
keywordthe keyword to search for
matchOptsearch mode (default: non-recursive with patterns)

Definition at line 256 of file dictionarySearch.C.

References null, keyType::RECURSIVE, keyType::REGEX, and dictionary::Searcher< Const >::set().

Referenced by csearchCompat(), findDict(), findDict(), findEntry(), findEntry(), findStream(), getCheckOrAdd(), getCheckOrDefault(), getOrAdd(), getOrDefault(), optionalSubDict(), readCheck(), readEntry(), search(), search(), set(), subDict(), subOrEmptyDict(), and substituteKeyword().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ search() [1/2]

Foam::dictionary::const_searcher search ( const word & keyword,
enum keyType::option matchOpt = keyType::REGEX ) const

Search dictionary for given keyword.

Parameters
keywordthe keyword to search for
matchOptsearch mode (default: non-recursive with patterns)

Definition at line 294 of file dictionarySearch.C.

References csearch().

Referenced by entry::New(), and set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ search() [2/2]

Foam::dictionary::searcher search ( const word & keyword,
enum keyType::option matchOpt = keyType::REGEX )

Search dictionary for given keyword.

Parameters
keywordthe keyword to search for
matchOptsearch mode (default: non-recursive with patterns)

Definition at line 304 of file dictionarySearch.C.

References csearch().

Here is the call graph for this function:

◆ csearchScoped()

Foam::dictionary::const_searcher csearchScoped ( const word & keyword,
enum keyType::option matchOpt ) const

Search using scoping.

There are two types of scoping available:

  1. dot-scoping, where a '.' is used to delineate the scope
  2. slash-scoping, where a '/' is used to delineate the scope

For dot-scoping, a leading '^' traverses to the top-level dictionary, leading dots mean use the parent dictionary and an intermediate dot separates a sub-dictionary or sub-entry. However, since the use of dots is ambiguous ("a.b.c" could be an entry itself or represent a "bc" entry from dictionary "a" etc), the heuristic backtracks and attempts successively longer top-level entries until a suitable match is found.

For slash-scoping, semantics similar to directory structures are used. A leading '/' traverses to the top-level dictionary, a single leading or intermediate '.' references the current dictionary level. A '..' pair references the parent dictionary. Any doubled slashes are silently ignored. Since a slash is not a valid keyword character, there is no ambiguity between separator and content.

Parameters
keywordthe keyword to search for
matchOptsearch mode

Definition at line 316 of file dictionarySearch.C.

References string::contains(), dictionary(), null, and keyType::RECURSIVE.

Referenced by findScoped(), entry::New(), searchScoped(), searchScoped(), set(), and substituteScopedKeyword().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ searchScoped() [1/2]

Foam::dictionary::const_searcher searchScoped ( const word & keyword,
enum keyType::option matchOpt ) const

Search using dot or slash scoping.

Parameters
keywordthe keyword to search for
matchOptsearch mode

Definition at line 346 of file dictionarySearch.C.

References csearchScoped().

Referenced by removeEntry::execute(), entry::New(), and set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ searchScoped() [2/2]

Foam::dictionary::searcher searchScoped ( const word & keyword,
enum keyType::option matchOpt )

Search using dot or slash scoping.

Parameters
keywordthe keyword to search for
matchOptsearch mode

Definition at line 356 of file dictionarySearch.C.

References csearchScoped().

Here is the call graph for this function:

◆ cfindScopedDict()

const Foam::dictionary * cfindScopedDict ( const fileName & dictPath) const

Locate a sub-dictionary using slash-scoping.

Returns
nullptr if the dictionary path does not exist

Definition at line 368 of file dictionarySearch.C.

References dictionary(), dictPath(), entry::dictPtr(), entry, Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, entry::isDict(), Foam::nl, null, path(), and Foam::stringOps::split().

Referenced by findScopedDict(), findScopedDict(), and set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findScopedDict() [1/2]

const Foam::dictionary * findScopedDict ( const fileName & dictPath) const

Locate a sub-dictionary using slash-scoping.

Returns
nullptr if the dictionary path does not exist

Definition at line 457 of file dictionarySearch.C.

References cfindScopedDict(), and dictPath().

Referenced by set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findScopedDict() [2/2]

Foam::dictionary * findScopedDict ( const fileName & dictPath)

Locate a sub-dictionary using slash-scoping.

Returns
nullptr if the dictionary path does not exist

Definition at line 466 of file dictionarySearch.C.

References cfindScopedDict(), dictionary(), and dictPath().

Here is the call graph for this function:

◆ makeScopedDict()

Foam::dictionary * makeScopedDict ( const fileName & dictPath)

Locate existing or create sub-dictionary using slash-scoping.

Returns
nullptr if the dictionary path could not be created

Definition at line 476 of file dictionarySearch.C.

References add(), fileName::clean(), dictionary(), dictionary, dictPath(), entry::dictPtr(), entry, Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, entry::isDict(), Foam::nl, null, path(), and Foam::stringOps::split().

Referenced by entry::New(), and set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ csearchCompat()

Foam::dictionary::const_searcher csearchCompat ( const word & keyword,
std::initializer_list< std::pair< const char *, int > > compat,
enum keyType::option matchOpt = keyType::REGEX ) const

Search dictionary for given keyword and any compatibility names.

Parameters
keywordthe keyword to search for
compatlist of old compatibility keywords and the last OpenFOAM version for which they were used. Old version 1600=OpenFOAM-v3.0, 240=OpenFOAM-2.4.x, 170=OpenFOAM-1.7.x,...
matchOptsearch mode (default: non-recursive with patterns)

Definition at line 26 of file dictionaryCompat.C.

References csearch(), dictionary::Searcher< Const >::good(), error::master(), Foam::nl, relativeName(), word::validate(), and error::warnAboutAge().

Referenced by findCompat(), getOrDefaultCompat(), readCompat(), and set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findCompat()

const Foam::entry * findCompat ( const word & keyword,
std::initializer_list< std::pair< const char *, int > > compat,
enum keyType::option matchOpt ) const

Find and return an entry pointer if present, or return a nullptr, using any compatibility names if needed.

Parameters
keywordthe keyword to search for
compatlist of old compatibility keywords and the last OpenFOAM version for which they were used.
matchOptsearch mode

Definition at line 67 of file dictionaryCompat.C.

References csearchCompat().

Referenced by foundCompat(), lookupEntryCompat(), and set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ foundCompat()

bool foundCompat ( const word & keyword,
std::initializer_list< std::pair< const char *, int > > compat,
enum keyType::option matchOpt = keyType::REGEX ) const

Search dictionary for given keyword and any compatibility names.

Parameters
keywordthe keyword to search for
compatlist of old compatibility keywords and the last OpenFOAM version for which they were used.
matchOptsearch mode (default: non-recursive with patterns)

Definition at line 78 of file dictionaryCompat.C.

References findCompat().

Referenced by set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lookupEntryCompat()

const Foam::entry & lookupEntryCompat ( const word & keyword,
std::initializer_list< std::pair< const char *, int > > compat,
enum keyType::option matchOpt ) const

Find and return an entry if present, otherwise FatalIOError, using any compatibility names if needed.

Parameters
keywordthe keyword to search for
compatlist of old compatibility keywords and the last OpenFOAM version for which they were used.
matchOptsearch mode

Definition at line 89 of file dictionaryCompat.C.

References entry, Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, findCompat(), and relativeName().

Referenced by lookupCompat(), and set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lookupCompat()

Foam::ITstream & lookupCompat ( const word & keyword,
std::initializer_list< std::pair< const char *, int > > compat,
enum keyType::option matchOpt = keyType::REGEX ) const

Find and return an entry data stream, using any compatibility names if needed.

Parameters
keywordthe keyword to search for
compatlist of old compatibility keywords and the last OpenFOAM version for which they were used.
matchOptsearch mode (default: non-recursive with patterns)

Definition at line 110 of file dictionaryCompat.C.

References lookupEntryCompat().

Referenced by set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCompat()

template<class T>
T getCompat ( const word & keyword,
std::initializer_list< std::pair< const char *, int > > compat,
enum keyType::option matchOpt = keyType::REGEX ) const

Find and return a T using any compatibility names if needed. FatalIOError if not found, or if there are excess tokens.

Parameters
keywordthe keyword to search for
compatlist of old compatibility keywords and the last OpenFOAM version for which they were used.
matchOptsearch mode (default: non-recursive with patterns)

Definition at line 126 of file dictionaryTemplates.C.

References readCompat(), and Foam::T().

Referenced by codedPoints0MotionSolver::codedPoints0MotionSolver(), basicChemistryModel::New(), motionSolver::New(), plane::plane(), and set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOrDefaultCompat()

template<class T>
T getOrDefaultCompat ( const word & keyword,
std::initializer_list< std::pair< const char *, int > > compat,
const T & deflt,
enum keyType::option matchOpt = keyType::REGEX ) const

Find and return a T, or return the given default value using any compatibility names if needed.

Parameters
keywordthe keyword to search for
compatlist of old compatibility keywords and the last OpenFOAM version for which they were used.
defltthe default value to use
matchOptsearch mode (default: non-recursive with patterns)

Definition at line 452 of file dictionaryTemplates.C.

References checkITstream(), csearchCompat(), entry, entry::stream(), Foam::T(), and writeOptionalEntries.

Referenced by fvDOM::fvDOM(), fvDOM::fvDOM(), NURBS3DVolume::NURBS3DVolume(), objective::objective(), set(), thermalShellModel::thermalShellModel(), and topODesignVariables::topODesignVariables().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readCompat()

template<class T>
bool readCompat ( const word & keyword,
std::initializer_list< std::pair< const char *, int > > compat,
T & val,
enum keyType::option matchOpt = keyType::REGEX,
IOobjectOption::readOption readOpt = IOobjectOption::MUST_READ ) const

Find entry and assign to T val using any compatibility names if needed. FatalIOError if there are excess tokens.

Parameters
keywordthe keyword to search for
compatlist of old compatibility keywords and the last OpenFOAM version for which they were used.
valthe value to read
matchOptsearch mode (default: non-recursive with patterns)
readOptthe entry is required/optional (default: MUST_READ)
Returns
true if the entry was read

Definition at line 374 of file dictionaryTemplates.C.

References checkITstream(), csearchCompat(), entry, Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, IOobjectOption::isReadRequired(), name, Foam::nl, IOobjectOption::NO_READ, entry::stream(), and Foam::T().

Referenced by getCompat(), RASModelVariables::New(), readIfPresentCompat(), and set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readIfPresentCompat()

template<class T>
bool readIfPresentCompat ( const word & keyword,
std::initializer_list< std::pair< const char *, int > > compat,
T & val,
enum keyType::option matchOpt = keyType::REGEX ) const

Find an entry if present, and assign to T val using any compatibility names if needed. FatalIOError if it is found and there are excess tokens.

Parameters
keywordthe keyword to search for
compatlist of old compatibility keywords and the last OpenFOAM version for which they were used.
valthe value to read
matchOptsearch mode (default: non-recursive with patterns)
Returns
true if the entry was found.

Definition at line 483 of file dictionaryTemplates.C.

References IOobjectOption::READ_IF_PRESENT, readCompat(), and Foam::T().

Referenced by set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

void operator= ( const dictionary & rhs)

Copy assignment.

Definition at line 886 of file dictionary.C.

References Foam::add(), clear(), dictionary(), e, entry, name, and Foam::rhs().

Referenced by dictionary(), IOdictionary::IOdictionary(), localIOdictionary::localIOdictionary(), baseIOdictionary::operator=(), baseIOdictionary::operator=(), meshState::reset(), and unwatchedIOdictionary::unwatchedIOdictionary().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator+=()

void operator+= ( const dictionary & rhs)

Include entries from the given dictionary.

Warn, but do not overwrite existing entries.

Definition at line 906 of file dictionary.C.

References Foam::abort(), Foam::add(), dictionary(), e, entry, Foam::FatalIOError, FatalIOErrorInFunction, Foam::nl, relativeName(), and Foam::rhs().

Here is the call graph for this function:

◆ operator|=()

void operator|= ( const dictionary & rhs)

Conditionally include entries from the given dictionary.

Do not overwrite existing entries.

Definition at line 923 of file dictionary.C.

References Foam::abort(), Foam::add(), dictionary(), e, entry, Foam::FatalIOError, FatalIOErrorInFunction, found, Foam::nl, relativeName(), and Foam::rhs().

Here is the call graph for this function:

◆ operator<<=()

void operator<<= ( const dictionary & rhs)

Unconditionally include entries from the given dictionary.

Overwrite existing entries.

Definition at line 943 of file dictionary.C.

References Foam::abort(), dictionary(), e, entry, Foam::FatalIOError, FatalIOErrorInFunction, Foam::nl, relativeName(), Foam::rhs(), and set().

Here is the call graph for this function:

◆ getBool()

bool getBool ( const word & keyword,
enum keyType::option matchOpt = keyType::REGEX ) const
inline

Same as get<bool>(const word&, keyType::option).

Definition at line 1701 of file dictionary.H.

References getBool().

Referenced by getBool(), and singleStepCombustion< ReactionThermo, ThermoType >::singleStepCombustion().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLabel()

label getLabel ( const word & keyword,
enum keyType::option matchOpt = keyType::REGEX ) const
inline

Same as get<label>(const word&, keyType::option).

Definition at line 1702 of file dictionary.H.

References getLabel().

Referenced by KirchhoffShell::evolveRegion(), getLabel(), and propellerInfo::setSampleDiskSurface().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getScalar()

◆ getString()

string getString ( const word & keyword,
enum keyType::option matchOpt = keyType::REGEX ) const
inline

Same as get<string>(const word&, keyType::option).

Definition at line 1704 of file dictionary.H.

References getString().

Referenced by getString().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getWord()

word getWord ( const word & keyword,
enum keyType::option matchOpt = keyType::REGEX ) const
inline

Same as get<word>(const word&, keyType::option).

Definition at line 1705 of file dictionary.H.

References getWord().

Referenced by getWord(), incompressibleInterPhaseTransportModel< Mixture >::incompressibleInterPhaseTransportModel(), and ParticleZoneInfo< CloudType >::ParticleZoneInfo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFileName()

fileName getFileName ( const word & keyword,
enum keyType::option matchOpt = keyType::REGEX ) const
inline

Same as get<fileName>(const word&, keyType::option).

Definition at line 1706 of file dictionary.H.

References getFileName().

Referenced by getFileName().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isDict()

bool isDict ( const word & keyword,
enum keyType::option matchOpt = keyType::REGEX ) const
inline

Check for existence of a sub-dictionary. Generally prefer findDict() for more flexibility.

Definition at line 1718 of file dictionary.H.

References findDict(), and isDict().

Referenced by add(), isDict(), and merge().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lookupOrDefault() [1/2]

template<class T>
T lookupOrDefault ( const word & keyword,
const T & deflt,
enum keyType::option matchOpt = keyType::REGEX ) const
inline

Same as getOrDefault().

Definition at line 1732 of file dictionary.H.

References getOrDefault(), lookupOrDefault(), and Foam::T().

Referenced by lookupOrDefault(), and lookupOrDefault().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lookupOrAddDefault() [1/2]

template<class T>
T lookupOrAddDefault ( const word & keyword,
const T & deflt,
enum keyType::option matchOpt = keyType::REGEX )
inline

Same as getOrAdd().

Definition at line 1747 of file dictionary.H.

References getOrAdd(), lookupOrAddDefault(), and Foam::T().

Referenced by lookupOrAddDefault(), and lookupOrAddDefault().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator[]()

ITstream & operator[] ( const word & keyword) const
inline

Deprecated(2018-07) - use lookup() method.

Deprecated
(2018-07) - use lookup() method

Definition at line 1763 of file dictionary.H.

References lookup(), and UILList< DLListBase, T >::operator.

Here is the call graph for this function:

◆ found() [2/2]

bool found ( const word & keyword,
bool recursive,
bool patternMatch = true ) const
inline

Deprecated(2018-10).

Deprecated
(2018-10) - use keyType::option version

Definition at line 1774 of file dictionary.H.

References found(), and found.

Here is the call graph for this function:

◆ lookupEntryPtr() [1/2]

entry * lookupEntryPtr ( const word & keyword,
bool recursive,
bool patternMatch )
inline

Deprecated(2018-10).

Deprecated
(2018-10) - use findEntry() method

Definition at line 1790 of file dictionary.H.

References entry, findEntry(), and lookupEntryPtr().

Referenced by lookupEntryPtr(), and lookupEntryPtr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lookupEntryPtr() [2/2]

const entry * lookupEntryPtr ( const word & keyword,
bool recursive,
bool patternMatch ) const
inline

Deprecated(2018-10).

Deprecated
(2018-10) - use findEntry() method

Definition at line 1806 of file dictionary.H.

References entry, findEntry(), and lookupEntryPtr().

Here is the call graph for this function:

◆ lookupScopedEntryPtr()

const entry * lookupScopedEntryPtr ( const word & keyword,
bool recursive,
bool patternMatch ) const
inline

Deprecated(2018-10).

Deprecated
(2018-10) - use findScoped() method

Definition at line 1822 of file dictionary.H.

References entry, findScoped(), and lookupScopedEntryPtr().

Referenced by lookupScopedEntryPtr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ subDictPtr() [1/2]

const dictionary * subDictPtr ( const word & keyword) const
inline

Deprecated(2018-10).

Find and return a sub-dictionary pointer if present (and a sub-dictionary) otherwise return nullptr.

Search type: non-recursive with patterns.

Deprecated
(2018-10) - use findDict() method

Definition at line 1842 of file dictionary.H.

References dictionary(), findDict(), keyType::REGEX, and subDictPtr().

Referenced by basicChemistryModel::New(), subDictPtr(), and subDictPtr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ subDictPtr() [2/2]

dictionary * subDictPtr ( const word & keyword)
inline

Deprecated(2018-10) Find and return a sub-dictionary pointer if present.

(and a sub-dictionary) otherwise return nullptr.

Search type: non-recursive with patterns.

Deprecated
(2018-10) - use findDict() method

Definition at line 1857 of file dictionary.H.

References dictionary(), findDict(), keyType::REGEX, and subDictPtr().

Here is the call graph for this function:

◆ lookupEntry() [2/2]

const entry & lookupEntry ( const word & keyword,
bool recursive,
bool patternMatch ) const
inline

Deprecated(2018-10).

Deprecated
(2018-10) - use keyType::option version

Definition at line 1868 of file dictionary.H.

References entry, and lookupEntry().

Here is the call graph for this function:

◆ lookup() [2/2]

ITstream & lookup ( const word & keyword,
bool recursive,
bool patternMatch = true ) const
inline

Deprecated(2018-10).

Deprecated
(2018-10) - use keyType::option version

Definition at line 1884 of file dictionary.H.

References lookup().

Here is the call graph for this function:

◆ lookupOrDefault() [2/2]

template<class T>
T lookupOrDefault ( const word & keyword,
const T & deflt,
bool recursive,
bool patternMatch = true ) const
inline

Deprecated(2018-10).

Deprecated
(2018-10) - use keyType::option version

Definition at line 1901 of file dictionary.H.

References getOrDefault(), lookupOrDefault(), and Foam::T().

Here is the call graph for this function:

◆ lookupOrAddDefault() [2/2]

template<class T>
T lookupOrAddDefault ( const word & keyword,
const T & deflt,
bool recursive,
bool patternMatch = true )
inline

Deprecated(2018-10).

Deprecated
(2018-10) - use keyType::option version

Definition at line 1919 of file dictionary.H.

References getOrAdd(), lookupOrAddDefault(), and Foam::T().

Here is the call graph for this function:

◆ readIfPresent() [2/2]

template<class T>
bool readIfPresent ( const word & keyword,
T & val,
bool recursive,
bool patternMatch = true ) const
inline

Deprecated(2018-10).

Deprecated
(2018-10) - use keyType::option version

Definition at line 1937 of file dictionary.H.

References readIfPresent(), and Foam::T().

Here is the call graph for this function:

◆ lookupType()

template<class T>
T lookupType ( const word & keyword,
bool recursive = false,
bool patternMatch = true ) const
inline

Deprecated(2018-10) find and return a T.

Deprecated
(2018-10) - use get() method

Definition at line 1960 of file dictionary.H.

References get(), lookupType(), and Foam::T().

Referenced by lookupType().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sortedToc() [3/3]

template<class Compare>
Foam::wordList sortedToc ( const Compare & comp) const

Definition at line 78 of file dictionaryTemplates.C.

◆ add() [9/9]

template<class T>
Foam::entry * add ( const keyType & k,
const T & v,
bool overwrite )

Definition at line 85 of file dictionaryTemplates.C.

References Foam::add(), k, and Foam::T().

Here is the call graph for this function:

◆ set() [8/8]

template<class T>
Foam::entry * set ( const keyType & k,
const T & v )

Definition at line 92 of file dictionaryTemplates.C.

References k, set(), and Foam::T().

Here is the call graph for this function:

◆ entry

◆ operator>>

Istream & operator>> ( Istream & is,
dictionary & dict )
friend

Read dictionary from Istream.

References dict, dictionary(), and UILList< DLListBase, T >::operator.

◆ operator<<

Ostream & operator<< ( Ostream & os,
const dictionary & dict )
friend

Write dictionary to Ostream.

References dict, dictionary(), UILList< DLListBase, T >::operator, and os().

Member Data Documentation

◆ const_searcher

Declare friendship with the searcher classes.

Definition at line 343 of file dictionary.H.

◆ searcher

friend searcher

Definition at line 344 of file dictionary.H.

◆ writeOptionalEntries

int writeOptionalEntries
static

Report optional keywords and values if not present in dictionary.

For value greater than 1: fatal. Set/unset via an InfoSwitch or -info-switch at the command-line

Definition at line 482 of file dictionary.H.

Referenced by getCheckOrAdd(), getCheckOrDefault(), getOrAdd(), getOrDefault(), getOrDefaultCompat(), registerInfoSwitch(), reportOptional(), and reportOptional().

◆ null

const Foam::dictionary null
static

An empty dictionary, which is also the parent for all dictionaries.

Definition at line 487 of file dictionary.H.

Referenced by cellModel::cellModel(), cfindScopedDict(), surfaceIntersection::ClassName(), entry::clone(), codedMixedFvPatchField< Type >::codeContext(), codedFunctionObject::codeContext(), Stokes< BasicTurbulenceModel >::coeffDict(), csearch(), csearchScoped(), MeshedSurfaceProxy< Face >::declareMemberFunctionSelectionTable(), fvExprDriver::declareRunTimeSelectionTable(), primitiveEntry::dict(), primitiveEntry::dict(), dictionary(), dictionary(), dictionary(), dictionary(), dictionary(), dictionary(), dictionaryListEntry::dictionaryListEntry(), Foam::dimensionedConstant(), faMeshDecomposition::faMeshDecomposition(), faMeshDecomposition::faMeshDecomposition(), writerCaching::fieldsDict(), decompositionMethod::findCoeffsDict(), dynamicCodeContext::good(), isNullDict(), liquidFilmBase::liquidFilmBase(), makeScopedDict(), multiphaseInterSystem::multiphaseInterSystem(), entry::New(), functionObjectList::New(), RASModelVariables::New(), lduMatrix::preconditioner::New(), lduMatrix::smoother::New(), NURBS3DVolume::NURBS3DVolume(), objective::objective(), sizeGroup::iNew::operator()(), motionSolver::iNew::operator()(), phase::iNew::operator()(), phaseModel::iNew::operator()(), parseDriver::operator=(), Foam::functionObjects::operator>>(), Foam::operator>>(), Foam::operator>>(), decompositionMethod::optionalRegionDict(), primitiveEntry::primitiveEntry(), rigidBodyMeshMotion::rigidBodyMeshMotion(), simple::simple(), solver::solver(), surfMesh::storeField(), meshRefinement::subDict(), topOVariablesBase::topOVariablesBase(), triSurfaceMeshPointSet::triSurfaceMeshPointSet(), OFstreamCollator::TypeName(), ConstantField< Type >::TypeName(), updateMethod::updateMethod(), volumetricBSplinesDesignVariables::volumetricBSplinesDesignVariables(), edgeMesh::write(), ABAQUSsurfaceFormat< Face >::write(), ABAQUSsurfaceFormat< Face >::write(), AC3DsurfaceFormat< Face >::write(), AC3DsurfaceFormat< Face >::write(), edgeMeshFormat::write(), edgeMeshFormat::write(), FLMAsurfaceFormat< Face >::write(), FLMAsurfaceFormat< Face >::write(), FLMAZsurfaceFormat< Face >::write(), FLMAZsurfaceFormat< Face >::write(), GTSsurfaceFormat< Face >::write(), GTSsurfaceFormat< Face >::write(), NASsurfaceFormat< Face >::write(), NASsurfaceFormat< Face >::write(), OBJedgeFormat::write(), OBJedgeFormat::write(), OBJsurfaceFormat< Face >::write(), OBJsurfaceFormat< Face >::write(), OFFsurfaceFormat< Face >::write(), OFFsurfaceFormat< Face >::write(), SMESHsurfaceFormat< Face >::write(), SMESHsurfaceFormat< Face >::write(), STARCDedgeFormat::write(), STARCDedgeFormat::write(), STARCDsurfaceFormat< Face >::write(), STARCDsurfaceFormat< Face >::write(), STLsurfaceFormat< Face >::write(), STLsurfaceFormat< Face >::write(), TRIsurfaceFormat< Face >::write(), TRIsurfaceFormat< Face >::write(), VTKedgeFormat::write(), VTKedgeFormat::write(), VTKsurfaceFormat< Face >::write(), VTKsurfaceFormat< Face >::write(), VTPsurfaceFormat< Face >::write(), VTPsurfaceFormat< Face >::write(), X3DsurfaceFormat< Face >::write(), X3DsurfaceFormat< Face >::write(), MeshedSurface< face >::write(), MeshedSurface< face >::write(), MeshedSurface< face >::write(), MeshedSurface< face >::write(), MeshedSurfaceProxy< Face >::write(), MeshedSurfaceProxy< Face >::write(), UnsortedMeshedSurface< face >::write(), UnsortedMeshedSurface< face >::write(), UnsortedMeshedSurface< face >::write(), UnsortedMeshedSurface< face >::write(), writeEntries(), ABAQUSsurfaceFormat< Face >::~ABAQUSsurfaceFormat(), AC3DsurfaceFormat< Face >::~AC3DsurfaceFormat(), edgeMeshFormat::~edgeMeshFormat(), FLMAsurfaceFormat< Face >::~FLMAsurfaceFormat(), FLMAZsurfaceFormat< Face >::~FLMAZsurfaceFormat(), GTSsurfaceFormat< Face >::~GTSsurfaceFormat(), NASsurfaceFormat< Face >::~NASsurfaceFormat(), OBJedgeFormat::~OBJedgeFormat(), OBJsurfaceFormat< Face >::~OBJsurfaceFormat(), OFFsurfaceFormat< Face >::~OFFsurfaceFormat(), SMESHsurfaceFormat< Face >::~SMESHsurfaceFormat(), STARCDedgeFormat::~STARCDedgeFormat(), STARCDsurfaceFormat< Face >::~STARCDsurfaceFormat(), STLsurfaceFormat< Face >::~STLsurfaceFormat(), TRIsurfaceFormat< Face >::~TRIsurfaceFormat(), VTKedgeFormat::~VTKedgeFormat(), VTKsurfaceFormat< Face >::~VTKsurfaceFormat(), VTPsurfaceFormat< Face >::~VTPsurfaceFormat(), and X3DsurfaceFormat< Face >::~X3DsurfaceFormat().

◆ reportingOutput

Foam::refPtr< Foam::OSstream > reportingOutput
static

Output location when reporting default values.

Definition at line 492 of file dictionary.H.


The documentation for this class was generated from the following files: