<ahref="cell_8hh.html">Go to the documentation of this file.</a><divclass="fragment"><divclass="line"><aname="l00001"></a><spanclass="lineno"> 1</span> <spanclass="comment">// Voro++, a 3D cell-based Voronoi library</span></div>
<divclass="line"><aname="l00008"></a><spanclass="lineno"> 8</span> <spanclass="comment"> * \brief Header file for the voronoicell and related classes. */</span></div>
<divclass="line"><aname="l00015"></a><spanclass="lineno"> 15</span> <spanclass="preprocessor">#include "<aclass="code"href="config_8hh.html"title="Master configuration file for setting various compile-time options.">config.hh</a>"</span></div>
<divclass="line"><aname="l00016"></a><spanclass="lineno"> 16</span> <spanclass="preprocessor">#include "<aclass="code"href="common_8hh.html"title="Header file for the small helper functions.">common.hh</a>"</span></div>
<divclass="line"><aname="l00020"></a><spanclass="lineno"> 20</span> <spanclass="comment">/** \brief A class representing a single Voronoi cell.</span></div>
<divclass="line"><aname="l00022"></a><spanclass="lineno"> 22</span> <spanclass="comment"> * This class represents a single Voronoi cell, as a collection of vertices</span></div>
<divclass="line"><aname="l00023"></a><spanclass="lineno"> 23</span> <spanclass="comment"> * that are connected by edges. The class contains routines for initializing</span></div>
<divclass="line"><aname="l00024"></a><spanclass="lineno"> 24</span> <spanclass="comment"> * the Voronoi cell to be simple shapes such as a box, tetrahedron, or octahedron.</span></div>
<divclass="line"><aname="l00025"></a><spanclass="lineno"> 25</span> <spanclass="comment"> * It the contains routines for recomputing the cell based on cutting it</span></div>
<divclass="line"><aname="l00026"></a><spanclass="lineno"> 26</span> <spanclass="comment"> * by a plane, which forms the key routine for the Voronoi cell computation.</span></div>
<divclass="line"><aname="l00027"></a><spanclass="lineno"> 27</span> <spanclass="comment"> * It contains numerous routine for computing statistics about the Voronoi cell,</span></div>
<divclass="line"><aname="l00028"></a><spanclass="lineno"> 28</span> <spanclass="comment"> * and it can output the cell in several formats.</span></div>
<divclass="line"><aname="l00030"></a><spanclass="lineno"> 30</span> <spanclass="comment"> * This class is not intended for direct use, but forms the base of the</span></div>
<divclass="line"><aname="l00031"></a><spanclass="lineno"> 31</span> <spanclass="comment"> * voronoicell and voronoicell_neighbor classes, which extend it based on</span></div>
<divclass="line"><aname="l00032"></a><spanclass="lineno"> 32</span> <spanclass="comment"> * whether neighboring particle ID information needs to be tracked. */</span></div>
<divclass="line"><aname="l00033"></a><spanclass="lineno"><aclass="code"href="classvoro_1_1voronoicell__base.html"> 33</a></span> <spanclass="keyword">class </span><aclass="code"href="classvoro_1_1voronoicell__base.html"title="A class representing a single Voronoi cell.">voronoicell_base</a> {</div>
<divclass="line"><aname="l00035"></a><spanclass="lineno"> 35</span> <spanclass="comment"> /** This holds the current size of the arrays ed and nu, which</span></div>
<divclass="line"><aname="l00036"></a><spanclass="lineno"> 36</span> <spanclass="comment"> * hold the vertex information. If more vertices are created</span></div>
<divclass="line"><aname="l00037"></a><spanclass="lineno"> 37</span> <spanclass="comment"> * than can fit in this array, then it is dynamically extended</span></div>
<divclass="line"><aname="l00038"></a><spanclass="lineno"> 38</span> <spanclass="comment"> * using the add_memory_vertices routine. */</span></div>
<divclass="line"><aname="l00040"></a><spanclass="lineno"> 40</span> <spanclass="comment"> /** This holds the current maximum allowed order of a vertex,</span></div>
<divclass="line"><aname="l00041"></a><spanclass="lineno"> 41</span> <spanclass="comment"> * which sets the size of the mem, mep, and mec arrays. If a</span></div>
<divclass="line"><aname="l00042"></a><spanclass="lineno"> 42</span> <spanclass="comment"> * vertex is created with more vertices than this, the arrays</span></div>
<divclass="line"><aname="l00043"></a><spanclass="lineno"> 43</span> <spanclass="comment"> * are dynamically extended using the add_memory_vorder routine.</span></div>
<divclass="line"><aname="l00046"></a><spanclass="lineno"> 46</span> <spanclass="comment"> /** This sets the size of the main delete stack. */</span></div>
<divclass="line"><aname="l00048"></a><spanclass="lineno"> 48</span> <spanclass="comment"> /** This sets the size of the auxiliary delete stack. */</span></div>
<divclass="line"><aname="l00050"></a><spanclass="lineno"> 50</span> <spanclass="comment"> /** This sets the total number of vertices in the current cell.</span></div>
<divclass="line"><aname="l00053"></a><spanclass="lineno"> 53</span> <spanclass="comment"> /** This is the index of particular point in the cell, which is</span></div>
<divclass="line"><aname="l00054"></a><spanclass="lineno"> 54</span> <spanclass="comment"> * used to start the tracing routines for plane intersection</span></div>
<divclass="line"><aname="l00055"></a><spanclass="lineno"> 55</span> <spanclass="comment"> * and cutting. These routines will work starting from any</span></div>
<divclass="line"><aname="l00056"></a><spanclass="lineno"> 56</span> <spanclass="comment"> * point, but it's often most efficient to start from the last</span></div>
<divclass="line"><aname="l00057"></a><spanclass="lineno"> 57</span> <spanclass="comment"> * point considered, since in many cases, the cell construction</span></div>
<divclass="line"><aname="l00058"></a><spanclass="lineno"> 58</span> <spanclass="comment"> * algorithm may consider many planes with similar vectors</span></div>
<divclass="line"><aname="l00061"></a><spanclass="lineno"> 61</span> <spanclass="comment"> /** This is a two dimensional array that holds information</span></div>
<divclass="line"><aname="l00062"></a><spanclass="lineno"> 62</span> <spanclass="comment"> * about the edge connections of the vertices that make up the</span></div>
<divclass="line"><aname="l00063"></a><spanclass="lineno"> 63</span> <spanclass="comment"> * cell. The two dimensional array is not allocated in the</span></div>
<divclass="line"><aname="l00064"></a><spanclass="lineno"> 64</span> <spanclass="comment"> * usual method. To account for the fact the different vertices</span></div>
<divclass="line"><aname="l00065"></a><spanclass="lineno"> 65</span> <spanclass="comment"> * have different orders, and thus require different amounts of</span></div>
<divclass="line"><aname="l00066"></a><spanclass="lineno"> 66</span> <spanclass="comment"> * storage, the elements of ed[i] point to one-dimensional</span></div>
<divclass="line"><aname="l00067"></a><spanclass="lineno"> 67</span> <spanclass="comment"> * arrays in the mep[] array of different sizes.</span></div>
<divclass="line"><aname="l00069"></a><spanclass="lineno"> 69</span> <spanclass="comment"> * More specifically, if vertex i has order m, then ed[i]</span></div>
<divclass="line"><aname="l00070"></a><spanclass="lineno"> 70</span> <spanclass="comment"> * points to a one-dimensional array in mep[m] that has 2*m+1</span></div>
<divclass="line"><aname="l00071"></a><spanclass="lineno"> 71</span> <spanclass="comment"> * entries. The first m elements hold the neighboring edges, so</span></div>
<divclass="line"><aname="l00072"></a><spanclass="lineno"> 72</span> <spanclass="comment"> * that the jth edge of vertex i is held in ed[i][j]. The next</span></div>
<divclass="line"><aname="l00073"></a><spanclass="lineno"> 73</span> <spanclass="comment"> * m elements hold a table of relations which is redundant but</span></div>
<divclass="line"><aname="l00074"></a><spanclass="lineno"> 74</span> <spanclass="comment"> * helps speed up the computation. It satisfies the relation</span></div>
<divclass="line"><aname="l00075"></a><spanclass="lineno"> 75</span> <spanclass="comment"> * ed[ed[i][j]][ed[i][m+j]]=i. The final entry holds a back</span></div>
<divclass="line"><aname="l00076"></a><spanclass="lineno"> 76</span> <spanclass="comment"> * pointer, so that ed[i+2*m]=i. The back pointers are used</span></div>
<divclass="line"><aname="l00077"></a><spanclass="lineno"> 77</span> <spanclass="comment"> * when rearranging the memory. */</span></div>
<divclass="line"><aname="l00079"></a><spanclass="lineno"> 79</span> <spanclass="comment"> /** This array holds the order of the vertices in the Voronoi</span></div>
<divclass="line"><aname="l00080"></a><spanclass="lineno"> 80</span> <spanclass="comment"> * cell. This array is dynamically allocated, with its current</span></div>
<divclass="line"><aname="l00081"></a><spanclass="lineno"> 81</span> <spanclass="comment"> * size held by current_vertices. */</span></div>
<divclass="line"><aname="l00083"></a><spanclass="lineno"> 83</span> <spanclass="comment"> /** This in an array with size 3*current_vertices for holding</span></div>
<divclass="line"><aname="l00084"></a><spanclass="lineno"> 84</span> <spanclass="comment"> * the positions of the vertices. */</span></div>
<divclass="line"><aname="l00093"></a><spanclass="lineno"> 93</span> <spanclass="comment"> /** Outputs the cell in POV-Ray format, using cylinders for edges</span></div>
<divclass="line"><aname="l00094"></a><spanclass="lineno"> 94</span> <spanclass="comment"> * and spheres for vertices, to a given file.</span></div>
<divclass="line"><aname="l00095"></a><spanclass="lineno"> 95</span> <spanclass="comment"> * \param[in] (x,y,z) a displacement to add to the cell's</span></div>
<divclass="line"><aname="l00097"></a><spanclass="lineno"> 97</span> <spanclass="comment"> * \param[in] filename the name of the file to write to. */</span></div>
<divclass="line"><aname="l00104"></a><spanclass="lineno"> 104</span> <spanclass="comment"> /** Outputs the cell in POV-Ray format as a mesh2 object to a</span></div>
<divclass="line"><aname="l00105"></a><spanclass="lineno"> 105</span> <spanclass="comment"> * given file.</span></div>
<divclass="line"><aname="l00106"></a><spanclass="lineno"> 106</span> <spanclass="comment"> * \param[in] (x,y,z) a displacement to add to the cell's</span></div>
<divclass="line"><aname="l00108"></a><spanclass="lineno"> 108</span> <spanclass="comment"> * \param[in] filename the name of the file to write to. */</span></div>
<divclass="line"><aname="l00115"></a><spanclass="lineno"> 115</span> <spanclass="comment"> /** Outputs the cell in Gnuplot format a given file.</span></div>
<divclass="line"><aname="l00116"></a><spanclass="lineno"> 116</span> <spanclass="comment"> * \param[in] (x,y,z) a displacement to add to the cell's</span></div>
<divclass="line"><aname="l00118"></a><spanclass="lineno"> 118</span> <spanclass="comment"> * \param[in] filename the name of the file to write to. */</span></div>
<divclass="line"><aname="l00138"></a><spanclass="lineno"> 138</span> <spanclass="comment"> /** Outputs the areas of the faces.</span></div>
<divclass="line"><aname="l00139"></a><spanclass="lineno"> 139</span> <spanclass="comment"> * \param[in] fp the file handle to write to. */</span></div>
<divclass="line"><aname="l00145"></a><spanclass="lineno"> 145</span> <spanclass="comment"> /** Outputs a list of the number of sides of each face.</span></div>
<divclass="line"><aname="l00146"></a><spanclass="lineno"> 146</span> <spanclass="comment"> * \param[in] fp the file handle to write to. */</span></div>
<divclass="line"><aname="l00164"></a><spanclass="lineno"> 164</span> <spanclass="comment"> /** Outputs a list of the perimeters of each face.</span></div>
<divclass="line"><aname="l00165"></a><spanclass="lineno"> 165</span> <spanclass="comment"> * \param[in] fp the file handle to write to. */</span></div>
<divclass="line"><aname="l00171"></a><spanclass="lineno"> 171</span> <spanclass="comment"> /** Outputs a list of the perimeters of each face.</span></div>
<divclass="line"><aname="l00172"></a><spanclass="lineno"> 172</span> <spanclass="comment"> * \param[in] fp the file handle to write to. */</span></div>
<divclass="line"><aname="l00177"></a><spanclass="lineno"> 177</span> <spanclass="comment"> /** Outputs a custom string of information about the Voronoi</span></div>
<divclass="line"><aname="l00178"></a><spanclass="lineno"> 178</span> <spanclass="comment"> * cell to a file. It assumes the cell is at (0,0,0) and has a</span></div>
<divclass="line"><aname="l00179"></a><spanclass="lineno"> 179</span> <spanclass="comment"> * the default_radius associated with it.</span></div>
<divclass="line"><aname="l00180"></a><spanclass="lineno"> 180</span> <spanclass="comment"> * \param[in] format the custom format string to use.</span></div>
<divclass="line"><aname="l00181"></a><spanclass="lineno"> 181</span> <spanclass="comment"> * \param[in] fp the file handle to write to. */</span></div>
<divclass="line"><aname="l00192"></a><spanclass="lineno"> 192</span> <spanclass="comment"> /** Returns a list of IDs of neighboring particles</span></div>
<divclass="line"><aname="l00193"></a><spanclass="lineno"> 193</span> <spanclass="comment"> * corresponding to each face.</span></div>
<divclass="line"><aname="l00194"></a><spanclass="lineno"> 194</span> <spanclass="comment"> * \param[out] v a reference to a vector in which to return the</span></div>
<divclass="line"><aname="l00195"></a><spanclass="lineno"> 195</span> <spanclass="comment"> * results. If no neighbor information is</span></div>
<divclass="line"><aname="l00196"></a><spanclass="lineno"> 196</span> <spanclass="comment"> * available, a blank vector is returned. */</span></div>
<divclass="line"><aname="l00198"></a><spanclass="lineno"> 198</span> <spanclass="comment"> /** This is a virtual function that is overridden by a routine</span></div>
<divclass="line"><aname="l00199"></a><spanclass="lineno"> 199</span> <spanclass="comment"> * to print a list of IDs of neighboring particles</span></div>
<divclass="line"><aname="l00200"></a><spanclass="lineno"> 200</span> <spanclass="comment"> * corresponding to each face. By default, when no neighbor</span></div>
<divclass="line"><aname="l00201"></a><spanclass="lineno"> 201</span> <spanclass="comment"> * information is available, the routine does nothing.</span></div>
<divclass="line"><aname="l00202"></a><spanclass="lineno"> 202</span> <spanclass="comment"> * \param[in] fp the file handle to write to. */</span></div>
<divclass="line"><aname="l00204"></a><spanclass="lineno"> 204</span> <spanclass="comment"> /** This a virtual function that is overridden by a routine to</span></div>
<divclass="line"><aname="l00205"></a><spanclass="lineno"> 205</span> <spanclass="comment"> * print the neighboring particle IDs for a given vertex. By</span></div>
<divclass="line"><aname="l00206"></a><spanclass="lineno"> 206</span> <spanclass="comment"> * default, when no neighbor information is available, the</span></div>
<divclass="line"><aname="l00207"></a><spanclass="lineno"> 207</span> <spanclass="comment"> * routine does nothing.</span></div>
<divclass="line"><aname="l00208"></a><spanclass="lineno"> 208</span> <spanclass="comment"> * \param[in] i the vertex to consider. */</span></div>
<divclass="line"><aname="l00210"></a><spanclass="lineno"> 210</span> <spanclass="comment"> /** This is a simple inline function for picking out the index</span></div>
<divclass="line"><aname="l00211"></a><spanclass="lineno"> 211</span> <spanclass="comment"> * of the next edge counterclockwise at the current vertex.</span></div>
<divclass="line"><aname="l00212"></a><spanclass="lineno"> 212</span> <spanclass="comment"> * \param[in] a the index of an edge of the current vertex.</span></div>
<divclass="line"><aname="l00213"></a><spanclass="lineno"> 213</span> <spanclass="comment"> * \param[in] p the number of the vertex.</span></div>
<divclass="line"><aname="l00214"></a><spanclass="lineno"> 214</span> <spanclass="comment"> * \return 0 if a=nu[p]-1, or a+1 otherwise. */</span></div>
<divclass="line"><aname="l00216"></a><spanclass="lineno"> 216</span> <spanclass="comment"> /** This is a simple inline function for picking out the index</span></div>
<divclass="line"><aname="l00217"></a><spanclass="lineno"> 217</span> <spanclass="comment"> * of the next edge clockwise from the current vertex.</span></div>
<divclass="line"><aname="l00218"></a><spanclass="lineno"> 218</span> <spanclass="comment"> * \param[in] a the index of an edge of the current vertex.</span></div>
<divclass="line"><aname="l00219"></a><spanclass="lineno"> 219</span> <spanclass="comment"> * \param[in] p the number of the vertex.</span></div>
<divclass="line"><aname="l00220"></a><spanclass="lineno"> 220</span> <spanclass="comment"> * \return nu[p]-1 if a=0, or a-1 otherwise. */</span></div>
<divclass="line"><aname="l00223"></a><spanclass="lineno"> 223</span> <spanclass="comment"> /** This a one dimensional array that holds the current sizes</span></div>
<divclass="line"><aname="l00224"></a><spanclass="lineno"> 224</span> <spanclass="comment"> * of the memory allocations for them mep array.*/</span></div>
<divclass="line"><aname="l00226"></a><spanclass="lineno"> 226</span> <spanclass="comment"> /** This is a one dimensional array that holds the current</span></div>
<divclass="line"><aname="l00227"></a><spanclass="lineno"> 227</span> <spanclass="comment"> * number of vertices of order p that are stored in the mep[p]</span></div>
<divclass="line"><aname="l00230"></a><spanclass="lineno"> 230</span> <spanclass="comment"> /** This is a two dimensional array for holding the information</span></div>
<divclass="line"><aname="l00231"></a><spanclass="lineno"> 231</span> <spanclass="comment"> * about the edges of the Voronoi cell. mep[p] is a</span></div>
<divclass="line"><aname="l00232"></a><spanclass="lineno"> 232</span> <spanclass="comment"> * one-dimensional array for holding the edge information about</span></div>
<divclass="line"><aname="l00233"></a><spanclass="lineno"> 233</span> <spanclass="comment"> * all vertices of order p, with each vertex holding 2*p+1</span></div>
<divclass="line"><aname="l00234"></a><spanclass="lineno"> 234</span> <spanclass="comment"> * integers of information. The total number of vertices held</span></div>
<divclass="line"><aname="l00235"></a><spanclass="lineno"> 235</span> <spanclass="comment"> * on mep[p] is stored in mem[p]. If the space runs out, the</span></div>
<divclass="line"><aname="l00236"></a><spanclass="lineno"> 236</span> <spanclass="comment"> * code allocates more using the add_memory() routine. */</span></div>
<divclass="line"><aname="l00240"></a><spanclass="lineno"> 240</span> <spanclass="keywordtype">void</span><aclass="code"href="classvoro_1_1voronoicell__base.html#af2c9d916f946ba8d9c7e4c0a7e65215b">check_memory_for_copy</a>(vc_class &vc,<aclass="code"href="classvoro_1_1voronoicell__base.html"title="A class representing a single Voronoi cell.">voronoicell_base</a>* vb);</div>
<divclass="line"><aname="l00241"></a><spanclass="lineno"> 241</span> <spanclass="keywordtype">void</span><aclass="code"href="classvoro_1_1voronoicell__base.html#a47d450e9b9be0fab103f401ddcaeefac">copy</a>(<aclass="code"href="classvoro_1_1voronoicell__base.html"title="A class representing a single Voronoi cell.">voronoicell_base</a>* vb);</div>
<divclass="line"><aname="l00243"></a><spanclass="lineno"> 243</span> <spanclass="comment"> /** This is the delete stack, used to store the vertices which</span></div>
<divclass="line"><aname="l00244"></a><spanclass="lineno"> 244</span> <spanclass="comment"> * are going to be deleted during the plane cutting procedure.</span></div>
<divclass="line"><aname="l00247"></a><spanclass="lineno"> 247</span> <spanclass="comment"> /** This is the auxiliary delete stack, which has size set by</span></div>
<divclass="line"><aname="l00250"></a><spanclass="lineno"> 250</span> <spanclass="comment"> /** This stores the current memory allocation for the marginal</span></div>
<divclass="line"><aname="l00253"></a><spanclass="lineno"> 253</span> <spanclass="comment"> /** This stores the total number of marginal points which are</span></div>
<divclass="line"><aname="l00254"></a><spanclass="lineno"> 254</span> <spanclass="comment"> * currently in the buffer. */</span></div>
<divclass="line"><aname="l00256"></a><spanclass="lineno"> 256</span> <spanclass="comment"> /** This array contains a list of the marginal points, and also</span></div>
<divclass="line"><aname="l00257"></a><spanclass="lineno"> 257</span> <spanclass="comment"> * the outcomes of the marginal tests. */</span></div>
<divclass="line"><aname="l00259"></a><spanclass="lineno"> 259</span> <spanclass="comment"> /** The x coordinate of the normal vector to the test plane. */</span></div>
<divclass="line"><aname="l00261"></a><spanclass="lineno"> 261</span> <spanclass="comment"> /** The y coordinate of the normal vector to the test plane. */</span></div>
<divclass="line"><aname="l00263"></a><spanclass="lineno"> 263</span> <spanclass="comment"> /** The z coordinate of the normal vector to the test plane. */</span></div>
<divclass="line"><aname="l00265"></a><spanclass="lineno"> 265</span> <spanclass="comment"> /** The magnitude of the normal vector to the test plane. */</span></div>
<divclass="line"><aname="l00290"></a><spanclass="lineno"> 290</span> <spanclass="keyword">friend</span><spanclass="keyword">class </span><aclass="code"href="classvoro_1_1voronoicell.html"title="Extension of the voronoicell_base class to represent a Voronoi cell without neighbor information...">voronoicell</a>;</div>
<divclass="line"><aname="l00291"></a><spanclass="lineno"> 291</span> <spanclass="keyword">friend</span><spanclass="keyword">class </span><aclass="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>;</div>
<divclass="line"><aname="l00294"></a><spanclass="lineno"> 294</span> <spanclass="comment">/** \brief Extension of the voronoicell_base class to represent a Voronoi</span></div>
<divclass="line"><aname="l00295"></a><spanclass="lineno"> 295</span> <spanclass="comment"> * cell without neighbor information.</span></div>
<divclass="line"><aname="l00297"></a><spanclass="lineno"> 297</span> <spanclass="comment"> * This class is an extension of the voronoicell_base class, in cases when</span></div>
<divclass="line"><aname="l00298"></a><spanclass="lineno"> 298</span> <spanclass="comment"> * is not necessary to track the IDs of neighboring particles associated</span></div>
<divclass="line"><aname="l00299"></a><spanclass="lineno"> 299</span> <spanclass="comment"> * with each face of the Voronoi cell. */</span></div>
<divclass="line"><aname="l00300"></a><spanclass="lineno"><aclass="code"href="classvoro_1_1voronoicell.html"> 300</a></span> <spanclass="keyword">class </span><aclass="code"href="classvoro_1_1voronoicell.html"title="Extension of the voronoicell_base class to represent a Voronoi cell without neighbor information...">voronoicell</a> : <spanclass="keyword">public</span><aclass="code"href="classvoro_1_1voronoicell__base.html"title="A class representing a single Voronoi cell.">voronoicell_base</a> {</div>
<divclass="line"><aname="l00303"></a><spanclass="lineno"> 303</span> <spanclass="comment"> /** Copies the information from another voronoicell class into</span></div>
<divclass="line"><aname="l00304"></a><spanclass="lineno"> 304</span> <spanclass="comment"> * this class, extending memory allocation if necessary.</span></div>
<divclass="line"><aname="l00305"></a><spanclass="lineno"> 305</span> <spanclass="comment"> * \param[in] c the class to copy. */</span></div>
<divclass="line"><aname="l00306"></a><spanclass="lineno"><aclass="code"href="classvoro_1_1voronoicell.html#a00ff7480ad31fbf06dcca83cb0683e68"> 306</a></span> <spanclass="keyword">inline</span><spanclass="keywordtype">void</span><aclass="code"href="classvoro_1_1voronoicell.html#a00ff7480ad31fbf06dcca83cb0683e68">operator=</a>(<aclass="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>
<divclass="line"><aname="l00307"></a><spanclass="lineno"> 307</span> <aclass="code"href="classvoro_1_1voronoicell__base.html"title="A class representing a single Voronoi cell.">voronoicell_base</a>* vb((<aclass="code"href="classvoro_1_1voronoicell__base.html"title="A class representing a single Voronoi cell.">voronoicell_base</a>*) &c);</div>
<divclass="line"><aname="l00310"></a><spanclass="lineno"> 310</span> <spanclass="comment"> /** Cuts a Voronoi cell using by the plane corresponding to the</span></div>
<divclass="line"><aname="l00311"></a><spanclass="lineno"> 311</span> <spanclass="comment"> * perpendicular bisector of a particle.</span></div>
<divclass="line"><aname="l00312"></a><spanclass="lineno"> 312</span> <spanclass="comment"> * \param[in] (x,y,z) the position of the particle.</span></div>
<divclass="line"><aname="l00313"></a><spanclass="lineno"> 313</span> <spanclass="comment"> * \param[in] rsq the modulus squared of the vector.</span></div>
<divclass="line"><aname="l00314"></a><spanclass="lineno"> 314</span> <spanclass="comment"> * \param[in] p_id the plane ID, ignored for this case where no</span></div>
<divclass="line"><aname="l00315"></a><spanclass="lineno"> 315</span> <spanclass="comment"> * neighbor tracking is enabled.</span></div>
<divclass="line"><aname="l00316"></a><spanclass="lineno"> 316</span> <spanclass="comment"> * \return False if the plane cut deleted the cell entirely,</span></div>
<divclass="line"><aname="l00321"></a><spanclass="lineno"> 321</span> <spanclass="comment"> /** Cuts a Voronoi cell using by the plane corresponding to the</span></div>
<divclass="line"><aname="l00322"></a><spanclass="lineno"> 322</span> <spanclass="comment"> * perpendicular bisector of a particle.</span></div>
<divclass="line"><aname="l00323"></a><spanclass="lineno"> 323</span> <spanclass="comment"> * \param[in] (x,y,z) the position of the particle.</span></div>
<divclass="line"><aname="l00324"></a><spanclass="lineno"> 324</span> <spanclass="comment"> * \param[in] p_id the plane ID, ignored for this case where no</span></div>
<divclass="line"><aname="l00325"></a><spanclass="lineno"> 325</span> <spanclass="comment"> * neighbor tracking is enabled.</span></div>
<divclass="line"><aname="l00326"></a><spanclass="lineno"> 326</span> <spanclass="comment"> * \return False if the plane cut deleted the cell entirely,</span></div>
<divclass="line"><aname="l00332"></a><spanclass="lineno"> 332</span> <spanclass="comment"> /** Cuts a Voronoi cell using by the plane corresponding to the</span></div>
<divclass="line"><aname="l00333"></a><spanclass="lineno"> 333</span> <spanclass="comment"> * perpendicular bisector of a particle.</span></div>
<divclass="line"><aname="l00334"></a><spanclass="lineno"> 334</span> <spanclass="comment"> * \param[in] (x,y,z) the position of the particle.</span></div>
<divclass="line"><aname="l00335"></a><spanclass="lineno"> 335</span> <spanclass="comment"> * \param[in] rsq the modulus squared of the vector.</span></div>
<divclass="line"><aname="l00336"></a><spanclass="lineno"> 336</span> <spanclass="comment"> * \return False if the plane cut deleted the cell entirely,</span></div>
<divclass="line"><aname="l00341"></a><spanclass="lineno"> 341</span> <spanclass="comment"> /** Cuts a Voronoi cell using by the plane corresponding to the</span></div>
<divclass="line"><aname="l00342"></a><spanclass="lineno"> 342</span> <spanclass="comment"> * perpendicular bisector of a particle.</span></div>
<divclass="line"><aname="l00343"></a><spanclass="lineno"> 343</span> <spanclass="comment"> * \param[in] (x,y,z) the position of the particle.</span></div>
<divclass="line"><aname="l00344"></a><spanclass="lineno"> 344</span> <spanclass="comment"> * \return False if the plane cut deleted the cell entirely,</span></div>
<divclass="line"><aname="l00350"></a><spanclass="lineno"> 350</span> <spanclass="comment"> /** Initializes the Voronoi cell to be rectangular box with the</span></div>
<divclass="line"><aname="l00351"></a><spanclass="lineno"> 351</span> <spanclass="comment"> * given dimensions.</span></div>
<divclass="line"><aname="l00352"></a><spanclass="lineno"> 352</span> <spanclass="comment"> * \param[in] (xmin,xmax) the minimum and maximum x coordinates.</span></div>
<divclass="line"><aname="l00353"></a><spanclass="lineno"> 353</span> <spanclass="comment"> * \param[in] (ymin,ymax) the minimum and maximum y coordinates.</span></div>
<divclass="line"><aname="l00354"></a><spanclass="lineno"> 354</span> <spanclass="comment"> * \param[in] (zmin,zmax) the minimum and maximum z coordinates. */</span></div>
<divclass="line"><aname="l00358"></a><spanclass="lineno"> 358</span> <spanclass="comment"> /** Initializes the cell to be an octahedron with vertices at</span></div>
<divclass="line"><aname="l00359"></a><spanclass="lineno"> 359</span> <spanclass="comment"> * (l,0,0), (-l,0,0), (0,l,0), (0,-l,0), (0,0,l), and (0,0,-l).</span></div>
<divclass="line"><aname="l00360"></a><spanclass="lineno"> 360</span> <spanclass="comment"> * \param[in] l a parameter setting the size of the octahedron.</span></div>
<divclass="line"><aname="l00365"></a><spanclass="lineno"> 365</span> <spanclass="comment"> /** Initializes the cell to be a tetrahedron.</span></div>
<divclass="line"><aname="l00366"></a><spanclass="lineno"> 366</span> <spanclass="comment"> * \param[in] (x0,y0,z0) the coordinates of the first vertex.</span></div>
<divclass="line"><aname="l00367"></a><spanclass="lineno"> 367</span> <spanclass="comment"> * \param[in] (x1,y1,z1) the coordinates of the second vertex.</span></div>
<divclass="line"><aname="l00368"></a><spanclass="lineno"> 368</span> <spanclass="comment"> * \param[in] (x2,y2,z2) the coordinates of the third vertex.</span></div>
<divclass="line"><aname="l00369"></a><spanclass="lineno"> 369</span> <spanclass="comment"> * \param[in] (x3,y3,z3) the coordinates of the fourth vertex.</span></div>
<divclass="line"><aname="l00396"></a><spanclass="lineno"> 396</span> <spanclass="comment">/** \brief Extension of the voronoicell_base class to represent a Voronoi cell</span></div>
<divclass="line"><aname="l00397"></a><spanclass="lineno"> 397</span> <spanclass="comment"> * with neighbor information.</span></div>
<divclass="line"><aname="l00399"></a><spanclass="lineno"> 399</span> <spanclass="comment"> * This class is an extension of the voronoicell_base class, in cases when the</span></div>
<divclass="line"><aname="l00400"></a><spanclass="lineno"> 400</span> <spanclass="comment"> * IDs of neighboring particles associated with each face of the Voronoi cell.</span></div>
<divclass="line"><aname="l00401"></a><spanclass="lineno"> 401</span> <spanclass="comment"> * It contains additional data structures mne and ne for storing this</span></div>
<divclass="line"><aname="l00403"></a><spanclass="lineno"><aclass="code"href="classvoro_1_1voronoicell__neighbor.html"> 403</a></span> <spanclass="keyword">class </span><aclass="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> : <spanclass="keyword">public</span><aclass="code"href="classvoro_1_1voronoicell__base.html"title="A class representing a single Voronoi cell.">voronoicell_base</a> {</div>
<divclass="line"><aname="l00406"></a><spanclass="lineno"> 406</span> <spanclass="comment"> /** This two dimensional array holds the neighbor information</span></div>
<divclass="line"><aname="l00407"></a><spanclass="lineno"> 407</span> <spanclass="comment"> * associated with each vertex. mne[p] is a one dimensional</span></div>
<divclass="line"><aname="l00408"></a><spanclass="lineno"> 408</span> <spanclass="comment"> * array which holds all of the neighbor information for</span></div>
<divclass="line"><aname="l00409"></a><spanclass="lineno"> 409</span> <spanclass="comment"> * vertices of order p. */</span></div>
<divclass="line"><aname="l00411"></a><spanclass="lineno"> 411</span> <spanclass="comment"> /** This is a two dimensional array that holds the neighbor</span></div>
<divclass="line"><aname="l00412"></a><spanclass="lineno"> 412</span> <spanclass="comment"> * information associated with each vertex. ne[i] points to a</span></div>
<divclass="line"><aname="l00413"></a><spanclass="lineno"> 413</span> <spanclass="comment"> * one-dimensional array in mne[nu[i]]. ne[i][j] holds the</span></div>
<divclass="line"><aname="l00414"></a><spanclass="lineno"> 414</span> <spanclass="comment"> * neighbor information associated with the jth edge of vertex</span></div>
<divclass="line"><aname="l00415"></a><spanclass="lineno"> 415</span> <spanclass="comment"> * i. It is set to the ID number of the plane that made the</span></div>
<divclass="line"><aname="l00416"></a><spanclass="lineno"> 416</span> <spanclass="comment"> * face that is clockwise from the jth edge. */</span></div>
<divclass="line"><aname="l00420"></a><spanclass="lineno"> 420</span> <spanclass="keywordtype">void</span><aclass="code"href="classvoro_1_1voronoicell__neighbor.html#ac6036ae44845e301da1e3656e0e98403">operator=</a>(<aclass="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>
<divclass="line"><aname="l00421"></a><spanclass="lineno"> 421</span> <spanclass="keywordtype">void</span><aclass="code"href="classvoro_1_1voronoicell__neighbor.html#ac6036ae44845e301da1e3656e0e98403">operator=</a>(<aclass="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);<spanclass="comment"></span></div>
<divclass="line"><aname="l00422"></a><spanclass="lineno"> 422</span> <spanclass="comment"> /** Cuts the Voronoi cell by a particle whose center is at a</span></div>
<divclass="line"><aname="l00423"></a><spanclass="lineno"> 423</span> <spanclass="comment"> * separation of (x,y,z) from the cell center. The value of rsq</span></div>
<divclass="line"><aname="l00424"></a><spanclass="lineno"> 424</span> <spanclass="comment"> * should be initially set to \f$x^2+y^2+z^2\f$.</span></div>
<divclass="line"><aname="l00425"></a><spanclass="lineno"> 425</span> <spanclass="comment"> * \param[in] (x,y,z) the normal vector to the plane.</span></div>
<divclass="line"><aname="l00426"></a><spanclass="lineno"> 426</span> <spanclass="comment"> * \param[in] rsq the distance along this vector of the plane.</span></div>
<divclass="line"><aname="l00427"></a><spanclass="lineno"> 427</span> <spanclass="comment"> * \param[in] p_id the plane ID (for neighbor tracking only).</span></div>
<divclass="line"><aname="l00428"></a><spanclass="lineno"> 428</span> <spanclass="comment"> * \return False if the plane cut deleted the cell entirely,</span></div>
<divclass="line"><aname="l00433"></a><spanclass="lineno"> 433</span> <spanclass="comment"> /** This routine calculates the modulus squared of the vector</span></div>
<divclass="line"><aname="l00434"></a><spanclass="lineno"> 434</span> <spanclass="comment"> * before passing it to the main nplane() routine with full</span></div>
<divclass="line"><aname="l00436"></a><spanclass="lineno"> 436</span> <spanclass="comment"> * \param[in] (x,y,z) the vector to cut the cell by.</span></div>
<divclass="line"><aname="l00437"></a><spanclass="lineno"> 437</span> <spanclass="comment"> * \param[in] p_id the plane ID (for neighbor tracking only).</span></div>
<divclass="line"><aname="l00438"></a><spanclass="lineno"> 438</span> <spanclass="comment"> * \return False if the plane cut deleted the cell entirely,</span></div>
<divclass="line"><aname="l00444"></a><spanclass="lineno"> 444</span> <spanclass="comment"> /** This version of the plane routine just makes up the plane</span></div>
<divclass="line"><aname="l00445"></a><spanclass="lineno"> 445</span> <spanclass="comment"> * ID to be zero. It will only be referenced if neighbor</span></div>
<divclass="line"><aname="l00446"></a><spanclass="lineno"> 446</span> <spanclass="comment"> * tracking is enabled.</span></div>
<divclass="line"><aname="l00447"></a><spanclass="lineno"> 447</span> <spanclass="comment"> * \param[in] (x,y,z) the vector to cut the cell by.</span></div>
<divclass="line"><aname="l00448"></a><spanclass="lineno"> 448</span> <spanclass="comment"> * \param[in] rsq the modulus squared of the vector.</span></div>
<divclass="line"><aname="l00449"></a><spanclass="lineno"> 449</span> <spanclass="comment"> * \return False if the plane cut deleted the cell entirely,</span></div>
<divclass="line"><aname="l00454"></a><spanclass="lineno"> 454</span> <spanclass="comment"> /** Cuts a Voronoi cell using the influence of a particle at</span></div>
<divclass="line"><aname="l00455"></a><spanclass="lineno"> 455</span> <spanclass="comment"> * (x,y,z), first calculating the modulus squared of this</span></div>
<divclass="line"><aname="l00456"></a><spanclass="lineno"> 456</span> <spanclass="comment"> * vector before passing it to the main nplane() routine. Zero</span></div>
<divclass="line"><aname="l00457"></a><spanclass="lineno"> 457</span> <spanclass="comment"> * is supplied as the plane ID, which will be ignored unless</span></div>
<divclass="line"><aname="l00458"></a><spanclass="lineno"> 458</span> <spanclass="comment"> * neighbor tracking is enabled.</span></div>
<divclass="line"><aname="l00459"></a><spanclass="lineno"> 459</span> <spanclass="comment"> * \param[in] (x,y,z) the vector to cut the cell by.</span></div>
<divclass="line"><aname="l00460"></a><spanclass="lineno"> 460</span> <spanclass="comment"> * \return False if the plane cut deleted the cell entirely,</span></div>