# PhasicFlow: src/phasicFlow/dictionary/fileDictionary.cpp Source File
PhasicFlow is an open-source parallel DEM (discrete element method) package for simulating granular flow. It is developed in C++ and can be exectued on both GPU (like CUDA) and CPU.

fileDictionary.cpp
Go to the documentation of this file.
#include "fileDictionary.hpp"
pFlow::fileDictionary::fileDictionary
(
const objectFile & of,
repository* owner
)
:
IOobject
(
of,
IOPattern::AllProcessorsSimilar,
owner
),
dictionary
(
of.name(),
true
)
{
dictionary::name_ = IOobject::path().wordPath();
if(!IOobject::readObject())
{
fatalErrorInFunction<<
"Error in reading from dictionary "<< globalName()<<endl;
fatalExit;
}
}
pFlow::fileDictionary::fileDictionary(const word &keyword, const fileSystem &file)
:
fileDictionary
(
objectFile
(
keyword,
file,
objectFile::READ_ALWAYS,
objectFile::WRITE_NEVER
),
nullptr
)
{}
pFlow::fileDictionary::fileDictionary
(
const objectFile &objf,
const dictionary &dict,
repository *owner
)
:
IOobject
(
objectFile
(
objf.name(),
objf.localPath(),
objectFile::READ_NEVER,
objf.wFlag()
),
IOPattern::AllProcessorsSimilar,
owner
),
dictionary(dict, true)
{
dictionary::name_ = IOobject::path().wordPath();
}
bool pFlow::fileDictionary::read(iIstream &is, const IOPattern &iop)
{
return dictionary::read(is);
}
bool pFlow::fileDictionary::write(iOstream &os, const IOPattern &iop) const
{
return dictionary::write(os);
}
pFlow::fileDictionary::fileDictionary
fileDictionary(const objectFile &of, repository *owner=nullptr)
construct an empty dictionary with keyword and make it global/fileDictionary
Definition: fileDictionary.cpp:5
fatalExit
#define fatalExit
Fatal exit.
Definition: error.hpp:98
pFlow::dictionary::name_
word name_
global name of dictionary, separated with dots
Definition: dictionary.hpp:76
pFlow::dictionary::read
bool read(iIstream &is) override
read from stream
Definition: dictionary.cpp:772
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pFlow::endl
iOstream & endl(iOstream &os)
Add newline and flush stream.
Definition: iOstream.hpp:341
pFlow::fileDictionary::read
bool read(iIstream &is, const IOPattern &iop) override
read from stream
Definition: fileDictionary.cpp:70
pFlow::IOobject
Definition: IOobject.hpp:35
pFlow::fileSystem
Manages file pathes, manupulate and combines them.
Definition: fileSystem.hpp:71
pFlow::iIstream
Interface class for any input stream
Definition: iIstream.hpp:37
fatalErrorInFunction
#define fatalErrorInFunction
Report a fatal error and function name and exit the application.
Definition: error.hpp:77
pFlow::IOfileHeader::path
fileSystem path() const
Definition: IOfileHeader.cpp:63
pFlow::objectFile::name
virtual const word & name() const
Definition: objectFile.hpp:101
pFlow::IOPattern
Definition: IOPattern.hpp:32
pFlow::dictionary::write
bool write(iOstream &os) const override
write to stream
Definition: dictionary.cpp:793
pFlow::objectFile
Definition: objectFile.hpp:30
pFlow::objectFile::READ_NEVER
@ READ_NEVER
Definition: objectFile.hpp:37
fileDictionary.hpp
pFlow::fileDictionary
Definition: fileDictionary.hpp:29
pFlow::IOPattern::AllProcessorsSimilar
@ AllProcessorsSimilar
Definition: IOPattern.hpp:55
pFlow::objectFile::localPath
virtual const fileSystem & localPath() const
Definition: objectFile.hpp:107
pFlow::repository
Definition: repository.hpp:34
pFlow::fileDictionary::write
bool write(iOstream &os, const IOPattern &iop) const override
write to stream
Definition: fileDictionary.cpp:75
pFlow::fileSystem::wordPath
word wordPath() const
Path in word type.
Definition: fileSystem.hpp:160
pFlow::iOstream
Interface class for any output stream.
Definition: iOstream.hpp:59
pFlow::objectFile::wFlag
writeFlag wFlag() const
Definition: objectFile.hpp:119
pFlow::dictionary
Dictionary holds a set of data entries or sub-dictionaries that are enclosed in a curely braces or ar...
Definition: dictionary.hpp:67