FreeFOAM The Cross-Platform CFD Toolkit
dictionary Class Reference

A list of keyword definitions, which are a keyword followed by any number of values (e.g. words and numbers). The keywords can represent patterns which are matched using Posix regular expressions. The general order for searching is as follows: More...

#include <OpenFOAM/dictionary.H>


Detailed Description

A list of keyword definitions, which are a keyword followed by any number of values (e.g. words and numbers). The keywords can represent patterns which are matched using Posix regular expressions. 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. It also serves as a bootstrap dictionary for the objectRegistry data dictionaries since, unlike the IOdictionary class, it does not use an objectRegistry itself to work.

Todo:
A merge() member function with a non-const dictionary parameter. This would avoid unnecessary cloning in the add(entry*, bool) method.
Source files

Definition at line 122 of file dictionary.H.

+ Inheritance diagram for dictionary:
+ Collaboration diagram for dictionary:

List of all members.

Public Member Functions

 ClassName ("dictionary")
 dictionary ()
 Construct top-level dictionary null.
 dictionary (const fileName &name)
 Construct top-level empty dictionary with given name.
 dictionary (const fileName &name, const dictionary &parentDict, Istream &)
 Construct given the entry name, parent dictionary and Istream,.
 dictionary (Istream &)
 Construct top-level dictionary from Istream, reading entries.
 dictionary (const dictionary &parentDict, const dictionary &)
 Construct as copy given the parent dictionary.
 dictionary (const dictionary &)
 Construct top-level dictionary as copy.
 dictionary (const dictionary *)
 Construct top-level dictionary as copy from pointer to dictionary.
 dictionary (const dictionary &parentDict, const Xfer< dictionary > &)
 Construct by transferring parameter contents given parent dictionary.
 dictionary (const Xfer< dictionary > &)
 Construct top-level dictionary by transferring parameter contents.
autoPtr< dictionaryclone () const
 Construct and return clone.
 ~dictionary ()
const dictionaryparent () const
 Return the parent dictionary.
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.
bool found (const word &, bool recursive=false) const
 Search dictionary for given keyword.
const entrylookupEntryPtr (const word &, bool recursive, bool patternMatch) const
 Find and return an entry data stream pointer if present.
entrylookupEntryPtr (const word &, bool recursive, bool patternMatch)
 Find and return an entry data stream pointer for manipulation.
const entrylookupEntry (const word &, bool recursive, bool patternMatch) const
 Find and return an entry data stream if present otherwise error.
ITstreamlookup (const word &, bool recursive=false, bool patternMatch=true) const
 Find and return an entry data stream.
template<class T >
T lookupOrDefault (const word &, const T &, bool recursive=false, bool patternMatch=true) const
 Find and return a T,.
template<class T >
T lookupOrAddDefault (const word &, const T &, bool recursive=false, bool patternMatch=true)
 Find and return a T, if not found return the given.
template<class T >
bool readIfPresent (const word &, T &, bool recursive=false, bool patternMatch=true) const
 Find an entry if present, and assign to T.
bool isDict (const word &) const
 Check if entry is a sub-dictionary.
const dictionarysubDictPtr (const word &) const
 Find and return a sub-dictionary pointer if present.
const dictionarysubDict (const word &) const
 Find and return a sub-dictionary.
dictionarysubDict (const word &)
 Find and return a sub-dictionary for manipulation.
dictionary subOrEmptyDict (const word &) const
 Find and return a sub-dictionary as a copy, or.
wordList toc () const
 Return the table of contents.
List< keyTypekeys (bool patterns=false) const
 Return the list of available keys or patterns.
bool substituteKeyword (const word &keyword)
 Substitute the given keyword prepended by '$' with the.
bool add (entry *, bool mergeEntry=false)
 Add a new entry.
void add (const entry &, bool mergeEntry=false)
 Add an entry.
void add (const keyType &, const word &, bool overwrite=false)
 Add a word entry.
void add (const keyType &, const string &, bool overwrite=false)
 Add a string entry.
void add (const keyType &, const label, bool overwrite=false)
 Add a label entry.
void add (const keyType &, const scalar, bool overwrite=false)
 Add a scalar entry.
void add (const keyType &, const dictionary &, bool mergeEntry=false)
 Add a dictionary entry.
template<class T >
void add (const keyType &, const T &, bool overwrite=false)
 Add a T entry.
void set (entry *)
 Assign a new entry, overwrite any existing entry.
