Nonorthogonal with minimal differential operators MMS test.#285
Conversation
A version of FV::Div_a_Grad_perp that includes all metric components, including g12 (X-Y non-orthogonal) and g13 (X-Z nonorthogonal) terms. Aim to test and then merge upstream into BOUT++
Testing, using operator that includes nonorthogonal mesh corrections
…ile as this causes problems when loading from xbout.
…re descriptive name.
… order with fit function, add comments.
… x y z coordinates instead of R Z.
…sults yet provided.
…g sympy for maximum flexibility.
…ement with try, except block.
… of convergence for orthogonal grid operator with a simple metric constant in x, y, z.
This reverts commit 28a2e4d.
`neutral_mixed` MMS tests and expanded differential operator MMS tests
mikekryjak
left a comment
There was a problem hiding this comment.
Looks good to me apart from two minor points:
- Let's rename the
mmsfolder tomms-operatorssince there are other mms tests in other folders. rnn_overridecould use a better name.
|
There a lot of revert commits in this PR. Would it make sense to git rebase this, and remove the initial commits and the reverts? Did understand it correctly that this PR, which adds new tests, should not be merged, as the unit test coverage is decreasing? |
I think we can make an exception since this is considerably adding to our overall test capability. |
If you can suggest unit tests in the C++ files affected, I am willing to try to implement them. However, as pointed out, this PR mostly adds tests, which are worthwhile in of themselves, even if code cov does not count them. |
…mms/*` to `test/mms_operator/*`. This name change is motivated by the observation that `tests/integrated` contains some tests using the method of manufactured solutions (MMS).
…hitespace in `src/neutral_mixed.cxx`.
|
@mikekryjak Your comments should now be addressed by e97c363 and 73c8879. |
…y`. Tests of `Finally` fail.
…ure.cxx or evolve_density.cxx. Introduce a similar set of unit tests. The integration tests fail: the changes have unexpectedly broken the component.
…-tests Unit tests and style changes for neutral_mixed.cxx
…sts/unit/test_neutral_mixed.cxx
Looks great, I'm happy for this to be merged in. |
I will merge master to resolve the conflicts. There are many commits in this PR. Would you be happy for me to squash the commits in the merge? |
Fixes to the
Div_a_Grad_perp_nonorthog(a, f)operator (commit 3d11cb7, commit 2e5e827), merge with master, and new automatic tests integrated withctestshowing a correct implementation. Theses tests arehermes-3/tests/mms/orthogonal_test.pyandhermes-3/tests/mms/nonorthogonal_test.py, and may be run interactively by, e.g.,or
These tests can be readily extended to test new nonorthogonal operators and the other existing operators in the Hermes-3 code base.
See
/hermes-3/tests/mmsREADME.mdfor some documentation. Comments and requests appreciated.Thanks to @dschwoerer for providing an initial MMS test to develop. Thanks to @johnomotani for numerous suggestions and bugfixes.
Below is the plot output from the tests, showing the error (blue), the expected (orange), and the fit of the error (green). Increase the range of$\Delta$ by increasing $N_x = N_y = N_z$ , the cost of the test rapidly increases with
ntestin thetest_inputdictionary inhermes-3/tests/mms/orthogonal_test.pyandhermes-3/tests/mms/nonorthogonal_test.py. Note that since the number of grid pointsntest.FV::Div_a_Grad_perp(a, f)with orthogonal metricDiv_a_Grad_perp_nonorthog(a, f)with orthogonal metricDiv_a_Grad_perp_nonorthog(a, f)with nonorthogonal metric