<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">iIstreamI.hpp</div></div>
</div><!--header-->
<divclass="contents">
<ahref="iIstreamI_8hpp.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="l00028"></a><spanclass="lineno"> 28</span> <aclass="code"href="classpFlow_1_1iIstream.html">iIstream</a>& is = *<spanclass="keyword">this</span>;</div>
<divclass="line"><aname="l00029"></a><spanclass="lineno"> 29</span>  is >> val;</div>
<divclass="line"><aname="l00060"></a><spanclass="lineno"> 60</span> <spanclass="stringliteral">" error in finding keyword "</span><< keyword <<<spanclass="stringliteral">" and value next to it."</span>;</div>
<divclass="line"><aname="l00104"></a><spanclass="lineno"> 104</span> <spanclass="stringliteral">" expected keyword "</span><< keyword <<<spanclass="stringliteral">" but found "</span><<next.<aclass="code"href="classpFlow_1_1token.html#a8658f0b0a04ffdb6e74c5af4ca27edf1">wordToken</a>()<<<aclass="code"href="namespacepFlow.html#aba8f0c455a3fdb4b05ad33a25b13b189">endl</a>;</div>
<divclass="line"><aname="l00108"></a><spanclass="lineno"> 108</span> <aclass="code"href="classpFlow_1_1iIstream.html">iIstream</a>& is = *<spanclass="keyword">this</span>;</div>
<divclass="line"><aname="l00109"></a><spanclass="lineno"> 109</span>  is >> data;</div>
<divclass="line"><aname="l00116"></a><spanclass="lineno"> 116</span> <spanclass="stringliteral">" expected ; but found "</span><< next<<<aclass="code"href="namespacepFlow.html#aba8f0c455a3fdb4b05ad33a25b13b189">endl</a>;</div>
<divclass="line"><aname="l00129"></a><spanclass="lineno"><aclass="line"href="namespacepFlow.html#ac08e23027fc74d4f881e8ad3e4d9db21"> 129</a></span> <spanclass="keyword">inline</span><aclass="code"href="classpFlow_1_1iIstream.html">pFlow::iIstream</a>&<aclass="code"href="namespacepFlow.html#a85ed561d066dae339196cd058783674f">pFlow::operator>></a>(<aclass="code"href="classpFlow_1_1iIstream.html">iIstream</a>& is, <aclass="code"href="namespacepFlow.html#a0ebe792a293e8c717bddf60070c0fe99">word</a>& w)</div>
<divclass="line"><aname="l00135"></a><spanclass="lineno"> 135</span> <<<spanclass="stringliteral">"Bad token - could not get word/string value"</span>;</div>
<divclass="line"><aname="l00147"></a><spanclass="lineno"> 147</span>  w = t.<aclass="code"href="classpFlow_1_1token.html#a8658f0b0a04ffdb6e74c5af4ca27edf1">wordToken</a>();</div>
<divclass="line"><aname="l00152"></a><spanclass="lineno"> 152</span> <<<spanclass="stringliteral">"Wrong token type - expected word/string value, found "</span></div>
<divclass="line"><aname="l00170"></a><spanclass="lineno"> 170</span> <<<spanclass="stringliteral">"Bad token - could not get int64 value"</span>;</div>
<divclass="line"><aname="l00178"></a><spanclass="lineno"> 178</span>  val = t.<aclass="code"href="classpFlow_1_1token.html#a66fa403264f7b94494f15dfd39ef8c3c">number</a>();</div>
<divclass="line"><aname="l00183"></a><spanclass="lineno"> 183</span> <<<spanclass="stringliteral">"Wrong token type - expected int64 value, found "</span></div>
<divclass="line"><aname="l00199"></a><spanclass="lineno"> 199</span>  val = <spanclass="keyword">static_cast<</span><aclass="code"href="namespacepFlow.html#aae6ad039f09c0676db11bd114136a3fa">int32</a><spanclass="keyword">></span>(lval);</div>
<divclass="line"><aname="l00208"></a><spanclass="lineno"> 208</span>  val = <spanclass="keyword">static_cast<</span><aclass="code"href="namespacepFlow.html#a07fb256c1077eea7a7726e948cc8ff0e">int8</a><spanclass="keyword">></span>(lval);</div>
<divclass="line"><aname="l00216"></a><spanclass="lineno"> 216</span>  val = <spanclass="keyword">static_cast<</span><aclass="code"href="namespacepFlow.html#aeefdb2888fa3c58f2454ef004419e6a5">uint64</a><spanclass="keyword">></span>(lval);</div>
<divclass="line"><aname="l00224"></a><spanclass="lineno"> 224</span>  val = <spanclass="keyword">static_cast<</span><aclass="code"href="namespacepFlow.html#abd01e8e67e3d94cab04ecaaf4f85ac1b">uint32</a><spanclass="keyword">></span>(lval);</div>
<divclass="line"><aname="l00232"></a><spanclass="lineno"> 232</span>  val = <spanclass="keyword">static_cast<</span><aclass="code"href="namespacepFlow.html#a34ecedcf03a70dc91e4616212d79267d">uint8</a><spanclass="keyword">></span>(lval);</div>
<divclass="line"><aname="l00244"></a><spanclass="lineno"> 244</span> <<<spanclass="stringliteral">"Bad token - could not get float value"</span>;</div>
<divclass="line"><aname="l00252"></a><spanclass="lineno"> 252</span>  val = t.<aclass="code"href="classpFlow_1_1token.html#a66fa403264f7b94494f15dfd39ef8c3c">number</a>();</div>
<divclass="line"><aname="l00257"></a><spanclass="lineno"> 257</span> <<<spanclass="stringliteral">"Wrong token type - expected float value, found "</span></div>
<divclass="line"><aname="l00274"></a><spanclass="lineno"> 274</span> <<<spanclass="stringliteral">"Bad token - could not get double value"</span>;</div>
<divclass="line"><aname="l00282"></a><spanclass="lineno"> 282</span>  val = t.<aclass="code"href="classpFlow_1_1token.html#a66fa403264f7b94494f15dfd39ef8c3c">number</a>();</div>
<divclass="line"><aname="l00287"></a><spanclass="lineno"> 287</span> <<<spanclass="stringliteral">"Wrong token type - expected double value, found "</span></div>
<divclass="line"><aname="l00304"></a><spanclass="lineno"> 304</span> <<<spanclass="stringliteral">"Bad token - could not get double value"</span>;</div>
<divclass="line"><aname="l00312"></a><spanclass="lineno"> 312</span>  val = <spanclass="keyword">static_cast<</span><spanclass="keywordtype">size_t</span><spanclass="keyword">></span>(t.<aclass="code"href="classpFlow_1_1token.html#a66fa403264f7b94494f15dfd39ef8c3c">number</a>());</div>
<divclass="line"><aname="l00317"></a><spanclass="lineno"> 317</span> <<<spanclass="stringliteral">"Wrong token type - expected double value, found "</span></div>
<divclass="ttc"id="aclasspFlow_1_1iIstream_html_a6b741dd8443f554f5de5b98897f2eb77"><divclass="ttname"><ahref="classpFlow_1_1iIstream.html#a6b741dd8443f554f5de5b98897f2eb77">pFlow::iIstream::lookupDataOrSet</a></div><divclass="ttdeci">T lookupDataOrSet(const word &keyword, const T &setVal)</div><divclass="ttdoc">lookup for keyword and data; set to setVal if lookup fails.</div><divclass="ttdef"><b>Definition:</b><ahref="iIstreamI_8hpp_source.html#l00068">iIstreamI.hpp:68</a></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_aa81aefc6aea3503b1eb4aefbafc8d0bc"><divclass="ttname"><ahref="classpFlow_1_1token.html#aa81aefc6aea3503b1eb4aefbafc8d0bc">pFlow::token::stringToken</a></div><divclass="ttdeci">const word & stringToken() const</div><divclass="ttdoc">Return const reference to the string contents.</div><divclass="ttdef"><b>Definition:</b><ahref="tokenI_8hpp_source.html#l00642">tokenI.hpp:642</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1token_html_a9db0c25a0b1baac0e7e5cbf5a72d3cdc"><divclass="ttname"><ahref="classpFlow_1_1token.html#a9db0c25a0b1baac0e7e5cbf5a72d3cdc">pFlow::token::error</a></div><divclass="ttdeci">bool error() const</div><divclass="ttdoc">Token is ERROR.</div><divclass="ttdef"><b>Definition:</b><ahref="tokenI_8hpp_source.html#l00402">tokenI.hpp:402</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="anamespacepFlow_html_abd01e8e67e3d94cab04ecaaf4f85ac1b"><divclass="ttname"><ahref="namespacepFlow.html#abd01e8e67e3d94cab04ecaaf4f85ac1b">pFlow::uint32</a></div><divclass="ttdeci">unsigned int uint32</div><divclass="ttdef"><b>Definition:</b><ahref="builtinTypes_8hpp_source.html#l00056">builtinTypes.hpp:56</a></div></div>
<divclass="ttc"id="anamespacepFlow_html_a94809bdb48183ff3ef62935d56f5c1e0"><divclass="ttname"><ahref="namespacepFlow.html#a94809bdb48183ff3ef62935d56f5c1e0">pFlow::int64</a></div><divclass="ttdeci">long long int int64</div><divclass="ttdef"><b>Definition:</b><ahref="builtinTypes_8hpp_source.html#l00052">builtinTypes.hpp:52</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_1iIstream_html_afb1243cec5833e96e8446abed4e3656c"><divclass="ttname"><ahref="classpFlow_1_1iIstream.html#afb1243cec5833e96e8446abed4e3656c">pFlow::iIstream::findKeywordAndVal</a></div><divclass="ttdeci">bool findKeywordAndVal(const word &keyword, T &val, bool checkEndStatement=true)</div><divclass="ttdoc">find a pair of keyword and data terminated by ; keyword data; return false if keyword does not exist ...</div><divclass="ttdef"><b>Definition:</b><ahref="iIstreamI_8hpp_source.html#l00024">iIstreamI.hpp:24</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1IOstream_html_a367eb3425fc4e8270e2aa961df8ac8a5"><divclass="ttname"><ahref="classpFlow_1_1IOstream.html#a367eb3425fc4e8270e2aa961df8ac8a5">pFlow::IOstream::check</a></div><divclass="ttdeci">virtual bool check(const char *operation) const</div><divclass="ttdoc">Check IOstream status for given operation.</div><divclass="ttdef"><b>Definition:</b><ahref="IOstream_8cpp_source.html#l00042">IOstream.cpp:42</a></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_1iIstream_html_a2240995351ba90efed8943099847069e"><divclass="ttname"><ahref="classpFlow_1_1iIstream.html#a2240995351ba90efed8943099847069e">pFlow::iIstream::nextData</a></div><divclass="ttdeci">bool nextData(const word &keyword, T &data)</div><divclass="ttdoc">read the data next to keword keyword data; check the keyword is correct or not</div><divclass="ttdef"><b>Definition:</b><ahref="iIstreamI_8hpp_source.html#l00081">iIstreamI.hpp:81</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1IOstream_html_a638b33dd25b3cd8ea7e846f04fd6a6a3"><divclass="ttname"><ahref="classpFlow_1_1IOstream.html#a638b33dd25b3cd8ea7e846f04fd6a6a3">pFlow::IOstream::setBad</a></div><divclass="ttdeci">void setBad()</div><divclass="ttdoc">Set stream to be bad.</div><divclass="ttdef"><b>Definition:</b><ahref="IOstream_8hpp_source.html#l00274">IOstream.hpp:274</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_1iIstream_html_a214b65eedf74268aed639e4d9b36fe08"><divclass="ttname"><ahref="classpFlow_1_1iIstream.html#a214b65eedf74268aed639e4d9b36fe08">pFlow::iIstream::lookupData</a></div><divclass="ttdeci">T lookupData(const word &keyword)</div><divclass="ttdoc">lookup for keyword and data; fatalExit if fails</div><divclass="ttdef"><b>Definition:</b><ahref="iIstreamI_8hpp_source.html#l00052">iIstreamI.hpp:52</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="anamespacepFlow_html_aeefdb2888fa3c58f2454ef004419e6a5"><divclass="ttname"><ahref="namespacepFlow.html#aeefdb2888fa3c58f2454ef004419e6a5">pFlow::uint64</a></div><divclass="ttdeci">unsigned long long int uint64</div><divclass="ttdef"><b>Definition:</b><ahref="builtinTypes_8hpp_source.html#l00058">builtinTypes.hpp:58</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_1iIstream_html_a5f238bd4e73ce3b43b8a737a8f30ab78"><divclass="ttname"><ahref="classpFlow_1_1iIstream.html#a5f238bd4e73ce3b43b8a737a8f30ab78">pFlow::iIstream::findToken</a></div><divclass="ttdeci">virtual bool findToken(const word &w)</div><divclass="ttdoc">search for all tokesn and find the first word token tbat matchs w</div><divclass="ttdef"><b>Definition:</b><ahref="iIstream_8cpp_source.html#l00084">iIstream.cpp:84</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1token_html_a1680baf2428512b1a45060f52f3ade28"><divclass="ttname"><ahref="classpFlow_1_1token.html#a1680baf2428512b1a45060f52f3ade28">pFlow::token::isNumber</a></div><divclass="ttdeci">bool isNumber() const</div><divclass="ttdoc">Token is int, float or duble.</div><divclass="ttdef"><b>Definition:</b><ahref="tokenI_8hpp_source.html#l00580">tokenI.hpp:580</a></div></div>
<divclass="ttc"id="aclasspFlow_1_1token_html_a9b6aebb08609e7ec6efde970dcf0433a"><divclass="ttname"><ahref="classpFlow_1_1token.html#a9b6aebb08609e7ec6efde970dcf0433a">pFlow::token::isEndStatement</a></div><divclass="ttdeci">bool isEndStatement() const</div><divclass="ttdoc">Token is end statement.</div><divclass="ttdef"><b>Definition:</b><ahref="tokenI_8hpp_source.html#l00449">tokenI.hpp:449</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_1token_html_abc9dc0708ec1aae2309621664fa8e5a4"><divclass="ttname"><ahref="classpFlow_1_1token.html#abc9dc0708ec1aae2309621664fa8e5a4">pFlow::token::isString</a></div><divclass="ttdeci">bool isString() const</div><divclass="ttdoc">Token is STRING, VARIABLE or VERBATIM string.</div><divclass="ttdef"><b>Definition:</b><ahref="tokenI_8hpp_source.html#l00633">tokenI.hpp:633</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>