Skip to content

Commit

Permalink
deploy: 6dd5598
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierr committed Jan 24, 2024
1 parent aa6b115 commit 82dbc10
Show file tree
Hide file tree
Showing 42 changed files with 228 additions and 50 deletions.
40 changes: 36 additions & 4 deletions _sources/juliabridge.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ BattMo.jl without further user intervention.



Setup and Use
=============
Start Server
============

To run simulation with Julia, we use a server. To communicate with the server we create a server manager from Matlab

Expand All @@ -31,12 +31,38 @@ To run simulation with Julia, we use a server. To communicate with the server we
This command starts the Julia server and return a manager :code:`man` which we use to pass data and run simulations.

.. note::
.. important::

Julia uses *just-in-time* compilation. It means that when we run a function for the first time in a julia session,
the code is going to be compiled. The compilation may take time (more than 10s). When using Julia Bridge, you will
notice it at the start. But, by starting a Julia server in the background where the compilation is done only once, Julia
notice it at the start.

But, **by starting a Julia server in the background** where the compilation is done only once, Julia
Bridge makes it possible to use the |battmo| julia solver at expected speed.

It is important to start the server only once and reuse it for further simulation, as described below

.. attention::

We could not start a persistent process from Matlab in Windows. The step must then be done manually, as follows

* Launch a command prompt window in Windows (NOT the powershell)
* Run the following command:

.. code:: matlab
julia --startup-file=no --project=\path\to\RunMatlab\directory -e "using Revise, DaemonMode; serve(3000, true, call_stack=true, async=true)"
Replace :code:`/path/to/RunMatlab/directory` with the path to the
:battmofile:`RunFromMatlab<Utilities/JuliaBridge/JuliaInterface/RunFromMatlab/>` directory, that is
:code:`Utilities\\JuliaBridge\\JuliaInterface\\RunFromMatlab` if your current directory is BattMo root installation
directory.

* Running this command will block the command prompt. The server will remain active until the window is closed or it
is deactivated in any other way. Calls to the server can now be made using the :code:`ServerManager` class.

Send simulation parameters
==========================

We pass data to the server using the :code:`load` method.

