Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development documentation and doc updates #79

Merged
merged 24 commits into from
Oct 1, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ddde518
enable generation of develop docs
n-claes Jul 2, 2021
bb0c12d
restructured docs folder
n-claes Jul 8, 2021
476efe0
docs: text alignment + smaller font size
n-claes Jul 9, 2021
5ab3590
docs: updated installation page
n-claes Jul 26, 2021
8234820
docs: updated first problem page
n-claes Jul 26, 2021
1d63eb2
docs: updated parfile page
n-claes Jul 26, 2021
53bdddd
docs: updated equilibria page
n-claes Jul 26, 2021
4d3cdd4
docs: updated solver page
n-claes Jul 26, 2021
2d2c834
docs: updated custom submodule docs
n-claes Jul 26, 2021
86d6254
docs: added physics section
n-claes Jul 27, 2021
dc5b3c1
docs: updated page on equilibrium balance
n-claes Jul 27, 2021
6c5aa3a
docs: updated units section
n-claes Jul 27, 2021
2cbcb2a
docs: updated pylbo documentation
n-claes Jul 27, 2021
2b95df1
docs: updated testing documentation
n-claes Jul 27, 2021
02321f7
docs: removed unused images + move source docs to getting-started
n-claes Jul 28, 2021
ef5f578
docs: updated homepage
n-claes Jul 28, 2021
82d4b29
docs: updated about section
n-claes Jul 28, 2021
ec1ac55
added docs for eigenfunction subset selection
n-claes Sep 7, 2021
5481972
fixed wrong article link for gold-hoyle equilibrium
n-claes Sep 17, 2021
5dbd9ff
fixed typo in docs
n-claes Sep 17, 2021
f583571
updated doc generation script with link to stable/dev version
n-claes Sep 17, 2021
8af4bf7
updated repository readmes
n-claes Sep 22, 2021
6cd24f7
updated docs .yml
n-claes Sep 22, 2021
367dc8f
added Slack shield to readme
n-claes Sep 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: updated first problem page
  • Loading branch information
n-claes committed Sep 7, 2021
commit 82348207f52546a905f8f3f820e06519a55138d7
6 changes: 1 addition & 5 deletions docs/_data/navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ leftcontents:
children:
- title: "Installation"
url: /getting-started/installation/
- title: "Running the code"
- title: "Running your first problem"
url: /getting-started/running/
- title: "Examples"
url: /getting-started/examples/
- title: "Source code documentation"
url: /source_docs
- title: General
Expand All @@ -35,8 +33,6 @@ leftcontents:
children:
- title: "About Pylbo"
url: /pylbo/about_pylbo/
- title: "Installing Pylbo"
url: /pylbo/installing_pylbo/
- title: "Interfacing with Legolas"
url: /pylbo/legolas_interface/
- title: "Using Pylbo"
Expand Down
82 changes: 66 additions & 16 deletions docs/getting-started/running.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,78 @@
---
title: Running Legolas
layout: single
classes: wide
sidebar:
nav: "leftcontents"
toc: true
last_modified_at: 2021-02-02
toc: false
last_modified_at: 2021-07-26
---

Once you have compiled Legolas it will have placed an executable in your current working directory (or in the
source directory if you chose an [in-repository build](../installation/#1-in-repository-build)).
The executable can be run in two ways, either through direct calling or through the Pylbo interface.
Once you cloned the repository and installed the Pylbo framework you are set to run your first problem.
As an example here we will run one of the pre-implemented equilibria already present in the source code.

# 1. Running Legolas directly
Passing parameters to Legolas is done through the use of a parameter file.
If you've set up your current running directory using `setuplegolas.py`, the script will have asked to copy over the
parfile. Edit this file to your needs, take a look at the different [possibilities](../../general/parameter_file).
Afterwards you simply call the executable from the command line, passing the parfile as an option:
## Running your first problem
Navigate to a directory of your choosing where you want to place the configuration files and output, and call the setup script:
```bash
./legolas -i parfile.par
cd my_favourite_directory
setuplegolas.py
```
The output is one single file, placed by default in a subdirectory `output` which is created during compilation.
Follow the instructions, this script will do and ask you a couple of things:
1. It copies over a `CMakeLists.txt` file if not already present
2. Ask if you want to copy over `pylbo_wrapper.py`, you need this if you want to plot your results immediately after running. **Answer yes**
3. Ask if you want to copy over a parfile if none was found. **Answer no**
4. Ask if you want to copy over a default submodule template `smod_user_defined.f08` if none was found. **Answer no**

# 2. Interfacing with Pylbo
A second way to run Legolas is through the Pylbo-interface, which is extremely handy when you are doing parametric studies
or want to run multiple setups at once. This obviously requires you to have Pylbo installed, explained [here](../../pylbo/installing_pylbo).
More information on how to run Legolas like this can be found on the [Interfacing with Legolas](../../pylbo/legolas_interface) page.
Since we are running a pre-implemented equilibrium we do not need the `smod_user_defined.f08` file, this one is only needed if you want to
set up and run your own problem.

Next call the build script:
```bash
buildlegolas.sh
```
If everything went well you should have 5 items in your current working directory: a `CMakeLists.txt` file, a `build` folder, an `output` folder,
the file `pylbo_wrapper.py` and the `legolas` executable.

<i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
It is NOT recommended to create custom build or run directories _inside_ the main legolas folder.
Keeping the repository clean ensures that you don't run into merge conflicts when updating the code.
Run the setup scripts in a separate directory and let them take care of linking.
{: .notice--warning}

## Creating the configuration file
Configuring Legolas is done through use of a "parfile", where various options are passed in the form of Fortran namelists. For an overview
of different possibilities you can take a look [here](../../general/parameter_file).
During setup we answered "no" when the script asked to copy over the parfile.
For now, create a new file called `my_setup.par` in which you copy the following lines:
```fortran
&gridlist
gridpoints = 50
/

&equilibriumlist
equilibrium_type = "rayleigh_taylor"
/

&savelist
write_eigenfunctions = .true.
show_results = .true.
/
```

## Running the code
Finally call `legolas` and supply the parfile you just created as argument:
```bash
./legolas -i my_setup.par
```
This will run a setup which defines Rayleigh-Taylor instabilities in a Cartesian geometry,
the spectrum itself should correspond to case **a** in Section 13.2, p. 487 of [MHD of Laboratory and Astrophysical Plasmas](http://doi.org/10.1017/9781316403679).

When the run is completed (this should take a few seconds) the code will immediately fire up the post-processing framework since we set `show_results = .true.` in the parfile.
A few interactive figures will pop up, including the spectrum. Click on one of the eigenvalues in the figure and press `Enter`, this will draw the corresponding eigenfunctions.
You can cycle through multiple eigenfunctions using the arrow keys, right-clicking a point unselects it and pressing the `d` key clears all selected points.

The legend shows the various continuum regions, which can also be interactively toggled by clicking on their legend entries.
More information on the interface can be found [here](../../pylbo/using_pylbo/#interactive-continua--eigenfunctions).

This covers the basics of running Legolas on a single equilibrium. You can take a look at the various [pre-implemented equilibria](../../general/equilibria) and
modify the `equilibriumlist` or `paramlist` accordingly to play around with different options.