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

Nonorthogonal with minimal differential operators MMS test. #285

Open
wants to merge 59 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
18ac63e
Div_a_Grad_perp_nonorthog function for testing
bendudson Nov 29, 2022
809ed4b
Clang formatting
bendudson Nov 29, 2022
8156075
neutral_mixed: Use Div_a_Grad_perp_nonorthog
bendudson Nov 29, 2022
910a0c4
Merge branch 'master' into nonorthogonal
bendudson Jul 20, 2023
aadc272
Attempt to port David Bold`s MMS test to Hermes-3.
mrhardman Nov 26, 2024
8f847a9
Read Rxy and Zxy from mesh file (hypnotoad), do not write 3D R Z to f…
mrhardman Dec 10, 2024
b0f380f
Merge branch 'master' into divops-mms-test
mrhardman Dec 10, 2024
f43cc54
Initial commit of files needed to port David Bold's MMS differential …
mrhardman Dec 17, 2024
fe91bd7
Changes to makes mms.py script run.
mrhardman Dec 17, 2024
cdb7be3
Reorganise and comment the mms.py test script.
mrhardman Dec 17, 2024
fdc7d1e
Reorganise and comment the mms.py test script, remove unused code.
mrhardman Dec 17, 2024
0b6b066
Reorganise the mms.py test script, rationalise plotting.
mrhardman Dec 17, 2024
427e76e
Add script to generate circular closed-field-line equilibria for the …
mrhardman Dec 19, 2024
a05eeed
Make test BOUT.inp file use a third circular equilibrium.
mrhardman Dec 19, 2024
4685453
Restore variable path input functionality, rename main function to mo…
mrhardman Dec 19, 2024
73e5c49
Rename variables to clarify meaning.
mrhardman Dec 19, 2024
fd9192d
Modify plot to show expected convergence order, calculate convergence…
mrhardman Dec 20, 2024
12488c3
Refactor plotting so that each test is a unique plot, experiment with…
mrhardman Dec 20, 2024
86aaa19
Comment out Poisson bracket tests for now from main.cxx.
mrhardman Dec 20, 2024
e020cd4
Make modifications to test the feasibility of MMS test in a slab with…
mrhardman Jan 13, 2025
7fa43c7
Reduce main.cxx for MMS test to the minimal code for a single operator
johnomotani Jan 13, 2025
11ba89e
Initial python script for running minimal MMS test, no plotting of re…
mrhardman Jan 14, 2025
7f55ffe
Start adding i/o result testing functionality.
mrhardman Jan 14, 2025
90677d8
Bare minimum script to compare analytical and numerical results, usin…
mrhardman Jan 15, 2025
071850d
Change syntax of open_boutdataset() to use xBOUT branch fix-gridless-…
mrhardman Jan 15, 2025
ef7aeeb
Make sure g** are taken from a single source, accomodate trivial agre…
mrhardman Jan 15, 2025
e674d04
Cut down seemingly unused options in BOUT.input.template.
mrhardman Jan 15, 2025
4b5c896
Support the ability to deal with polynomial test functions.
mrhardman Jan 15, 2025
b828e7f
Changes needed to get minimal MMS test to work, showing expected rate…
mrhardman Jan 16, 2025
a4a2da4
Include C language to permit compiling of C dependencies.
mrhardman Jan 17, 2025
e4b849e
Merge branch 'divops-mms-test-minimal' into nonorthogonal-divops-mms-…
mrhardman Jan 17, 2025
b010265
Add Div_a_Grad_perp_nonorthog to run-jobs.py and main.cxx to permit e…
mrhardman Jan 17, 2025
4f2025e
Correct label on plots
mrhardman Jan 17, 2025
3d11cb7
Bugfix: correct position of parenthesis in ddz affecting g13 term in …
mrhardman Jan 21, 2025
a151fd7
Test g11 to make sure it is calculated properly.
mrhardman Jan 21, 2025
2e5e827
Bugfix: correct indexing error in Y flux affecting g12 nonorthogonal …
mrhardman Jan 21, 2025
fc3d32b
Make coefficients differ from one another in analytical prescription.…
mrhardman Jan 21, 2025
0f488c9
Make sure a = a(x,y,z) is tested. MMS test currently passes.
mrhardman Jan 22, 2025
890a9b3
Start development of version of test for automated tests.
mrhardman Jan 22, 2025
0bac5f5
Add ability for tests/mms/main.cxx to loop over a list of operators, …
mrhardman Jan 22, 2025
4bbe4ec
Generalise main.cxx and run-jobs-2.py so that list of operators and s…
mrhardman Jan 22, 2025
1aef2ee
Send rate -> order in output message.
mrhardman Jan 23, 2025
8fcd604
Refactored MMS test to allow for different metrics to be tested on op…
mrhardman Jan 23, 2025
8aae139
Remove older revisions of test for clarity in ongoing development.
mrhardman Jan 23, 2025
101697e
Make sure to make root test directory.
mrhardman Jan 23, 2025
31e9af0
Correct minor typos.
mrhardman Jan 23, 2025
17238a6
Include differential operator tests in CMakelists.txt correctly
mrhardman Jan 23, 2025
4698c47
Make interactive plotting optional.
mrhardman Jan 23, 2025
da10095
Try to change .pip_install_for_tests.sh to make sure we have the late…
mrhardman Jan 24, 2025
62b9f4a
Some documentation for the tests.
mrhardman Jan 24, 2025
607780a
Make sure plots saved in appropriate directory.
mrhardman Jan 24, 2025
cd679c8
Remove unnecessary code for MMS tests in CMakelists.txt.
mrhardman Jan 27, 2025
ca23fb9
Update src/div_ops.cxx
mrhardman Jan 27, 2025
dd95973
Update src/div_ops.cxx
mrhardman Jan 27, 2025
ab2831e
Merge branch 'nonorthogonal-divops-mms-test-minimal' of https://githu…
mrhardman Jan 27, 2025
6b11132
Revert "Update src/div_ops.cxx "
mrhardman Jan 27, 2025
7bd1012
Use David Bold suggestion to streamline `.pip_install_for_tests.sh`.
mrhardman Jan 28, 2025
70a15e1
Update docs to make it clear that xBOUT needs to be installed from gi…
mrhardman Jan 28, 2025
05ef0a9
Note on debug flags for Spack notes.
mrhardman Jan 28, 2025
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
9 changes: 4 additions & 5 deletions .pip_install_for_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ do
fi
done

# Install Hermes-3
git clone https://github.com/boutproject/xhermes.git
cd xhermes
pip3 install --user .
cd ..
# Install xBOUT to make sure we get latest master version
pip3 install --user git+https://github.com/boutproject/xBOUT.git
# Install xHermes for Hermes-3 python
pip3 install --user git+https://github.com/boutproject/xhermes.git

16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,22 @@ if(HERMES_TESTS)
add_test(NAME hermes_unit_tests COMMAND hermes_unit_tests)
target_link_libraries(hermes_unit_tests PRIVATE gtest bout++::bout++ hermes-3-lib)
endif()

# Method of manufactured solutions (MMS) tests
option(HERMES_DIVOPS_MMS_TESTS "Build the differential operator MMS tests" ON)
if(HERMES_DIVOPS_MMS_TESTS)
#TEST_SOURCES=
add_executable(hermes_mms_tests
tests/mms/main.cxx)
#${TEST_SOURCES})
target_link_libraries(hermes_mms_tests PRIVATE gtest bout++::bout++ hermes-3-lib)
add_test(NAME differential_operators_mms_orthogonal
WORKING_DIRECTORY tests/mms/
COMMAND python3 orthogonal_test.py)
add_test(NAME differential_operators_mms_nonorthogonal
WORKING_DIRECTORY tests/mms/
COMMAND python3 nonorthogonal_test.py)
endif()
endif()

# Compile-time options
Expand Down
10 changes: 8 additions & 2 deletions docs/sphinx/installation_using_spack.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,14 @@ Make a virtual python environment with
source /path/to/your-python-env/bin/activate

To install the required python libraries later.
You should install ``xhermes`` https://github.com/boutproject/xhermes with
You should install ``xbout`` https://github.com/boutproject/xBOUT
and ``xhermes`` https://github.com/boutproject/xhermes with

.. code-block:: bash

git clone https://github.com/boutproject/xBOUT.git
cd xBOUT
python3 -m pip install -e .
git clone https://github.com/boutproject/xhermes.git
cd xhermes
python3 -m pip install -e .
Expand Down Expand Up @@ -142,7 +146,7 @@ Now we are ready to install Hermes-3. First use
git clone https://github.com/bendudson/hermes-3.git
cd hermes-3

Now run
Now run the configuration command

.. code-block:: bash

Expand All @@ -161,6 +165,8 @@ Test the install by
cd build
ctest

To build in debug mode, use the flag ``-DCMAKE_BUILD_TYPE=Debug`` at the
configuration step above.
Export a line like the following to your python path to make sure that
python functions are available for post processing

Expand Down
9 changes: 9 additions & 0 deletions include/div_ops.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ const Field3D Div_a_Grad_perp_upwind_flows(const Field3D& a, const Field3D& f, F
const Field3D Div_par_K_Grad_par_mod(const Field3D& k, const Field3D& f, Field3D& flow_ylow,
bool bndry_flux = true);

/*!
* Div ( a Grad_perp(f) ) -- ∇⊥ ( a ⋅ ∇⊥ f) -- Vorticity
*
* This version includes corrections for non-orthogonal meshes
* in which the g12 and g13 components can be non-zero
* i.e. X-Y, X-Z and Y-Z coordinates can all be non-orthogonal.
*/
Field3D Div_a_Grad_perp_nonorthog(const Field3D& a, const Field3D& x);

namespace FV {

/// Superbee limiter
Expand Down
Loading