-
Notifications
You must be signed in to change notification settings - Fork 64
Add 1D divergence and laplacian operators #247
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
Add 1D divergence and laplacian operators #247
Conversation
This commit 1. Synchronizes a conditionally compiled gfortran workaround to match the updated alternative block. 2. Updates the unit test to work around a gfortran issue with `associate`.
This commit fixes issues with the matrix-vector multiplication function "matvec" to ensure infers the loop limits and array section bounds from the dimensions of the arrays accessed by the loop or array section.
This commit adds the ability to convert a mimetic matrix to a
Julienne file_t object so that the matrix elements can be printed
with code like the following
type(mimetic_matrix_t) mimetic_matrix
! define matrix here
associate(file => mimetic_matrix%to_file_t())
call file%write_lines()
end associate
Now all tests pass for computing 1D gradients of 0th, 1st, & 2nd-order polynomials, each with mimetic discretizations of 2nd- and 4th-order accuracy.
This commit adds tests of the ratio of the log of the maximum absolute error for gradients of a sinusoidal function. The tests verify that 2nd- and 4th-order mimetic discretizations converge to the expected gradient values at a rate proportional to dx raised to the 2nd and 4th powers of the error within a tolerance of 5%.
To work around gfortran-14 not supporting `do concurrent` locality specifiers, this commit removes specifiers conditionally via a new macro: HAVE_LOCALITY_SPECIFIER_SUPPORT defined in include/mole-language-support.F90.
This commit adds 1. generic `assemble` bindings to gradient_operator_t and divergence_operator_t that produce the complete operator matrix as a 2D array, including zero values. 2. example `print-assembled-1D-operators` demonstrating the use of `assemble` to print the assembled matrices. For a gradient operator matrix, G, for example, the `assemble` computs the matrix product GI = G, where is the idenity matrix. This approach a. works around the fact that the MOLE Fortran data structures store only the non-zero submatrix blocks. b. supports the verification of both the non-zero values (which were already available via `to_file_t` type-bound functions) and the mimetic-matrix multiplication functions.
This commit reintroduces the execution of the Laplacian operator convergence-rate tests with all tests passing.
Usage: fpm run \ --example print-assembled-1D-operators \ --compiler flang-new \ --flag "-O3" \ -- [--help|-h] | [--grad] [--div] [--order <integer>] where square brackets indicate optional arguments and angular brackets indicate user input values.
This commit 1. Adjusts the Laplacian convergence rate tests to check for the nominal convergence rate at internal grid points and a rate one order lower near boundaries, 2. Combines the Laplacian convergence checks int one function that can be called for mimetic schmes of any order, and 4. Refactors the 2nd- and 4th-order mimetic Laplacian convergence tests so that each calls the new unified function.
This commit is an attempt to work around the issue demonstrate at https://github.com/rouson/mole/actions/runs/19996603010/job/57345130923
This commit is an attempt to work around an issue demonstrated at https://github.com/rouson/mole/actions/runs/19996724722/job/57345438334
This commit attempts to work around the issue demonstrated at https://github.com/rouson/mole/actions/runs/19996775690/job/57345568589
|
@joehellmers this PR is ready for review. I'm tagging you because I don't have the permissions to designate a reviewer. It's gargantuan so I recommend just running My original submission was marked draft because I expected merge conflicts, but I'm happy to see that there are none. Additionally, all tests pass so this is safe to merge. |
What type of PR is this? (check all applicable)
Description
Change Log
.div.and.laplacian.divergence_1D_tandlaplacian_1D_tassemble) for thegradient_operator_1D_tanddivergence_operator_1D_tderived types along with correspondingprivatetype-bound functions that produce the assembled matrices, including zeros.examplesubdirectory:print-assembled-1D-operatorsprints the assembled 1D gradient and divergence matricesdiv-grad-laplacian-1Dprints.grad.to ascalar_1D_tobject.div.to avector_1D_tobject.laplacian.to ascalar_1D_tobject-- --helpis appended to the abovefpmcommanddoc/fortran-classes.mddepictingscalar_1D_t,vector_1D_t,divergence_1D_t,laplacian_1D_ttensor_1D_t,mimetic_matrix_1D_t,gradient_operator_1D_t,divergence_operator_1D_ttestsubdirectory:divergence_operator_1D_test_mtests the.div. result values and convergence rateslaplacian_operator_1D_test_mtests the.laplacian.result values and convergence ratesgfortrancompiler bugs or missing featuresifxin two testsifxruns to a single image because MOLE Fortran uses no multi-image features butifxdefaults to multi-image execution, resulting in redundant output for test failures. (Julienne avoids duplicative reporting for passing tests.)Related Issues & Documents
N.A.
QA Instructions, Screenshots, Recordings
LLVM
Version 20 or later
Version 19
Add
-mmlir -allow-assumed-rankinside the double quotes into the above commands with a space separating the new flags from-O3.GCC
Version 14 or later
Version 13
Append
--flag -ffree-line-length-0to the above commands, except in the one with the trailing-- --help, in which case the added flag must precede-- --help.Intel
NAG
This release drops support for the
nagforcompiler unless and until blocking compiler bugs have been isolated, reported, and fixed.Added/updated tests?
have not been included
Read Contributing Guide and Code of Conduct
Are there any post deployment tasks we need to perform?
No.
What gif best describes this PR or how it makes you feel?