<a href="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 container and related classes. */</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="preprocessor">#include "<a class="code" href="container_8hh.html" title="Header file for the container_base and related classes.">container.hh</a>"</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">/** The class constructor sets up the geometry of container, initializing the</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> * minimum and maximum coordinates in each direction, and setting whether each</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"> * direction is periodic or not. It divides the container into a rectangular</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment"> * grid of blocks, and allocates memory for each of these for storing particle</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment"> * positions and IDs.</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="comment"> * \param[in] (ax_,bx_) the minimum and maximum x coordinates.</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment"> * \param[in] (ay_,by_) the minimum and maximum y coordinates.</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="comment"> * \param[in] (az_,bz_) the minimum and maximum z coordinates.</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment"> * \param[in] (nx_,ny_,nz_) the number of grid blocks in each of the three</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="comment"> * \param[in] init_mem the initial memory allocation for each block.</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="comment"> * \param[in] ps_ the number of floating point entries to store for each</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  : <a class="code" href="classvoro_1_1voro__base.html" title="Class containing data structures common across all particle container classes.">voro_base</a>(nx_,ny_,nz_,(bx_-ax_)/nx_,(by_-ay_)/ny_,(bz_-az_)/nz_),</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span> <span class="comment">/** The class constructor sets up the geometry of container.</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span> <span class="comment"> * \param[in] (ax_,bx_) the minimum and maximum x coordinates.</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span> <span class="comment"> * \param[in] (ay_,by_) the minimum and maximum y coordinates.</span></div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span> <span class="comment"> * \param[in] (az_,bz_) the minimum and maximum z coordinates.</span></div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span> <span class="comment"> * \param[in] (nx_,ny_,nz_) the number of grid blocks in each of the three</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  : <a class="code" href="classvoro_1_1container__base.html" title="Class for representing a particle system in a three-dimensional rectangular box.">container_base</a>(ax_,bx_,ay_,by_,az_,bz_,nx_,ny_,nz_,xperiodic_,yperiodic_,zperiodic_,init_mem,3),</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span> <span class="comment">/** The class constructor sets up the geometry of container.</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span> <span class="comment"> * \param[in] (ax_,bx_) the minimum and maximum x coordinates.</span></div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span> <span class="comment"> * \param[in] (ay_,by_) the minimum and maximum y coordinates.</span></div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span> <span class="comment"> * \param[in] (az_,bz_) the minimum and maximum z coordinates.</span></div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span> <span class="comment"> * \param[in] (nx_,ny_,nz_) the number of grid blocks in each of the three</span></div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  : <a class="code" href="classvoro_1_1container__base.html" title="Class for representing a particle system in a three-dimensional rectangular box.">container_base</a>(ax_,bx_,ay_,by_,az_,bz_,nx_,ny_,nz_,xperiodic_,yperiodic_,zperiodic_,init_mem,4),</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span> <span class="comment">/** Put a particle into the correct region of the container.</span></div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span> <span class="comment"> * \param[in] n the numerical ID of the inserted particle.</span></div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span> <span class="comment"> * \param[in] (x,y,z) the position vector of the inserted particle. */</span></div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span> <span class="comment">/** Put a particle into the correct region of the container.</span></div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span> <span class="comment"> * \param[in] n the numerical ID of the inserted particle.</span></div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span> <span class="comment"> * \param[in] (x,y,z) the position vector of the inserted particle.</span></div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span> <span class="comment"> * \param[in] r the radius of the particle. */</span></div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span> <span class="comment">/** Put a particle into the correct region of the container, also recording</span></div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span> <span class="comment"> * into which region it was stored.</span></div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span> <span class="comment"> * \param[in] vo the ordering class in which to record the region.</span></div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span> <span class="comment"> * \param[in] n the numerical ID of the inserted particle.</span></div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span> <span class="comment"> * \param[in] (x,y,z) the position vector of the inserted particle. */</span></div>
<div class="line"><a name="l00115"></a><span class="lineno"><a class="code" href="classvoro_1_1container.html#a6e4a48cc9c31557457213923254fdda3"> 115</a></span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1container.html#a5c67c9998e4f174fb217967dcb41c7f3">container::put</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,<span class="keywordtype">int</span> n,<span class="keywordtype">double</span> x,<span class="keywordtype">double</span> y,<span class="keywordtype">double</span> z) {</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span> <span class="comment">/** Put a particle into the correct region of the container, also recording</span></div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span> <span class="comment"> * into which region it was stored.</span></div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span> <span class="comment"> * \param[in] vo the ordering class in which to record the region.</span></div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span> <span class="comment"> * \param[in] n the numerical ID of the inserted particle.</span></div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span> <span class="comment"> * \param[in] (x,y,z) the position vector of the inserted particle.</span></div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span> <span class="comment"> * \param[in] r the radius of the particle. */</span></div>
<div class="line"><a name="l00131"></a><span class="lineno"><a class="code" href="classvoro_1_1container__poly.html#aa0c81a2be68ed2a8b799ad7682c9b853"> 131</a></span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1container__poly.html#a61689312fb6f8ee36f1fbb0fe00e4fe3">container_poly::put</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,<span class="keywordtype">int</span> n,<span class="keywordtype">double</span> x,<span class="keywordtype">double</span> y,<span class="keywordtype">double</span> z,<span class="keywordtype">double</span> r) {</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span> <span class="comment">/** This routine takes a particle position vector, tries to remap it into the</span></div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span> <span class="comment"> * primary domain. If successful, it computes the region into which it can be</span></div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span> <span class="comment"> * stored and checks that there is enough memory within this region to store</span></div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span> <span class="comment"> * \param[out] ijk the region index.</span></div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span> <span class="comment"> * \param[in,out] (x,y,z) the particle position, remapped into the primary</span></div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span> <span class="comment"> * domain if necessary.</span></div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span> <span class="comment"> * \return True if the particle can be successfully placed into the container,</span></div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span> <span class="comment">/** Takes a particle position vector and computes the region index into which</span></div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span> <span class="comment"> * it should be stored. If the container is periodic, then the routine also</span></div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span> <span class="comment"> * maps the particle position to ensure it is in the primary domain. If the</span></div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span> <span class="comment"> * container is not periodic, the routine bails out.</span></div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span> <span class="comment"> * \param[out] ijk the region index.</span></div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span> <span class="comment"> * \param[in,out] (x,y,z) the particle position, remapped into the primary</span></div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span> <span class="comment"> * domain if necessary.</span></div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span> <span class="comment"> * \return True if the particle can be successfully placed into the container,</span></div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span> <span class="comment">/** Takes a position vector and attempts to remap it into the primary domain.</span></div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span> <span class="comment"> * \param[out] (ai,aj,ak) the periodic image displacement that the vector is in,</span></div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span> <span class="comment"> * with (0,0,0) corresponding to the primary domain.</span></div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span> <span class="comment"> * \param[out] (ci,cj,ck) the index of the block that the position vector is</span></div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span> <span class="comment"> * within, once it has been remapped.</span></div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span> <span class="comment"> * \param[in,out] (x,y,z) the position vector to consider, which is remapped</span></div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span> <span class="comment"> * into the primary domain during the routine.</span></div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span> <span class="comment"> * \param[out] ijk the block index that the vector is within.</span></div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span> <span class="comment"> * \return True if the particle is within the container or can be remapped into</span></div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span> <span class="comment"> * it, false if it lies outside of the container bounds. */</span></div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span> <span class="comment">/** Takes a vector and finds the particle whose Voronoi cell contains that</span></div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span> <span class="comment"> * vector. This is equivalent to finding the particle which is nearest to the</span></div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span> <span class="comment"> * vector. Additional wall classes are not considered by this routine.</span></div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span> <span class="comment"> * \param[in] (x,y,z) the vector to test.</span></div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span> <span class="comment"> * \param[out] (rx,ry,rz) the position of the particle whose Voronoi cell</span></div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span> <span class="comment"> * contains the vector. If the container is periodic,</span></div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span> <span class="comment"> * this may point to a particle in a periodic image of</span></div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span> <span class="comment"> * the primary domain.</span></div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span> <span class="comment"> * \param[out] pid the ID of the particle.</span></div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span> <span class="comment"> * \return True if a particle was found. If the container has no particles,</span></div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span> <span class="comment"> * then the search will not find a Voronoi cell and false is returned. */</span></div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  <a class="code" href="structvoro_1_1particle__record.html" title="Structure for holding information about a particle.">particle_record</a> w;</div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  <span class="comment">// If the given vector lies outside the domain, but the container</span></div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  <span class="comment">// is periodic, then remap it back into the domain</span></div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  <span class="comment">// Assemble the position vector of the particle to be returned,</span></div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  <span class="comment">// applying a periodic remapping if necessary</span></div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  <span class="comment">// If no particle if found then just return false</span></div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span> <span class="comment">/** Takes a vector and finds the particle whose Voronoi cell contains that</span></div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span> <span class="comment"> * vector. Additional wall classes are not considered by this routine.</span></div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span> <span class="comment"> * \param[in] (x,y,z) the vector to test.</span></div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span> <span class="comment"> * \param[out] (rx,ry,rz) the position of the particle whose Voronoi cell</span></div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span> <span class="comment"> * contains the vector. If the container is periodic,</span></div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span> <span class="comment"> * this may point to a particle in a periodic image of</span></div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span> <span class="comment"> * the primary domain.</span></div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span> <span class="comment"> * \param[out] pid the ID of the particle.</span></div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span> <span class="comment"> * \return True if a particle was found. If the container has no particles,</span></div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span> <span class="comment"> * then the search will not find a Voronoi cell and false is returned. */</span></div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>  <a class="code" href="structvoro_1_1particle__record.html" title="Structure for holding information about a particle.">particle_record</a> w;</div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>  <span class="comment">// If the given vector lies outside the domain, but the container</span></div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>  <span class="comment">// is periodic, then remap it back into the domain</span></div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>  <span class="comment">// Assemble the position vector of the particle to be returned,</span></div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>  <span class="comment">// applying a periodic remapping if necessary</span></div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>  <span class="comment">// If no particle if found then just return false</span></div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span> <span class="comment">/** Increase memory for a particular region.</span></div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span> <span class="comment"> * \param[in] i the index of the region to reallocate. */</span></div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span>  <span class="comment">// Carry out a check on the memory allocation size, and</span></div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>  <span class="comment">// print a status message if requested</span></div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span> <span class="preprocessor"></span> fprintf(stderr,<span class="stringliteral">"Particle memory in region %d scaled up to %d\n"</span>,i,nmem);</div>
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span>  <span class="comment">// Allocate new memory and copy in the contents of the old arrays</span></div>
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span> <span class="comment">/** Import a list of particles from an open file stream into the container.</span></div>
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span> <span class="comment"> * Entries of four numbers (Particle ID, x position, y position, z position)</span></div>
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span> <span class="comment"> * are searched for. If the file cannot be successfully read, then the routine</span></div>
<div class="line"><a name="l00337"></a><span class="lineno"> 337</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="l00338"></a><span class="lineno"> 338</span> <span class="comment"> * of that the particles are read. Entries of four numbers (Particle ID, x</span></div>
<div class="line"><a name="l00339"></a><span class="lineno"> 339</span> <span class="comment"> * position, y position, z position) are searched for. If the file cannot be</span></div>
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span> <span class="comment"> * successfully read, then the routine causes a fatal error.</span></div>
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span> <span class="comment"> * \param[in,out] vo a reference to an ordering class to use.</span></div>
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span> <span class="comment"> * \param[in] fp the file handle to read from. */</span></div>
<div class="line"><a name="l00343"></a><span class="lineno"><a class="code" href="classvoro_1_1container.html#a7b3aa6219cfb0fd538839aeeae4457cc"> 343</a></span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1container.html#a1e4fe0c7b59c93cdd3f965c59dbb2f66">container::import</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,FILE *fp) {</div>
<div class="line"><a name="l00350"></a><span class="lineno"> 350</span> <span class="comment">/** Import a list of particles from an open file stream into the container.</span></div>
<div class="line"><a name="l00351"></a><span class="lineno"> 351</span> <span class="comment"> * Entries of five numbers (Particle ID, x position, y position, z position,</span></div>
<div class="line"><a name="l00352"></a><span class="lineno"> 352</span> <span class="comment"> * radius) are searched for. If the file cannot be successfully read, then the</span></div>
<div class="line"><a name="l00362"></a><span class="lineno"> 362</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="l00363"></a><span class="lineno"> 363</span> <span class="comment"> * of that the particles are read. Entries of four numbers (Particle ID, x</span></div>
<div class="line"><a name="l00364"></a><span class="lineno"> 364</span> <span class="comment"> * position, y position, z position, radius) are searched for. If the file</span></div>
<div class="line"><a name="l00365"></a><span class="lineno"> 365</span> <span class="comment"> * cannot be successfully read, then the routine causes a fatal error.</span></div>
<div class="line"><a name="l00366"></a><span class="lineno"> 366</span> <span class="comment"> * \param[in,out] vo a reference to an ordering class to use.</span></div>
<div class="line"><a name="l00367"></a><span class="lineno"> 367</span> <span class="comment"> * \param[in] fp the file handle to read from. */</span></div>
<div class="line"><a name="l00368"></a><span class="lineno"><a class="code" href="classvoro_1_1container__poly.html#aecedca4f256e9382d54efb805877c68f"> 368</a></span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1container__poly.html#a65ddee05ee3b3677c7a48f67ce64a1d5">container_poly::import</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,FILE *fp) {</div>
<div class="line"><a name="l00375"></a><span class="lineno"> 375</span> <span class="comment">/** Outputs the a list of all the container regions along with the number of</span></div>
<div class="line"><a name="l00388"></a><span class="lineno"> 388</span> <span class="comment">/** Clears a container of particles, also clearing resetting the maximum radius</span></div>
<div class="line"><a name="l00389"></a><span class="lineno"> 389</span> <span class="comment"> * to zero. */</span></div>
<div class="line"><a name="l00395"></a><span class="lineno"> 395</span> <span class="comment">/** Computes all the Voronoi cells and saves customized information about them.</span></div>
<div class="line"><a name="l00396"></a><span class="lineno"> 396</span> <span class="comment"> * \param[in] format the custom output string to use.</span></div>
<div class="line"><a name="l00397"></a><span class="lineno"> 397</span> <span class="comment"> * \param[in] fp a file handle to write to. */</span></div>
<div class="line"><a name="l00399"></a><span class="lineno"> 399</span>  <a class="code" href="classvoro_1_1c__loop__all.html" title="Class for looping over all of the particles in a container.">c_loop_all</a> vl(*<span class="keyword">this</span>);</div>
<div class="line"><a name="l00403"></a><span class="lineno"> 403</span> <span class="comment">/** Computes all the Voronoi cells and saves customized</span></div>
<div class="line"><a name="l00404"></a><span class="lineno"> 404</span> <span class="comment"> * information about them.</span></div>
<div class="line"><a name="l00405"></a><span class="lineno"> 405</span> <span class="comment"> * \param[in] format the custom output string to use.</span></div>
<div class="line"><a name="l00406"></a><span class="lineno"> 406</span> <span class="comment"> * \param[in] fp a file handle to write to. */</span></div>
<div class="line"><a name="l00408"></a><span class="lineno"> 408</span>  <a class="code" href="classvoro_1_1c__loop__all.html" title="Class for looping over all of the particles in a container.">c_loop_all</a> vl(*<span class="keyword">this</span>);</div>
<div class="line"><a name="l00412"></a><span class="lineno"> 412</span> <span class="comment">/** Computes all the Voronoi cells and saves customized information about them.</span></div>
<div class="line"><a name="l00413"></a><span class="lineno"> 413</span> <span class="comment"> * \param[in] format the custom output string to use.</span></div>
<div class="line"><a name="l00414"></a><span class="lineno"> 414</span> <span class="comment"> * \param[in] filename the name of the file to write to. */</span></div>
<div class="line"><a name="l00421"></a><span class="lineno"> 421</span> <span class="comment">/** Computes all the Voronoi cells and saves customized</span></div>
<div class="line"><a name="l00422"></a><span class="lineno"> 422</span> <span class="comment"> * information about them</span></div>
<div class="line"><a name="l00423"></a><span class="lineno"> 423</span> <span class="comment"> * \param[in] format the custom output string to use.</span></div>
<div class="line"><a name="l00424"></a><span class="lineno"> 424</span> <span class="comment"> * \param[in] filename the name of the file to write to. */</span></div>
<div class="line"><a name="l00431"></a><span class="lineno"> 431</span> <span class="comment">/** Computes all of the Voronoi cells in the container, but does nothing</span></div>
<div class="line"><a name="l00432"></a><span class="lineno"> 432</span> <span class="comment"> * with the output. It is useful for measuring the pure computation time</span></div>
<div class="line"><a name="l00433"></a><span class="lineno"> 433</span> <span class="comment"> * of the Voronoi algorithm, without any additional calculations such as</span></div>
<div class="line"><a name="l00436"></a><span class="lineno"> 436</span>  <a class="code" href="classvoro_1_1voronoicell.html" title="Extension of the voronoicell_base class to represent a Voronoi cell without neighbor information...">voronoicell</a> c;</div>
<div class="line"><a name="l00437"></a><span class="lineno"> 437</span>  <a class="code" href="classvoro_1_1c__loop__all.html" title="Class for looping over all of the particles in a container.">c_loop_all</a> vl(*<span class="keyword">this</span>);</div>
<div class="line"><a name="l00442"></a><span class="lineno"> 442</span> <span class="comment">/** Computes all of the Voronoi cells in the container, but does nothing</span></div>
<div class="line"><a name="l00443"></a><span class="lineno"> 443</span> <span class="comment"> * with the output. It is useful for measuring the pure computation time</span></div>
<div class="line"><a name="l00444"></a><span class="lineno"> 444</span> <span class="comment"> * of the Voronoi algorithm, without any additional calculations such as</span></div>
<div class="line"><a name="l00447"></a><span class="lineno"> 447</span>  <a class="code" href="classvoro_1_1voronoicell.html" title="Extension of the voronoicell_base class to represent a Voronoi cell without neighbor information...">voronoicell</a> c;</div>
<div class="line"><a name="l00448"></a><span class="lineno"> 448</span>  <a class="code" href="classvoro_1_1c__loop__all.html" title="Class for looping over all of the particles in a container.">c_loop_all</a> vl(*<span class="keyword">this</span>);</div>
<div class="line"><a name="l00452"></a><span class="lineno"> 452</span> <span class="comment">/** Calculates all of the Voronoi cells and sums their volumes. In most cases</span></div>
<div class="line"><a name="l00453"></a><span class="lineno"> 453</span> <span class="comment"> * without walls, the sum of the Voronoi cell volumes should equal the volume</span></div>
<div class="line"><a name="l00454"></a><span class="lineno"> 454</span> <span class="comment"> * of the container to numerical precision.</span></div>
<div class="line"><a name="l00455"></a><span class="lineno"> 455</span> <span class="comment"> * \return The sum of all of the computed Voronoi volumes. */</span></div>
<div class="line"><a name="l00457"></a><span class="lineno"> 457</span>  <a class="code" href="classvoro_1_1voronoicell.html" title="Extension of the voronoicell_base class to represent a Voronoi cell without neighbor information...">voronoicell</a> c;</div>
<div class="line"><a name="l00459"></a><span class="lineno"> 459</span>  <a class="code" href="classvoro_1_1c__loop__all.html" title="Class for looping over all of the particles in a container.">c_loop_all</a> vl(*<span class="keyword">this</span>);</div>
<div class="line"><a name="l00464"></a><span class="lineno"> 464</span> <span class="comment">/** Calculates all of the Voronoi cells and sums their volumes. In most cases</span></div>
<div class="line"><a name="l00465"></a><span class="lineno"> 465</span> <span class="comment"> * without walls, the sum of the Voronoi cell volumes should equal the volume</span></div>
<div class="line"><a name="l00466"></a><span class="lineno"> 466</span> <span class="comment"> * of the container to numerical precision.</span></div>
<div class="line"><a name="l00467"></a><span class="lineno"> 467</span> <span class="comment"> * \return The sum of all of the computed Voronoi volumes. */</span></div>
<div class="line"><a name="l00469"></a><span class="lineno"> 469</span>  <a class="code" href="classvoro_1_1voronoicell.html" title="Extension of the voronoicell_base class to represent a Voronoi cell without neighbor information...">voronoicell</a> c;</div>
<div class="line"><a name="l00471"></a><span class="lineno"> 471</span>  <a class="code" href="classvoro_1_1c__loop__all.html" title="Class for looping over all of the particles in a container.">c_loop_all</a> vl(*<span class="keyword">this</span>);</div>
<div class="line"><a name="l00476"></a><span class="lineno"> 476</span> <span class="comment">/** This function tests to see if a given vector lies within the container</span></div>
<div class="line"><a name="l00477"></a><span class="lineno"> 477</span> <span class="comment"> * bounds and any walls.</span></div>
<div class="line"><a name="l00478"></a><span class="lineno"> 478</span> <span class="comment"> * \param[in] (x,y,z) the position vector to be tested.</span></div>
<div class="line"><a name="l00479"></a><span class="lineno"> 479</span> <span class="comment"> * \return True if the point is inside the container, false if the point is</span></div>
<div class="line"><a name="l00486"></a><span class="lineno"> 486</span> <span class="comment">/** Draws an outline of the domain in gnuplot format.</span></div>
<div class="line"><a name="l00487"></a><span class="lineno"> 487</span> <span class="comment"> * \param[in] fp the file handle to write to. */</span></div>
<div class="line"><a name="l00495"></a><span class="lineno"> 495</span> <span class="comment">/** Draws an outline of the domain in POV-Ray format.</span></div>
<div class="line"><a name="l00496"></a><span class="lineno"> 496</span> <span class="comment"> * \param[in] fp the file handle to write to. */</span></div>
<div class="line"><a name="l00517"></a><span class="lineno"> 517</span> <span class="comment">/** The wall_list constructor sets up an array of pointers to wall classes. */</span></div>
<div class="line"><a name="l00518"></a><span class="lineno"><a class="code" href="classvoro_1_1wall__list.html#a248fb5d008de9a5a97d4720d47794698"> 518</a></span> <a class="code" href="classvoro_1_1wall__list.html#a248fb5d008de9a5a97d4720d47794698">wall_list::wall_list</a>() : walls(new <a class="code" href="classvoro_1_1wall.html" title="Pure virtual class from which wall objects are derived.">wall</a>*[init_wall_size]), wep(walls), wel(walls+init_wall_size),</div>
<div class="line"><a name="l00521"></a><span class="lineno"> 521</span> <span class="comment">/** The wall_list destructor frees the array of pointers to the wall classes.</span></div>
<div class="line"><a name="l00527"></a><span class="lineno"> 527</span> <span class="comment">/** Adds all of the walls on another wall_list to this class.</span></div>
<div class="line"><a name="l00528"></a><span class="lineno"> 528</span> <span class="comment"> * \param[in] wl a reference to the wall class. */</span></div>
<div class="line"><a name="l00529"></a><span class="lineno"><a class="code" href="classvoro_1_1wall__list.html#af872ae39e2bb8fe1e6947644a84cb1a8"> 529</a></span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1wall__list.html#aca50327f246b61f6aeef5337327d957d">wall_list::add_wall</a>(<a class="code" href="classvoro_1_1wall__list.html" title="A class for storing a list of pointers to walls.">wall_list</a> &wl) {</div>
<div class="line"><a name="l00530"></a><span class="lineno"> 530</span>  <span class="keywordflow">for</span>(<a class="code" href="classvoro_1_1wall.html" title="Pure virtual class from which wall objects are derived.">wall</a> **wp=wl.<a class="code" href="classvoro_1_1wall__list.html#abfc54768de5b596237d7eef5f589fe90">walls</a>;wp<wl.<a class="code" href="classvoro_1_1wall__list.html#abb48a3e29042c51cf48fa6a6b6c2dc1d">wep</a>;wp++) <a class="code" href="classvoro_1_1wall__list.html#aca50327f246b61f6aeef5337327d957d">add_wall</a>(*wp);</div>
<div class="line"><a name="l00533"></a><span class="lineno"> 533</span> <span class="comment">/** Deallocates all of the wall classes pointed to by the wall_list. */</span></div>
<div class="line"><a name="l00538"></a><span class="lineno"> 538</span> <span class="comment">/** Increases the memory allocation for the walls array. */</span></div>
<div class="line"><a name="l00543"></a><span class="lineno"> 543</span>  <a class="code" href="classvoro_1_1wall.html" title="Pure virtual class from which wall objects are derived.">wall</a> **nwalls=<span class="keyword">new</span> <a class="code" href="classvoro_1_1wall.html" title="Pure virtual class from which wall objects are derived.">wall</a>*[<a class="code" href="classvoro_1_1wall__list.html#a8a06b6562bbf488ff30852cd1a548506">current_wall_size</a>],**nwp=nwalls,**wp=<a class="code" href="classvoro_1_1wall__list.html#abfc54768de5b596237d7eef5f589fe90">walls</a>;</div>