33void Foam::potential::setSiteIdList(
const dictionary& moleculePropertiesDict)
36 DynamicList<word> pairPotentialSiteIdList;
40 const word& id(idList_[i]);
42 if (!moleculePropertiesDict.found(
id))
45 <<
id <<
" molecule subDict not found"
49 const dictionary& molDict(moleculePropertiesDict.subDict(
id));
51 List<word> siteIdNames
53 molDict.lookup(
"siteIds")
58 const word& siteId = siteIdNames[sI];
66 List<word> pairPotSiteIds
68 molDict.lookup(
"pairPotentialSiteIds")
73 const word& siteId = pairPotSiteIds[sI];
75 if (!siteIdNames.found(siteId))
78 << siteId <<
" in pairPotentialSiteIds is not in siteIds: "
82 if (!pairPotentialSiteIdList.found(siteId))
84 pairPotentialSiteIdList.append(siteId);
89 nPairPotIds_ = pairPotentialSiteIdList.size();
95 if (!pairPotentialSiteIdList.found(siteId))
97 pairPotentialSiteIdList.append(siteId);
101 siteIdList_.transfer(pairPotentialSiteIdList);
105void Foam::potential::potential::readPotentialDict()
107 Info<<
nl <<
"Reading potential dictionary:" <<
endl;
114 mesh_.time().constant(),
121 idListDict.readEntry(
"idList", idList_);
129 "moleculeProperties",
130 mesh_.time().constant(),
144 Info<<
nl <<
"Unique site ids found: " << siteIdList_
145 <<
nl <<
"Site Ids requiring a pair potential: "
146 << pairPotentialSiteIdList
150 idListDict.readIfPresent(
"tetherSiteIdList", tetherSiteIdList);
157 mesh_.time().system(),
164 potentialDict.readEntry(
"potentialEnergyLimit", potentialEnergyLimit_);
168 if (potentialDict.readIfPresent(
"removalOrder", remOrd))
170 removalOrder_.setSize(remOrd.size());
174 removalOrder_[rO] = idList_.find(remOrd[rO]);
176 if (removalOrder_[rO] == -1)
179 <<
"removalOrder entry: " << remOrd[rO]
180 <<
" not found in idList."
189 if (!potentialDict.found(
"pair"))
192 <<
"pair potential specification subDict not found"
198 pairPotentials_.buildPotentials
200 pairPotentialSiteIdList,
208 if (tetherSiteIdList.size())
210 if (!potentialDict.found(
"tether"))
213 <<
"tether potential specification subDict not found"
219 tetherPotentials_.buildPotentials
232 if (potentialDict.found(
"external"))
234 Info<<
nl <<
"Reading external forces:" <<
endl;
246void Foam::potential::potential::readMdInitialiseDict
256 "moleculeProperties",
257 mesh_.time().constant(),
273 mdInitialiseDict.toc()[
zone]
278 zoneDict.lookup(
"latticeIds")
283 const word&
id = latticeIds[i];
285 if (!moleculePropertiesDict.found(
id))
288 <<
"Molecule type " <<
id
289 <<
" not found in moleculeProperties dictionary." <<
nl
293 if (!idList.found(
id))
301 zoneDict.lookup(
"tetherSiteIds")
306 const word& tetherSiteId = tetherSiteIds[t];
308 bool idFound =
false;
317 const word&
id = latticeIds[i];
321 moleculePropertiesDict.subDict(
id).lookup(
"siteIds")
324 if (siteIds.found(tetherSiteId))
332 tetherSiteIdList.append(tetherSiteId);
337 <<
" not found as a site of any molecule in zone." <<
nl
343 idList_.transfer(idList);
345 tetherSiteIdList.shrink();
347 idListDict.add(
"idList", idList_);
349 idListDict.add(
"tetherSiteIdList", tetherSiteIdList);
351 setSiteIdList(moleculePropertiesDict);
364Foam::potential::potential
373 readMdInitialiseDict(mdInitialiseDict, idListDict);
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
@ NO_REGISTER
Do not request registration (bool: false).
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A non-owning sub-view of a List (allocated or unallocated storage).
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens i...
Mesh consisting of general polyhedral cells.
const List< word > & siteIdList() const
A class for handling words, derived from Foam::string.
Base class for mesh zones.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
constexpr char nl
The newline '\n' character (0x0a).
constexpr char tab
The tab '\t' character(0x09).
#define forAll(list, i)
Loop across all elements in list.