Skip to content

Commit f43eaee

Browse files
authored
Merge pull request #161 from su2code/master
master -> develop
2 parents b67d3da + 78c60a8 commit f43eaee

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+757
-21
lines changed

_config.yml

+13
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,16 @@ defaults:
7676
sectionid: vandv
7777
seo:
7878
type: "WebPage"
79+
80+
- scope:
81+
path: _su2gui
82+
type: su2gui
83+
values:
84+
layout: su2gui
85+
sectionid: su2gui
86+
seo:
87+
type: "WebPage"
88+
7989
collections:
8090
docs:
8191
permalink: /:collection/:path/
@@ -89,6 +99,9 @@ collections:
8999
vandv:
90100
permalink: /:collection/:path/
91101
output: true
102+
su2gui:
103+
permalink: /:collection/:path/
104+
output: true
92105
posts:
93106
permalink: /blog/:year/:month/:day/:title/
94107
output: true

_data/su2gui.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
- title: Introduction to SU2GUI
2+
su2gui:
3+
- Introduction
4+
- Quick-Start
5+
6+
- title: Installation
7+
su2gui:
8+
- Installation
9+
10+
- title: User Guide
11+
su2gui:
12+
- Terminal-Initialization
13+
- Manage-Cases
14+
- Mesh-File
15+
- configurations
16+
- Initialization
17+
- Logs-Errors
18+
- Result-Analysis
19+
- Supported-Functionalities

_docs_v7/Container-Development.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Please note that some of the examples refer to features that are only available
4545
A container can be started using the `run` command and the name, e.g.
4646

