Go to the documentation of this file.
32 auto motionModel = dict.
getVal<
word>(
"motionModel");
34 if(motionModel !=
"vibratingMotion")
37 " motionModel should be vibratingMotion, but found "
38 << motionModel <<
endl;
42 auto& motionInfo = dict.
subDict(
"vibratingMotionInfo");
45 components_.reserve(compNames.size()+1);
49 componentName_.clear();
52 for(
auto& cName: compNames)
54 auto& compDict = motionInfo.subDict(cName);
56 if(
auto compPtr = makeUnique<vibrating>(compDict); compPtr)
58 components_.push_back(compPtr());
59 componentName_.push_back(cName);
64 "could not read vibrating motion from "<< compDict.globalName()<<
endl;
71 if( !componentName_.search(
"none") )
77 componentName_.push_back(
"none");
80 components_.syncViews();
81 numComponents_ = components_.size();
92 dict.
add(
"motionModel",
"vibratingMotion");
99 auto& compDict = motionInfo.subDictOrCreate(componentName_[i]);
100 if( !components_.hostVectorAll()[i].write(compDict))
103 " error in writing motion compoonent "<< componentName_[i] <<
" to dicrionary "
104 << motionInfo.globalName()<<
endl;
120 if(! readDictionary(dict) )
135 if( !motionInfo.
read(is) )
142 if( !readDictionary(motionInfo) )
return false;
155 if( !writeDictionary(motionInfo))
160 if( !motionInfo.
write(os) )
163 " error in writing dictionray to file. \n";
const char * motionModelFile__
FUNCTION_H bool read(iIstream &is)
Read from input stream is.
Vibrating model for a wall.
virtual bool write(iOstream &os) const
virtual bool read(iIstream &is)
dictionary & subDictOrCreate(const word &keyword)
bool add(const word &keyword, const float &v)
iOstream & endl(iOstream &os)
Add newline and flush stream.
wordList dictionaryKeywords() const
bool readDictionary(const dictionary &dict)
Read from a dictionary.
#define fatalErrorInFunction
#define ForAll(i, container)
virtual const word & name() const
Return the name of the stream.
dictionary & subDict(const word &keyword)
T getVal(const word &keyword) const
bool writeDictionary(dictionary &dict) const
Write to a dictionary.
#define ioErrorInFile(fileName, lineNumber)
int32 lineNumber() const
Const access to the current stream line number.
FUNCTION_H vibratingMotion()
Empty.
FUNCTION_H bool write(iOstream &os) const
Write to output stream os.