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";