Page MenuHomec4science

system_8hh_source.html
No OneTemporary

File Metadata

Created
Wed, Nov 27, 11:18

system_8hh_source.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>particles: system.hh Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">particles
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">system.hh</div> </div>
</div><!--header-->
<div class="contents">
<a href="system_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>&#160;<span class="preprocessor">#ifndef __SYSTEM__HH__</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="preprocessor">#define __SYSTEM__HH__</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;</div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment">/* -------------------------------------------------------------------------- */</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="my__types_8hh.html">my_types.hh</a>&quot;</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="particle_8hh.html">particle.hh</a>&quot;</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="preprocessor">#include &lt;memory&gt;</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment">/* -------------------------------------------------------------------------- */</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;</div><div class="line"><a name="l00012"></a><span class="lineno"><a class="line" href="class_system.html"> 12</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_system.html">System</a> {</div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;</div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160; <span class="keyword">virtual</span> <a class="code" href="class_system.html#ad652aa3c77ed19131f598a7355c0939a">~System</a>() = <span class="keywordflow">default</span>;</div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;</div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160; <span class="comment">// List of particle pointers</span></div><div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="class_system.html#a481a94085f38a64e40d219f2a03822d5"> 18</a></span>&#160; <span class="keyword">using</span> <a class="code" href="class_system.html#a481a94085f38a64e40d219f2a03822d5">ParticleList</a> = std::vector&lt;std::shared_ptr&lt;Particle&gt;&gt;;</div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;</div><div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="class_system.html#a8b8b7f24d3953b4cb54160095a3abec7"> 21</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_system.html#a8b8b7f24d3953b4cb54160095a3abec7">removeParticle</a>(<a class="code" href="my__types_8hh.html#a9cc0620fb2e91b51587c6936060d4161">UInt</a> particle){};</div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160; <a class="code" href="class_particle.html">Particle</a>&amp; <a class="code" href="class_system.html#ac52821aa899673c76e96d5b4c8bb93c1">getParticle</a>(<a class="code" href="my__types_8hh.html#a9cc0620fb2e91b51587c6936060d4161">UInt</a> i);</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_system.html#acc785b5442c8709559d86cf88a75a729">addParticle</a>(<span class="keyword">const</span> std::shared_ptr&lt;Particle&gt;&amp; new_particle);</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; <a class="code" href="my__types_8hh.html#a9cc0620fb2e91b51587c6936060d4161">UInt</a> <a class="code" href="class_system.html#a6f0a4333dedadef8f92728716efd292a">getNbParticles</a>();</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="struct_system_1_1iterator.html"> 30</a></span>&#160; <span class="keyword">struct </span><a class="code" href="struct_system_1_1iterator.html">iterator</a> : ParticleList::iterator {</div><div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="struct_system_1_1iterator.html#ac5bc23b92dd44f41505184ac007fe923"> 31</a></span>&#160; <a class="code" href="struct_system_1_1iterator.html#ac5bc23b92dd44f41505184ac007fe923">iterator</a>(<span class="keyword">const</span> ParticleList::iterator&amp; it) : <a class="code" href="class_system.html#a481a94085f38a64e40d219f2a03822d5">ParticleList</a>::<a class="code" href="struct_system_1_1iterator.html">iterator</a>(it) {}</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="struct_system_1_1iterator.html#af43274be526948414ad247d0ff0381d1"> 34</a></span>&#160; <a class="code" href="class_particle.html">Particle</a>&amp; <a class="code" href="struct_system_1_1iterator.html#af43274be526948414ad247d0ff0381d1">operator*</a>() { <span class="keywordflow">return</span> *<a class="code" href="vector_8hh.html#ae2a4a40bc4d791a05129b4c1f3ad28f0">ParticleList::iterator::operator*</a>(); }</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; };</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; <span class="comment">// Iterators</span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="class_system.html#a204326f562adf97adafc91b4c599bc38"> 39</a></span>&#160; <span class="keyword">auto</span> <a class="code" href="class_system.html#a204326f562adf97adafc91b4c599bc38">begin</a>() { <span class="keywordflow">return</span> <a class="code" href="struct_system_1_1iterator.html#ac5bc23b92dd44f41505184ac007fe923">iterator</a>(<a class="code" href="class_system.html#a75b0005e56d777203aa7e5a62b91da1b">list_particles</a>.begin()); }</div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="class_system.html#a85e281555ce67b04f345e32eba6be80e"> 40</a></span>&#160; <span class="keyword">auto</span> <a class="code" href="class_system.html#a85e281555ce67b04f345e32eba6be80e">end</a>() { <span class="keywordflow">return</span> <a class="code" href="struct_system_1_1iterator.html#ac5bc23b92dd44f41505184ac007fe923">iterator</a>(<a class="code" href="class_system.html#a75b0005e56d777203aa7e5a62b91da1b">list_particles</a>.end()); }</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;<span class="keyword">protected</span>:</div><div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="class_system.html#a75b0005e56d777203aa7e5a62b91da1b"> 43</a></span>&#160; <a class="code" href="class_system.html#a481a94085f38a64e40d219f2a03822d5">ParticleList</a> <a class="code" href="class_system.html#a75b0005e56d777203aa7e5a62b91da1b">list_particles</a>;</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;};</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;<span class="comment">/* -------------------------------------------------------------------------- */</span></div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;<span class="preprocessor">#endif //__SYSTEM__HH__</span></div><div class="ttc" id="class_system_html_a6f0a4333dedadef8f92728716efd292a"><div class="ttname"><a href="class_system.html#a6f0a4333dedadef8f92728716efd292a">System::getNbParticles</a></div><div class="ttdeci">UInt getNbParticles()</div><div class="ttdoc">Get number of particles. </div><div class="ttdef"><b>Definition:</b> system.cc:19</div></div>
<div class="ttc" id="struct_system_1_1iterator_html_af43274be526948414ad247d0ff0381d1"><div class="ttname"><a href="struct_system_1_1iterator.html#af43274be526948414ad247d0ff0381d1">System::iterator::operator*</a></div><div class="ttdeci">Particle &amp; operator*()</div><div class="ttdoc">Access the underlying particle. </div><div class="ttdef"><b>Definition:</b> system.hh:34</div></div>
<div class="ttc" id="class_particle_html"><div class="ttname"><a href="class_particle.html">Particle</a></div><div class="ttdoc">Particle base class. </div><div class="ttdef"><b>Definition:</b> particle.hh:9</div></div>
<div class="ttc" id="vector_8hh_html_ae2a4a40bc4d791a05129b4c1f3ad28f0"><div class="ttname"><a href="vector_8hh.html#ae2a4a40bc4d791a05129b4c1f3ad28f0">operator*</a></div><div class="ttdeci">Vector operator*(const Vector &amp;a, Real val)</div><div class="ttdef"><b>Definition:</b> vector_inline.hh:71</div></div>
<div class="ttc" id="class_system_html_a204326f562adf97adafc91b4c599bc38"><div class="ttname"><a href="class_system.html#a204326f562adf97adafc91b4c599bc38">System::begin</a></div><div class="ttdeci">auto begin()</div><div class="ttdef"><b>Definition:</b> system.hh:39</div></div>
<div class="ttc" id="class_system_html_a85e281555ce67b04f345e32eba6be80e"><div class="ttname"><a href="class_system.html#a85e281555ce67b04f345e32eba6be80e">System::end</a></div><div class="ttdeci">auto end()</div><div class="ttdef"><b>Definition:</b> system.hh:40</div></div>
<div class="ttc" id="class_system_html_ac52821aa899673c76e96d5b4c8bb93c1"><div class="ttname"><a href="class_system.html#ac52821aa899673c76e96d5b4c8bb93c1">System::getParticle</a></div><div class="ttdeci">Particle &amp; getParticle(UInt i)</div><div class="ttdoc">Get particle for specific id. </div><div class="ttdef"><b>Definition:</b> system.cc:3</div></div>
<div class="ttc" id="struct_system_1_1iterator_html"><div class="ttname"><a href="struct_system_1_1iterator.html">System::iterator</a></div><div class="ttdoc">Iterator class to erase the unique pointer on Particle. </div><div class="ttdef"><b>Definition:</b> system.hh:30</div></div>
<div class="ttc" id="class_system_html_a8b8b7f24d3953b4cb54160095a3abec7"><div class="ttname"><a href="class_system.html#a8b8b7f24d3953b4cb54160095a3abec7">System::removeParticle</a></div><div class="ttdeci">void removeParticle(UInt particle)</div><div class="ttdoc">Remove particle from vector. </div><div class="ttdef"><b>Definition:</b> system.hh:21</div></div>
<div class="ttc" id="particle_8hh_html"><div class="ttname"><a href="particle_8hh.html">particle.hh</a></div></div>
<div class="ttc" id="class_system_html_a75b0005e56d777203aa7e5a62b91da1b"><div class="ttname"><a href="class_system.html#a75b0005e56d777203aa7e5a62b91da1b">System::list_particles</a></div><div class="ttdeci">ParticleList list_particles</div><div class="ttdef"><b>Definition:</b> system.hh:43</div></div>
<div class="ttc" id="class_system_html_ad652aa3c77ed19131f598a7355c0939a"><div class="ttname"><a href="class_system.html#ad652aa3c77ed19131f598a7355c0939a">System::~System</a></div><div class="ttdeci">virtual ~System()=default</div></div>
<div class="ttc" id="my__types_8hh_html"><div class="ttname"><a href="my__types_8hh.html">my_types.hh</a></div></div>
<div class="ttc" id="struct_system_1_1iterator_html_ac5bc23b92dd44f41505184ac007fe923"><div class="ttname"><a href="struct_system_1_1iterator.html#ac5bc23b92dd44f41505184ac007fe923">System::iterator::iterator</a></div><div class="ttdeci">iterator(const ParticleList::iterator &amp;it)</div><div class="ttdef"><b>Definition:</b> system.hh:31</div></div>
<div class="ttc" id="class_system_html_a481a94085f38a64e40d219f2a03822d5"><div class="ttname"><a href="class_system.html#a481a94085f38a64e40d219f2a03822d5">System::ParticleList</a></div><div class="ttdeci">std::vector&lt; std::shared_ptr&lt; Particle &gt; &gt; ParticleList</div><div class="ttdef"><b>Definition:</b> system.hh:18</div></div>
<div class="ttc" id="class_system_html"><div class="ttname"><a href="class_system.html">System</a></div><div class="ttdoc">Container for particles. </div><div class="ttdef"><b>Definition:</b> system.hh:12</div></div>
<div class="ttc" id="my__types_8hh_html_a9cc0620fb2e91b51587c6936060d4161"><div class="ttname"><a href="my__types_8hh.html#a9cc0620fb2e91b51587c6936060d4161">UInt</a></div><div class="ttdeci">unsigned int UInt</div><div class="ttdef"><b>Definition:</b> my_types.hh:8</div></div>
<div class="ttc" id="class_system_html_acc785b5442c8709559d86cf88a75a729"><div class="ttname"><a href="class_system.html#acc785b5442c8709559d86cf88a75a729">System::addParticle</a></div><div class="ttdeci">void addParticle(const std::shared_ptr&lt; Particle &gt; &amp;new_particle)</div><div class="ttdoc">Add a particle to the system. </div><div class="ttdef"><b>Definition:</b> system.cc:11</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>

Event Timeline