void set (const entry &)
 Assign a new entry, overwrite any existing entry.
void set (const keyType &, const dictionary &)
 Assign a dictionary entry, overwrite any existing entry.
template<class T >
void set (const keyType &, const T &)
 Assign a T entry, overwrite any existing entry.
bool remove (const word &)
 Remove an entry specified by keyword.
bool changeKeyword (const keyType &oldKeyword, const keyType &newKeyword, bool forceOverwrite=false)
 Change the keyword for an entry,.
bool merge (const dictionary &)
 Merge entries from the given dictionary.
void clear ()
 Clear the dictionary.
void transfer (dictionary &)
 Transfer the contents of the argument and annul the argument.
Xfer< dictionaryxfer ()
 Transfer contents to the Xfer container.
bool read (Istream &)
 Read dictionary from Istream.
void write (Ostream &, bool subDict=true) const
ITstreamoperator[] (const word &) const
 Find and return entry.
void operator= (const dictionary &)
void operator+= (const dictionary &)
 Include entries from the given dictionary.
void operator|= (const dictionary &)
 Conditionally include entries from the given dictionary.
void operator<<= (const dictionary &)
 Unconditionally include entries from the given dictionary.
- Public Member Functions inherited from dictionaryName
 dictionaryName ()
 Construct dictionaryName null.
 dictionaryName (const fileName &name)
 Construct dictionaryName as copy of the given fileName.
const fileNamename () const
 Return the dictionary name.
fileNamename ()
 Return the dictionary name.
- Public Member Functions inherited from IDLList< entry >
 IDLList ()
 Null construct.
 IDLList (const entry &a)
 Construct given initial T.
 IDLList (Istream &is, const INew &inewt)
 Construct from Istream using given Istream constructor class.
 IDLList (Istream &is)
 Construct from Istream.
 IDLList (const IDLList< entry > &idll, const CloneArg &cloneArg)
 Copy constructor with additional argument for clone.
- Public Member Functions inherited from ILList< DLListBase, entry >
 ILList ()
 Null construct.
 ILList (entry *a)
 Construct given initial T.
 ILList (Istream &)
 Construct from Istream.
 ILList (const ILList< DLListBase, entry > &)
 Construct as copy.
 ILList (const ILList< DLListBase, entry > &lst, const CloneArg &cloneArg)
 Copy constructor with additional argument for clone.
 ILList (Istream &, const INew &)
 Construct from Istream using given Istream constructor class.
 ~ILList ()
bool eraseHead ()
 Remove the head element specified from the list and delete it.
bool erase (entry *p)
 Remove the specified element from the list and delete it.
void transfer (ILList< DLListBase, entry > &)
 Transfer the contents of the argument into this List.
void operator= (const ILList< DLListBase, entry > &)
- Public Member Functions inherited from UILList< DLListBase, entry >
 UILList ()
 Null construct.
 UILList (entry *a)
 Construct given initial T.
 UILList (const UILList< DLListBase, entry > &)
 Construct as copy.
entryfirst ()
 Return the first entry.
const entryfirst () const
 Return the first entry.
entrylast ()
 Return the last entry.
const entrylast () const
 Return the last entry.
entryremoveHead ()
 Remove and return head.
entryremove (entry *p)
 Remove and return element.
entryremove (iterator &it)
 Remove and return specified by iterator.
void operator= (const UILList< DLListBase, entry > &)
bool operator== (const UILList< DLListBase, entry > &) const
 Equality operation on ULists of the same type.
bool operator!= (const UILList< DLListBase, entry > &) const
 The opposite of the equality operation. Takes linear time.
- Public Member Functions inherited from DLListBase
 DLListBase ()
 Null construct.
 DLListBase (link *)
 Construct given initial entry.
 ~DLListBase ()
label size () const
 Return number of elements in list.
bool empty () const
 Return true if the list is empty.
void insert (link *)
 Add at head of list.
void append (link *)
 Add at tail of list.
bool swapUp (link *)
 Swap this element with the one above unless it is at the top.
bool swapDown (link *)
 Swap this element with the one below unless it is at the bottom.
linkremove (link *)
 Remove and return element.
linkreplace (link *oldLink, link *newLink)
 Replace oldLink with newLink and return element.
linkreplace (iterator &oldIter, link *newLink)
 Replace oldIter with newLink and return element.
