This repository has been archived by the owner on Nov 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #163 from havahol/paper_release_fdmvsfvm
Paper release fdmvsfvm
- Loading branch information
Showing
314 changed files
with
10,217 additions
and
69,472 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"```\n", | ||
"This software is part of GPU Ocean. \n", | ||
"\n", | ||
"Copyright (C) 2018, 2019 SINTEF Digital\n", | ||
"Copyright (C) 2018, 2019 Norwegian Meteorological Institute\n", | ||
"\n", | ||
"This notebook provides the description of the code found in this \n", | ||
"software package, which is provided as supplementary material to\n", | ||
"\"Evaluation of Selected Finite-Difference and Finite-Volume Approaches \n", | ||
"to Rotational Shallow-Water Flow\" \n", | ||
"by Holm, Brodtkorb, Broström, Christensen and Sætra.\n", | ||
"\n", | ||
"This program is free software: you can redistribute it and/or modify\n", | ||
"it under the terms of the GNU General Public License as published by\n", | ||
"the Free Software Foundation, either version 3 of the License, or\n", | ||
"(at your option) any later version.\n", | ||
"\n", | ||
"This program is distributed in the hope that it will be useful,\n", | ||
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n", | ||
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n", | ||
"GNU General Public License for more details.\n", | ||
"\n", | ||
"You should have received a copy of the GNU General Public License\n", | ||
"along with this program. If not, see <http://www.gnu.org/licenses/>.\n", | ||
"```" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Evaluation of Selected Finite-Difference and Finite-Volume Approaches to Rotational Shallow-Water Flow - Software Supplement " | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"This software package is provideded as a supplement to the paper *Evaluation of Selected Finite-Difference and Finite-Volume Approaches to Rotational Shallow-Water Flow* written by Håvard H. Holm, André R. Brodtkorb, Göran Broström, Kai. H. Christensen, and Martin L. Sætra" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Purpose\n", | ||
"The main purpose of this software is to provide code that set up, run, and evaluate four numerical schemes on the test cases presented in the paper, and reproduce the results. \n", | ||
"\n", | ||
"The code is written in Python, whereas the numerical schemes are implemented in CUDA and accessed through the PyCUDA library.\n", | ||
"\n", | ||
"Each test case is represented by a Jupyter Notebook. In some cases, two notebooks are provided for a single case, so that one notebook sets up the case and runs the simulations, wheareas the other do the post-processing and plotting. This way, the plots can be adjusted at any time without the need of rerunning the simulations, which may be time consuming depending on your available hardware." | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Organization of the code\n", | ||
"The code is organized as follows:\n", | ||
"- `notebooks/` contains notebooks representing the test cases for rotational shallow-water schemes\n", | ||
"- `SWESimulators/` contains python modules for each scheme and a selection of utility classes and functions.\n", | ||
"- `SWESimulators/gpu_kernels/` contains the CUDA implementations of the numerical schemes\n", | ||
"- `notebooks/matlab/` contains octave-compatible code to generate reference solutions to the rossby adjustment problem. \n", | ||
"- `tests/` contains regression tests for the numerical schemes\n", | ||
"\n", | ||
"Small result files produced for the paper can also be found under the `notebooks/`-folder, and the subfolders not mentioned above." | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Installation \n", | ||
"In order to run this code, you need to have access to a CUDA enabled GPU, with CUDA toolkit and appropriate drivers installed. If you are on Windows, you also need to have installed Visual Studios and add the path to its bin folder in PATH. This is so that pycuda can find a C++ compiler.\n", | ||
"\n", | ||
"We recommend that you set up your python environment using Conda as follows:\n", | ||
"- Install [miniconda](https://conda.io/miniconda.html) (which is a minimal subset of Anaconda)\n", | ||
"- Install jupyter notebook (unless you already have it installed on your system) by opening a terminal (or Anaconda prompt if on Windows) and type\n", | ||
" ```\n", | ||
" conda install -c conda-forge jupyter\n", | ||
" ```\n", | ||
"- Install the conda extensions that allows jupyter notebook to select conda environments as kernels:\n", | ||
" ```\n", | ||
" conda install -c conda-forge nb_conda_kernels\n", | ||
" ```\n", | ||
"- Create a new conda environment according to the environment file in this repository\n", | ||
" ```\n", | ||
" conda env create -f conda_environment.yml\n", | ||
" ```\n", | ||
"\n", | ||
"You should now be able to start a jupyter notebook server, open one of our notebooks, select the conda environment 'gpuocean' as kernel, and run the code. \n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# The test cases\n", | ||
"The notebooks are named with a CaseX-prefix to make it easy to find the relevant cases. \n", | ||
"- **Case A: Traditional Non-rotating Shallow-Water Benchmarks** This is really two test cases. First there is the lake-at-rest benchmark, before SWASHES benchmark 4.1.1. Each of them is presented in their own notebook.\n", | ||
" - `testCasesDemos/CaseA_LakeAtRest.ipynb`\n", | ||
" - `testCasesDemos/CaseA_SwashesDambreak.ipynb`\n", | ||
"- **Case B: Rossby Adjustment**. One notebook sets up the test and runs the simulations, whereas the other notebook plots results based on the generated results, or existing simulation results available for download. The reference solution can be obtained from one of the octave-files.\n", | ||
" - `testCasesDemos/CaseB_RossbyAdjustment.ipynb`\n", | ||
" - `testCasesDemos/CaseB_RossbyAdjustment_Plotting.ipynb`\n", | ||
" - `testCasesDemos/matlab/python_like_steady_state.m`\n", | ||
"- **Case C: The Adjustment Problem for Variable Rossby Radius of Deformation** One notebook sets up the test and run simulations, whereas the other read results and produces plots. Reference solution obtained from octave scripts.\n", | ||
" - `testCasesDemos/CaseC_VariableRossbyRadius.ipynb`\n", | ||
" - `testCasesDemos/CaseC_VariableRossbyRadius_Plotting.ipynb`\n", | ||
" - `testCasesDemos/matlab/variable_depth_steady_state.m`\n", | ||
"- **Case D: Kelvin Waves** One notebook that sets up the test cases, runs the simulations and plots the results.\n", | ||
" - `testCasesDemos/CaseD_Kelvin.ipynb`\n", | ||
"- **Case E: Planetary Rossby Waves** One notebook sets up use cases and runs simulations, the other reads and visualize results.\n", | ||
" - `testCasesDemos/CaseE_PlanetaryRossbyWaves.ipynb`\n", | ||
" - `testCasesDemos/CaseE_F_RossbyWaves_Plotter.ipynb`\n", | ||
"- **Case F: Topographic Rossby Waves** One notebook sets up use cases and runs simulations, the other reads and visualize results.\n", | ||
" - `testCasesDemos/CaseF_TopographicRossbyWaves.ipynb`\n", | ||
" - `testCasesDemos/CaseE_F_RossbyWaves_Plotter.ipynb`\n", | ||
"- **Numerical order:** One notebook present the experimental setup to investigate convergence rates for the four numerical schemes.\n", | ||
" - `testCasesDemos/NumericalOrder.ipynb`" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 2", | ||
"language": "python", | ||
"name": "python2" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 2 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython2", | ||
"version": "2.7.12" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
5 changes: 3 additions & 2 deletions
5
...cean/SWESimulators/BaseDrifterEnsemble.py → SWESimulators/BaseDrifterEnsemble.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 7 additions & 3 deletions
10
gpu_ocean/SWESimulators/BathymetryAndICs.py → SWESimulators/BathymetryAndICs.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 7 additions & 3 deletions
10
gpu_ocean/SWESimulators/CDKLM16.py → SWESimulators/CDKLM16.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
gpu_ocean/SWESimulators/IPythonMagic.py → SWESimulators/IPythonMagic.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
...ocean/SWESimulators/OceanNoiseEnsemble.py → SWESimulators/OceanNoiseEnsemble.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletions
7
gpu_ocean/SWESimulators/OceanStateNoise.py → SWESimulators/OceanStateNoise.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 6 additions & 2 deletions
8
gpu_ocean/SWESimulators/PlotHelper.py → SWESimulators/PlotHelper.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.