Expand Down Expand Up @@ -75,12 +101,18 @@ big issue for Matlab users because the Julia syntax is very close to Matlab for
implement json support for tabulated data. Tabulated data give more flexibility and could be used both in Matlab and
Julia.
Run the simulation
==================
Finally, we run the simulation
.. code:: matlab
result = man.run();
Post process the output
=======================
The matlab structure contains the simulation output, which can be processed in Matlab. For example,
.. code:: matlab
Expand Down
5 changes: 4 additions & 1 deletion advancedtopics.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="juliabridge.html">BattMo Julia bridge</a><ul>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#introduction">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#setup-and-use">Setup and Use</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#start-server">Start Server</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#send-simulation-parameters">Send simulation parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#run-the-simulation">Run the simulation</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#post-process-the-output">Post process the output</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="publishedExamples/runElectrolyser.html">Electrolyser simulation</a><ul>
Expand Down
5 changes: 4 additions & 1 deletion architecture.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="juliabridge.html">BattMo Julia bridge</a><ul>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#introduction">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#setup-and-use">Setup and Use</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#start-server">Start Server</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#send-simulation-parameters">Send simulation parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#run-the-simulation">Run the simulation</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#post-process-the-output">Post process the output</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="publishedExamples/runElectrolyser.html">Electrolyser simulation</a><ul>
Expand Down
5 changes: 4 additions & 1 deletion basicusage.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="juliabridge.html">BattMo Julia bridge</a><ul>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#introduction">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#setup-and-use">Setup and Use</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#start-server">Start Server</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#send-simulation-parameters">Send simulation parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#run-the-simulation">Run the simulation</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#post-process-the-output">Post process the output</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="publishedExamples/runElectrolyser.html">Electrolyser simulation</a><ul>
Expand Down
5 changes: 4 additions & 1 deletion bibliography.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="juliabridge.html">BattMo Julia bridge</a><ul>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#introduction">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#setup-and-use">Setup and Use</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#start-server">Start Server</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#send-simulation-parameters">Send simulation parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#run-the-simulation">Run the simulation</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#post-process-the-output">Post process the output</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="publishedExamples/runElectrolyser.html">Electrolyser simulation</a><ul>
Expand Down
5 changes: 4 additions & 1 deletion compositeElectrode.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="juliabridge.html">BattMo Julia bridge</a><ul>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#introduction">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#setup-and-use">Setup and Use</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#start-server">Start Server</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#send-simulation-parameters">Send simulation parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#run-the-simulation">Run the simulation</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#post-process-the-output">Post process the output</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="publishedExamples/runElectrolyser.html">Electrolyser simulation</a><ul>
Expand Down
5 changes: 4 additions & 1 deletion controlinput.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="juliabridge.html">BattMo Julia bridge</a><ul>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#introduction">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#setup-and-use">Setup and Use</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#start-server">Start Server</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#send-simulation-parameters">Send simulation parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#run-the-simulation">Run the simulation</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#post-process-the-output">Post process the output</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="publishedExamples/runElectrolyser.html">Electrolyser simulation</a><ul>
Expand Down
5 changes: 4 additions & 1 deletion genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="juliabridge.html">BattMo Julia bridge</a><ul>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#introduction">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#setup-and-use">Setup and Use</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#start-server">Start Server</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#send-simulation-parameters">Send simulation parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#run-the-simulation">Run the simulation</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#post-process-the-output">Post process the output</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="publishedExamples/runElectrolyser.html">Electrolyser simulation</a><ul>
Expand Down
5 changes: 4 additions & 1 deletion geometryinput.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="juliabridge.html">BattMo Julia bridge</a><ul>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#introduction">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#setup-and-use">Setup and Use</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#start-server">Start Server</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#send-simulation-parameters">Send simulation parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#run-the-simulation">Run the simulation</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#post-process-the-output">Post process the output</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="publishedExamples/runElectrolyser.html">Electrolyser simulation</a><ul>
Expand Down
5 changes: 4 additions & 1 deletion gui.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="juliabridge.html">BattMo Julia bridge</a><ul>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#introduction">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#setup-and-use">Setup and Use</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#start-server">Start Server</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#send-simulation-parameters">Send simulation parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#run-the-simulation">Run the simulation</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#post-process-the-output">Post process the output</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="publishedExamples/runElectrolyser.html">Electrolyser simulation</a><ul>
Expand Down
5 changes: 4 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="juliabridge.html">BattMo Julia bridge</a><ul>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#introduction">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#setup-and-use">Setup and Use</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#start-server">Start Server</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#send-simulation-parameters">Send simulation parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#run-the-simulation">Run the simulation</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#post-process-the-output">Post process the output</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="publishedExamples/runElectrolyser.html">Electrolyser simulation</a><ul>
Expand Down
5 changes: 4 additions & 1 deletion installation.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="juliabridge.html">BattMo Julia bridge</a><ul>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#introduction">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#setup-and-use">Setup and Use</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#start-server">Start Server</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#send-simulation-parameters">Send simulation parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#run-the-simulation">Run the simulation</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#post-process-the-output">Post process the output</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="publishedExamples/runElectrolyser.html">Electrolyser simulation</a><ul>
Expand Down
7 changes: 5 additions & 2 deletions intermediate.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="juliabridge.html">BattMo Julia bridge</a><ul>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#introduction">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#setup-and-use">Setup and Use</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#start-server">Start Server</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#send-simulation-parameters">Send simulation parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#run-the-simulation">Run the simulation</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#post-process-the-output">Post process the output</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="publishedExamples/runElectrolyser.html">Electrolyser simulation</a><ul>
Expand Down Expand Up @@ -312,7 +315,7 @@ <h2>File links and insertions with <code class="code docutils literal notranslat
<p>the <code class="code docutils literal notranslate"><span class="pre">jsonstruct</span></code> that is obtained is equivalent to the one where we would have copied and paste the content of
<a class="reference external" href="https://github.com/BattMoTeam/BattMo/blob/dev/ParameterData/MaterialProperties/Graphite/graphite.json">graphite.json</a>.</p>
<div class="sphinx_collapse docutils container">
<input class="sphinx_collapse__input" id="4b639f3d-a5e5-45f8-812c-cf88b3a702dc" name="4b639f3d-a5e5-45f8-812c-cf88b3a702dc" type="checkbox"><label class="sphinx_collapse__label" for="4b639f3d-a5e5-45f8-812c-cf88b3a702dc"><i class="sphinx_collapse__icon"></i>jsonstruct detail</label><div class="sphinx_collapse__content docutils container">
<input class="sphinx_collapse__input" id="b672f60b-bda4-4ccb-bb0d-e093c52a07d7" name="b672f60b-bda4-4ccb-bb0d-e093c52a07d7" type="checkbox"><label class="sphinx_collapse__label" for="b672f60b-bda4-4ccb-bb0d-e093c52a07d7"><i class="sphinx_collapse__icon"></i>jsonstruct detail</label><div class="sphinx_collapse__content docutils container">
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="nt">&quot;NegativeElectrode&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;Coating&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;ActiveMaterial&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
Expand Down
5 changes: 4 additions & 1 deletion json.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="juliabridge.html">BattMo Julia bridge</a><ul>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#introduction">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#setup-and-use">Setup and Use</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#start-server">Start Server</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#send-simulation-parameters">Send simulation parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#run-the-simulation">Run the simulation</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#post-process-the-output">Post process the output</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="publishedExamples/runElectrolyser.html">Electrolyser simulation</a><ul>
Expand Down
5 changes: 4 additions & 1 deletion jsonexample.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="juliabridge.html">BattMo Julia bridge</a><ul>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#introduction">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#setup-and-use">Setup and Use</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#start-server">Start Server</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#send-simulation-parameters">Send simulation parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#run-the-simulation">Run the simulation</a></li>
<li class="toctree-l2"><a class="reference internal" href="juliabridge.html#post-process-the-output">Post process the output</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="publishedExamples/runElectrolyser.html">Electrolyser simulation</a><ul>
Expand Down
Loading

0 comments on commit 82dbc10

Please sign in to comment.