void transfer (DLListBase &)
 Transfer the contents of the argument into this List.
iterator begin ()
const iteratorend ()
const_iterator cbegin () const
const const_iteratorcend () const
const_iterator begin () const
const const_iteratorend () const

Static Public Member Functions

static autoPtr< dictionaryNew (Istream &)
 Construct top-level dictionary on freestore from Istream.

Static Public Attributes

static const dictionary null
 Null dictionary.

Friends

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

Constructor & Destructor Documentation

Construct top-level dictionary null.

Definition at line 105 of file dictionary.C.

dictionary ( const fileName name)

Construct top-level empty dictionary with given name.

Definition at line 111 of file dictionary.C.

dictionary ( const fileName name,
const dictionary parentDict,
Istream is 
)

Construct given the entry name, parent dictionary and Istream,.

reading entries until lastEntry or EOF

Definition at line 96 of file dictionaryIO.C.

dictionary ( Istream is)

Construct top-level dictionary from Istream, reading entries.

until EOF

Definition at line 109 of file dictionaryIO.C.

References dictionary::clear(), and dictionary::read().

dictionary ( const dictionary parentDict,
const dictionary dict 
)

Construct as copy given the parent dictionary.

Definition at line 119 of file dictionary.C.

References forAllIter.

dictionary ( const dictionary dict)

Construct top-level dictionary as copy.

Definition at line 145 of file dictionary.C.

References forAllIter.

dictionary ( const dictionary dictPtr)

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

A null pointer is treated like an empty dictionary.

Definition at line 170 of file dictionary.C.

dictionary ( const dictionary parentDict,
const Xfer< dictionary > &  dict 
)

Construct by transferring parameter contents given parent dictionary.

Definition at line 184 of file dictionary.C.

References dictionaryName::name(), and Foam::name().

dictionary ( const Xfer< dictionary > &  dict)

Construct top-level dictionary by transferring parameter contents.

Definition at line 197 of file dictionary.C.

~dictionary ( )

Definition at line 215 of file dictionary.C.


Member Function Documentation

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

Construct and return clone.

Definition at line 207 of file dictionary.C.

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

Construct top-level dictionary on freestore from Istream.

Definition at line 121 of file dictionaryIO.C.

Referenced by dictionary::read().

const dictionary& parent ( ) const
inline

Return the parent dictionary.

Definition at line 229 of file dictionary.H.

Foam::label startLineNumber ( ) const

Return line number of first token in dictionary.

Reimplemented in dictionaryEntry.

Definition at line 223 of file dictionary.C.

Foam::label endLineNumber ( ) const

Return line number of last token in dictionary.

Reimplemented in dictionaryEntry.

Definition at line 236 of file dictionary.C.

Foam::SHA1Digest digest ( ) const

Return the SHA1 digest of the dictionary contents.

Definition at line 249 of file dictionary.C.

References OSHA1stream::digest(), and forAllConstIter.

Referenced by functionObjectList::read().

bool found ( const word keyword,
bool  recursive = false 
) const

Search dictionary for given keyword.

If recursive, search parent dictionaries

Definition at line 263 of file dictionary.C.

References DLListBase::begin(), and dictionary::null.

