<a href="container_8hh.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 Header file for the container_base and related classes. */</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</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="l00017"></a><span class="lineno"> 17</span> <span class="preprocessor">#include "<a class="code" href="common_8hh.html" title="Header file for the small helper functions.">common.hh</a>"</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#include "<a class="code" href="v__base_8hh.html" title="Header file for the base Voronoi container class.">v_base.hh</a>"</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#include "<a class="code" href="cell_8hh.html" title="Header file for the voronoicell and related classes.">cell.hh</a>"</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#include "<a class="code" href="c__loops_8hh.html" title="Header file for the loop classes.">c_loops.hh</a>"</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include "<a class="code" href="v__compute_8hh.html" title="Header file for the voro_compute template and related classes.">v_compute.hh</a>"</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#include "<a class="code" href="rad__option_8hh.html" title="Header file for the classes encapsulating functionality for the regular and radical Voronoi tessellat...">rad_option.hh</a>"</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="comment">/** \brief Pure virtual class from which wall objects are derived.</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="comment"> * This is a pure virtual class for a generic wall object. A wall object</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="comment"> * can be specified by deriving a new class from this and specifying the</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  <span class="keyword">virtual</span> ~<a class="code" href="classvoro_1_1wall.html" title="Pure virtual class from which wall objects are derived.">wall</a>() {}<span class="comment"></span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="comment"> /** A pure virtual function for testing whether a point is</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="comment"> /** A pure virtual function for cutting a cell without</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="comment"> * neighbor-tracking with a wall. */</span></div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classvoro_1_1wall.html#ab54b4c6d37223584f1fbf653d0b17d14">cut_cell</a>(<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,<span class="keywordtype">double</span> x,<span class="keywordtype">double</span> y,<span class="keywordtype">double</span> z) = 0;<span class="comment"></span></div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="comment"> /** A pure virtual function for cutting a cell with</span></div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="comment"> * neighbor-tracking enabled with a wall. */</span></div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classvoro_1_1wall.html#ab54b4c6d37223584f1fbf653d0b17d14">cut_cell</a>(<a class="code" href="classvoro_1_1voronoicell__neighbor.html" title="Extension of the voronoicell_base class to represent a Voronoi cell with neighbor information...">voronoicell_neighbor</a> &c,<span class="keywordtype">double</span> x,<span class="keywordtype">double</span> y,<span class="keywordtype">double</span> z) = 0;</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="comment">/** \brief A class for storing a list of pointers to walls.</span></div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <span class="comment"> * This class stores a list of pointers to wall classes. It contains several</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span> <span class="comment"> * simple routines that make use of the wall classes (such as telling whether a</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span> <span class="comment"> * given position is inside all of the walls or not). It can be used by itself,</span></div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span> <span class="comment"> * but also forms part of container_base, for associating walls with this</span></div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="code" href="classvoro_1_1wall__list.html"> 52</a></span> <span class="keyword">class </span><a class="code" href="classvoro_1_1wall__list.html" title="A class for storing a list of pointers to walls.">wall_list</a> {</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span> <span class="comment"> /** An array holding pointers to wall objects. */</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"><a class="code" href="classvoro_1_1wall__list.html#abfc54768de5b596237d7eef5f589fe90"> 55</a></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#abfc54768de5b596237d7eef5f589fe90">walls</a>;<span class="comment"></span></div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span> <span class="comment"> /** A pointer to the next free position to add a wall pointer.</span></div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span> <span class="comment"> /** Adds a wall to the list.</span></div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span> <span class="comment"> * \param[in] w a reference to the wall to add. */</span></div>
<div class="line"><a name="l00069"></a><span class="lineno"><a class="code" href="classvoro_1_1wall__list.html#a8e3a5253fa0392bf0f8b7a84eb1b61d4"> 69</a></span>  <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1wall__list.html#a8e3a5253fa0392bf0f8b7a84eb1b61d4">add_wall</a>(<a class="code" href="classvoro_1_1wall.html" title="Pure virtual class from which wall objects are derived.">wall</a> &w) {<a class="code" href="classvoro_1_1wall__list.html#a8e3a5253fa0392bf0f8b7a84eb1b61d4">add_wall</a>(&w);}</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1wall__list.html#aca50327f246b61f6aeef5337327d957d">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);<span class="comment"></span></div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span> <span class="comment"> /** Determines whether a given position is inside all of the</span></div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span> <span class="comment"> * walls on the list.</span></div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span> <span class="comment"> * \param[in] (x,y,z) the position to test.</span></div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span> <span class="comment"> * \return True if it is inside, false if it is outside. */</span></div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span> <span class="comment"> /** Cuts a Voronoi cell by all of the walls currently on</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span> <span class="comment"> * the list.</span></div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span> <span class="comment"> * \param[in] c a reference to the Voronoi cell class.</span></div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span> <span class="comment"> * \param[in] (x,y,z) the position of the cell.</span></div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span> <span class="comment"> * \return True if the cell still exists, false if the cell is</span></div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span> <span class="comment"> /** A pointer to the limit of the walls array, used to</span></div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span> <span class="comment"> * determine when array is full. */</span></div>
<div class="line"><a name="l00095"></a><span class="lineno"><a class="code" href="classvoro_1_1wall__list.html#a292491bc99b6bbc819bb3720fcfb08a1"> 95</a></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#a292491bc99b6bbc819bb3720fcfb08a1">wel</a>;<span class="comment"></span></div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span> <span class="comment"> /** The current amount of memory allocated for walls. */</span></div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span> <span class="comment">/** \brief Class for representing a particle system in a three-dimensional</span></div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span> <span class="comment"> * This class represents a system of particles in a three-dimensional</span></div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span> <span class="comment"> * rectangular box. Any combination of non-periodic and periodic coordinates</span></div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span> <span class="comment"> * can be used in the three coordinate directions. The class is not intended</span></div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span> <span class="comment"> * for direct use, but instead forms the base of the container and</span></div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span> <span class="comment"> * container_poly classes that add specialized routines for computing the</span></div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span> <span class="comment"> * regular and radical Voronoi tessellations respectively. It contains routines</span></div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span> <span class="comment"> * that are commonly between these two classes, such as those for drawing the</span></div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span> <span class="comment"> * domain, and placing particles within the internal data structure.</span></div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span> <span class="comment"> * The class is derived from the wall_list class, which encapsulates routines</span></div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span> <span class="comment"> * for associating walls with the container, and the voro_base class, which</span></div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span> <span class="comment"> * encapsulates routines about the underlying computational grid. */</span></div>
<div class="line"><a name="l00115"></a><span class="lineno"><a class="code" href="classvoro_1_1container__base.html"> 115</a></span> <span class="keyword">class </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> : <span class="keyword">public</span> <a class="code" href="classvoro_1_1voro__base.html" title="Class containing data structures common across all particle container classes.">voro_base</a>, <span class="keyword">public</span> <a class="code" href="classvoro_1_1wall__list.html" title="A class for storing a list of pointers to walls.">wall_list</a> {</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span> <span class="comment"> /** The minimum x coordinate of the container. */</span></div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span> <span class="comment"> /** The maximum x coordinate of the container. */</span></div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span> <span class="comment"> /** The minimum y coordinate of the container. */</span></div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span> <span class="comment"> /** The maximum y coordinate of the container. */</span></div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span> <span class="comment"> /** The minimum z coordinate of the container. */</span></div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span> <span class="comment"> /** The maximum z coordinate of the container. */</span></div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span> <span class="comment"> /** A boolean value that determines if the x coordinate in</span></div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span> <span class="comment"> /** A boolean value that determines if the y coordinate in</span></div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span> <span class="comment"> /** A boolean value that determines if the z coordinate in</span></div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span> <span class="comment"> /** This array holds the numerical IDs of each particle in each</span></div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span> <span class="comment"> /** This array holds the number of particles within each</span></div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span> <span class="comment"> * computational box of the container. */</span></div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span> <span class="comment"> /** This array holds the maximum amount of particle memory for</span></div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span> <span class="comment"> * each computational box of the container. If the number of</span></div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span> <span class="comment"> * particles in a particular box ever approaches this limit,</span></div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span> <span class="comment"> * more is allocated using the add_particle_memory() function.</span></div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span> <span class="comment"> /** The amount of memory in the array structure for each</span></div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span> <span class="comment"> * particle. This is set to 3 when the basic class is</span></div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span> <span class="comment"> * initialized, so that the array holds (x,y,z) positions. If</span></div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span> <span class="comment"> * the container class is initialized as part of the derived</span></div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span> <span class="comment"> * class container_poly, then this is set to 4, to also hold</span></div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span> <span class="comment"> /** Initializes the Voronoi cell prior to a compute_cell</span></div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span> <span class="comment"> * operation for a specific particle being carried out by a</span></div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span> <span class="comment"> * voro_compute class. The cell is initialized to fill the</span></div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span> <span class="comment"> * entire container. For non-periodic coordinates, this is set</span></div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span> <span class="comment"> * by the position of the walls. For periodic coordinates, the</span></div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span> <span class="comment"> * space is equally divided in either direction from the</span></div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span> <span class="comment"> * particle's initial position. Plane cuts made by any walls</span></div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span> <span class="comment"> * that have been added are then applied to the cell.</span></div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span> <span class="comment"> * \param[in,out] c a reference to a voronoicell object.</span></div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span> <span class="comment"> * \param[in] ijk the block that the particle is within.</span></div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span> <span class="comment"> * \param[in] q the index of the particle within its block.</span></div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span> <span class="comment"> * \param[in] (ci,cj,ck) the coordinates of the block in the</span></div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span> <span class="comment"> * \param[out] (i,j,k) the coordinates of the test block</span></div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span> <span class="comment"> * relative to the voro_compute</span></div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span> <span class="comment"> * \param[out] (x,y,z) the position of the particle.</span></div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span> <span class="comment"> * \param[out] disp a block displacement used internally by the</span></div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span> <span class="comment"> /** Initializes parameters for a find_voronoi_cell call within</span></div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span> <span class="comment"> * the voro_compute template.</span></div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span> <span class="comment"> * \param[in] (ci,cj,ck) the coordinates of the test block in</span></div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span> <span class="comment"> * \param[in] ijk the index of the test block</span></div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span> <span class="comment"> * \param[out] (i,j,k) the coordinates of the test block</span></div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span> <span class="comment"> * relative to the voro_compute</span></div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span> <span class="comment"> /** Returns the position of a particle currently being computed</span></div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span> <span class="comment"> * relative to the computational block that it is within. It is</span></div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span> <span class="comment"> * used to select the optimal worklist entry to use.</span></div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span> <span class="comment"> * \param[in] (x,y,z) the position of the particle.</span></div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span> <span class="comment"> * \param[in] (ci,cj,ck) the block that the particle is within.</span></div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span> <span class="comment"> * \param[out] (fx,fy,fz) the position relative to the block.</span></div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span> <span class="comment"> /** Calculates the index of block in the container structure</span></div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span> <span class="comment"> * corresponding to given coordinates.</span></div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span> <span class="comment"> * \param[in] (ci,cj,ck) the coordinates of the original block</span></div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span> <span class="comment"> * in the current computation, relative</span></div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span> <span class="comment"> * to the container coordinate system.</span></div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span> <span class="comment"> * \param[in] (ei,ej,ek) the displacement of the current block</span></div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span> <span class="comment"> * from the original block.</span></div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span> <span class="comment"> /** Draws an outline of the domain in Gnuplot format.</span></div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span> <span class="comment"> * \param[in] filename the filename to write to. */</span></div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span> <span class="comment"> /** Draws an outline of the domain in Gnuplot format.</span></div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span> <span class="comment"> * \param[in] filename the filename to write to. */</span></div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span> <span class="comment"> /** Sums up the total number of stored particles.</span></div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span> <span class="comment"> * \return The number of particles. */</span></div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span> <span class="comment">/** \brief Extension of the container_base class for computing regular Voronoi</span></div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span> <span class="comment"> * This class is an extension of the container_base class that has routines</span></div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span> <span class="comment"> * specifically for computing the regular Voronoi tessellation with no</span></div>
<div class="line"><a name="l00285"></a><span class="lineno"><a class="code" href="classvoro_1_1container.html"> 285</a></span> <span class="keyword">class </span><a class="code" href="classvoro_1_1container.html" title="Extension of the container_base class for computing regular Voronoi tessellations.">container</a> : <span class="keyword">public</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>, <span class="keyword">public</span> <a class="code" href="classvoro_1_1radius__mono.html" title="Class containing all of the routines that are specific to computing the regular Voronoi tessellation...">radius_mono</a> {</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>  <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1container.html#a5c67c9998e4f174fb217967dcb41c7f3">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="l00293"></a><span class="lineno"> 293</span>  <span class="keywordtype">void</span> <span class="keyword">import</span>(<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=stdin);<span class="comment"></span></div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span> <span class="comment"> /** Imports a list of particles from an open file stream into</span></div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span> <span class="comment"> * the container. Entries of four numbers (Particle ID, x</span></div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span> <span class="comment"> * position, y position, z position) are searched for. If the</span></div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span> <span class="comment"> * file cannot be successfully read, then the routine causes a</span></div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span> <span class="comment"> * \param[in] filename the name of the file to open and read</span></div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span> <span class="comment"> /** Imports a list of particles from an open file stream into</span></div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span> <span class="comment"> * the container. Entries of four numbers (Particle ID, x</span></div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span> <span class="comment"> * position, y position, z position) are searched for. In</span></div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span> <span class="comment"> * addition, the order in which particles are read is saved</span></div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span> <span class="comment"> * into an ordering class. If the file cannot be successfully</span></div>
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span> <span class="comment"> * read, then the routine causes a fatal error.</span></div>
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span> <span class="comment"> * \param[in,out] vo the ordering class to use.</span></div>
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span> <span class="comment"> * \param[in] filename the name of the file to open and read</span></div>
<div class="line"><a name="l00315"></a><span class="lineno"><a class="code" href="classvoro_1_1container.html#acd9da3dc12eecccd5db8af5ff111222c"> 315</a></span>  <span class="keyword">inline</span> <span class="keywordtype">void</span> <span class="keyword">import</span>(<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="keyword">const</span> <span class="keywordtype">char</span>* filename) {</div>
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span> <span class="comment"> /** Dumps particle IDs and positions to a file.</span></div>
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span> <span class="comment"> * \param[in] vl the loop class to use.</span></div>
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span> <span class="comment"> * \param[in] fp a file handle to write to. */</span></div>
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span> <span class="comment"> /** Dumps all of the particle IDs and positions to a file.</span></div>
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span> <span class="comment"> * \param[in] fp a file handle to write to. */</span></div>
<div class="line"><a name="l00336"></a><span class="lineno"> 336</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="l00339"></a><span class="lineno"> 339</span> <span class="comment"> /** Dumps all of the particle IDs and positions to a file.</span></div>
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span> <span class="comment"> * \param[in] filename the name of the file to write to. */</span></div>
<div class="line"><a name="l00347"></a><span class="lineno"> 347</span> <span class="comment"> * \param[in] vl the loop class to use.</span></div>
<div class="line"><a name="l00348"></a><span class="lineno"> 348</span> <span class="comment"> * \param[in] fp a file handle to write to. */</span></div>
<div class="line"><a name="l00361"></a><span class="lineno"> 361</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="l00364"></a><span class="lineno"> 364</span> <span class="comment"> /** Dumps all particle positions in POV-Ray format.</span></div>
<div class="line"><a name="l00365"></a><span class="lineno"> 365</span> <span class="comment"> * \param[in] filename the name of the file to write to. */</span></div>
<div class="line"><a name="l00373"></a><span class="lineno"> 373</span> <span class="comment"> * \param[in] vl the loop class to use.</span></div>
<div class="line"><a name="l00374"></a><span class="lineno"> 374</span> <span class="comment"> * \param[in] fp a file handle to write to. */</span></div>
<div class="line"><a name="l00377"></a><span class="lineno"> 377</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;<span class="keywordtype">double</span> *pp;</div>
<div class="line"><a name="l00383"></a><span class="lineno"> 383</span> <span class="comment"> /** Computes all Voronoi cells and saves the output in gnuplot</span></div>
<div class="line"><a name="l00387"></a><span class="lineno"> 387</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="l00390"></a><span class="lineno"> 390</span> <span class="comment"> /** Computes all Voronoi cells and saves the output in gnuplot</span></div>
<div class="line"><a name="l00392"></a><span class="lineno"> 392</span> <span class="comment"> * \param[in] filename the name of the file to write to. */</span></div>
<div class="line"><a name="l00400"></a><span class="lineno"> 400</span> <span class="comment"> * \param[in] vl the loop class to use.</span></div>
<div class="line"><a name="l00401"></a><span class="lineno"> 401</span> <span class="comment"> * \param[in] fp a file handle to write to. */</span></div>
<div class="line"><a name="l00404"></a><span class="lineno"> 404</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;<span class="keywordtype">double</span> *pp;</div>
<div class="line"><a name="l00411"></a><span class="lineno"> 411</span> <span class="comment"> /** Computes all Voronoi cells and saves the output in POV-Ray</span></div>
<div class="line"><a name="l00415"></a><span class="lineno"> 415</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="l00418"></a><span class="lineno"> 418</span> <span class="comment"> /** Computes all Voronoi cells and saves the output in POV-Ray</span></div>
<div class="line"><a name="l00420"></a><span class="lineno"> 420</span> <span class="comment"> * \param[in] filename the name of the file to write to. */</span></div>
<div class="line"><a name="l00426"></a><span class="lineno"> 426</span> <span class="comment"> /** Computes the Voronoi cells and saves customized information</span></div>
<div class="line"><a name="l00427"></a><span class="lineno"> 427</span> <span class="comment"> * about them.</span></div>
<div class="line"><a name="l00428"></a><span class="lineno"> 428</span> <span class="comment"> * \param[in] vl the loop class to use.</span></div>
<div class="line"><a name="l00429"></a><span class="lineno"> 429</span> <span class="comment"> * \param[in] format the custom output string to use.</span></div>
<div class="line"><a name="l00430"></a><span class="lineno"> 430</span> <span class="comment"> * \param[in] fp a file handle to write to. */</span></div>
<div class="line"><a name="l00435"></a><span class="lineno"> 435</span>  <a class="code" href="classvoro_1_1voronoicell__neighbor.html" title="Extension of the voronoicell_base class to represent a Voronoi cell with neighbor information...">voronoicell_neighbor</a> c;</div>
<div class="line"><a name="l00441"></a><span class="lineno"> 441</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="l00451"></a><span class="lineno"> 451</span> <span class="comment"> /** Computes the Voronoi cell for a particle currently being</span></div>
<div class="line"><a name="l00452"></a><span class="lineno"> 452</span> <span class="comment"> * referenced by a loop class.</span></div>
<div class="line"><a name="l00453"></a><span class="lineno"> 453</span> <span class="comment"> * \param[out] c a Voronoi cell class in which to store the</span></div>
<div class="line"><a name="l00455"></a><span class="lineno"> 455</span> <span class="comment"> * \param[in] vl the loop class to use.</span></div>
<div class="line"><a name="l00456"></a><span class="lineno"> 456</span> <span class="comment"> * \return True if the cell was computed. If the cell cannot be</span></div>
<div class="line"><a name="l00457"></a><span class="lineno"> 457</span> <span class="comment"> * computed, if it is removed entirely by a wall or boundary</span></div>
<div class="line"><a name="l00458"></a><span class="lineno"> 458</span> <span class="comment"> * condition, then the routine returns false. */</span></div>
<div class="line"><a name="l00463"></a><span class="lineno"> 463</span> <span class="comment"> /** Computes the Voronoi cell for given particle.</span></div>
<div class="line"><a name="l00464"></a><span class="lineno"> 464</span> <span class="comment"> * \param[out] c a Voronoi cell class in which to store the</span></div>
<div class="line"><a name="l00466"></a><span class="lineno"> 466</span> <span class="comment"> * \param[in] ijk the block that the particle is within.</span></div>
<div class="line"><a name="l00467"></a><span class="lineno"> 467</span> <span class="comment"> * \param[in] q the index of the particle within the block.</span></div>
<div class="line"><a name="l00468"></a><span class="lineno"> 468</span> <span class="comment"> * \return True if the cell was computed. If the cell cannot be</span></div>
<div class="line"><a name="l00469"></a><span class="lineno"> 469</span> <span class="comment"> * computed, if it is removed entirely by a wall or boundary</span></div>
<div class="line"><a name="l00470"></a><span class="lineno"> 470</span> <span class="comment"> * condition, then the routine returns false. */</span></div>
<div class="line"><a name="l00481"></a><span class="lineno"> 481</span> <span class="comment">/** \brief Extension of the container_base class for computing radical Voronoi</span></div>
<div class="line"><a name="l00484"></a><span class="lineno"> 484</span> <span class="comment"> * This class is an extension of container_base class that has routines</span></div>
<div class="line"><a name="l00485"></a><span class="lineno"> 485</span> <span class="comment"> * specifically for computing the radical Voronoi tessellation that depends on</span></div>
<div class="line"><a name="l00487"></a><span class="lineno"><a class="code" href="classvoro_1_1container__poly.html"> 487</a></span> <span class="keyword">class </span><a class="code" href="classvoro_1_1container__poly.html" title="Extension of the container_base class for computing radical Voronoi tessellations.">container_poly</a> : <span class="keyword">public</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>, <span class="keyword">public</span> <a class="code" href="classvoro_1_1radius__poly.html" title="Class containing all of the routines that are specific to computing the radical Voronoi tessellation...">radius_poly</a> {</div>
<div class="line"><a name="l00495"></a><span class="lineno"> 495</span>  <span class="keywordtype">void</span> <span class="keyword">import</span>(<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=stdin);<span class="comment"></span></div>
<div class="line"><a name="l00496"></a><span class="lineno"> 496</span> <span class="comment"> /** Imports a list of particles from an open file stream into</span></div>
<div class="line"><a name="l00497"></a><span class="lineno"> 497</span> <span class="comment"> * the container_poly class. Entries of five numbers (Particle</span></div>
<div class="line"><a name="l00498"></a><span class="lineno"> 498</span> <span class="comment"> * ID, x position, y position, z position, radius) are searched</span></div>
<div class="line"><a name="l00499"></a><span class="lineno"> 499</span> <span class="comment"> * for. If the file cannot be successfully read, then the</span></div>
<div class="line"><a name="l00501"></a><span class="lineno"> 501</span> <span class="comment"> * \param[in] filename the name of the file to open and read</span></div>
<div class="line"><a name="l00508"></a><span class="lineno"> 508</span> <span class="comment"> /** Imports a list of particles from an open file stream into</span></div>
<div class="line"><a name="l00509"></a><span class="lineno"> 509</span> <span class="comment"> * the container_poly class. Entries of five numbers (Particle</span></div>
<div class="line"><a name="l00510"></a><span class="lineno"> 510</span> <span class="comment"> * ID, x position, y position, z position, radius) are searched</span></div>
<div class="line"><a name="l00511"></a><span class="lineno"> 511</span> <span class="comment"> * for. In addition, the order in which particles are read is</span></div>
<div class="line"><a name="l00512"></a><span class="lineno"> 512</span> <span class="comment"> * saved into an ordering class. If the file cannot be</span></div>
<div class="line"><a name="l00513"></a><span class="lineno"> 513</span> <span class="comment"> * successfully read, then the routine causes a fatal error.</span></div>
<div class="line"><a name="l00514"></a><span class="lineno"> 514</span> <span class="comment"> * \param[in,out] vo the ordering class to use.</span></div>
<div class="line"><a name="l00515"></a><span class="lineno"> 515</span> <span class="comment"> * \param[in] filename the name of the file to open and read</span></div>
<div class="line"><a name="l00517"></a><span class="lineno"><a class="code" href="classvoro_1_1container__poly.html#af897ea09b80064d4b492862884ba316c"> 517</a></span>  <span class="keyword">inline</span> <span class="keywordtype">void</span> <span class="keyword">import</span>(<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="keyword">const</span> <span class="keywordtype">char</span>* filename) {</div>
<div class="line"><a name="l00524"></a><span class="lineno"> 524</span> <span class="comment"> /** Dumps particle IDs, positions and radii to a file.</span></div>
<div class="line"><a name="l00525"></a><span class="lineno"> 525</span> <span class="comment"> * \param[in] vl the loop class to use.</span></div>
<div class="line"><a name="l00526"></a><span class="lineno"> 526</span> <span class="comment"> * \param[in] fp a file handle to write to. */</span></div>
<div class="line"><a name="l00535"></a><span class="lineno"> 535</span> <span class="comment"> /** Dumps all of the particle IDs, positions and radii to a</span></div>
<div class="line"><a name="l00539"></a><span class="lineno"> 539</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="l00542"></a><span class="lineno"> 542</span> <span class="comment"> /** Dumps all of the particle IDs, positions and radii to a</span></div>
<div class="line"><a name="l00544"></a><span class="lineno"> 544</span> <span class="comment"> * \param[in] filename the name of the file to write to. */</span></div>
<div class="line"><a name="l00551"></a><span class="lineno"> 551</span> <span class="comment"> * \param[in] vl the loop class to use.</span></div>
<div class="line"><a name="l00552"></a><span class="lineno"> 552</span> <span class="comment"> * \param[in] fp a file handle to write to. */</span></div>
<div class="line"><a name="l00562"></a><span class="lineno"> 562</span> <span class="comment"> /** Dumps all the particle positions in POV-Ray format.</span></div>
<div class="line"><a name="l00563"></a><span class="lineno"> 563</span> <span class="comment"> * \param[in] fp a file handle to write to. */</span></div>
<div class="line"><a name="l00565"></a><span class="lineno"> 565</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="l00568"></a><span class="lineno"> 568</span> <span class="comment"> /** Dumps all the particle positions in POV-Ray format.</span></div>
<div class="line"><a name="l00569"></a><span class="lineno"> 569</span> <span class="comment"> * \param[in] filename the name of the file to write to. */</span></div>
<div class="line"><a name="l00577"></a><span class="lineno"> 577</span> <span class="comment"> * \param[in] vl the loop class to use.</span></div>
<div class="line"><a name="l00578"></a><span class="lineno"> 578</span> <span class="comment"> * \param[in] fp a file handle to write to. */</span></div>
<div class="line"><a name="l00581"></a><span class="lineno"> 581</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;<span class="keywordtype">double</span> *pp;</div>
<div class="line"><a name="l00587"></a><span class="lineno"> 587</span> <span class="comment"> /** Compute all Voronoi cells and saves the output in gnuplot</span></div>
<div class="line"><a name="l00591"></a><span class="lineno"> 591</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="l00594"></a><span class="lineno"> 594</span> <span class="comment"> /** Compute all Voronoi cells and saves the output in gnuplot</span></div>
<div class="line"><a name="l00596"></a><span class="lineno"> 596</span> <span class="comment"> * \param[in] filename the name of the file to write to. */</span></div>
<div class="line"><a name="l00604"></a><span class="lineno"> 604</span> <span class="comment"> * \param[in] vl the loop class to use.</span></div>
<div class="line"><a name="l00605"></a><span class="lineno"> 605</span> <span class="comment"> * \param[in] fp a file handle to write to. */</span></div>
<div class="line"><a name="l00608"></a><span class="lineno"> 608</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;<span class="keywordtype">double</span> *pp;</div>
<div class="line"><a name="l00615"></a><span class="lineno"> 615</span> <span class="comment"> /** Computes all Voronoi cells and saves the output in POV-Ray</span></div>
<div class="line"><a name="l00619"></a><span class="lineno"> 619</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="l00622"></a><span class="lineno"> 622</span> <span class="comment"> /** Computes all Voronoi cells and saves the output in POV-Ray</span></div>
<div class="line"><a name="l00624"></a><span class="lineno"> 624</span> <span class="comment"> * \param[in] filename the name of the file to write to. */</span></div>
<div class="line"><a name="l00630"></a><span class="lineno"> 630</span> <span class="comment"> /** Computes the Voronoi cells and saves customized information</span></div>
<div class="line"><a name="l00631"></a><span class="lineno"> 631</span> <span class="comment"> * about them.</span></div>
<div class="line"><a name="l00632"></a><span class="lineno"> 632</span> <span class="comment"> * \param[in] vl the loop class to use.</span></div>
<div class="line"><a name="l00633"></a><span class="lineno"> 633</span> <span class="comment"> * \param[in] format the custom output string to use.</span></div>
<div class="line"><a name="l00634"></a><span class="lineno"> 634</span> <span class="comment"> * \param[in] fp a file handle to write to. */</span></div>
<div class="line"><a name="l00639"></a><span class="lineno"> 639</span>  <a class="code" href="classvoro_1_1voronoicell__neighbor.html" title="Extension of the voronoicell_base class to represent a Voronoi cell with neighbor information...">voronoicell_neighbor</a> c;</div>
<div class="line"><a name="l00645"></a><span class="lineno"> 645</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="l00652"></a><span class="lineno"> 652</span> <span class="comment"> /** Computes the Voronoi cell for a particle currently being</span></div>
<div class="line"><a name="l00653"></a><span class="lineno"> 653</span> <span class="comment"> * referenced by a loop class.</span></div>
<div class="line"><a name="l00654"></a><span class="lineno"> 654</span> <span class="comment"> * \param[out] c a Voronoi cell class in which to store the</span></div>
<div class="line"><a name="l00656"></a><span class="lineno"> 656</span> <span class="comment"> * \param[in] vl the loop class to use.</span></div>
<div class="line"><a name="l00657"></a><span class="lineno"> 657</span> <span class="comment"> * \return True if the cell was computed. If the cell cannot be</span></div>
<div class="line"><a name="l00658"></a><span class="lineno"> 658</span> <span class="comment"> * computed, if it is removed entirely by a wall or boundary</span></div>
<div class="line"><a name="l00659"></a><span class="lineno"> 659</span> <span class="comment"> * condition, then the routine returns false. */</span></div>
<div class="line"><a name="l00664"></a><span class="lineno"> 664</span> <span class="comment"> /** Computes the Voronoi cell for given particle.</span></div>
<div class="line"><a name="l00665"></a><span class="lineno"> 665</span> <span class="comment"> * \param[out] c a Voronoi cell class in which to store the</span></div>
<div class="line"><a name="l00667"></a><span class="lineno"> 667</span> <span class="comment"> * \param[in] ijk the block that the particle is within.</span></div>
<div class="line"><a name="l00668"></a><span class="lineno"> 668</span> <span class="comment"> * \param[in] q the index of the particle within the block.</span></div>
<div class="line"><a name="l00669"></a><span class="lineno"> 669</span> <span class="comment"> * \return True if the cell was computed. If the cell cannot be</span></div>
<div class="line"><a name="l00670"></a><span class="lineno"> 670</span> <span class="comment"> * computed, if it is removed entirely by a wall or boundary</span></div>
<div class="line"><a name="l00671"></a><span class="lineno"> 671</span> <span class="comment"> * condition, then the routine returns false. */</span></div>