4747
```
48-
docker run su2code/su2/build-su2
48+
docker run su2code/build-su2
4949
```
5050
You should see the following message, which means that everything works as intended:
5151
```
@@ -64,7 +64,7 @@ The containers we provide all feature entrypoint scripts, i.e. a script that is
6464

6565
A typical call where the current directory on the host is mounted and used as working directory would look like this:
6666
```
67-
docker run -ti --rm -v $PWD:/workdir/ -w /workdir --entrypoint bash su2code/su2/build-su2
67+
docker run -ti --rm -v $PWD:/workdir/ -w /workdir --entrypoint bash su2code/build-su2
6868
```
6969
Here, we also override the entrypoint in order to execute a bash shell. Note that all changes you make will be lost after you exit the container (except from changes in the working directory). Once in the bash you can simply use an existing or new clone of the repository to compile SU2 [the usual way](/docs_v7/Build-SU2-Linux-MacOS/), run a regression test script, or execute a specific regression test.
7070

@@ -93,7 +93,7 @@ Instead of checking out a fresh copy of the source code, it is also possible to
9393
```
9494
docker run -ti --rm -v ~/Documents/SU2:/workdir/src/SU2 \
9595
-v ~/Documents/SU2/bin:/workdir/install/ -w /workdir \
96-
su2code/su2/build-su2 -f "-Denable-pywrapper=true"
96+
su2code/build-su2 -f "-Denable-pywrapper=true"
9797
```
9898

9999
The binaries can then be found at `~/Documents/SU2/bin`.
@@ -110,7 +110,7 @@ The compiled binaries used for the tests must be mounted at `/install/bin`.
110110
The following command will clone the master branches of all required repositories and run the `parallel_regression.py` script:
111111
```
112112
docker run -ti --rm -v ~/Documents/SU2/bin:/workdir/install/bin \
113-
-w /workdir su2code/su2/test-su2 -t master -b master -c master -s parallel_regression.py
113+
-w /workdir su2code/test-su2 -t master -b master -c master -s parallel_regression.py
114114
```
115115

116116
Similar to the compilation script, you can use already existing clones of the repositories by mounting them at `<workdir>/src/Tutorials`, `<workdir>/src/SU2`, `<workdir>/src/TestData` and omitting the `-t`, `-b` or `-c` option, respectively.
@@ -119,11 +119,11 @@ The following example will compile SU2 using the `build-su2` container and then
119119

120120
```
121121
docker run -ti --rm -v $PWD:/workdir/ -w /workdir \
122-
su2code/su2/build-su2 -f "-Denable-pywrapper=true" -b develop
122+
su2code/build-su2 -f "-Denable-pywrapper=true" -b develop
123123
124124
docker run -ti --rm -v $PWD/install/bin:/workdir/install/bin -w /workdir \
125125
-v $PWD/src/SU2_develop:/workdir/src/SU2 \
126-
su2code/su2/test-su2 -t develop -c develop -s parallel_regression.py
126+
su2code/test-su2 -t develop -c develop -s parallel_regression.py
127127
```
128128

129129
### Running thread sanitizer tests ###

_docs_v7/Execution.md

+28-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Once downloaded and installed, and now that you know the basics for setting up y
1515
- [Discrete Adjoint Gradient Calculation (discrete_adjoint.py)](#discrete-adjoint-gradient-calculation-discreteadjointpy)
1616
- [Finite Difference Gradient Calculation (finite_differences.py)](#finite-difference-gradient-calculation-finitedifferencespy)
1717
- [Shape Optimization Script (shape_optimization.py)](#shape-optimization-script-shapeoptimizationpy)
18-
18+
- [Python wrapper scripts](#python-wrapper-scripts)
1919
---
2020

2121
## C++ Modules
@@ -109,3 +109,30 @@ Options:
109109
* `-n PARTITIONS, --partitions=PARTITIONS` number of PARTITIONS
110110
* `-g GRADIENT, --gradient=GRADIENT` Method for computing the GRADIENT (ADJOINT, DISCRETE_ADJOINT, FINDIFF, NONE)
111111
* `-q QUIET, --quiet=QUIET` True/False Quiet all SU2 output (optimizer output only)
112+
113+
### Python wrapper scripts
114+
115+
It is possible to call SU2 from python by importing it as a module. The first step is to compile SU2 with python wrapper support. For instance if your SU2 repository is in your home directory at *~/SU2*:
116+
117+
Usage: `$ ./meson.py build -Denable-pywrapper=true --prefix=~/SU2`
118+
119+
The python module will then be available in the installation folder *~/SU2/bin*. To make the SU2 python wrapper available from everywhere in the system, add the installation path to *PYTHONPATH*:
120+
121+
Usage: `export PYTHONPATH=~/SU2/bin:$PYTHONPATH`
122+
123+
You should now be able to call SU2 from a python file. A quick way to test this is by using the following command:
124+
125+
Usage: `python -c "import pysu2; print('hello world') "`
126+
127+
If you see the message *hello world* without any error messages, you can now try to run the pywrapper examples in the */Testcases/py_wrapper* subdirectory.
128+
For instance the unsteady flat plate with conjugate heat transfer. Note that the configuration files are inside the SU2 repository and the meshes for the testcases are inside the Testcases repository. We recommend to copy .cfg files to the Testcases repository and run from there.
129+
```
130+
cd ~/Testcases/py_wrapper/flatplate_unsteady_CHT
131+
cp ~/SU2/Testcases/py_wrapper/flatplate_unsteady_CHT/unsteady_CHT_FlatPlate_Conf.cfg .
132+
python launch_unsteady_CHT_FlatPlate.py -f unsteady_CHT_FlatPlate_Conf.cfg
133+
```
134+
135+
Options:
136+
* `-h, --help` show this help message and exit
137+
* `-f FILE, --file=FILE` read config from FILE
138+
* `--parallel` Specify if we need to initialize MPI

_includes/su2gui_nav.html

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
2+
{% for section in site.data.su2gui %}
3+
<div class="panel panel-default">
4+
<div class="panel-heading">
5+
<h4 class="panel-title">
6+
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse-{{forloop.index}}" aria-expanded="false" aria-controls="collapse-{{forloop.index}}">
7+
{{ section.title }}
8+
</a>
9+
</h4>
10+
</div>
11+
<div id="collapse-{{forloop.index}}" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
12+
<ul class="list-group">
13+
{% for item in section.su2gui %}
14+
{% assign item_url = item | prepend:"/su2gui/" | append:"/" %}
15+
{% assign p = site.su2gui | where:"url", item_url | first %}
16+
<a class="list-group-item {% if item_url == page.url %}active{% endif %}" href="{{ p.url | relative_url }}">{{ p.title }}</a>
17+
{% endfor %}
18+
</ul>
19+
</div>
20+
</div>
21+
{% endfor %}
22+
</div>

_includes/su2gui_section_nav.html

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{% comment %}
2+
Map grabs the doc sections, giving us an array of arrays. Join, flattens all
3+
the items to a comma delimited string. Split turns it into an array again.
4+
{% endcomment %}
5+
{% assign su2gui = site.data.su2gui | map: 'su2gui' | join: ',' | split: ',' %}
6+
7+
{% comment %}
8+
Because this is built for every page, lets find where we are in the ordered
9+
document list by comparing url strings. Then if there's something previous or
10+
next, lets build a link to it.
11+
{% endcomment %}
12+
13+
{% for document in su2gui %}
14+
{% assign document_url = document | prepend:"/su2gui/" | append:"/" %}
15+
{% if document_url == page.url %}
16+
<ul class="pager">
17+
{% if forloop.first %}
18+
<li class="previous disabled">
19+
<a>
20+
<span aria-hidden="true">&larr;</span> Previous
21+
</a>
22+
</li>
23+
{% else %}
24+
{% assign previous = forloop.index0 | minus: 1 %}
25+
{% assign previous_page = su2gui[previous] | prepend:"/su2gui/" | append:"/" %}
26+
<li class="previous">
27+
<a href="{{ previous_page | relative_url }}">
28+
<span aria-hidden="true">&larr;</span> Previous
29+
</a>
30+
</li>
31+
{% endif %}
32+
33+
{% if forloop.last %}
34+
<li class="next disabled">
35+
<a>
36+
Next <span aria-hidden="true">&rarr;</span>
37+
</a>
38+
</li>
39+
{% else %}
40+
{% assign next = forloop.index0 | plus: 1 %}
41+
{% assign next_page = su2gui[next] | prepend:"/su2gui/" | append:"/" %}
42+
<li class="next">
43+
<a href="{{ next_page | relative_url }}">
44+
Next <span aria-hidden="true">&rarr;</span>
45+
</a>
46+
</li>
47+
{% endif %}
48+
</div>
49+
<div class="clear"></div>
50+
{% break %}
51+
{% endif %}
52+
{% endfor %}

_includes/topnav.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@
1818
<li {% if page.sectionid=='docs' %} class="active" {% endif %}><a href="{{ "/docs_v7/home/" | relative_url }}">Docs</a></li>
1919
<li {% if page.sectionid=='tutorials' %} class="active" {% endif %}><a href="{{ "/tutorials/home/" | relative_url }}">Tutorials</a></li>
2020
<li {% if page.sectionid=='vandv' %} class="active" {% endif %}><a href="{{ "/vandv/home/" | relative_url }}">V&V</a></li>
21-
<li {% if page.sectionid=='forum' %} class="active" {% endif %}><a href="{{ "https://www.cfd-online.com/Forums/su2/" }}">Forum</a></li>
21+
<li {% if page.sectionid=='forum' %} class="active" {% endif %}><a href="{{ "https://www.cfd-online.com/Forums/su2/" }}">User Forum</a></li>
22+
<li {% if page.sectionid=='slack' %} class="active" {% endif %}><a href="{{ "https://join.slack.com/t/su2devteam/shared_invite/zt-af0uuqf8-8XNExKMV9G~UVsnkvi5uVA" }}">Dev Team Slack</a></li>
2223
<li {% if page.sectionid=='develop' %} class="active" {% endif %}><a href="{{ "/develop.html" relative_url }}">Develop</a></li>
24+
<li {% if page.sectionid=='su2gui' %} class="active" {% endif %}><a href="{{ "/su2gui/Introduction" relative_url }}">GUI</a></li>
2325
</ul>
2426
<div class="navbar-right">
2527
<ul class="nav navbar-nav">
2628
<li><a href="https://www.youtube.com/channel/UCxv_00gWLAQPBUnl9mGRQjA"><i class="fab fa-youtube" aria-hidden="true"></i></a></li>
27-
<li><a href="https://join.slack.com/t/su2devteam/shared_invite/zt-af0uuqf8-8XNExKMV9G~UVsnkvi5uVA"><i class="fab fa-slack-hash" aria-hidden="true"></i></a></li>
2829
<li><a href="{{ site.git_address }}"><i class="fab fa-github" aria-hidden="true"></i></a></li>
2930
<li><a href="https://twitter.com/intent/user?screen_name=su2code"><i class="fab fa-twitter" aria-hidden="true"></i></a></li>
3031
<li><a href="https://www.facebook.com/su2code/"><i class="fab fa-facebook" aria-hidden="true"></i></a></li>

_layouts/su2gui.html

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
layout: default
3+
---
4+
5+
<div class="container">
6+
<div class="row">
7+
<div class="col-md-4">
8+
{% include su2gui_nav.html %}
9+
</div>
10+
11+
<div class="col-md-8">
12+
<h1>{{ page.title }}</h1>
13+
<div id="markdown-content-container">{{ content }}</div>
14+
<hr>
15+
{% unless true %}
16+
<script>
17+
18+
/**
19+
* RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
20+
* LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
21+
/*
22+
var disqus_config = function () {
23+
this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable
24+
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
25+
};
26+
*/
27+
(function() { // DON'T EDIT BELOW THIS LINE
28+
var d = document, s = d.createElement('script');
29+
s.src = 'https://su2code-github-io.disqus.com/embed.js';
30+
s.setAttribute('data-timestamp', +new Date());
31+
(d.head || d.body).appendChild(s);
32+
})();
33+
</script>
34+
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
35+
36+
37+
<div id="disqus_thread"></div>
38+
<hr>
39+
{% endunless %}
40+
<p class="text-center">
41+
<br />
42+
<a target="_blank" href="{{site.git_edit_address}}/{{ page.path }}" class="btn btn-default githubEditButton" role="button">
43+
<i class="fa fa-pencil fa-lg"></i> Improve this page
44+
</a>
45+
</p>
46+
{% include su2gui_section_nav.html %}
47+
</div>
48+
49+
</div>
50+
</div>
51+
52+
<!-- Mathjax Support -->
53+
<script type="text/javascript" async
54+
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
55+
</script>

_su2gui/Build-From-Source.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: Build From Source
3+
permalink: /su2gui/Build-From-Source/
4+
---
5+
6+
This section guides you through using the source code to run SU2GUI on your device, enabling custom changes and optimizations.
7+
8+
### Minimal Requirements
9+
10+
- Python 3
11+
- SU2 Software
12+
- Python Libraries listed in [requirements.txt](Link)
13+
14+
### Installation and Setup
15+
16+
Clone the source code from our [GitHub repository](Link). Navigate to the root folder and run `su2gui.py`. You can also pass additional options or create your custom terminal arguments.
17+
18+
### Command to Start the Server
19+
20+
usage: python su2gui.py [-h] [-p PORT] [-c CASE] [-m MESH] [--config CONFIG] [--restart RESTART]

_su2gui/Configurations.md

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: Configurations
3+
permalink: /su2gui/configurations/
4+
---
5+
6+
This section explains how to use the configuration file and Config Tab in SU2GUI. For an overview of what a configuration file is, please refer to the [configuration file](../../docs_v7/Configuration-File/) page.
7+
8+
## Loading a Configuration File
9+
SU2GUI allows users to load a configuration file through both the GUI and the terminal. Loading the file is optional, as SU2GUI will create one if the user does not provide it. Before doing so, it is necessary for the user to initialize a Case. It is recommended to load the mesh file before the configuration file to set boundary condition properties and ensure proper functionality.
10+
11+
**Steps to load configuration file:**
12+
13+
1. Start a new case and load mesh file. Follow these guides for detailed steps on [starting a new case](../Manage-Cases/#starting-a-new-case) and [loading a mesh file](../Mesh-File).
14+
15+
16+
2. Click on the "Load Config File" option. ![](../../su2gui_files/User_guide/Configuration/button-config-file.png)
17+
18+
19+
3. In the pop-up window, choose the desired configuration file. ![](../../su2gui_files/User_guide/Configuration/choose-config-file.png)
20+
21+
22+
4. The configuration file should now be loaded, and the properties in the GUI should be updated accordingly. ![](../../su2gui_files/User_guide/Configuration/loaded-config-file.png)
23+
24+
25+
26+
For instructions on loading a configuration file through the terminal, refer to the guide on [ Terminal Initialization](./../Terminal-Initialization).
27+
28+
## Config Tab
29+
30+
The Config Tab allows users to analyze and modify the current state of the Configuration File. It presents the data in JSON format, which is then converted into a configuration file for SU2 when the solver is initiated.
31+
32+
![Config Tab](../../su2gui_files/User_guide/Configuration/config-tab.png)
33+
34+
### Adding New Properties
35+
36+
User can add/modify Properties in configuration file using this. Place the Key in key textbox and Value in Value textbox. By default, Key is capitalised and preceding and trailing spaces are removed from the Key. Ways to add Value for property are given below:
37+
38+
- **Adding Float/Int**: The system attempts to convert all input into a float. If the conversion fails, it proceeds with other data types.
39+
40+
- **Adding Boolean**: The system recognizes "YES," "NO," "TRUE," and "FALSE" in any case (uppercase or lowercase) and stores them as boolean values.
41+
42+
- **Adding List**: When a list is added, it creates a list of elements and checks if each element is a digit. Below are examples of correct and incorrect list formats:
43+
44+
45+
46+
| **Correct List** | (outlet1, 101325, outlet2, 101325) | [outlet1, 101325, outlet2, 101325] | outlet1, 101325, outlet2, 101325 | outlet1 101325 outlet2 101325 |
47+
|-------------------|------------------------------------|------------------------------------|---------------------------------|--------------------------------|
48+
| **Incorrect List** | (outlet1, 101325, outlet2, 101325 | outlet1, 101325, outlet2, 101325} | outlet1, 101325 outlet2 101325 | outlet1101325 outlet2101325 |

0 commit comments

Comments
 (0)