Referenced by activeBaffleVelocityFvPatchVectorField::activeBaffleVelocityFvPatchVectorField(), sixDoFRigidBodyMotion::addConstraints(), sixDoFRigidBodyMotion::addRestraints(), advectiveFvPatchField< Type >::advectiveFvPatchField(), alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField(), alphaFixedPressureFvPatchScalarField::alphaFixedPressureFvPatchScalarField(), angularOscillatingDisplacementPointPatchVectorField::angularOscillatingDisplacementPointPatchVectorField(), angularOscillatingVelocityPointPatchVectorField::angularOscillatingVelocityPointPatchVectorField(), autoHexMeshDriver::autoHexMeshDriver(), chemkinReader::chemkinReader(), cyclicPolyPatch::cyclicPolyPatch(), argList::displayDoc(), fanFvPatchField< Type >::fanFvPatchField(), fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField(), fvMotionSolverEngineMesh::fvMotionSolverEngineMesh(), fvPatchField< Type >::fvPatchField(), fvsPatchField< Type >::fvsPatchField(), greyDiffusiveRadiationMixedFvPatchScalarField::greyDiffusiveRadiationMixedFvPatchScalarField(), inletOutletTotalTemperatureFvPatchScalarField::inletOutletTotalTemperatureFvPatchScalarField(), JobInfo::JobInfo(), layeredEngineMesh::layeredEngineMesh(), layerParameters::layerParameters(), PstreamImpl::loadPstreamLibrary(), MarshakRadiationFixedTMixedFvPatchScalarField::MarshakRadiationFixedTMixedFvPatchScalarField(), MarshakRadiationFvPatchScalarField::MarshakRadiationFvPatchScalarField(), MRFZone::MRFZone(), pointPatchField< Type >::New(), fvsPatchField< Type >::New(), fvPatchField< Type >::New(), dlLibraryTable::open(), coordinateRotation::operator=(), coordinateSystem::operator=(), oscillatingDisplacementPointPatchVectorField::oscillatingDisplacementPointPatchVectorField(), oscillatingFixedValueFvPatchField< Type >::oscillatingFixedValueFvPatchField(), oscillatingVelocityPointPatchVectorField::oscillatingVelocityPointPatchVectorField(), Foam::preservePatchTypes(), pressureInletOutletVelocityFvPatchVectorField::pressureInletOutletVelocityFvPatchVectorField(), tolerances::read(), solution::read(), fvSchemes::read(), fieldAverage::readAveragingProperties(), Time::readDict(), refinementSurfaces::refinementSurfaces(), tolerances::relax(), sampledPlane::sampledPlane(), sampledThresholdCellFaces::sampledThresholdCellFaces(), searchableSurfaces::searchableSurfaces(), Foam::setRefCell(), sixDoFRigidBodyDisplacementPointPatchVectorField::sixDoFRigidBodyDisplacementPointPatchVectorField(), supersonicFreestreamFvPatchVectorField::supersonicFreestreamFvPatchVectorField(), timeVaryingMappedFixedValueFvPatchField< Type >::timeVaryingMappedFixedValueFvPatchField(), timeVaryingUniformFixedValueFvPatchField< Type >::timeVaryingUniformFixedValueFvPatchField(), timeVaryingUniformInletOutletFvPatchField< Type >::timeVaryingUniformInletOutletFvPatchField(), timeVaryingUniformTotalPressureFvPatchScalarField::timeVaryingUniformTotalPressureFvPatchScalarField(), totalPressureFvPatchScalarField::totalPressureFvPatchScalarField(), totalTemperatureFvPatchScalarField::totalTemperatureFvPatchScalarField(), turbulentInletFvPatchField< Type >::turbulentInletFvPatchField(), turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::turbulentTemperatureCoupledBaffleMixedFvPatchScalarField(), uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField::uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField(), uniformDensityHydrostaticPressureFvPatchScalarField::uniformDensityHydrostaticPressureFvPatchScalarField(), valuePointPatchField< Type >::valuePointPatchField(), wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField(), and wideBandDiffusiveRadiationMixedFvPatchScalarField::wideBandDiffusiveRadiationMixedFvPatchScalarField().

const Foam::entry * lookupEntryPtr ( const word keyword,
bool  recursive,
bool  patternMatch 
) const

Find and return an entry data stream pointer if present.

otherwise return NULL. If recursive, search parent dictionaries. If patternMatch, use regular expressions

Definition at line 298 of file dictionary.C.

References DLListBase::begin(), HashTable< T, Key, Hash >::end(), HashTable< T, Key, Hash >::find(), and dictionary::null.

Referenced by coordinateSystem::coordinateSystem(), entry::New(), Foam::debug::switchSet(), and solution::upgradeSolverDict().

Foam::entry * lookupEntryPtr ( const word keyword,
bool  recursive,
bool  patternMatch 
)

Find and return an entry data stream pointer for manipulation.

if present otherwise return NULL. If recursive, search parent dictionaries. If patternMatch, use regular expressions.

Definition at line 337 of file dictionary.C.

References DLListBase::begin(), HashTable< T, Key, Hash >::end(), HashTable< T, Key, Hash >::find(), and dictionary::null.

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

Find and return an entry data stream if present otherwise error.

If recursive, search parent dictionaries. If patternMatch, use regular expressions.

Definition at line 381 of file dictionary.C.

References Foam::exit(), Foam::FatalIOError, FatalIOErrorIn, and Foam::name().

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

Foam::ITstream & lookup ( const word keyword,
bool  recursive = false,
bool  patternMatch = true 
) const

Find and return an entry data stream.

