<ahref="v__base_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 base Voronoi container class. */</span></div>
<divclass="line"><aname="l00013"></a><spanclass="lineno"> 13</span> <spanclass="preprocessor">#include "<aclass="code"href="worklist_8hh.html"title="Header file for setting constants used in the block worklists that are used during cell computation...">worklist.hh</a>"</span></div>
<divclass="line"><aname="l00017"></a><spanclass="lineno"> 17</span> <spanclass="comment">/** \brief Class containing data structures common across all particle container classes.</span></div>
<divclass="line"><aname="l00019"></a><spanclass="lineno"> 19</span> <spanclass="comment"> * This class contains constants and data structures that are common across all</span></div>
<divclass="line"><aname="l00020"></a><spanclass="lineno"> 20</span> <spanclass="comment"> * particle container classes. It contains constants setting the size of the</span></div>
<divclass="line"><aname="l00021"></a><spanclass="lineno"> 21</span> <spanclass="comment"> * underlying subgrid of blocks that forms the basis of the Voronoi cell</span></div>
<divclass="line"><aname="l00022"></a><spanclass="lineno"> 22</span> <spanclass="comment"> * computations. It also constructs bound tables that are used in the Voronoi</span></div>
<divclass="line"><aname="l00023"></a><spanclass="lineno"> 23</span> <spanclass="comment"> * cell computation, and contains a number of routines that are common across</span></div>
<divclass="line"><aname="l00024"></a><spanclass="lineno"> 24</span> <spanclass="comment"> * all container classes. */</span></div>
<divclass="line"><aname="l00025"></a><spanclass="lineno"><aclass="code"href="classvoro_1_1voro__base.html"> 25</a></span> <spanclass="keyword">class </span><aclass="code"href="classvoro_1_1voro__base.html"title="Class containing data structures common across all particle container classes.">voro_base</a> {</div>
<divclass="line"><aname="l00027"></a><spanclass="lineno"> 27</span> <spanclass="comment"> /** The number of blocks in the x direction. */</span></div>
<divclass="line"><aname="l00029"></a><spanclass="lineno"> 29</span> <spanclass="comment"> /** The number of blocks in the y direction. */</span></div>
<divclass="line"><aname="l00031"></a><spanclass="lineno"> 31</span> <spanclass="comment"> /** The number of blocks in the z direction. */</span></div>
<divclass="line"><aname="l00033"></a><spanclass="lineno"> 33</span> <spanclass="comment"> /** A constant, set to the value of nx multiplied by ny, which</span></div>
<divclass="line"><aname="l00034"></a><spanclass="lineno"> 34</span> <spanclass="comment"> * is used in the routines that step through blocks in</span></div>
<divclass="line"><aname="l00037"></a><spanclass="lineno"> 37</span> <spanclass="comment"> /** A constant, set to the value of nx*ny*nz, which is used in</span></div>
<divclass="line"><aname="l00038"></a><spanclass="lineno"> 38</span> <spanclass="comment"> * the routines that step through blocks in sequence. */</span></div>
<divclass="line"><aname="l00040"></a><spanclass="lineno"> 40</span> <spanclass="comment"> /** The size of a computational block in the x direction. */</span></div>
<divclass="line"><aname="l00042"></a><spanclass="lineno"> 42</span> <spanclass="comment"> /** The size of a computational block in the y direction. */</span></div>
<divclass="line"><aname="l00044"></a><spanclass="lineno"> 44</span> <spanclass="comment"> /** The size of a computational block in the z direction. */</span></div>
<divclass="line"><aname="l00046"></a><spanclass="lineno"> 46</span> <spanclass="comment"> /** The inverse box length in the x direction. */</span></div>
<divclass="line"><aname="l00048"></a><spanclass="lineno"> 48</span> <spanclass="comment"> /** The inverse box length in the y direction. */</span></div>
<divclass="line"><aname="l00050"></a><spanclass="lineno"> 50</span> <spanclass="comment"> /** The inverse box length in the z direction. */</span></div>
<divclass="line"><aname="l00052"></a><spanclass="lineno"> 52</span> <spanclass="comment"> /** An array to hold the minimum distances associated with the</span></div>
<divclass="line"><aname="l00053"></a><spanclass="lineno"> 53</span> <spanclass="comment"> * worklists. This array is initialized during container</span></div>
<divclass="line"><aname="l00054"></a><spanclass="lineno"> 54</span> <spanclass="comment"> * construction, by the initialize_radii() routine. */</span></div>
<divclass="line"><aname="l00060"></a><spanclass="lineno"> 60</span>  ~<aclass="code"href="classvoro_1_1voro__base.html"title="Class containing data structures common across all particle container classes.">voro_base</a>() {<spanclass="keyword">delete</span> [] <aclass="code"href="classvoro_1_1voro__base.html#ab59b5feedb35ea611b05d65df1216775">mrad</a>;}</div>
<divclass="line"><aname="l00062"></a><spanclass="lineno"> 62</span> <spanclass="comment"> /** A custom int function that returns consistent stepping</span></div>
<divclass="line"><aname="l00063"></a><spanclass="lineno"> 63</span> <spanclass="comment"> * for negative numbers, so that (-1.5, -0.5, 0.5, 1.5) maps</span></div>
<divclass="line"><aname="l00064"></a><spanclass="lineno"> 64</span> <spanclass="comment"> * to (-2,-1,0,1).</span></div>
<divclass="line"><aname="l00065"></a><spanclass="lineno"> 65</span> <spanclass="comment"> * \param[in] a the number to consider.</span></div>
<divclass="line"><aname="l00066"></a><spanclass="lineno"> 66</span> <spanclass="comment"> * \return The value of the custom int operation. */</span></div>
<divclass="line"><aname="l00067"></a><spanclass="lineno"><aclass="code"href="classvoro_1_1voro__base.html#a37fd9fdedc5d415e55f3bbb22a786d8c"> 67</a></span> <spanclass="keyword">inline</span><spanclass="keywordtype">int</span><aclass="code"href="classvoro_1_1voro__base.html#a37fd9fdedc5d415e55f3bbb22a786d8c">step_int</a>(<spanclass="keywordtype">double</span> a) {<spanclass="keywordflow">return</span> a<0?int(a)-1:int(a);}<spanclass="comment"></span></div>
<divclass="line"><aname="l00068"></a><spanclass="lineno"> 68</span> <spanclass="comment"> /** A custom modulo function that returns consistent stepping</span></div>
<divclass="line"><aname="l00069"></a><spanclass="lineno"> 69</span> <spanclass="comment"> * for negative numbers. For example, (-2,-1,0,1,2) step_mod 2</span></div>
<divclass="line"><aname="l00070"></a><spanclass="lineno"> 70</span> <spanclass="comment"> * is (0,1,0,1,0).</span></div>
<divclass="line"><aname="l00071"></a><spanclass="lineno"> 71</span> <spanclass="comment"> * \param[in] (a,b) the input integers.</span></div>
<divclass="line"><aname="l00072"></a><spanclass="lineno"> 72</span> <spanclass="comment"> * \return The value of a modulo b, consistent for negative</span></div>
<divclass="line"><aname="l00074"></a><spanclass="lineno"><aclass="code"href="classvoro_1_1voro__base.html#ab432b8bee0def0666ac39a132c721135"> 74</a></span> <spanclass="keyword">inline</span><spanclass="keywordtype">int</span><aclass="code"href="classvoro_1_1voro__base.html#ab432b8bee0def0666ac39a132c721135">step_mod</a>(<spanclass="keywordtype">int</span> a,<spanclass="keywordtype">int</span> b) {<spanclass="keywordflow">return</span> a>=0?a%b:b-1-(b-1-a)%b;}<spanclass="comment"></span></div>
<divclass="line"><aname="l00075"></a><spanclass="lineno"> 75</span> <spanclass="comment"> /** A custom integer division function that returns consistent</span></div>
<divclass="line"><aname="l00076"></a><spanclass="lineno"> 76</span> <spanclass="comment"> * stepping for negative numbers. For example, (-2,-1,0,1,2)</span></div>
<divclass="line"><aname="l00077"></a><spanclass="lineno"> 77</span> <spanclass="comment"> * step_div 2 is (-1,-1,0,0,1).</span></div>
<divclass="line"><aname="l00078"></a><spanclass="lineno"> 78</span> <spanclass="comment"> * \param[in] (a,b) the input integers.</span></div>
<divclass="line"><aname="l00079"></a><spanclass="lineno"> 79</span> <spanclass="comment"> * \return The value of a div b, consistent for negative</span></div>