39 if (!moleculePropertiesDict.
found(
id))
42 <<
id <<
" molecule subDict not found"
52 const word& siteId = siteIdNames[sI];
64 const word& siteId = pairPotSiteIds[sI];
69 << siteId <<
" in pairPotentialSiteIds is not in siteIds: "
73 if (
findIndex(pairPotentialSiteIdList, siteId) == -1)
75 pairPotentialSiteIdList.
append(siteId);
86 if (
findIndex(pairPotentialSiteIdList, siteId) == -1)
88 pairPotentialSiteIdList.
append(siteId);
96 void Foam::potential::potential::readPotentialDict()
98 Info<<
nl <<
"Reading potential dictionary:" <<
endl;
105 mesh_.time().constant(),
120 "moleculeProperties",
121 mesh_.time().constant(),
135 Info<<
nl <<
"Unique site ids found: " << siteIdList_
136 <<
nl <<
"Site Ids requiring a pair potential: "
137 << pairPotentialSiteIdList
142 if (idListDict.
found(
"tetherSiteIdList"))
147 IOdictionary potentialDict
152 mesh_.time().system(),
161 potentialDict.lookup(
"potentialEnergyLimit")
164 if (potentialDict.found(
"removalOrder"))
166 List<word> remOrd = potentialDict.lookup(
"removalOrder");
168 removalOrder_.setSize(remOrd.
size());
172 removalOrder_[rO] =
findIndex(idList_, remOrd[rO]);
174 if (removalOrder_[rO] == -1)
177 <<
"removalOrder entry: " << remOrd[rO]
178 <<
" not found in idList."
187 if (!potentialDict.found(
"pair"))
190 <<
"pair potential specification subDict not found"
194 const dictionary& pairDict = potentialDict.subDict(
"pair");
196 pairPotentials_.buildPotentials
198 pairPotentialSiteIdList,
206 if (tetherSiteIdList.size())
208 if (!potentialDict.found(
"tether"))
211 <<
"tether potential specification subDict not found"
215 const dictionary& tetherDict = potentialDict.subDict(
"tether");
217 tetherPotentials_.buildPotentials
230 if (potentialDict.found(
"external"))
232 Info<<
nl <<
"Reading external forces:" <<
endl;
234 const dictionary& externalDict = potentialDict.subDict(
"external");
237 externalDict.readIfPresent(
"gravity", gravity_);
244 void Foam::potential::potential::readMdInitialiseDict
246 const IOdictionary& mdInitialiseDict,
247 IOdictionary& idListDict
250 IOdictionary moleculePropertiesDict
254 "moleculeProperties",
255 mesh_.time().constant(),
263 DynamicList<word> idList;
265 DynamicList<word> tetherSiteIdList;
267 forAll(mdInitialiseDict.toc(), zone)
269 const dictionary& zoneDict = mdInitialiseDict.subDict
271 mdInitialiseDict.toc()[zone]
276 zoneDict.lookup(
"latticeIds")
281 const word&
id = latticeIds[i];
283 if (!moleculePropertiesDict.found(
id))
286 <<
"Molecule type " <<
id
287 <<
" not found in moleculeProperties dictionary." <<
nl
299 zoneDict.lookup(
"tetherSiteIds")
304 const word& tetherSiteId = tetherSiteIds[t];
306 bool idFound =
false;
315 const word&
id = latticeIds[i];
319 moleculePropertiesDict.subDict(
id).lookup(
"siteIds")
322 if (
findIndex(siteIds, tetherSiteId) != -1)
330 tetherSiteIdList.append(tetherSiteId);
335 <<
" not found as a site of any molecule in zone." <<
nl
341 idList_.transfer(idList);
343 tetherSiteIdList.shrink();
345 idListDict.add(
"idList", idList_);
347 idListDict.add(
"tetherSiteIdList", tetherSiteIdList);
349 setSiteIdList(moleculePropertiesDict);
371 readMdInitialiseDict(mdInitialiseDict, idListDict);