If recursive, search parent dictionaries. If patternMatch, use regular expressions.

Definition at line 405 of file dictionary.C.

Referenced by activeBaffleVelocityFvPatchVectorField::activeBaffleVelocityFvPatchVectorField(), sixDoFRigidBodyMotion::addConstraints(), advectiveFvPatchField< Type >::advectiveFvPatchField(), argList::argList(), autoHexMeshDriver::autoHexMeshDriver(), cellModel::cellModel(), motionSmoother::checkMesh(), chemkinReader::chemkinReader(), molecule::constantProperties::constantProperties(), correlationFunction< Type >::correlationFunction(), cyclicPolyPatch::cyclicPolyPatch(), forces::devRhoReff(), Foam::dimensionedConstant(), directions::directions(), argList::displayDoc(), autoRefineDriver::doRefine(), EulerCoordinateRotation::EulerCoordinateRotation(), fanFvPatchField< Type >::fanFvPatchField(), Field< Type >::Field(), fieldAverageItem::fieldAverageItem(), FreeStream< CloudType >::FreeStream(), fvMotionSolverEngineMesh::fvMotionSolverEngineMesh(), lduMatrix::smoother::getName(), lduMatrix::preconditioner::getName(), globalMeshData::globalMeshData(), Foam::MULES::implicitSolve(), absorptionCoeffs::initialise(), cellSource::initialise(), faceSource::initialise(), JobInfo::JobInfo(), laminarFlameSpeed::laminarFlameSpeed(), layeredEngineMesh::layeredEngineMesh(), layerParameters::layerParameters(), liquidMixture::liquidMixture(), PstreamImpl::loadPstreamInstance(), PstreamImpl::loadPstreamLibrary(), multiDirRefinement::multiDirRefinement(), multivariateSelectionScheme< Type >::multivariateSelectionScheme(), basicPsiThermo::New(), motionSolver::New(), hCombustionThermo::New(), hsCombustionThermo::New(), hReactionThermo::New(), hsReactionThermo::New(), basicRhoThermo::New(), hhuCombustionThermo::New(), dragModel::New(), scatterModel::New(), heatTransferModel::New(), injectorType::New(), evaporationModel::New(), tetherPotential::New(), atomizationModel::New(), extrudeModel::New(), absorptionEmissionModel::New(), dispersionModel::New(), DragModel< CloudType >::New(), DispersionModel< CloudType >::New(), interpolation< Type >::New(), energyScalingFunction::New(), psiChemistryModel::New(), rhoChemistryModel::New(), engineMesh::New(), LESfilter::New(), BinaryCollisionModel< CloudType >::New(), WallInteractionModel< CloudType >::New(), InflowBoundaryModel< CloudType >::New(), collisionModel::New(), injectorModel::New(), DevolatilisationModel< CloudType >::New(), sixDoFRigidBodyMotionRestraint::New(), wallModel::New(), SurfaceReactionModel< CloudType >::New(), HeatTransferModel< CloudType >::New(), LESdelta::New(), breakupModel::New(), barotropicCompressibilityModel::New(), DataEntry< Type >::New(), dynamicFvMesh::New(), decompositionMethod::New(), solidBodyMotionFunction::New(), PostProcessingModel< CloudType >::New(), pdf::New(), sixDoFRigidBodyMotionConstraint::New(), laminarFlameSpeed::New(), pairPotential::New(), PatchInteractionModel< CloudType >::New(), CompositionModel< CloudType >::New(), SRFModel::New(), polyMeshModifier::New(), functionObject::New(), incompressible::turbulenceModel::New(), PhaseChangeModel< CloudType >::New(), turbulenceModel::New(), radiationModel::New(), incompressible::LESModel::New(), LESModel::New(), incompressible::RASModel::New(), IntegrationScheme< Type >::New(), GAMGAgglomeration::New(), RASModel::New(), cellZone::New(), pointZone::New(), pointPatchField< Type >::New(), sampledSurface::New(), fvsPatchField< Type >::New(), InjectionModel< CloudType >::New(), faceZone::New(), sampledSet::New(), fvPatchField< Type >::New(), polyPatch::New(), basicSource::New(), lduMatrix::solver::New(), lduMatrix::smoother::New(), lduMatrix::preconditioner::New(), hsReactionThermo::NewType(), hsCombustionThermo::NewType(), hReactionThermo::NewType(), hCombustionThermo::NewType(), dlLibraryTable::open(), coordinateRotation::operator=(), Foam::operator>>(), phaseProperties::phaseProperties(), plane::plane(), Foam::preservePatchTypes(), pressureGradientExplicitSource::pressureGradientExplicitSource(), Foam::PstreamConfigSectionName(), exponentialRepulsion::read(), lennardJones::read(), harmonicSpring::read(), tolerances::read(), cubeRootVolDelta::read(), pitchForkRing::read(), restrainedHarmonicSpring::read(), dampedCoulomb::read(), maxDeltaxyz::read(), maxhxhyhzDelta::read(), anisotropicFilter::read(), laplaceFilter::read(), IDDESDelta::read(), pureMixture< ThermoType >::read(), sigmoid::read(), outputFilterOutputControl::read(), doubleSigmoid::read(), CrossPowerLaw::read(), powerLaw::read(), HerschelBulkley::read(), BirdCarreau::read(), azizChen::read(), maitlandSmith::read(), multiComponentMixture< ThermoType >::read(), writeRegisteredObject::read(), staticPressure::read(), forceCoeffs::read(), partialWrite::read(), homogeneousMixture< ThermoType >::read(), patchProbes::read(), surfaceInterpolateFields::read(), fvSchemes::read(), readFields::read(), sixDoFRigidBodyMotionConstraint::read(), dieselMixture< ThermoType >::read(), fieldMinMax::read(), fieldValue::read(), inhomogeneousMixture< ThermoType >::read(), veryInhomogeneousMixture< ThermoType >::read(), twoPhaseMixture::read(), egrMixture< ThermoType >::read(), forces::read(), probes::read(), smoothDelta::read(), sampledSurfaces::read(), fieldAverage::read(), basicSource::read(), dynamicRefineFvMesh::readDict(), Time::readDict(), DimensionedField< Type, GeoMesh >::readField(), IOobject::readHeader(), ensightPart::reconstruct(), refinementParameters::refinementParameters(), refinementSurfaces::refinementSurfaces(), tolerances::relaxationFactor(), boundaryRegion::rename(), sampledCuttingPlane::sampledCuttingPlane(), sampledIsoSurface::sampledIsoSurface(), motionSmoother::scaleMesh(), searchableSurfaceCollection::searchableSurfaceCollection(), searchableSurfaces::searchableSurfaces(), searchableSurfaceWithGaps::searchableSurfaceWithGaps(), TimeActivatedExplicitSource< Type >::setFieldData(), Foam::setRefCell(), reducedUnits::setRefValues(), basicSource::setSelection(), TimeActivatedExplicitSource< Type >::setSelection(), shellSurfaces::shellSurfaces(), sixDoFRigidBodyDisplacementPointPatchVectorField::sixDoFRigidBodyDisplacementPointPatchVectorField(), slidingInterface::slidingInterface(), solidMixture::solidMixture(), tolerances::solverRelativeTolerance(), tolerances::solverTolerance(), STARCDCoordinateRotation::STARCDCoordinateRotation(), surfaceFeatures::surfaceFeatures(), surfacePatchIOList::surfacePatchIOList(), surfZoneIOList::surfZoneIOList(), TimeActivatedExplicitSource< Type >::TimeActivatedExplicitSource(), timeVaryingMappedFixedValueFvPatchField< Type >::timeVaryingMappedFixedValueFvPatchField(), UniformDimensionedField< Type >::UniformDimensionedField(), dynamicRefineFvMesh::update(), and wideBandAbsorptionEmission::wideBandAbsorptionEmission().

