Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
GitHub CI Documentation builder committed Oct 18, 2023
1 parent 025ee47 commit 577dacd
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 104 deletions.
96 changes: 49 additions & 47 deletions bsl__advection__vx_8hpp_source.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,53 +140,55 @@
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; ddc::ChunkSpan&lt;const double, SpatialDDom&gt; <span class="keyword">const</span> electric_field,</div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; <span class="keywordtype">double</span> <span class="keyword">const</span> dt)<span class="keyword"> const override</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="keyword"> </span>{</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; FdistribuDDom <span class="keyword">const</span> dom = allfdistribu.domain();</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; ddc::DiscreteDomain&lt;DDimV&gt; <span class="keyword">const</span> v_dom = ddc::select&lt;DDimV&gt;(dom);</div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; ddc::DiscreteDomain&lt;DDimSp&gt; <span class="keyword">const</span> sp_dom = ddc::select&lt;DDimSp&gt;(dom);</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="comment">// pre-allocate some memory to prevent allocation later in loop</span></div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; ddc::Chunk&lt;ddc::Coordinate&lt;CDimV&gt;, ddc::DiscreteDomain&lt;DDimV&gt;&gt; feet_coords(v_dom);</div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; ddc::Chunk&lt;double, ddc::DiscreteDomain&lt;DDimV&gt;&gt; contiguous_slice(v_dom);</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; std::unique_ptr&lt;IInterpolator&lt;DDimV&gt;&gt; <span class="keyword">const</span> interpolator_v_ptr</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; = m_interpolator_v.<a class="code" href="classIPreallocatableInterpolator.html#aceaa10e332a925c432a9f2f1ca1b7110">preallocate</a>();</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <a class="code" href="classIInterpolator.html">IInterpolator&lt;DDimV&gt;</a> <span class="keyword">const</span>&amp; interpolator_v = *interpolator_v_ptr;</div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; </div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; SpatialDDom <span class="keyword">const</span> spatial_dom(allfdistribu.domain());</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; </div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; <span class="keyword">auto</span> c_dom = ddc::remove_dims_of(</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; ddc::remove_dims_of(ddc::remove_dims_of(dom, sp_dom), spatial_dom),</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; v_dom);</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; <span class="keyword">using</span> DElemC = <span class="keyword">typename</span> decltype(c_dom)::discrete_element_type;</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <span class="keyword">using</span> DElemSpatial = <span class="keyword">typename</span> SpatialDDom::discrete_element_type;</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; </div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; ddc::for_each(c_dom, [&amp;](DElemC <span class="keyword">const</span> ic) {</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; ddc::for_each(sp_dom, [&amp;](DElemSp <span class="keyword">const</span> isp) {</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; <span class="keywordtype">double</span> <span class="keyword">const</span> sqrt_me_on_mspecies = std::sqrt(mass(ielec()) / mass(isp));</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; </div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; ddc::for_each(spatial_dom, [&amp;](DElemSpatial <span class="keyword">const</span> ix) {</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; <span class="comment">// compute the displacement</span></div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; <span class="keywordtype">double</span> <span class="keyword">const</span> dvx = charge(isp) * sqrt_me_on_mspecies * dt * electric_field(ix);</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; </div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; <span class="comment">// compute the coordinates of the feet</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; ddc::for_each(v_dom, [&amp;](DElemV <span class="keyword">const</span> iv) {</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; feet_coords(iv) = ddc::Coordinate&lt;CDimV&gt;(ddc::coordinate(iv) - dvx);</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; });</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; </div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <span class="comment">// copy the slice in contiguous memory</span></div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; ddc::deepcopy(contiguous_slice, allfdistribu[ic][isp][ix]);</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; </div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="comment">// build a spline representation of the data</span></div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; interpolator_v(contiguous_slice, feet_coords.span_cview());</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; </div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="comment">// copy back</span></div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; ddc::deepcopy(allfdistribu[ic][isp][ix], contiguous_slice);</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; });</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; });</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; });</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; </div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; <span class="keywordflow">return</span> allfdistribu;</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; }</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;};</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; Kokkos::Profiling::pushRegion(<span class="stringliteral">&quot;BslAdvectionVelocity&quot;</span>);</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; FdistribuDDom <span class="keyword">const</span> dom = allfdistribu.domain();</div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; ddc::DiscreteDomain&lt;DDimV&gt; <span class="keyword">const</span> v_dom = ddc::select&lt;DDimV&gt;(dom);</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; ddc::DiscreteDomain&lt;DDimSp&gt; <span class="keyword">const</span> sp_dom = ddc::select&lt;DDimSp&gt;(dom);</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; </div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; <span class="comment">// pre-allocate some memory to prevent allocation later in loop</span></div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; ddc::Chunk&lt;ddc::Coordinate&lt;CDimV&gt;, ddc::DiscreteDomain&lt;DDimV&gt;&gt; feet_coords(v_dom);</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; ddc::Chunk&lt;double, ddc::DiscreteDomain&lt;DDimV&gt;&gt; contiguous_slice(v_dom);</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; std::unique_ptr&lt;IInterpolator&lt;DDimV&gt;&gt; <span class="keyword">const</span> interpolator_v_ptr</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; = m_interpolator_v.<a class="code" href="classIPreallocatableInterpolator.html#aceaa10e332a925c432a9f2f1ca1b7110">preallocate</a>();</div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; <a class="code" href="classIInterpolator.html">IInterpolator&lt;DDimV&gt;</a> <span class="keyword">const</span>&amp; interpolator_v = *interpolator_v_ptr;</div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; </div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; SpatialDDom <span class="keyword">const</span> spatial_dom(allfdistribu.domain());</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; </div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <span class="keyword">auto</span> c_dom = ddc::remove_dims_of(</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; ddc::remove_dims_of(ddc::remove_dims_of(dom, sp_dom), spatial_dom),</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; v_dom);</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <span class="keyword">using</span> DElemC = <span class="keyword">typename</span> decltype(c_dom)::discrete_element_type;</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; <span class="keyword">using</span> DElemSpatial = <span class="keyword">typename</span> SpatialDDom::discrete_element_type;</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; </div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; ddc::for_each(c_dom, [&amp;](DElemC <span class="keyword">const</span> ic) {</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; ddc::for_each(sp_dom, [&amp;](DElemSp <span class="keyword">const</span> isp) {</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; <span class="keywordtype">double</span> <span class="keyword">const</span> sqrt_me_on_mspecies = std::sqrt(mass(ielec()) / mass(isp));</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; </div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; ddc::for_each(spatial_dom, [&amp;](DElemSpatial <span class="keyword">const</span> ix) {</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; <span class="comment">// compute the displacement</span></div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <span class="keywordtype">double</span> <span class="keyword">const</span> dvx = charge(isp) * sqrt_me_on_mspecies * dt * electric_field(ix);</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; </div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="comment">// compute the coordinates of the feet</span></div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; ddc::for_each(v_dom, [&amp;](DElemV <span class="keyword">const</span> iv) {</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; feet_coords(iv) = ddc::Coordinate&lt;CDimV&gt;(ddc::coordinate(iv) - dvx);</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; });</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; </div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; <span class="comment">// copy the slice in contiguous memory</span></div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; ddc::deepcopy(contiguous_slice, allfdistribu[ic][isp][ix]);</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; </div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; <span class="comment">// build a spline representation of the data</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; interpolator_v(contiguous_slice, feet_coords.span_cview());</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; </div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; <span class="comment">// copy back</span></div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; ddc::deepcopy(allfdistribu[ic][isp][ix], contiguous_slice);</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; });</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; });</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; });</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; </div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; Kokkos::Profiling::popRegion();</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="keywordflow">return</span> allfdistribu;</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; }</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;};</div>
<div class="ttc" id="aclassBslAdvectionVelocity_html"><div class="ttname"><a href="classBslAdvectionVelocity.html">BslAdvectionVelocity</a></div><div class="ttdef"><b>Definition:</b> bsl_advection_vx.hpp:14</div></div>
<div class="ttc" id="aclassIAdvectionVelocity_html"><div class="ttname"><a href="classIAdvectionVelocity.html">IAdvectionVelocity</a></div><div class="ttdef"><b>Definition:</b> iadvectionvx.hpp:9</div></div>
<div class="ttc" id="aclassIInterpolator_html"><div class="ttname"><a href="classIInterpolator.html">IInterpolator</a></div><div class="ttdoc">A class which provides an interpolating function.</div><div class="ttdef"><b>Definition:</b> i_interpolator.hpp:18</div></div>
Expand Down
Loading

0 comments on commit 577dacd

Please sign in to comment.