229 lines
36 KiB
HTML
229 lines
36 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
|
<meta name="generator" content="Doxygen 1.9.6"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>Penning Trap Simulation: include/PenningTrap.hpp 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="navtree.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="resize.js"></script>
|
|
<script type="text/javascript" src="navtreedata.js"></script>
|
|
<script type="text/javascript" src="navtree.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>
|
|
<script type="text/x-mathjax-config">
|
|
MathJax.Hub.Config({
|
|
extensions: ["tex2jax.js"],
|
|
jax: ["input/TeX","output/HTML-CSS"],
|
|
});
|
|
</script>
|
|
<script type="text/javascript" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
<link href="doxygen-awesome.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 id="projectrow">
|
|
<td id="projectalign">
|
|
<div id="projectname">Penning Trap Simulation
|
|
</div>
|
|
<div id="projectbrief">Simulate particle behavior inside a Penning Trap</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.9.6 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */
|
|
</script>
|
|
<div id="main-nav"></div>
|
|
</div><!-- top -->
|
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
|
<div id="nav-tree">
|
|
<div id="nav-tree-contents">
|
|
<div id="nav-sync" class="sync"></div>
|
|
</div>
|
|
</div>
|
|
<div id="splitbar" style="-moz-user-select:none;"
|
|
class="ui-resizable-handle">
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(document).ready(function(){initNavTree('PenningTrap_8hpp_source.html',''); initResizable(); });
|
|
/* @license-end */
|
|
</script>
|
|
<div id="doc-content">
|
|
<!-- 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">
|
|
<div id="MSearchResults">
|
|
<div class="SRPage">
|
|
<div id="SRIndex">
|
|
<div id="SRResults"></div>
|
|
<div class="SRStatus" id="Loading">Loading...</div>
|
|
<div class="SRStatus" id="Searching">Searching...</div>
|
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="header">
|
|
<div class="headertitle"><div class="title">PenningTrap.hpp</div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<a href="PenningTrap_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
|
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#ifndef __PENNING_TRAP__</span></div>
|
|
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#define __PENNING_TRAP__</span></div>
|
|
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> </div>
|
|
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include <armadillo></span></div>
|
|
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include <omp.h></span></div>
|
|
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> </div>
|
|
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#include "<a class="code" href="Particle_8hpp.html">Particle.hpp</a>"</span></div>
|
|
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#include "<a class="code" href="constants_8hpp.html">constants.hpp</a>"</span></div>
|
|
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="preprocessor">#include "<a class="code" href="typedefs_8hpp.html">typedefs.hpp</a>"</span></div>
|
|
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#include "<a class="code" href="utils_8hpp.html">utils.hpp</a>"</span></div>
|
|
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> </div>
|
|
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="preprocessor">#pragma omp declare reduction(+ : vec3 : omp_out += omp_in) \</span></div>
|
|
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="preprocessor"> initializer(omp_priv = omp_orig)</span></div>
|
|
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> </div>
|
|
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"><a class="line" href="classPenningTrap.html"> 31</a></span><span class="keyword">class </span><a class="code hl_class" href="classPenningTrap.html">PenningTrap</a></div>
|
|
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span>{</div>
|
|
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="keyword">private</span>:</div>
|
|
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="classPenningTrap.html#a0cac3509aa96e71a26d3b2c902e27716"> 34</a></span> <span class="keywordtype">double</span> <a class="code hl_variable" href="classPenningTrap.html#a0cac3509aa96e71a26d3b2c902e27716">B_0</a>; </div>
|
|
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="classPenningTrap.html#a715329844d75ec4c04f8391421fb4e89"> 35</a></span> <span class="keywordtype">double</span> <a class="code hl_variable" href="classPenningTrap.html#a715329844d75ec4c04f8391421fb4e89">V_0</a>; </div>
|
|
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="classPenningTrap.html#ae915f6ad0eef1fb46530e836b6e071e5"> 36</a></span> std::function<double(<span class="keywordtype">double</span>)> <a class="code hl_variable" href="classPenningTrap.html#ae915f6ad0eef1fb46530e836b6e071e5">perturbation</a>; </div>
|
|
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"><a class="line" href="classPenningTrap.html#a66dfe89c68716b9502927b97f59c27d2"> 37</a></span> <span class="keywordtype">double</span> <a class="code hl_variable" href="classPenningTrap.html#a66dfe89c68716b9502927b97f59c27d2">d</a>; </div>
|
|
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"><a class="line" href="classPenningTrap.html#a8ca4e21291f60fde619c14099d8c4e8e"> 38</a></span> <span class="keywordtype">double</span> <a class="code hl_variable" href="classPenningTrap.html#a8ca4e21291f60fde619c14099d8c4e8e">t</a>; </div>
|
|
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="classPenningTrap.html#a0112525d9e79a472e761f8ef402a339f"> 39</a></span> std::vector<Particle> <a class="code hl_variable" href="classPenningTrap.html#a0112525d9e79a472e761f8ef402a339f">particles</a>; </div>
|
|
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="classPenningTrap.html#ae9b5afdaa5cd366e94bd294452a1eed4"> 40</a></span> <a class="code hl_typedef" href="typedefs_8hpp.html#aec69d34220fff45de238b9e01f2686af">sim_arr</a> <a class="code hl_variable" href="classPenningTrap.html#ae9b5afdaa5cd366e94bd294452a1eed4">k_v</a>; </div>
|
|
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="classPenningTrap.html#a2f168622587709b9e3c49077f0b9a640"> 42</a></span> <a class="code hl_typedef" href="typedefs_8hpp.html#aec69d34220fff45de238b9e01f2686af">sim_arr</a> <a class="code hl_variable" href="classPenningTrap.html#a2f168622587709b9e3c49077f0b9a640">k_r</a>; </div>
|
|
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> </div>
|
|
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <a class="code hl_typedef" href="typedefs_8hpp.html#a3bdfb73a02f88ae32b6128ef747c4aea">vec3</a> <a class="code hl_function" href="classPenningTrap.html#a3c0a44e4e0a94366ff609e81fe463fa2">v_func</a>(uint i, uint j, <span class="keywordtype">double</span> dt);</div>
|
|
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> </div>
|
|
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <a class="code hl_typedef" href="typedefs_8hpp.html#a3bdfb73a02f88ae32b6128ef747c4aea">vec3</a> <a class="code hl_function" href="classPenningTrap.html#a826b7fa8e709d481eb1dee7d0c2cdc08">r_func</a>(uint i, uint j, <span class="keywordtype">double</span> dt);</div>
|
|
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> </div>
|
|
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <a class="code hl_typedef" href="typedefs_8hpp.html#a3bdfb73a02f88ae32b6128ef747c4aea">vec3</a> <a class="code hl_function" href="classPenningTrap.html#a5846c8f75cdc543fd9cf0b2185a3ef22">external_E_field</a>(<a class="code hl_typedef" href="typedefs_8hpp.html#a3bdfb73a02f88ae32b6128ef747c4aea">vec3</a> r);</div>
|
|
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> </div>
|
|
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <a class="code hl_typedef" href="typedefs_8hpp.html#a3bdfb73a02f88ae32b6128ef747c4aea">vec3</a> <a class="code hl_function" href="classPenningTrap.html#a361f2c4862c90b5e8e2a2f50c6a95655">external_B_field</a>(<a class="code hl_typedef" href="typedefs_8hpp.html#a3bdfb73a02f88ae32b6128ef747c4aea">vec3</a> r);</div>
|
|
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> </div>
|
|
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <a class="code hl_typedef" href="typedefs_8hpp.html#a3bdfb73a02f88ae32b6128ef747c4aea">vec3</a> <a class="code hl_function" href="classPenningTrap.html#a7f210bb2768a5d79ced4b0df0df97598">force_on_particle</a>(uint i, uint j);</div>
|
|
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> </div>
|
|
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <a class="code hl_typedef" href="typedefs_8hpp.html#a3bdfb73a02f88ae32b6128ef747c4aea">vec3</a> <a class="code hl_function" href="classPenningTrap.html#a2c01108b52c8e2a003cf9170da9e7682">total_force_external</a>(uint i);</div>
|
|
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> </div>
|
|
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> <a class="code hl_typedef" href="typedefs_8hpp.html#a3bdfb73a02f88ae32b6128ef747c4aea">vec3</a> <a class="code hl_function" href="classPenningTrap.html#a2fe1cefbae18fa5808155ee0d2df713c">total_force_particles</a>(uint i);</div>
|
|
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> </div>
|
|
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <a class="code hl_typedef" href="typedefs_8hpp.html#a3bdfb73a02f88ae32b6128ef747c4aea">vec3</a> <a class="code hl_function" href="classPenningTrap.html#a9a301b0540078c36697880ef204afdf3">total_force</a>(uint i);</div>
|
|
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> </div>
|
|
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span><span class="keyword">public</span>:</div>
|
|
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> <a class="code hl_class" href="classPenningTrap.html">PenningTrap</a>(<span class="keywordtype">double</span> <a class="code hl_variable" href="classPenningTrap.html#a0cac3509aa96e71a26d3b2c902e27716">B_0</a> = <a class="code hl_define" href="constants_8hpp.html#a0acb682b8260ab1c60b918599864e2e5">T</a>, <span class="keywordtype">double</span> <a class="code hl_variable" href="classPenningTrap.html#a715329844d75ec4c04f8391421fb4e89">V_0</a> = (25. * <a class="code hl_define" href="constants_8hpp.html#af40a326b23c68a27cebe60f16634a2cb">V</a>) / 1000., <span class="keywordtype">double</span> <a class="code hl_variable" href="classPenningTrap.html#a66dfe89c68716b9502927b97f59c27d2">d</a> = 500.,</div>
|
|
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <span class="keywordtype">double</span> <a class="code hl_variable" href="classPenningTrap.html#a8ca4e21291f60fde619c14099d8c4e8e">t</a> = 0.);</div>
|
|
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> </div>
|
|
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <a class="code hl_class" href="classPenningTrap.html">PenningTrap</a>(uint i, <span class="keywordtype">double</span> <a class="code hl_variable" href="classPenningTrap.html#a0cac3509aa96e71a26d3b2c902e27716">B_0</a> = <a class="code hl_define" href="constants_8hpp.html#a0acb682b8260ab1c60b918599864e2e5">T</a>, <span class="keywordtype">double</span> <a class="code hl_variable" href="classPenningTrap.html#a715329844d75ec4c04f8391421fb4e89">V_0</a> = (25. * <a class="code hl_define" href="constants_8hpp.html#af40a326b23c68a27cebe60f16634a2cb">V</a>) / 1000.,</div>
|
|
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> <span class="keywordtype">double</span> <a class="code hl_variable" href="classPenningTrap.html#a66dfe89c68716b9502927b97f59c27d2">d</a> = 500., <span class="keywordtype">double</span> <a class="code hl_variable" href="classPenningTrap.html#a8ca4e21291f60fde619c14099d8c4e8e">t</a> = 0.);</div>
|
|
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> </div>
|
|
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> <a class="code hl_class" href="classPenningTrap.html">PenningTrap</a>(std::vector<Particle> <a class="code hl_variable" href="classPenningTrap.html#a0112525d9e79a472e761f8ef402a339f">particles</a>, <span class="keywordtype">double</span> <a class="code hl_variable" href="classPenningTrap.html#a0cac3509aa96e71a26d3b2c902e27716">B_0</a> = <a class="code hl_define" href="constants_8hpp.html#a0acb682b8260ab1c60b918599864e2e5">T</a>,</div>
|
|
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> <span class="keywordtype">double</span> <a class="code hl_variable" href="classPenningTrap.html#a715329844d75ec4c04f8391421fb4e89">V_0</a> = (25. * <a class="code hl_define" href="constants_8hpp.html#af40a326b23c68a27cebe60f16634a2cb">V</a>) / 1000., <span class="keywordtype">double</span> <a class="code hl_variable" href="classPenningTrap.html#a66dfe89c68716b9502927b97f59c27d2">d</a> = 500., <span class="keywordtype">double</span> <a class="code hl_variable" href="classPenningTrap.html#a8ca4e21291f60fde619c14099d8c4e8e">t</a> = 0.);</div>
|
|
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> </div>
|
|
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classPenningTrap.html#a9d1d8e90ca839b928aee1ad0cd4aff43">set_pertubation</a>(<span class="keywordtype">double</span> f, <span class="keywordtype">double</span> omega_V);</div>
|
|
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> </div>
|
|
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classPenningTrap.html#aaee129f177657455348d0c8ae1441dea">reinitialize</a>(<span class="keywordtype">double</span> f, <span class="keywordtype">double</span> omega_V, <span class="keywordtype">double</span> <a class="code hl_variable" href="classPenningTrap.html#a8ca4e21291f60fde619c14099d8c4e8e">t</a> = 0.);</div>
|
|
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> </div>
|
|
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classPenningTrap.html#a6e9776ff5b149f01080800716455d7c8">add_particle</a>(<a class="code hl_class" href="classParticle.html">Particle</a> particle);</div>
|
|
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> </div>
|
|
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classPenningTrap.html#a36946152fd951b1f7c346c51ff900d8e">evolve_RK4</a>(<span class="keywordtype">double</span> dt, <span class="keywordtype">bool</span> particle_interaction = <span class="keyword">true</span>);</div>
|
|
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> </div>
|
|
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classPenningTrap.html#ab9ea97a406534bbe621a95215144875e">evolve_forward_euler</a>(<span class="keywordtype">double</span> dt, <span class="keywordtype">bool</span> particle_interaction = <span class="keyword">true</span>);</div>
|
|
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> </div>
|
|
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> <a class="code hl_struct" href="structsimulation.html">simulation_t</a> <a class="code hl_function" href="classPenningTrap.html#a7a1d9f0528a12308de25bc30718da20a">simulate</a>(<span class="keywordtype">double</span> time, uint steps, std::string method = <span class="stringliteral">"rk4"</span>,</div>
|
|
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> <span class="keywordtype">bool</span> particle_interaction = <span class="keyword">true</span>);</div>
|
|
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> </div>
|
|
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classPenningTrap.html#ad8bc4df7ab3eed53b16cfdff38e7760b">write_simulation_to_dir</a>(std::string path, <span class="keywordtype">double</span> time, uint steps,</div>
|
|
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> std::string method = <span class="stringliteral">"rk4"</span>,</div>
|
|
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span> <span class="keywordtype">bool</span> particle_interaction = <span class="keyword">true</span>);</div>
|
|
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span> </div>
|
|
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"> 228</span> <span class="keywordtype">double</span> <a class="code hl_function" href="classPenningTrap.html#ac529aa26c288f34eae184a67e6bac41f">fraction_of_particles_left</a>(<span class="keywordtype">double</span> time, uint steps,</div>
|
|
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"> 229</span> std::string method = <span class="stringliteral">"rk4"</span>,</div>
|
|
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"> 230</span> <span class="keywordtype">bool</span> particle_interaction = <span class="keyword">true</span>);</div>
|
|
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span> </div>
|
|
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code hl_class" href="classPenningTrapTest.html">PenningTrapTest</a>;</div>
|
|
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span>};</div>
|
|
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span> </div>
|
|
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"> 235</span><span class="preprocessor">#endif</span></div>
|
|
<div class="ttc" id="aParticle_8hpp_html"><div class="ttname"><a href="Particle_8hpp.html">Particle.hpp</a></div><div class="ttdoc">A class that holds the properties of a particle.</div></div>
|
|
<div class="ttc" id="aclassParticle_html"><div class="ttname"><a href="classParticle.html">Particle</a></div><div class="ttdoc">A class that holds attributes of a particle.</div><div class="ttdef"><b>Definition:</b> <a href="Particle_8hpp_source.html#l00022">Particle.hpp:23</a></div></div>
|
|
<div class="ttc" id="aclassPenningTrapTest_html"><div class="ttname"><a href="classPenningTrapTest.html">PenningTrapTest</a></div><div class="ttdoc">Test class for the Penning trap.</div><div class="ttdef"><b>Definition:</b> <a href="test__suite_8cpp_source.html#l00023">test_suite.cpp:24</a></div></div>
|
|
<div class="ttc" id="aclassPenningTrap_html"><div class="ttname"><a href="classPenningTrap.html">PenningTrap</a></div><div class="ttdoc">A class that simulates a Penning trap.</div><div class="ttdef"><b>Definition:</b> <a href="PenningTrap_8hpp_source.html#l00031">PenningTrap.hpp:32</a></div></div>
|
|
<div class="ttc" id="aclassPenningTrap_html_a0112525d9e79a472e761f8ef402a339f"><div class="ttname"><a href="classPenningTrap.html#a0112525d9e79a472e761f8ef402a339f">PenningTrap::particles</a></div><div class="ttdeci">std::vector< Particle > particles</div><div class="ttdoc">The particles in the Penning trap.</div><div class="ttdef"><b>Definition:</b> <a href="PenningTrap_8hpp_source.html#l00039">PenningTrap.hpp:39</a></div></div>
|
|
<div class="ttc" id="aclassPenningTrap_html_a0cac3509aa96e71a26d3b2c902e27716"><div class="ttname"><a href="classPenningTrap.html#a0cac3509aa96e71a26d3b2c902e27716">PenningTrap::B_0</a></div><div class="ttdeci">double B_0</div><div class="ttdoc">Magnetic field strength.</div><div class="ttdef"><b>Definition:</b> <a href="PenningTrap_8hpp_source.html#l00034">PenningTrap.hpp:34</a></div></div>
|
|
<div class="ttc" id="aclassPenningTrap_html_a2c01108b52c8e2a003cf9170da9e7682"><div class="ttname"><a href="classPenningTrap.html#a2c01108b52c8e2a003cf9170da9e7682">PenningTrap::total_force_external</a></div><div class="ttdeci">vec3 total_force_external(uint i)</div><div class="ttdoc">Calculate the total external force on a particle.</div><div class="ttdef"><b>Definition:</b> <a href="PenningTrap_8cpp_source.html#l00130">PenningTrap.cpp:130</a></div></div>
|
|
<div class="ttc" id="aclassPenningTrap_html_a2f168622587709b9e3c49077f0b9a640"><div class="ttname"><a href="classPenningTrap.html#a2f168622587709b9e3c49077f0b9a640">PenningTrap::k_r</a></div><div class="ttdeci">sim_arr k_r</div><div class="ttdef"><b>Definition:</b> <a href="PenningTrap_8hpp_source.html#l00042">PenningTrap.hpp:42</a></div></div>
|
|
<div class="ttc" id="aclassPenningTrap_html_a2fe1cefbae18fa5808155ee0d2df713c"><div class="ttname"><a href="classPenningTrap.html#a2fe1cefbae18fa5808155ee0d2df713c">PenningTrap::total_force_particles</a></div><div class="ttdeci">vec3 total_force_particles(uint i)</div><div class="ttdoc">Calculate the total force on a particle p_i from other particles.</div><div class="ttdef"><b>Definition:</b> <a href="PenningTrap_8cpp_source.html#l00143">PenningTrap.cpp:143</a></div></div>
|
|
<div class="ttc" id="aclassPenningTrap_html_a361f2c4862c90b5e8e2a2f50c6a95655"><div class="ttname"><a href="classPenningTrap.html#a361f2c4862c90b5e8e2a2f50c6a95655">PenningTrap::external_B_field</a></div><div class="ttdeci">vec3 external_B_field(vec3 r)</div><div class="ttdoc">Calculate B at point r.</div><div class="ttdef"><b>Definition:</b> <a href="PenningTrap_8cpp_source.html#l00114">PenningTrap.cpp:114</a></div></div>
|
|
<div class="ttc" id="aclassPenningTrap_html_a36946152fd951b1f7c346c51ff900d8e"><div class="ttname"><a href="classPenningTrap.html#a36946152fd951b1f7c346c51ff900d8e">PenningTrap::evolve_RK4</a></div><div class="ttdeci">void evolve_RK4(double dt, bool particle_interaction=true)</div><div class="ttdoc">Go forward one timestep using the RK4 method.</div><div class="ttdef"><b>Definition:</b> <a href="PenningTrap_8cpp_source.html#l00163">PenningTrap.cpp:163</a></div></div>
|
|
<div class="ttc" id="aclassPenningTrap_html_a3c0a44e4e0a94366ff609e81fe463fa2"><div class="ttname"><a href="classPenningTrap.html#a3c0a44e4e0a94366ff609e81fe463fa2">PenningTrap::v_func</a></div><div class="ttdeci">vec3 v_func(uint i, uint j, double dt)</div><div class="ttdoc">Helper for evolve_RK4 when calculating values.</div><div class="ttdef"><b>Definition:</b> <a href="PenningTrap_8cpp_source.html#l00063">PenningTrap.cpp:63</a></div></div>
|
|
<div class="ttc" id="aclassPenningTrap_html_a5846c8f75cdc543fd9cf0b2185a3ef22"><div class="ttname"><a href="classPenningTrap.html#a5846c8f75cdc543fd9cf0b2185a3ef22">PenningTrap::external_E_field</a></div><div class="ttdeci">vec3 external_E_field(vec3 r)</div><div class="ttdoc">Calculate E at point r.</div><div class="ttdef"><b>Definition:</b> <a href="PenningTrap_8cpp_source.html#l00106">PenningTrap.cpp:106</a></div></div>
|
|
<div class="ttc" id="aclassPenningTrap_html_a66dfe89c68716b9502927b97f59c27d2"><div class="ttname"><a href="classPenningTrap.html#a66dfe89c68716b9502927b97f59c27d2">PenningTrap::d</a></div><div class="ttdeci">double d</div><div class="ttdoc">Characteristic dimension.</div><div class="ttdef"><b>Definition:</b> <a href="PenningTrap_8hpp_source.html#l00037">PenningTrap.hpp:37</a></div></div>
|
|
<div class="ttc" id="aclassPenningTrap_html_a6e9776ff5b149f01080800716455d7c8"><div class="ttname"><a href="classPenningTrap.html#a6e9776ff5b149f01080800716455d7c8">PenningTrap::add_particle</a></div><div class="ttdeci">void add_particle(Particle particle)</div><div class="ttdoc">Add a particle to the system.</div><div class="ttdef"><b>Definition:</b> <a href="PenningTrap_8cpp_source.html#l00101">PenningTrap.cpp:101</a></div></div>
|
|
<div class="ttc" id="aclassPenningTrap_html_a715329844d75ec4c04f8391421fb4e89"><div class="ttname"><a href="classPenningTrap.html#a715329844d75ec4c04f8391421fb4e89">PenningTrap::V_0</a></div><div class="ttdeci">double V_0</div><div class="ttdoc">Applied potential.</div><div class="ttdef"><b>Definition:</b> <a href="PenningTrap_8hpp_source.html#l00035">PenningTrap.hpp:35</a></div></div>
|
|
<div class="ttc" id="aclassPenningTrap_html_a7a1d9f0528a12308de25bc30718da20a"><div class="ttname"><a href="classPenningTrap.html#a7a1d9f0528a12308de25bc30718da20a">PenningTrap::simulate</a></div><div class="ttdeci">simulation_t simulate(double time, uint steps, std::string method="rk4", bool particle_interaction=true)</div><div class="ttdoc">Simulate the particle system inside the Penning trap over a certain amount of time.</div><div class="ttdef"><b>Definition:</b> <a href="PenningTrap_8cpp_source.html#l00228">PenningTrap.cpp:228</a></div></div>
|
|
<div class="ttc" id="aclassPenningTrap_html_a7f210bb2768a5d79ced4b0df0df97598"><div class="ttname"><a href="classPenningTrap.html#a7f210bb2768a5d79ced4b0df0df97598">PenningTrap::force_on_particle</a></div><div class="ttdeci">vec3 force_on_particle(uint i, uint j)</div><div class="ttdoc">Calculate the force between 2 particles.</div><div class="ttdef"><b>Definition:</b> <a href="PenningTrap_8cpp_source.html#l00119">PenningTrap.cpp:119</a></div></div>
|
|
<div class="ttc" id="aclassPenningTrap_html_a826b7fa8e709d481eb1dee7d0c2cdc08"><div class="ttname"><a href="classPenningTrap.html#a826b7fa8e709d481eb1dee7d0c2cdc08">PenningTrap::r_func</a></div><div class="ttdeci">vec3 r_func(uint i, uint j, double dt)</div><div class="ttdoc">Helper for evolve_RK4 when calculating values.</div><div class="ttdef"><b>Definition:</b> <a href="PenningTrap_8cpp_source.html#l00082">PenningTrap.cpp:82</a></div></div>
|
|
<div class="ttc" id="aclassPenningTrap_html_a8ca4e21291f60fde619c14099d8c4e8e"><div class="ttname"><a href="classPenningTrap.html#a8ca4e21291f60fde619c14099d8c4e8e">PenningTrap::t</a></div><div class="ttdeci">double t</div><div class="ttdoc">Current time.</div><div class="ttdef"><b>Definition:</b> <a href="PenningTrap_8hpp_source.html#l00038">PenningTrap.hpp:38</a></div></div>
|
|
<div class="ttc" id="aclassPenningTrap_html_a9a301b0540078c36697880ef204afdf3"><div class="ttname"><a href="classPenningTrap.html#a9a301b0540078c36697880ef204afdf3">PenningTrap::total_force</a></div><div class="ttdeci">vec3 total_force(uint i)</div><div class="ttdoc">calculate the total force on a particle p_i.</div><div class="ttdef"><b>Definition:</b> <a href="PenningTrap_8cpp_source.html#l00155">PenningTrap.cpp:155</a></div></div>
|
|
<div class="ttc" id="aclassPenningTrap_html_a9d1d8e90ca839b928aee1ad0cd4aff43"><div class="ttname"><a href="classPenningTrap.html#a9d1d8e90ca839b928aee1ad0cd4aff43">PenningTrap::set_pertubation</a></div><div class="ttdeci">void set_pertubation(double f, double omega_V)</div><div class="ttdoc">Time dependent perturbation to V_0.</div><div class="ttdef"><b>Definition:</b> <a href="PenningTrap_8cpp_source.html#l00046">PenningTrap.cpp:46</a></div></div>
|
|
<div class="ttc" id="aclassPenningTrap_html_aaee129f177657455348d0c8ae1441dea"><div class="ttname"><a href="classPenningTrap.html#aaee129f177657455348d0c8ae1441dea">PenningTrap::reinitialize</a></div><div class="ttdeci">void reinitialize(double f, double omega_V, double t=0.)</div><div class="ttdoc">Give all particles new positions and velocities, and change t and V_0.</div><div class="ttdef"><b>Definition:</b> <a href="PenningTrap_8cpp_source.html#l00053">PenningTrap.cpp:53</a></div></div>
|
|
<div class="ttc" id="aclassPenningTrap_html_ab9ea97a406534bbe621a95215144875e"><div class="ttname"><a href="classPenningTrap.html#ab9ea97a406534bbe621a95215144875e">PenningTrap::evolve_forward_euler</a></div><div class="ttdeci">void evolve_forward_euler(double dt, bool particle_interaction=true)</div><div class="ttdoc">Go forward one timestep using the forward Euler method.</div><div class="ttdef"><b>Definition:</b> <a href="PenningTrap_8cpp_source.html#l00201">PenningTrap.cpp:201</a></div></div>
|
|
<div class="ttc" id="aclassPenningTrap_html_ac529aa26c288f34eae184a67e6bac41f"><div class="ttname"><a href="classPenningTrap.html#ac529aa26c288f34eae184a67e6bac41f">PenningTrap::fraction_of_particles_left</a></div><div class="ttdeci">double fraction_of_particles_left(double time, uint steps, std::string method="rk4", bool particle_interaction=true)</div><div class="ttdoc">Simulate and calculate what fraction of particles are still left inside the Penning trap after the si...</div><div class="ttdef"><b>Definition:</b> <a href="PenningTrap_8cpp_source.html#l00297">PenningTrap.cpp:297</a></div></div>
|
|
<div class="ttc" id="aclassPenningTrap_html_ad8bc4df7ab3eed53b16cfdff38e7760b"><div class="ttname"><a href="classPenningTrap.html#ad8bc4df7ab3eed53b16cfdff38e7760b">PenningTrap::write_simulation_to_dir</a></div><div class="ttdeci">void write_simulation_to_dir(std::string path, double time, uint steps, std::string method="rk4", bool particle_interaction=true)</div><div class="ttdoc">Simulate and write the displacement of all particles to files.</div><div class="ttdef"><b>Definition:</b> <a href="PenningTrap_8cpp_source.html#l00259">PenningTrap.cpp:259</a></div></div>
|
|
<div class="ttc" id="aclassPenningTrap_html_ae915f6ad0eef1fb46530e836b6e071e5"><div class="ttname"><a href="classPenningTrap.html#ae915f6ad0eef1fb46530e836b6e071e5">PenningTrap::perturbation</a></div><div class="ttdeci">std::function< double(double)> perturbation</div><div class="ttdoc">Time-dependent perturbation.</div><div class="ttdef"><b>Definition:</b> <a href="PenningTrap_8hpp_source.html#l00036">PenningTrap.hpp:36</a></div></div>
|
|
<div class="ttc" id="aclassPenningTrap_html_ae9b5afdaa5cd366e94bd294452a1eed4"><div class="ttname"><a href="classPenningTrap.html#ae9b5afdaa5cd366e94bd294452a1eed4">PenningTrap::k_v</a></div><div class="ttdeci">sim_arr k_v</div><div class="ttdef"><b>Definition:</b> <a href="PenningTrap_8hpp_source.html#l00040">PenningTrap.hpp:40</a></div></div>
|
|
<div class="ttc" id="aconstants_8hpp_html"><div class="ttname"><a href="constants_8hpp.html">constants.hpp</a></div><div class="ttdoc">Library of constants.</div></div>
|
|
<div class="ttc" id="aconstants_8hpp_html_a0acb682b8260ab1c60b918599864e2e5"><div class="ttname"><a href="constants_8hpp.html#a0acb682b8260ab1c60b918599864e2e5">T</a></div><div class="ttdeci">#define T</div><div class="ttdoc">1 Tesla. unit:</div><div class="ttdef"><b>Definition:</b> <a href="constants_8hpp_source.html#l00021">constants.hpp:21</a></div></div>
|
|
<div class="ttc" id="aconstants_8hpp_html_af40a326b23c68a27cebe60f16634a2cb"><div class="ttname"><a href="constants_8hpp.html#af40a326b23c68a27cebe60f16634a2cb">V</a></div><div class="ttdeci">#define V</div><div class="ttdoc">1 Volt. unit:</div><div class="ttdef"><b>Definition:</b> <a href="constants_8hpp_source.html#l00025">constants.hpp:25</a></div></div>
|
|
<div class="ttc" id="astructsimulation_html"><div class="ttname"><a href="structsimulation.html">simulation</a></div><div class="ttdoc">Typedef for PenningTrap::simulation return value.</div><div class="ttdef"><b>Definition:</b> <a href="typedefs_8hpp_source.html#l00040">typedefs.hpp:40</a></div></div>
|
|
<div class="ttc" id="atypedefs_8hpp_html"><div class="ttname"><a href="typedefs_8hpp.html">typedefs.hpp</a></div><div class="ttdoc">Useful typedefs for cleaner code.</div></div>
|
|
<div class="ttc" id="atypedefs_8hpp_html_a3bdfb73a02f88ae32b6128ef747c4aea"><div class="ttname"><a href="typedefs_8hpp.html#a3bdfb73a02f88ae32b6128ef747c4aea">vec3</a></div><div class="ttdeci">arma::vec::fixed< 3 > vec3</div><div class="ttdoc">Typedef for a fixed 3d arma vector.</div><div class="ttdef"><b>Definition:</b> <a href="typedefs_8hpp_source.html#l00023">typedefs.hpp:23</a></div></div>
|
|
<div class="ttc" id="atypedefs_8hpp_html_aec69d34220fff45de238b9e01f2686af"><div class="ttname"><a href="typedefs_8hpp.html#aec69d34220fff45de238b9e01f2686af">sim_arr</a></div><div class="ttdeci">std::vector< sim_cols > sim_arr</div><div class="ttdoc">Typedef for the result of the simulate method.</div><div class="ttdef"><b>Definition:</b> <a href="typedefs_8hpp_source.html#l00036">typedefs.hpp:36</a></div></div>
|
|
<div class="ttc" id="autils_8hpp_html"><div class="ttname"><a href="utils_8hpp.html">utils.hpp</a></div><div class="ttdoc">Function prototypes and macros that are useful.</div></div>
|
|
</div><!-- fragment --></div><!-- contents -->
|
|
</div><!-- doc-content -->
|
|
<!-- start footer part -->
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="PenningTrap_8hpp.html">PenningTrap.hpp</a></li>
|
|
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6 </li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|