T lookupOrAddDefault ( const word keyword,
const T deflt,
bool  recursive = false,
bool  patternMatch = true 
)

Find and return a T, if not found return the given.

default value, and add to dictionary. If recursive, search parent dictionaries. If patternMatch, use regular expressions.

Definition at line 55 of file dictionaryTemplates.C.

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

Referenced by Foam::debug::debugSwitch(), Foam::debug::infoSwitch(), dimensioned< Type >::lookupOrAddToDict(), Switch::lookupOrAddToDict(), and Foam::debug::optimisationSwitch().

bool isDict ( const word keyword) const

Check if entry is a sub-dictionary.

Definition at line 415 of file dictionary.C.

References entry::isDict().

Referenced by searchableSurfaceCollection::searchableSurfaceCollection(), and searchableSurfaces::searchableSurfaces().

const Foam::dictionary * subDictPtr ( const word keyword) const

Find and return a sub-dictionary pointer if present.

otherwise return NULL.

Definition at line 431 of file dictionary.C.

References entry::dict().

Referenced by liquidMixture::liquidMixture(), porousZone::porousZone(), and porousZone::writeDict().

const Foam::dictionary & subDict ( const word keyword) const

Find and return a sub-dictionary.

Definition at line 446 of file dictionary.C.

References entry::dict(), Foam::exit(), Foam::FatalIOError, FatalIOErrorIn, and Foam::name().

