<metaname="description"content="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.">
<!-- iframe showing the search results (closed by default) -->
<divid="MSearchResultsWindow">
<iframesrc="javascript:void(0)"frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<divclass="header">
<divclass="headertitle">
<divclass="title">iEntry.cpp</div></div>
</div><!--header-->
<divclass="contents">
<ahref="iEntry_8cpp.html">Go to the documentation of this file.</a><divclass="fragment"><divclass="line"><aname="l00001"></a><spanclass="lineno"> 1</span> <spanclass="comment">/*------------------------------- phasicFlow ---------------------------------</span></div>
<divclass="line"><aname="l00002"></a><spanclass="lineno"> 2</span> <spanclass="comment"> O C enter of</span></div>
<divclass="line"><aname="l00003"></a><spanclass="lineno"> 3</span> <spanclass="comment"> O O E ngineering and</span></div>
<divclass="line"><aname="l00004"></a><spanclass="lineno"> 4</span> <spanclass="comment"> O O M ultiscale modeling of</span></div>
<divclass="line"><aname="l00005"></a><spanclass="lineno"> 5</span> <spanclass="comment"> OOOOOOO F luid flow </span></div>
<divclass="line"><aname="l00011"></a><spanclass="lineno"> 11</span> <spanclass="comment"> This file is part of phasicFlow code. It is a free software for simulating </span></div>
<divclass="line"><aname="l00012"></a><spanclass="lineno"> 12</span> <spanclass="comment"> granular and multiphase flows. You can redistribute it and/or modify it under</span></div>
<divclass="line"><aname="l00013"></a><spanclass="lineno"> 13</span> <spanclass="comment"> the terms of GNU General Public License v3 or any other later versions. </span></div>
<divclass="line"><aname="l00015"></a><spanclass="lineno"> 15</span> <spanclass="comment"> phasicFlow is distributed to help others in their research in the field of </span></div>
<divclass="line"><aname="l00016"></a><spanclass="lineno"> 16</span> <spanclass="comment"> granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the</span></div>
<divclass="line"><aname="l00017"></a><spanclass="lineno"> 17</span> <spanclass="comment"> implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</span></div>
<divclass="line"><aname="l00020"></a><spanclass="lineno"> 20</span> <spanclass="comment">// based on OpenFOAM dictionary, with some modifications/simplifications</span></div>
<divclass="line"><aname="l00021"></a><spanclass="lineno"> 21</span> <spanclass="comment">// to be tailored to our needs</span></div>
<divclass="line"><aname="l00083"></a><spanclass="lineno"> 83</span> <spanclass="stringliteral">"expecting a valid token after keyword "</span><< key <<<aclass="code"href="namespacepFlow.html#aba8f0c455a3fdb4b05ad33a25b13b189">endl</a>;</div>
<divclass="line"><aname="l00125"></a><spanclass="lineno"> 125</span> <spanclass="stringliteral">"expecting a } but found "</span><< nextTok <<<aclass="code"href="namespacepFlow.html#aba8f0c455a3fdb4b05ad33a25b13b189">endl</a>;</div>
<divclass="line"><aname="l00143"></a><spanclass="lineno"> 143</span> <spanclass="stringliteral">"error in reading next token. \n"</span>;</div>
<divclass="line"><aname="l00169"></a><spanclass="lineno"> 169</span> <spanclass="stringliteral">"Error in wrting to file \n"</span>;</div>
<divclass="line"><aname="l00180"></a><spanclass="lineno"> 180</span> <spanclass="stringliteral">"Error in reading from file \n"</span>;</div>
<divclass="ttc"id="aclasspFlow_1_1IOstream_html_af3418ac60d0d7a303478f29a387feb3c"><divclass="ttname"><ahref="classpFlow_1_1IOstream.html#af3418ac60d0d7a303478f29a387feb3c">pFlow::IOstream::eof</a></div><divclass="ttdeci">bool eof() const</div><divclass="ttdoc">Return true if end of input seen.</div><divclass="ttdef"><b>Definition:</b><ahref="IOstream_8hpp_source.html#l00192">IOstream.hpp:192</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1iIstream_html_ac35c0ab7b3a6a0cdcf8c2bd2bf24de11"><divclass="ttname"><ahref="classpFlow_1_1iIstream.html#ac35c0ab7b3a6a0cdcf8c2bd2bf24de11">pFlow::iIstream::read</a></div><divclass="ttdeci">virtual iIstream & read(token &)=0</div><divclass="ttdoc">Return next token from stream.</div></div>
<divclass="ttc"id="aclasspFlow_1_1token_html"><divclass="ttname"><ahref="classpFlow_1_1token.html">pFlow::token</a></div><divclass="ttdoc">Token class based on OpenFOAM stream, with some modifications/simplifications to be tailored to our n...</div><divclass="ttdef"><b>Definition:</b><ahref="token_8hpp_source.html#l00044">token.hpp:44</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1token_html_abdcc7f96f487faadc7769afcf58fe992"><divclass="ttname"><ahref="classpFlow_1_1token.html#abdcc7f96f487faadc7769afcf58fe992">pFlow::token::good</a></div><divclass="ttdeci">bool good() const</div><divclass="ttdoc">True if token is not UNDEFINED or ERROR.</div><divclass="ttdef"><b>Definition:</b><ahref="tokenI_8hpp_source.html#l00390">tokenI.hpp:390</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1dictionary_html_a85c3c1fce0c14d36030092df2f27b632"><divclass="ttname"><ahref="classpFlow_1_1dictionary.html#a85c3c1fce0c14d36030092df2f27b632">pFlow::dictionary::globalName</a></div><divclass="ttdeci">virtual word globalName() const</div><divclass="ttdoc">global name of entry, separated with dots</div><divclass="ttdef"><b>Definition:</b><ahref="dictionary_8cpp_source.html#l00356">dictionary.cpp:356</a></div></div>
<divclass="ttc"id="anamespacepFlow_html_aba8f0c455a3fdb4b05ad33a25b13b189"><divclass="ttname"><ahref="namespacepFlow.html#aba8f0c455a3fdb4b05ad33a25b13b189">pFlow::endl</a></div><divclass="ttdeci">iOstream & endl(iOstream &os)</div><divclass="ttdoc">Add newline and flush stream.</div><divclass="ttdef"><b>Definition:</b><ahref="iOstream_8hpp_source.html#l00341">iOstream.hpp:341</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1iEntry_html_afa17f5989b1af05e5ed08234f217a59c"><divclass="ttname"><ahref="classpFlow_1_1iEntry.html#afa17f5989b1af05e5ed08234f217a59c">pFlow::iEntry::write</a></div><divclass="ttdeci">virtual bool write(iOstream &os) const =0</div><divclass="ttdoc">write to stream</div></div>
<divclass="ttc"id="aclasspFlow_1_1iIstream_html"><divclass="ttname"><ahref="classpFlow_1_1iIstream.html">pFlow::iIstream</a></div><divclass="ttdoc">Interface class for any input stream</div><divclass="ttdef"><b>Definition:</b><ahref="iIstream_8hpp_source.html#l00037">iIstream.hpp:37</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1iEntry_html_a70add3b10fc1217ec5b9f30d261bda27"><divclass="ttname"><ahref="classpFlow_1_1iEntry.html#a70add3b10fc1217ec5b9f30d261bda27">pFlow::iEntry::read</a></div><divclass="ttdeci">virtual bool read(iIstream &is)=0</div><divclass="ttdoc">read from stream</div></div>
<divclass="ttc"id="aclasspFlow_1_1IOstream_html_a9f7290a5d70f30e1b1b42c8ac4a6082d"><divclass="ttname"><ahref="classpFlow_1_1IOstream.html#a9f7290a5d70f30e1b1b42c8ac4a6082d">pFlow::IOstream::bad</a></div><divclass="ttdeci">bool bad() const</div><divclass="ttdoc">Return true if stream is corrupted.</div><divclass="ttdef"><b>Definition:</b><ahref="IOstream_8hpp_source.html#l00204">IOstream.hpp:204</a></div></div>
<divclass="ttc"id="aerror_8hpp_html_aca9aa547c8441e4410a65a2ce7c21554"><divclass="ttname"><ahref="error_8hpp.html#aca9aa547c8441e4410a65a2ce7c21554">fatalErrorInFunction</a></div><divclass="ttdeci">#define fatalErrorInFunction</div><divclass="ttdoc">Report a fatal error and function name and exit the application.</div><divclass="ttdef"><b>Definition:</b><ahref="error_8hpp_source.html#l00077">error.hpp:77</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1iEntry_html_a133f34e170bc1f28e7439fe87043ce2f"><divclass="ttname"><ahref="classpFlow_1_1iEntry.html#a133f34e170bc1f28e7439fe87043ce2f">pFlow::iEntry::createEntry</a></div><divclass="ttdeci">static bool createEntry(dictionary &parDict, iIstream &is, bool hasBlockToken=false)</div><divclass="ttdoc">create an entry (dataEntry or dictionary) from stream</div><divclass="ttdef"><b>Definition:</b><ahref="iEntry_8cpp_source.html#l00064">iEntry.cpp:64</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1iIstream_html_aeecefbf648ad32c20134e67c4fa35597"><divclass="ttname"><ahref="classpFlow_1_1iIstream.html#aeecefbf648ad32c20134e67c4fa35597">pFlow::iIstream::putBack</a></div><divclass="ttdeci">void putBack(const token &tok)</div><divclass="ttdoc">Put back token Only a single put back is permitted.</div><divclass="ttdef"><b>Definition:</b><ahref="iIstream_8cpp_source.html#l00023">iIstream.cpp:23</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1IOstream_html_a281bbfd1fe6ab10377d7cb1f5111044d"><divclass="ttname"><ahref="classpFlow_1_1IOstream.html#a281bbfd1fe6ab10377d7cb1f5111044d">pFlow::IOstream::fatalCheck</a></div><divclass="ttdeci">bool fatalCheck(const char *operation) const</div><divclass="ttdoc">Check IOstream status for given operation.</div><divclass="ttdef"><b>Definition:</b><ahref="IOstream_8cpp_source.html#l00048">IOstream.cpp:48</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1IOstream_html_ac9b54653d0ec63ee05f64a185437b335"><divclass="ttname"><ahref="classpFlow_1_1IOstream.html#ac9b54653d0ec63ee05f64a185437b335">pFlow::IOstream::name</a></div><divclass="ttdeci">virtual const word & name() const</div><divclass="ttdoc">Return the name of the stream.</div><divclass="ttdef"><b>Definition:</b><ahref="IOstream_8cpp_source.html#l00031">IOstream.cpp:31</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1dictionary_html_a520c6483b3b2e0fa7d3997be204f3893"><divclass="ttname"><ahref="classpFlow_1_1dictionary.html#a520c6483b3b2e0fa7d3997be204f3893">pFlow::dictionary::addPtr</a></div><divclass="ttdeci">bool addPtr(const word &keyword, uniquePtr< iEntry >&etry, bool warning=true)</div><divclass="ttdoc">add a pointer entry (dictionary/dataEntry) replaces this entry with existing one and issue a warning</div><divclass="ttdef"><b>Definition:</b><ahref="dictionary_8cpp_source.html#l00386">dictionary.cpp:386</a></div></div>
<divclass="ttc"id="aerror_8hpp_html_a83efa053dfcfcef04cc0e721c0314ff3"><divclass="ttname"><ahref="error_8hpp.html#a83efa053dfcfcef04cc0e721c0314ff3">ioErrorInFile</a></div><divclass="ttdeci">#define ioErrorInFile(fileName, lineNumber)</div><divclass="ttdoc">Report an error in file operation with supplied fileName and lineNumber.</div><divclass="ttdef"><b>Definition:</b><ahref="error_8hpp_source.html#l00087">error.hpp:87</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1iEntry_html_adaf3255a26893f538d0e891e77d0d6c7"><divclass="ttname"><ahref="classpFlow_1_1iEntry.html#adaf3255a26893f538d0e891e77d0d6c7">pFlow::iEntry::readKeyword</a></div><divclass="ttdeci">static bool readKeyword(iIstream &is, word &keyword, token &tok)</div><divclass="ttdoc">read a keyword from stream</div><divclass="ttdef"><b>Definition:</b><ahref="iEntry_8cpp_source.html#l00032">iEntry.cpp:32</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1iEntry_html"><divclass="ttname"><ahref="classpFlow_1_1iEntry.html">pFlow::iEntry</a></div><divclass="ttdoc">Interface calss for data entry and dictionary</div><divclass="ttdef"><b>Definition:</b><ahref="iEntry_8hpp_source.html#l00042">iEntry.hpp:42</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1IOstream_html_a607efe5fb94edbe4cfa890c4907e76c3"><divclass="ttname"><ahref="classpFlow_1_1IOstream.html#a607efe5fb94edbe4cfa890c4907e76c3">pFlow::IOstream::lineNumber</a></div><divclass="ttdeci">int32 lineNumber() const</div><divclass="ttdoc">Const access to the current stream line number.</div><divclass="ttdef"><b>Definition:</b><ahref="IOstream_8hpp_source.html#l00223">IOstream.hpp:223</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1iOstream_html"><divclass="ttname"><ahref="classpFlow_1_1iOstream.html">pFlow::iOstream</a></div><divclass="ttdoc">Interface class for any output stream.</div><divclass="ttdef"><b>Definition:</b><ahref="iOstream_8hpp_source.html#l00059">iOstream.hpp:59</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1token_html_a8658f0b0a04ffdb6e74c5af4ca27edf1"><divclass="ttname"><ahref="classpFlow_1_1token.html#a8658f0b0a04ffdb6e74c5af4ca27edf1">pFlow::token::wordToken</a></div><divclass="ttdeci">const word & wordToken() const</div><divclass="ttdoc">Return const reference to the word contents.</div><divclass="ttdef"><b>Definition:</b><ahref="tokenI_8hpp_source.html#l00618">tokenI.hpp:618</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1iOstream_html_af746580dedb817d31f5060ee684b9543"><divclass="ttname"><ahref="classpFlow_1_1iOstream.html#af746580dedb817d31f5060ee684b9543">pFlow::iOstream::writeWordKeyword</a></div><divclass="ttdeci">virtual iOstream & writeWordKeyword(const word &kw)</div><divclass="ttdoc">Write the keyword followed by an appropriate indentation.</div><divclass="ttdef"><b>Definition:</b><ahref="iOstream_8cpp_source.html#l00048">iOstream.cpp:48</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1dictionary_html"><divclass="ttname"><ahref="classpFlow_1_1dictionary.html">pFlow::dictionary</a></div><divclass="ttdoc">Dictionary holds a set of data entries or sub-dictionaries that are enclosed in a curely braces or ar...</div><divclass="ttdef"><b>Definition:</b><ahref="dictionary_8hpp_source.html#l00067">dictionary.hpp:67</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1token_html_ace6d5ecd2736d19990a7c12e0fe5a745"><divclass="ttname"><ahref="classpFlow_1_1token.html#ace6d5ecd2736d19990a7c12e0fe5a745">pFlow::token::isWord</a></div><divclass="ttdeci">bool isWord() const</div><divclass="ttdoc">Token is word or DIRECTIVE word.</div><divclass="ttdef"><b>Definition:</b><ahref="tokenI_8hpp_source.html#l00602">tokenI.hpp:602</a></div></div>