<a href="pre__container_8cc.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">// Voro++, a 3D cell-based Voronoi library</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> * \brief Function implementations for the pre_container and related classes.</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="preprocessor">#include "<a class="code" href="config_8hh.html" title="Master configuration file for setting various compile-time options.">config.hh</a>"</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="preprocessor">#include "<a class="code" href="pre__container_8hh.html" title="Header file for the pre_container and related classes.">pre_container.hh</a>"</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment">/** The class constructor sets up the geometry of container, initializing the</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="comment"> * minimum and maximum coordinates in each direction. It allocates an initial</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment"> * chunk into which to store particle information.</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="comment"> * \param[in] (ax_,bx_) the minimum and maximum x coordinates.</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment"> * \param[in] (ay_,by_) the minimum and maximum y coordinates.</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="comment"> * \param[in] (az_,bz_) the minimum and maximum z coordinates.</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="comment"> * \param[in] ps_ the number of floating point entries to store for each</span></div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span> <span class="comment">/** Makes a guess at the optimal grid of blocks to use, computing in</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span> <span class="comment"> * a way that</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span> <span class="comment"> * \param[out] (nx,ny,nz) the number of blocks to use. */</span></div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="comment">/** Stores a particle ID and position, allocating a new memory chunk if</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="comment"> * necessary. For coordinate directions in which the container is not periodic,</span></div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span> <span class="comment"> * the routine checks to make sure that the particle is within the container</span></div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span> <span class="comment"> * bounds. If the particle is out of bounds, it is not stored.</span></div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span> <span class="comment"> * \param[in] n the numerical ID of the inserted particle.</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span> <span class="comment"> * \param[in] (x,y,z) the position vector of the inserted particle. */</span></div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span> <span class="comment">/** Stores a particle ID and position, allocating a new memory chunk if necessary.</span></div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span> <span class="comment"> * \param[in] n the numerical ID of the inserted particle.</span></div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span> <span class="comment"> * \param[in] (x,y,z) the position vector of the inserted particle.</span></div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span> <span class="comment"> * \param[in] r the radius of the particle. */</span></div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span> <span class="comment">/** Transfers the particles stored within the class to a container class.</span></div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span> <span class="comment"> * \param[in] con the container class to transfer to. */</span></div>
<div class="line"><a name="l00099"></a><span class="lineno"><a class="code" href="classvoro_1_1pre__container.html#a7a2e73ad34fbfe1001f59ea3b69f992f"> 99</a></span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1pre__container.html#a7a2e73ad34fbfe1001f59ea3b69f992f">pre_container::setup</a>(<a class="code" href="classvoro_1_1container.html" title="Extension of the container_base class for computing regular Voronoi tessellations.">container</a> &con) {</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span> <span class="comment">/** Transfers the particles stored within the class to a container_poly class.</span></div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span> <span class="comment"> * \param[in] con the container_poly class to transfer to. */</span></div>
<div class="line"><a name="l00120"></a><span class="lineno"><a class="code" href="classvoro_1_1pre__container__poly.html#ac71c0ee24182a115ce79da4cc91ee356"> 120</a></span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1pre__container__poly.html#ac71c0ee24182a115ce79da4cc91ee356">pre_container_poly::setup</a>(<a class="code" href="classvoro_1_1container__poly.html" title="Extension of the container_base class for computing radical Voronoi tessellations.">container_poly</a> &con) {</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span> <span class="comment">/** Transfers the particles stored within the class to a container class, also</span></div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span> <span class="comment"> * recording the order in which particles were stored.</span></div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span> <span class="comment"> * \param[in] vo the ordering class to use.</span></div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span> <span class="comment"> * \param[in] con the container class to transfer to. */</span></div>
<div class="line"><a name="l00143"></a><span class="lineno"><a class="code" href="classvoro_1_1pre__container.html#a81aae000e3b787c58deef7a8f197bdc3"> 143</a></span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1pre__container.html#a7a2e73ad34fbfe1001f59ea3b69f992f">pre_container::setup</a>(<a class="code" href="classvoro_1_1particle__order.html" title="A class for storing ordering information when particles are added to a container.">particle_order</a> &vo,<a class="code" href="classvoro_1_1container.html" title="Extension of the container_base class for computing regular Voronoi tessellations.">container</a> &con) {</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span> <span class="comment">/** Transfers the particles stored within the class to a container_poly class,</span></div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span> <span class="comment"> * also recording the order in which particles were stored.</span></div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span> <span class="comment"> * \param[in] vo the ordering class to use.</span></div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span> <span class="comment"> * \param[in] con the container_poly class to transfer to. */</span></div>
<div class="line"><a name="l00166"></a><span class="lineno"><a class="code" href="classvoro_1_1pre__container__poly.html#ac18d16204c7769ec554d14f84b6517f0"> 166</a></span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1pre__container__poly.html#ac71c0ee24182a115ce79da4cc91ee356">pre_container_poly::setup</a>(<a class="code" href="classvoro_1_1particle__order.html" title="A class for storing ordering information when particles are added to a container.">particle_order</a> &vo,<a class="code" href="classvoro_1_1container__poly.html" title="Extension of the container_base class for computing radical Voronoi tessellations.">container_poly</a> &con) {</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span> <span class="comment">/** Import a list of particles from an open file stream into the container.</span></div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span> <span class="comment"> * Entries of four numbers (Particle ID, x position, y position, z position)</span></div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span> <span class="comment"> * are searched for. If the file cannot be successfully read, then the routine</span></div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span> <span class="comment">/** Import a list of particles from an open file stream, also storing the order</span></div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span> <span class="comment"> * of that the particles are read. Entries of four numbers (Particle ID, x</span></div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span> <span class="comment"> * position, y position, z position) are searched for. If the file cannot be</span></div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span> <span class="comment"> * successfully read, then the routine causes a fatal error.</span></div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span> <span class="comment"> * \param[in] fp the file handle to read from. */</span></div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span> <span class="comment">/** Allocates a new chunk of memory for storing particles. */</span></div>