Referenced by sixDoFRigidBodyMotion::addConstraints(), autoLayerDriver::addLayers(), sixDoFRigidBodyMotion::addRestraints(), directions::directions(), argList::displayDoc(), fvMeshDistribute::distribute(), autoHexMeshDriver::doMesh(), greyMeanAbsorptionEmission::greyMeanAbsorptionEmission(), IDDESDelta::IDDESDelta(), layerParameters::layerParameters(), PstreamImpl::loadPstreamInstance(), PstreamImpl::loadPstreamLibrary(), coordinateRotation::operator=(), coordinateSystem::operator=(), plane::plane(), Foam::preservePatchTypes(), Foam::PstreamConfigSectionName(), exponentialRepulsion::read(), lennardJones::read(), tolerances::read(), harmonicSpring::read(), pitchForkRing::read(), restrainedHarmonicSpring::read(), cubeRootVolDelta::read(), dampedCoulomb::read(), maxhxhyhzDelta::read(), maxDeltaxyz::read(), PrandtlDelta::read(), vanDriestDelta::read(), anisotropicFilter::read(), laplaceFilter::read(), IDDESDelta::read(), sigmoid::read(), doubleSigmoid::read(), solution::read(), CrossPowerLaw::read(), BirdCarreau::read(), HerschelBulkley::read(), powerLaw::read(), azizChen::read(), maitlandSmith::read(), solidBodyMotionFunction::read(), sixDoFRigidBodyMotionRestraint::read(), fvSchemes::read(), sixDoFRigidBodyMotionConstraint::read(), twoPhaseMixture::read(), actuationDiskSource::read(), smoothDelta::read(), explicitSource::read(), basicSource::read(), fieldAverage::readAveragingProperties(), dynamicRefineFvMesh::readDict(), refinementSurfaces::refinementSurfaces(), searchableSurfaceCollection::searchableSurfaceCollection(), searchableSurfaces::searchableSurfaces(), shellSurfaces::shellSurfaces(), dynamicRefineFvMesh::update(), wideBandAbsorptionEmission::wideBandAbsorptionEmission(), and fieldAverage::writeAveragingProperties().

Foam::dictionary & subDict ( const word keyword)

Find and return a sub-dictionary for manipulation.

Definition at line 464 of file dictionary.C.

References entry::dict(), Foam::exit(), Foam::FatalIOError, FatalIOErrorIn, and Foam::name().

Foam::dictionary subOrEmptyDict ( const word keyword) const

Find and return a sub-dictionary as a copy, or.

return an empty dictionary if the sub-dictionary does not exist

Definition at line 483 of file dictionary.C.

References entry::dict(), and Foam::name().

Foam::wordList toc ( ) const

Return the table of contents.

Definition at line 500 of file dictionary.C.

References forAllConstIter.

Referenced by removeEntry::execute(), FreeStream< CloudType >::FreeStream(), and explicitSource::setFieldData().

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

Return the list of available keys or patterns.

Definition at line 514 of file dictionary.C.

References forAllConstIter, and List< T >::setSize().

Referenced by layerParameters::layerParameters().

bool substituteKeyword ( const word keyword)

Substitute the given keyword prepended by '$' with the.

corresponding sub-dictionary entries

Definition at line 69 of file dictionaryIO.C.

References Foam::add(), and forAllConstIter.

Referenced by entry::New().

void add ( const entry e,
bool  mergeEntry = false 
)

Add an entry.

With the merge option, dictionaries are interwoven and primitive entries are overwritten

Definition at line 613 of file dictionary.C.

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

void add ( const keyType k,
const word w,
bool  overwrite = false 
)

Add a word entry.

optionally overwrite an existing entry

Definition at line 619 of file dictionary.C.

References Foam::add().

void add ( const keyType k,
const string s,
bool  overwrite = false 
)

Add a string entry.

optionally overwrite an existing entry

