Skip to content

Commit

Permalink
Merge pull request #150 from orbitfold/montecarlo_flowchart
Browse files Browse the repository at this point in the history
Montecarlo flowchart
  • Loading branch information
wkerzendorf committed Jun 3, 2014
2 parents 447b823 + 708a3dd commit 2a21cfc
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.mathjax',
'sphinx.ext.graphviz',
'numpydoc',
]

Expand Down
25 changes: 25 additions & 0 deletions docs/physics/montecarlo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,28 @@ dilution factor
W = \frac{\pi J}{\sigma_{SB} T_{R}^4} = \frac{1}{4\sigma_{SB} T_{R}^4\, \Delta t\, V} J_\textrm{estimator}.
There endeth the lesson.

Algorithm Flowchart
^^^^^^^^^^^^^^^^^^^

.. graphviz::

digraph g{
a -> b -> c
c -> d [label="d_inner or \nd_outer"]
c -> e [label="d_line"]
d -> f [label="yes"]
d -> g [label="no"]
g -> a
e -> a [label="no"]
e -> h [label="yes"]
h -> a
a [label="We have a packet.",shape=box,fillcolor="white",style="filled,rounded"];
b [label="Calculate\nd_line, d_electron,\nd_inner and d_outer.",shape=box,fillcolor="white",style="filled,rounded"];
c [label="Which distance\nis smallest?", shape="diamond", fillcolor="white", style="filled"]
d [label="Are we leaving\nsimulation area?", shape="diamond", fillcolor="white", style="filled"]
e [label="Does the\npacket interact?", shape="diamond", fillcolor="white", style="filled"]
f [label="Packet is re-absorbed\nor emitted.\nThis ends the loop.", shape="box", fillcolor="white", style="filled,rounded"]
g [label="Update line\nprobabilities.", shape="box", fillcolor="white", style="filled,rounded"]
h [label="New random direction,\nupdated energy,\nmoving packet to current position,\nupdating event random number.", shape="box", fillcolor="white", style="filled,rounded"]
}

0 comments on commit 2a21cfc

Please sign in to comment.