Definition at line 626 of file dictionary.C.

References Foam::add().

void add ( const keyType k,
const label  l,
bool  overwrite = false 
)

Add a label entry.

optionally overwrite an existing entry

Definition at line 636 of file dictionary.C.

References Foam::add().

void add ( const keyType k,
const scalar  s,
bool  overwrite = false 
)

Add a scalar entry.

optionally overwrite an existing entry

Definition at line 642 of file dictionary.C.

References Foam::add().

void add ( const keyType k,
const dictionary d,
bool  mergeEntry = false 
)

Add a dictionary entry.

optionally merge with an existing sub-dictionary

Definition at line 649 of file dictionary.C.

References Foam::add().

void add ( const keyType k,
const T t,
bool  overwrite = false 
)

Add a T entry.

optionally overwrite an existing entry

Definition at line 100 of file dictionaryTemplates.C.

References dictionary::add().

void set ( entry entryPtr)

Assign a new entry, overwrite any existing entry.

Definition at line 659 of file dictionary.C.

References Foam::add(), dictionary::clear(), entry::dict(), entry::isDict(), and entry::keyword().

Referenced by liquidMixture::liquidMixture(), boundaryRegion::rename(), and solution::upgradeSolverDict().

void set ( const entry e)

Assign a new entry, overwrite any existing entry.

Definition at line 672 of file dictionary.C.

References entry::clone().

void set ( const keyType k,
const dictionary d 
)

Assign a dictionary entry, overwrite any existing entry.

Definition at line 678 of file dictionary.C.

void set ( const keyType k,
const T t 
)

Assign a T entry, overwrite any existing entry.

Definition at line 107 of file dictionaryTemplates.C.

bool remove ( const word Keyword)
bool changeKeyword ( const keyType oldKeyword,
const keyType newKeyword,
bool  forceOverwrite = false 
)

Change the keyword for an entry,.

optionally forcing overwrite of an existing entry

Definition at line 717 of file dictionary.C.

References DLListBase::begin(), HashTable< T, Key, Hash >::end(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorIn, HashTable< T, Key, Hash >::find(), keyType::isPattern(), Foam::name(), DLListBase::replace(), and WarningIn.

bool merge ( const dictionary dict)

Merge entries from the given dictionary.

Also merge sub-dictionaries as required.

Definition at line 808 of file dictionary.C.

References Foam::abort(), Foam::add(), HashTable< T, Key, Hash >::end(), Foam::FatalError, FatalErrorIn, HashTable< T, Key, Hash >::find(), forAllConstIter, and Foam::name().

void clear ( )

Clear the dictionary.

Reimplemented from ILList< DLListBase, entry >.

Definition at line 853 of file dictionary.C.

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

Referenced by dictionary::dictionary(), entry::New(), Foam::operator>>(), and dictionary::set().

void transfer ( dictionary dict)

Transfer the contents of the argument and annul the argument.

Definition at line 862 of file dictionary.C.

References dictionaryName::name(), Foam::name(), and ILList< DLListBase, T >::transfer().

Transfer contents to the Xfer container.

Definition at line 875 of file dictionary.C.

References Foam::xferMove().

Foam::ITstream & operator[] ( const word keyword) const

Find and return entry.

Definition at line 883 of file dictionary.C.

void operator+= ( const dictionary rhs)

Include entries from the given dictionary.

Warn, but do not overwrite existing entries.

Definition at line 912 of file dictionary.C.

References Foam::abort(), Foam::add(), Foam::FatalError, FatalErrorIn, forAllConstIter, and Foam::name().

void operator|= ( const dictionary rhs)

Conditionally include entries from the given dictionary.

Do not overwrite existing entries.

Definition at line 929 of file dictionary.C.

References Foam::abort(), Foam::add(), Foam::FatalError, FatalErrorIn, forAllConstIter, and Foam::name().

void operator<<= ( const dictionary rhs)

Unconditionally include entries from the given dictionary.

Overwrite existing entries.

Definition at line 949 of file dictionary.C.

References Foam::abort(), Foam::FatalError, FatalErrorIn, forAllConstIter, and Foam::name().


Friends And Related Function Documentation

friend class entry
friend

Declare friendship with the entry class for IO.

Definition at line 166 of file dictionary.H.

Istream& operator>> ( Istream ,
dictionary  
)
friend

Read dictionary from Istream.

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

Write dictionary to Ostream.


Member Data Documentation


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