Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
274 commits
Select commit Hold shift + click to select a range
0ee0d07
Merge remote-tracking branch 'origin/next' into fci-splitting
dschwoerer Feb 4, 2024
49cd985
Merge remote-tracking branch 'origin/next' into fci-splitting
dschwoerer Feb 4, 2024
4566405
Apply black changes
dschwoerer Feb 4, 2024
4935742
CI: install wget
dschwoerer Feb 4, 2024
01a436c
Merge remote-tracking branch 'origin/next' into fci-splitting
dschwoerer Feb 4, 2024
147a872
Apply clang-format changes
dschwoerer Feb 4, 2024
cee68f2
Add asserts to serial methods to avoid using in parallel
dschwoerer Feb 7, 2024
15aaa05
Apply clang-format changes
dschwoerer Feb 7, 2024
eba722b
Merge branch 'par-bc-cleanup' into fci-splitting
dschwoerer Feb 7, 2024
30ea7e3
Remove accidentially added files
dschwoerer Feb 13, 2024
66ff716
Merge remote-tracking branch 'origin/next' into fci-splitting
dschwoerer Feb 13, 2024
10d320f
Use parallel_neumann as BC
dschwoerer Feb 15, 2024
4b05708
fix usage of f-string
dschwoerer Feb 15, 2024
60224e4
Use localmesh
dschwoerer Feb 19, 2024
608bb5d
add PETSc requirement for MPI test
dschwoerer Feb 19, 2024
88741c5
Update header location
dschwoerer Feb 19, 2024
09f609b
More const correctness
dschwoerer Feb 19, 2024
d46efba
Merge branch 'origin/next' into fci-splitting
dschwoerer Mar 19, 2024
1fb921e
Add some asserts for non parallelised XZ interpolation
dschwoerer Feb 2, 2023
4a79fb4
enable openmp for sundials if it is enabled for BOUT++
dschwoerer Feb 23, 2023
b5bd5f0
Add required interfaces
dschwoerer Nov 3, 2023
6819718
Add maskFromRegion
dschwoerer Mar 19, 2024
fee27c9
Dump field before and after rhs evaluation for debugging
dschwoerer Nov 3, 2023
96da2e9
Add setName function
dschwoerer Nov 3, 2023
e56981c
Set div_par and grad_par names
dschwoerer Jun 19, 2023
6b2c132
Dump debug file if PVODE fails
dschwoerer Jun 19, 2023
df2d661
Add tracking to Field3D
dschwoerer Jun 19, 2023
263f9fe
Add tracking to Field3D
dschwoerer Jun 19, 2023
bac4ca9
cvode: Add option to use Adams Moulton solver instead of BDF
dschwoerer Apr 25, 2023
708bdcb
Expose more pvode option to user
dschwoerer Mar 29, 2023
fa357c1
Add isFci to check if a field is a FCI field.
dschwoerer Mar 19, 2024
ca59edb
Improve isFci
dschwoerer Nov 3, 2023
d88b454
Fix bad cherry-pick
dschwoerer Mar 19, 2024
8b1fbba
Apply clang-format changes
dschwoerer Mar 19, 2024
023bc41
Update to new API
dschwoerer Mar 19, 2024
affc995
Fix documentation
dschwoerer Mar 19, 2024
71f5b6a
Apply clang-format changes
dschwoerer Mar 19, 2024
31fd461
Apply recomendations from code-review
dschwoerer Mar 20, 2024
17e46cf
Use more meaningful names
dschwoerer Mar 20, 2024
9c0ae16
Apply clang-format changes
dschwoerer Mar 20, 2024
4a17b49
Apply suggestions from code review
dschwoerer Mar 20, 2024
23d309f
Make isFci a member function and add missing func
dschwoerer Mar 20, 2024
4bbd9ba
Add option to automatically compute parallel fields
dschwoerer Nov 3, 2023
4fac018
Explicitly set parallel boundary order
dschwoerer Nov 6, 2023
29a195f
Make Field2d and Field3D more similar
dschwoerer Nov 6, 2023
4ee8630
Do more things automagically
dschwoerer Nov 6, 2023
2e216be
Allow DDY without parallel slices
dschwoerer Nov 6, 2023
faa1046
Add more fci-auto-magic
dschwoerer Mar 18, 2024
414247b
Add copy function
dschwoerer Mar 18, 2024
6ba17ed
Inherit applyParallelBoundary functions
dschwoerer Mar 18, 2024
b319807
Merge remote-tracking branch 'origin/add-is-fci' into fci-auto
dschwoerer Mar 20, 2024
b814c9b
update calls to isFci
dschwoerer Mar 20, 2024
1260730
Merge remote-tracking branch 'origin/par-bc-improve' into fci-auto
dschwoerer Mar 20, 2024
4a6fdba
Fix remaining usage of free isFci function
dschwoerer Mar 20, 2024
0aca4a5
Merge remote-tracking branch 'origin/par-bc-regions' into fci-auto
dschwoerer Mar 20, 2024
2f7c3c0
Workaround for gcc 9.4
dschwoerer Mar 20, 2024
413e54f
Fixup porting to shared_ptr
dschwoerer Mar 20, 2024
d5d7c6a
Update include to moved location
dschwoerer Mar 26, 2024
652be61
Move iteration mostly to iterator
dschwoerer Mar 26, 2024
7d48dbd
Move stencils to separte header
dschwoerer Mar 27, 2024
59cd39d
Add more dummy functions to field2d
dschwoerer Mar 27, 2024
127fc9a
Add basic boundary region iterator
dschwoerer Mar 27, 2024
9b68bf2
Provide a new boundary iterator based on RangeIterator
dschwoerer Apr 9, 2024
d611758
Add option to debug on failure
dschwoerer Apr 9, 2024
db96b7e
Add option to euler solver to dump debug info
dschwoerer Apr 9, 2024
1ed4f9e
Merge branch 'pvcode-cvode-improvements' into fci-auto-with-debug
dschwoerer Apr 9, 2024
6f3bbf5
Fall back to non fv div_par for fci
dschwoerer Jul 2, 2024
a73080d
Add isFci also to mesh
dschwoerer Jul 2, 2024
d8cf334
Only check hasBndry*Y if they would be included
dschwoerer Jul 2, 2024
98da34a
Add option to disable tracking
dschwoerer Jul 2, 2024
e25884e
DEBUG: add debug statements for regionID
dschwoerer Jul 2, 2024
6b6ee52
Fix: preserve regionID
dschwoerer Jul 5, 2024
03c98da
Fix OOB read/write in boutmesh
dschwoerer Jul 5, 2024
8bf4840
Ensure pointer is checked before dereferencing
dschwoerer Jul 5, 2024
e39774a
ensure we dont mix non-fci BCs with fci
dschwoerer Jul 5, 2024
22f493c
Fix exception message
dschwoerer Aug 9, 2024
6c2c82c
Expose tracking
dschwoerer Aug 9, 2024
c6c259b
Add simple interface to store parallel fields
dschwoerer Aug 9, 2024
de99acc
Add const version for getCoordinates
dschwoerer Aug 9, 2024
c35d773
rename to include order
dschwoerer Aug 9, 2024
22bbd27
Set using value rather then using self
dschwoerer Aug 9, 2024
4a6a7ef
Also set parallel fields for operator=
dschwoerer Aug 9, 2024
bcc1418
Set parallel region by default
dschwoerer Aug 9, 2024
61a2521
Set name in operator=
dschwoerer Aug 9, 2024
27db217
preserve parallel fields more often
dschwoerer Aug 9, 2024
6b9e86e
Fix: remove broken code
dschwoerer Aug 9, 2024
d3b0d65
Add comment
dschwoerer Aug 9, 2024
63a1f74
Communicate automatically in Div_par with automagic
dschwoerer Aug 9, 2024
8e773f7
Add option to disallow calculating parallel fields
dschwoerer Aug 9, 2024
8485353
Disable metric components that require y-derivatives for fci
dschwoerer Aug 9, 2024
484a473
Communicate Bxy if needed
dschwoerer Aug 9, 2024
a45f681
Clarify which div_par has been used
dschwoerer Aug 9, 2024
1a26515
Avoid using FV in y direction with FCI
dschwoerer Aug 9, 2024
167ba2e
fixup fv_ops
dschwoerer Aug 9, 2024
df42998
fixup again
dschwoerer Aug 9, 2024
b53d27d
Always set region for hermite_spline_xz
dschwoerer Aug 9, 2024
43669c8
Remove debugging code
dschwoerer Aug 9, 2024
b600cda
Allow dumping at 0
dschwoerer Aug 9, 2024
1ce3f2a
Dump variables before rhs()
dschwoerer Aug 9, 2024
6bc5010
Ensure mesh is either valid of nullptr
dschwoerer Aug 9, 2024
3831c37
Also dump parallel fields
dschwoerer Aug 9, 2024
35a2c4f
Allow dumping several times
dschwoerer Aug 9, 2024
3e5bf8c
Stop debugging after dump has been written
dschwoerer Aug 9, 2024
a78350f
Dump also parallel fields by default
dschwoerer Aug 9, 2024
f943880
Set name for Field functions
dschwoerer Sep 26, 2024
a128be5
Fix code path without FCI automagic
dschwoerer Sep 26, 2024
653d836
Only set region of parallel fields for FCI
dschwoerer Sep 26, 2024
34c3f8f
Ensure field to be saved is allocated
dschwoerer Sep 26, 2024
b37ef0e
Output model vars to debug file
dschwoerer Sep 26, 2024
761bfc4
Update PETSc download url
dschwoerer Sep 26, 2024
1d54e75
Merge remote-tracking branch 'origin/next' into fci-auto-with-debug
dschwoerer Sep 27, 2024
805b4c1
Add dummy functions for FieldPerp
dschwoerer Sep 27, 2024
d2200cc
Allow XZHermiteSpline also without y-offset
dschwoerer Sep 27, 2024
433df79
Convert test to new iterator scheeme
dschwoerer Sep 27, 2024
8112e98
Fix segfault in unit test
dschwoerer Sep 27, 2024
5c80fbd
Ensure we do not segfault if coords is not set
dschwoerer Sep 27, 2024
7b9b7e4
fix boundary condition
dschwoerer Sep 30, 2024
d91607f
Add Field2D version for 2D metrics
dschwoerer Oct 1, 2024
e95636e
Add setYPrevIfValid
dschwoerer Oct 1, 2024
63531f0
Fix default region name
dschwoerer Oct 1, 2024
2b1d9fb
Rename to allowCalcParallelSlices
dschwoerer Oct 11, 2024
749bddb
Add code to load parallel metric slices
dschwoerer Oct 10, 2024
a00625f
add setRegion / getRegionID to all fields
dschwoerer Oct 16, 2024
1b4128f
Prefer UNUSED over MAYBE_UNUSED
dschwoerer Oct 16, 2024
4c50c6e
Preserve regionID in emptyFrom
dschwoerer Oct 16, 2024
f88a35f
set region in loaded parallel fields
dschwoerer Oct 11, 2024
6384384
Only load parallel J if J is loadable
dschwoerer Oct 15, 2024
1ab7fb0
Fix Div_par
dschwoerer Oct 11, 2024
5f7a799
Only check for allowCalcParallelSlices if we are about to calculate
dschwoerer Oct 18, 2024
9535ab9
Merge remote-tracking branch 'origin/lazy-grid-loading' into fci-auto…
dschwoerer Nov 6, 2024
f7919e0
Fix bad merge
dschwoerer Nov 6, 2024
c9124f6
Fix error message
dschwoerer Nov 6, 2024
adf3e51
Set parallel slices only for 3D metrics
dschwoerer Nov 6, 2024
0619ffe
Fix #if guard
dschwoerer Nov 8, 2024
a19c9e8
Merge remote-tracking branch 'origin/next' into fci-auto-with-debug
dschwoerer Nov 8, 2024
ac212ef
Fix bad merge
dschwoerer Nov 8, 2024
0b053da
Merge remote-tracking branch 'origin/next' into fci-auto-with-debug
dschwoerer Nov 8, 2024
70726f3
Fix Field3D::setBoundaryTo for FCI methods
bendudson Nov 21, 2024
c64d439
Copy BCs in x-direction also for FCI
dschwoerer Nov 25, 2024
2d64a0d
Use consistently first order interpolation
dschwoerer Nov 25, 2024
d59517e
Disable broken test-laplace-petsc3d by default
dschwoerer Nov 25, 2024
a65b1d8
Fix unit test for FCI
dschwoerer Nov 25, 2024
b71e978
Update to new grid with parallel metrics
dschwoerer Nov 26, 2024
df4ea45
Merge pull request #3030 from boutproject/fci-fix-setBoundaryTo
dschwoerer Nov 27, 2024
93b6c48
Avoid define conflict with sundials
dschwoerer Nov 25, 2024
095c980
Allow setter to be chained
dschwoerer Dec 4, 2024
6c674fe
Expose more arguments of Laplacian
dschwoerer Dec 4, 2024
6f7eff8
Expose `Mesh::get` for Field3D
dschwoerer Dec 4, 2024
6934acb
Avoid using kwargs, to avoid hiding typos
dschwoerer Dec 4, 2024
50e01ae
Fix deallocation of Laplacian
dschwoerer Dec 4, 2024
9f3fb54
Set mesh for Fields in Laplacian
dschwoerer Dec 4, 2024
1f93c73
Fix some unused variable warning for 3D metrics
dschwoerer Dec 4, 2024
ec5fe92
Move `invert3x3` out of general purpose `utils.hxx` header
ZedThree Oct 30, 2024
bd2f36d
Return `bool` instead of `int` from `invert3x3`
ZedThree Oct 30, 2024
3ceef07
Apply clang-format changes
ZedThree Oct 30, 2024
c42dc24
Return `std::optional` from `invert3x3`
ZedThree Nov 7, 2024
36a06f3
simplify return statement
dschwoerer Nov 26, 2024
b4dd92f
Use formatter for SpecificInd
dschwoerer Nov 26, 2024
a7e783a
Apply clang-format changes
dschwoerer Dec 4, 2024
33a72a5
Add missing header to format SpecificInd
dschwoerer Nov 26, 2024
4f2da4d
Prefere const
dschwoerer Nov 26, 2024
a1f4b46
Use PEP 625 compatible archive name
dschwoerer Nov 26, 2024
b4bd5b8
CI: Increase check level for debug run
dschwoerer Nov 26, 2024
5863856
Fix unit test for CHECK=4
dschwoerer Nov 26, 2024
57f0553
Apply clang-format changes
dschwoerer Nov 26, 2024
cc9d5cc
Avoid using the wrong grid by accident
dschwoerer Nov 29, 2024
aef4215
Add some checks to petsc_laplace
dschwoerer Dec 16, 2024
bbc8e08
Add forward method to Laplacian inversion
dschwoerer Dec 16, 2024
552c2fd
Add function to check wehther point is in the boundary
dschwoerer Jan 13, 2025
00233cf
Add offset to parallel boundary region
dschwoerer Jan 13, 2025
136fa8a
Add setValid to BoundaryRegionParIterBase
dschwoerer Jan 13, 2025
0e089cd
Reimplement ynext for the boundary region
dschwoerer Jan 13, 2025
7e1067a
Fix extrapolaton / interpolation
dschwoerer Jan 13, 2025
d416b5d
Fix parallel boundary to interpolate into the boundary
dschwoerer Jan 13, 2025
6cca6a4
Ensure data is sorted
dschwoerer Jan 13, 2025
62b62bf
fix typo
dschwoerer Jan 13, 2025
628a6ce
Calculate valid for the general case
dschwoerer Jan 13, 2025
e5c9fc1
Add communication routine for FCI operation
dschwoerer Jan 15, 2025
40dac59
Unify XZMonotonicHermiteSpline and XZMonotonicHermiteSpline
dschwoerer Jan 15, 2025
9a98a8b
Use x-splitting for monotonichermitespline test
dschwoerer Jan 15, 2025
cb068ea
Fix position of maybe_unused for old gcc
dschwoerer Jan 15, 2025
d7d7c91
Ensure PETSC_SUCCESS is defined
dschwoerer Jan 15, 2025
3cc13b9
Merge remote-tracking branch 'origin/next' into fci-auto-with-debug-h…
dschwoerer Jan 15, 2025
a05201b
Revert "Ensure PETSC_SUCCESS is defined"
dschwoerer Jan 15, 2025
7d73c5c
Define PETSC_SUCCESS for old petsc versions
dschwoerer Jan 15, 2025
ebf2d07
Set region for lagrange4pt
dschwoerer Jan 16, 2025
ae1fcfe
Fix split parallel slices
dschwoerer Jan 20, 2025
8b7d97d
Add option to split + allocate
dschwoerer Jan 20, 2025
ad56d8e
fix parallel neumann BC
dschwoerer Jan 20, 2025
2a48341
set name for parallel component
dschwoerer Jan 20, 2025
f73813b
Add limitFree
dschwoerer Jan 20, 2025
ff7525d
add setAll to parallel BC
dschwoerer Jan 20, 2025
1c44f98
Add monotonic check also to other code branches
dschwoerer Jan 21, 2025
42c0958
use lower_bound instead of find
dschwoerer Jan 21, 2025
21d1985
Do not shadow mapping
dschwoerer Jan 21, 2025
4f39c1d
Ensure setup has been called
dschwoerer Jan 21, 2025
cabdc4c
Use pointer to data
dschwoerer Jan 21, 2025
aa7938d
Call setup before communicator is used
dschwoerer Jan 21, 2025
d1dee59
Deduplicate code
dschwoerer Jan 21, 2025
5818327
Fix tags for comm
dschwoerer Jan 21, 2025
aa2d8b6
Use pointer instead of std::vector
dschwoerer Jan 21, 2025
007fed0
Do not reuse requests if the array is still in use
dschwoerer Jan 21, 2025
c40110b
rename offset to getOffsets
dschwoerer Jan 22, 2025
2a10ccd
Fix: mixup of sending / receiving size
dschwoerer Jan 22, 2025
296cc15
Fix receive data offset
dschwoerer Jan 22, 2025
31d7702
Add check to ensure the proc layout is as expected
dschwoerer Jan 22, 2025
71dd37c
clang-format
dschwoerer Jan 22, 2025
90a7f4f
Use BOUT++ assert
dschwoerer Jan 22, 2025
db77ef3
Fix check
dschwoerer Jan 22, 2025
147a874
Expect lower convergence for monotonic correction
dschwoerer Jan 22, 2025
81d929d
Add delay on error
dschwoerer Jan 22, 2025
276007c
Move yboundary iterator from hermes to BOUT++
dschwoerer Jan 31, 2025
731db60
Add delay on error
dschwoerer Jan 22, 2025
dc94e06
Add legacy monotonic hermite spline implementation again
dschwoerer Jan 22, 2025
1823144
Take periodicity into account
dschwoerer Jan 28, 2025
1e96b3e
Sort a reference, not a copy
dschwoerer Jan 28, 2025
ad8f403
Only communicate non-empty vectors
dschwoerer Jan 28, 2025
5adf893
Make check stricter
dschwoerer Jan 31, 2025
cd383e2
Minor improvements to mms test
dschwoerer Jan 31, 2025
2d72bab
Fix: include global offset in monotonic spline
dschwoerer Jan 31, 2025
b3841fb
make fci_comm openmp thread safe
dschwoerer Jan 31, 2025
e052c26
Merge remote-tracking branch 'origin/next' into fci-auto-with-debug-h…
dschwoerer Jan 31, 2025
63e8cb9
Fix communication for fci
dschwoerer Feb 7, 2025
371c928
Add check to reduce risk of bugs
dschwoerer Feb 7, 2025
f2939c6
Handle C++ exception for more functions
dschwoerer Feb 7, 2025
d74d2a7
Merge commit '81d929d7f' into fci-auto-with-debug-higher-order
dschwoerer Feb 10, 2025
ad09499
Expose LaplaceXZ
dschwoerer Feb 10, 2025
def8a06
Formatting fixes
dschwoerer Feb 10, 2025
f1534f2
Expose Mesh::get for Field3D
dschwoerer Feb 10, 2025
0bcc047
remove non-petsc inversions
dschwoerer Feb 10, 2025
f6106a2
Allow to overwrite MYG with options.
dschwoerer Feb 24, 2025
8665a67
Revert "Disable metric components that require y-derivatives for fci"
dschwoerer Feb 27, 2025
ff71182
Add iter_pnts function
dschwoerer Mar 3, 2025
d3bc5cc
Add example on how to replace RangeIterator with YBoundary
dschwoerer Mar 3, 2025
8337531
Move documentation to sphinx
dschwoerer Mar 3, 2025
fcc3af6
Only read `MYG` if it set or mesh:MYG is not set
dschwoerer Mar 3, 2025
f925c94
Do not set MYG/MXG if it is not needed
dschwoerer Mar 3, 2025
51e7b58
Do not set MYG/MXG if it is not needed
dschwoerer Mar 3, 2025
1c8fb47
Fix iter_pnts
dschwoerer Mar 4, 2025
bfaf986
Add more documentation on YBoundary
dschwoerer Mar 4, 2025
f4acdb0
Ensure the field has parallel slices
dschwoerer Mar 7, 2025
23f5992
Lower check level
dschwoerer Mar 7, 2025
d05e733
Loosen tolereances again
dschwoerer Mar 11, 2025
35206d4
Remove broken code
dschwoerer Mar 11, 2025
261442e
Merge branch 'next' of https://github.com/boutproject/BOUT-dev into f…
dschwoerer Mar 12, 2025
df490b9
CI: Avoid issues with special characters
dschwoerer Mar 12, 2025
eef32f9
CI: run git-clang-format until there are no more changes
dschwoerer Mar 12, 2025
9fd76bf
CI: use one line
dschwoerer Mar 12, 2025
ee9dc99
CI: stage before we run git-clang-format again
dschwoerer Mar 12, 2025
d10cd71
Apply clang-format changes
dschwoerer Mar 12, 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
2 changes: 1 addition & 1 deletion .ci_fedora.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ then
echo "minrate=10M" >> /etc/dnf/dnf.conf
export FORCE_COLUMNS=200
time dnf -y install dnf5
time dnf5 -y install dnf5-plugins cmake python3-zoidberg python3-natsort
time dnf5 -y install dnf5-plugins cmake python3-zoidberg python3-natsort wget
# Allow to override packages - see #2073
time dnf5 copr enable -y davidsch/fixes4bout || :
time dnf5 -y upgrade
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ jobs:

- name: Run clang-format
id: format
run: git clang-format origin/${{ github.base_ref }} || :
run:
while ! git clang-format origin/${{ github.base_ref }} ; do git add . ; done

- name: Commit to the PR branch
uses: stefanzweifel/git-auto-commit-action@v5
Expand Down
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,12 @@ set(BOUT_SOURCES
./src/mesh/interpolation/hermite_spline_z.cxx
./src/mesh/interpolation/interpolation_z.cxx
./src/mesh/interpolation/lagrange_4pt_xz.cxx
./src/mesh/interpolation/monotonic_hermite_spline_xz.cxx
./src/mesh/invert3x3.hxx
./src/mesh/mesh.cxx
./src/mesh/parallel/fci.cxx
./src/mesh/parallel/fci.hxx
./src/mesh/parallel/fci_comm.cxx
./src/mesh/parallel/fci_comm.hxx
./src/mesh/parallel/identity.cxx
./src/mesh/parallel/shiftedmetric.cxx
./src/mesh/parallel/shiftedmetricinterp.cxx
Expand Down Expand Up @@ -592,6 +593,9 @@ else()
endif()
set(BOUT_USE_METRIC_3D ${BOUT_ENABLE_METRIC_3D})

option(BOUT_ENABLE_FCI_AUTOMAGIC "Enable (slow?) automatic features for FCI" ON)
set(BOUT_USE_FCI_AUTOMAGIC ${BOUT_ENABLE_FCI_AUTOMAGIC})

include(CheckCXXSourceCompiles)
check_cxx_source_compiles("int main() { const char* name = __PRETTY_FUNCTION__; }"
HAS_PRETTY_FUNCTION)
Expand Down
4 changes: 2 additions & 2 deletions bin/bout-build-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ NCVER=${NCVER:-4.7.4}
NCCXXVER=${NCCXXVER:-4.3.1}
FFTWVER=${FFTWVER:-3.3.9}
SUNVER=${SUNVER:-5.7.0}
PETSCVER=${PETSCVER:-3.15.0}
PETSCVER=${PETSCVER:-3.21.4}


HDF5FLAGS=${HDF5FLAGS:-}
Expand Down Expand Up @@ -147,7 +147,7 @@ petsc() {
test -z $PETSC_DIR || error "\$PETSC_DIR is set ($PETSC_DIR) - please unset"
test -z $PETSC_ARCH || error "\$PETSC_ARCH is set ($PETSC_ARCH) - please unset"
cd $BUILD
wget -c https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-$PETSCVER.tar.gz || :
wget -c https://web.cels.anl.gov/projects/petsc/download/release-snapshots/petsc-$PETSCVER.tar.gz || :
tar -xf petsc-$PETSCVER.tar.gz
cd petsc-$PETSCVER
unset PETSC_DIR
Expand Down
16 changes: 15 additions & 1 deletion cmake/BOUT++functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ endfunction()
#
function(bout_add_integrated_or_mms_test BUILD_CHECK_TARGET TESTNAME)
set(options USE_RUNTEST USE_DATA_BOUT_INP)
set(oneValueArgs EXECUTABLE_NAME PROCESSORS)
set(oneValueArgs EXECUTABLE_NAME PROCESSORS DOWNLOAD DOWNLOAD_NAME)
set(multiValueArgs SOURCES EXTRA_FILES REQUIRES CONFLICTS TESTARGS EXTRA_DEPENDS)
cmake_parse_arguments(BOUT_TEST_OPTIONS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

Expand Down Expand Up @@ -202,6 +202,20 @@ function(bout_add_integrated_or_mms_test BUILD_CHECK_TARGET TESTNAME)
add_custom_target(${TESTNAME})
endif()

if (BOUT_TEST_OPTIONS_DOWNLOAD)
if (NOT BOUT_TEST_OPTIONS_DOWNLOAD_NAME)
message(FATAL_ERROR "We need DOWNLOAD_NAME if we should DOWNLOAD!")
endif()
set(output )
add_custom_command(OUTPUT ${BOUT_TEST_OPTIONS_DOWNLOAD_NAME}
COMMAND wget ${BOUT_TEST_OPTIONS_DOWNLOAD} -O ${BOUT_TEST_OPTIONS_DOWNLOAD_NAME}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Downloading ${BOUT_TEST_OPTIONS_DOWNLOAD_NAME}"
)
add_custom_target(download_test_data DEPENDS ${BOUT_TEST_OPTIONS_DOWNLOAD_NAME})
add_dependencies(${TESTNAME} download_test_data)
endif()

if (BOUT_TEST_OPTIONS_EXTRA_DEPENDS)
add_dependencies(${TESTNAME} ${BOUT_TEST_OPTIONS_EXTRA_DEPENDS})
endif()
Expand Down
2 changes: 1 addition & 1 deletion cmake/SetupBOUTThirdParty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ if (BOUT_USE_SUNDIALS)
set(EXAMPLES_ENABLE_C OFF CACHE BOOL "" FORCE)
set(EXAMPLES_INSTALL OFF CACHE BOOL "" FORCE)
set(ENABLE_MPI ${BOUT_USE_MPI} CACHE BOOL "" FORCE)
set(ENABLE_OPENMP OFF CACHE BOOL "" FORCE)
set(ENABLE_OPENMP ${BOUT_USE_OPENMP} CACHE BOOL "" FORCE)
if (BUILD_SHARED_LIBS)
set(BUILD_STATIC_LIBS OFF CACHE BOOL "" FORCE)
else()
Expand Down
1 change: 1 addition & 0 deletions cmake_build_defines.hxx.in
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#cmakedefine BOUT_METRIC_TYPE @BOUT_METRIC_TYPE@
#cmakedefine01 BOUT_USE_METRIC_3D
#cmakedefine01 BOUT_USE_MSGSTACK
#cmakedefine01 BOUT_USE_FCI_AUTOMAGIC

// CMake build does not support legacy interface
#define BOUT_HAS_LEGACY_NETCDF 0
Expand Down
2 changes: 1 addition & 1 deletion examples/fci-wave/div-integrate/BOUT.inp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ bndry_par_ydown = parallel_neumann_o2

[v]

bndry_par_all = parallel_dirichlet
bndry_par_all = parallel_dirichlet_o2

[solver]
output_step = 0.1
Expand Down
2 changes: 1 addition & 1 deletion examples/fci-wave/div/BOUT.inp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ bndry_par_ydown = parallel_neumann_o2

[v]

bndry_par_all = parallel_dirichlet
bndry_par_all = parallel_dirichlet_o2

[solver]
output_step = 0.1
Expand Down
2 changes: 1 addition & 1 deletion examples/fci-wave/logn/BOUT.inp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ bndry_par_ydown = parallel_neumann_o2

[nv]

bndry_par_all = parallel_dirichlet
bndry_par_all = parallel_dirichlet_o2

[solver]
output_step = 0.1
Expand Down
4 changes: 2 additions & 2 deletions externalpackages/PVODE/include/pvode/band.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ typedef struct bandmat_type {
* *
******************************************************************/

#define PVODE_BAND_ELEM(A,i,j) ((A->data)[j][i-j+(A->smu)])
#define PVODE_BAND_ELEM(A, i, j) ((A->data)[j][i - j + (A->smu)])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function-like macro 'PVODE_BAND_ELEM' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage]

#define PVODE_BAND_ELEM(A, i, j) ((A->data)[j][i - j + (A->smu)])
        ^

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]

Suggested change
#define PVODE_BAND_ELEM(A, i, j) ((A->data)[j][i - j + (A->smu)])
#define PVODE_BAND_ELEM(A, i, j) (((A)->data)[j][i - j + (A->smu)])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]

Suggested change
#define PVODE_BAND_ELEM(A, i, j) ((A->data)[j][i - j + (A->smu)])
#define PVODE_BAND_ELEM(A, i, j) ((A->data)[j][(i) - j + (A->smu)])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]

Suggested change
#define PVODE_BAND_ELEM(A, i, j) ((A->data)[j][i - j + (A->smu)])
#define PVODE_BAND_ELEM(A, i, j) ((A->data)[j][i - (j) + (A->smu)])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]

Suggested change
#define PVODE_BAND_ELEM(A, i, j) ((A->data)[j][i - j + (A->smu)])
#define PVODE_BAND_ELEM(A, i, j) ((A->data)[j][i - j + ((A)->smu)])


/******************************************************************
* *
Expand All @@ -153,7 +153,7 @@ typedef struct bandmat_type {
* *
******************************************************************/

#define PVODE_BAND_COL(A,j) (((A->data)[j])+(A->smu))
#define PVODE_BAND_COL(A, j) (((A->data)[j]) + (A->smu))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function-like macro 'PVODE_BAND_COL' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage]

#define PVODE_BAND_COL(A, j) (((A->data)[j]) + (A->smu))
        ^

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]

Suggested change
#define PVODE_BAND_COL(A, j) (((A->data)[j]) + (A->smu))
#define PVODE_BAND_COL(A, j) ((((A)->data)[j]) + (A->smu))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]

Suggested change
#define PVODE_BAND_COL(A, j) (((A->data)[j]) + (A->smu))
#define PVODE_BAND_COL(A, j) (((A->data)[j]) + ((A)->smu))


/******************************************************************
* *
Expand Down
2 changes: 1 addition & 1 deletion externalpackages/PVODE/precon/band.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ typedef struct bandmat_type {
* *
******************************************************************/

#define BAND_COL(A, j) (((A->data)[j]) + (A->smu))
#define PVODE_BAND_COL(A, j) (((A->data)[j]) + (A->smu))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function-like macro 'PVODE_BAND_COL' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage]

#define PVODE_BAND_COL(A, j) (((A->data)[j]) + (A->smu))
        ^

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]

Suggested change
#define PVODE_BAND_COL(A, j) (((A->data)[j]) + (A->smu))
#define PVODE_BAND_COL(A, j) ((((A)->data)[j]) + (A->smu))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]

Suggested change
#define PVODE_BAND_COL(A, j) (((A->data)[j]) + (A->smu))
#define PVODE_BAND_COL(A, j) (((A->data)[j]) + ((A)->smu))


/******************************************************************
* *
Expand Down
166 changes: 166 additions & 0 deletions include/bout/boundary_iterator.hxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
#pragma once

#include "bout/mesh.hxx"
#include "bout/parallel_boundary_region.hxx"
#include "bout/sys/parallel_stencils.hxx"
#include "bout/sys/range.hxx"

class BoundaryRegionIter {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: destructor of 'BoundaryRegionIter' is public and non-virtual [cppcoreguidelines-virtual-class-destructor]

class BoundaryRegionIter {
      ^
Additional context

include/bout/boundary_iterator.hxx:7: make it public and virtual

class BoundaryRegionIter {
      ^

public:
BoundaryRegionIter(int x, int y, int bx, int by, Mesh* mesh)
: dir(bx + by), x(x), y(y), bx(bx), by(by), localmesh(mesh) {
ASSERT3(bx * by == 0);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "ASSERT3" is directly included [misc-include-cleaner]

include/bout/boundary_iterator.hxx:2:

- #include "bout/mesh.hxx"
+ #include "bout/assert.hxx"
+ #include "bout/mesh.hxx"

}
bool operator!=(const BoundaryRegionIter& rhs) { return ind() != rhs.ind(); }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: method 'operator!=' can be made const [readability-make-member-function-const]

Suggested change
bool operator!=(const BoundaryRegionIter& rhs) { return ind() != rhs.ind(); }
bool operator!=(const BoundaryRegionIter& rhs) const { return ind() != rhs.ind(); }


Ind3D ind() const { return xyz2ind(x, y, z); }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "Ind3D" is directly included [misc-include-cleaner]

include/bout/boundary_iterator.hxx:4:

- #include "bout/sys/parallel_stencils.hxx"
+ #include "bout/region.hxx"
+ #include "bout/sys/parallel_stencils.hxx"

BoundaryRegionIter& operator++() {
ASSERT3(z < nz());
z++;
if (z == nz()) {
z = 0;
_next();
}
return *this;
}
virtual void _next() = 0;
BoundaryRegionIter& operator*() { return *this; }

void dirichlet_o2(Field3D& f, BoutReal value) const {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "BoutReal" is directly included [misc-include-cleaner]

include/bout/boundary_iterator.hxx:2:

- #include "bout/mesh.hxx"
+ #include "bout/bout_types.hxx"
+ #include "bout/mesh.hxx"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "Field3D" is directly included [misc-include-cleaner]

include/bout/boundary_iterator.hxx:2:

- #include "bout/mesh.hxx"
+ #include "bout/field3d.hxx"
+ #include "bout/mesh.hxx"

ynext(f) = parallel_stencil::dirichlet_o2(1, f[ind()], 0.5, value);
}

BoutReal extrapolate_grad_o2(const Field3D& f) const { return f[ind()] - yprev(f); }

BoutReal extrapolate_sheath_o2(const Field3D& f) const {
return (f[ind()] * 3 - yprev(f)) * 0.5;
}

BoutReal extrapolate_next_o2(const Field3D& f) const { return 2 * f[ind()] - yprev(f); }

BoutReal
extrapolate_next_o2(const std::function<BoutReal(int yoffset, Ind3D ind)>& f) const {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "std::function" is directly included [misc-include-cleaner]

include/bout/boundary_iterator.hxx:6:

+ #include <functional>

return 2 * f(0, ind()) - f(0, ind().yp(-by).xp(-bx));
}

BoutReal interpolate_sheath_o1(const Field3D& f) const {
return (f[ind()] + ynext(f)) * 0.5;
}
BoutReal
extrapolate_sheath_o2(const std::function<BoutReal(int yoffset, Ind3D ind)>& f) const {
return 0.5 * (3 * f(0, ind()) - f(0, ind().yp(-by).xp(-bx)));
}

void limitFree(Field3D& f) const {
const BoutReal fac =
bout::parallel_boundary_region::limitFreeScale(yprev(f), ythis(f));
BoutReal val = ythis(f);
for (int i = 1; i <= localmesh->ystart; ++i) {
val *= fac;
f[ind().yp(by * i).xp(bx * i)] = val;
}
}

void neumann_o1(Field3D& f, BoutReal grad) const {
BoutReal val = ythis(f);
for (int i = 1; i <= localmesh->ystart; ++i) {
val += grad;
f[ind().yp(by * i).xp(bx * i)] = val;
}
}

void neumann_o2(Field3D& f, BoutReal grad) const {
BoutReal val = yprev(f) + grad;
for (int i = 1; i <= localmesh->ystart; ++i) {
val += grad;
f[ind().yp(by * i).xp(bx * i)] = val;
}
}

BoutReal& ynext(Field3D& f) const { return f[ind().yp(by).xp(bx)]; }
const BoutReal& ynext(const Field3D& f) const { return f[ind().yp(by).xp(bx)]; }
BoutReal& yprev(Field3D& f) const { return f[ind().yp(-by).xp(-bx)]; }
const BoutReal& yprev(const Field3D& f) const { return f[ind().yp(-by).xp(-bx)]; }
BoutReal& ythis(Field3D& f) const { return f[ind()]; }
const BoutReal& ythis(const Field3D& f) const { return f[ind()]; }

void setYPrevIfValid(Field3D& f, BoutReal val) const { yprev(f) = val; }
void setAll(Field3D& f, const BoutReal val) const {
for (int i = -localmesh->ystart; i <= localmesh->ystart; ++i) {
f[ind().yp(by * i).xp(bx * i)] = val;
}
}

int abs_offset() const { return 1; }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: method 'abs_offset' can be made static [readability-convert-member-functions-to-static]

Suggested change
int abs_offset() const { return 1; }
static int abs_offset() { return 1; }


#if BOUT_USE_METRIC_3D == 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "BOUT_USE_METRIC_3D" is directly included [misc-include-cleaner]

include/bout/boundary_iterator.hxx:2:

- #include "bout/mesh.hxx"
+ #include "bout/build_defines.hxx"
+ #include "bout/mesh.hxx"

BoutReal& ynext(Field2D& f) const { return f[ind().yp(by).xp(bx)]; }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "Field2D" is directly included [misc-include-cleaner]

include/bout/boundary_iterator.hxx:2:

- #include "bout/mesh.hxx"
+ #include "bout/field2d.hxx"
+ #include "bout/mesh.hxx"

const BoutReal& ynext(const Field2D& f) const { return f[ind().yp(by).xp(bx)]; }
BoutReal& yprev(Field2D& f) const { return f[ind().yp(-by).xp(-bx)]; }
const BoutReal& yprev(const Field2D& f) const { return f[ind().yp(-by).xp(-bx)]; }
#endif

const int dir;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: member 'dir' of type 'const int' is const qualified [cppcoreguidelines-avoid-const-or-ref-data-members]

  const int dir;
            ^

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: member variable 'dir' has public visibility [cppcoreguidelines-non-private-member-variables-in-classes]

  const int dir;
            ^


protected:
int z{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: member variable 'z' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]

  int z{0};
      ^

int x;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: member variable 'x' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]

  int x;
      ^

int y;
const int bx;
const int by;

private:
Mesh* localmesh;
int nx() const { return localmesh->LocalNx; }
int ny() const { return localmesh->LocalNy; }
int nz() const { return localmesh->LocalNz; }

Ind3D xyz2ind(int x, int y, int z) const {
return Ind3D{(x * ny() + y) * nz() + z, ny(), nz()};
}
};

class BoundaryRegionIterY : public BoundaryRegionIter {
public:
BoundaryRegionIterY(RangeIterator r, int y, int dir, bool is_end, Mesh* mesh)
: BoundaryRegionIter(r.ind, y, 0, dir, mesh), r(r), is_end(is_end) {}

bool operator!=(const BoundaryRegionIterY& rhs) {
ASSERT2(y == rhs.y);
if (is_end) {
if (rhs.is_end) {
return false;
}
return !rhs.r.isDone();
}
if (rhs.is_end) {
return !r.isDone();
}
return x != rhs.x;
}

virtual void _next() override {
++r;
x = r.ind;
}

private:
RangeIterator r;
bool is_end;
};

class NewBoundaryRegionY {
public:
NewBoundaryRegionY(Mesh* mesh, bool lower, RangeIterator r)
: mesh(mesh), lower(lower), r(std::move(r)) {}
BoundaryRegionIterY begin(bool begin = true) {
return BoundaryRegionIterY(r, lower ? mesh->ystart : mesh->yend, lower ? -1 : +1,
!begin, mesh);
}
BoundaryRegionIterY end() { return begin(false); }

private:
Mesh* mesh;
bool lower;
RangeIterator r;
};
3 changes: 3 additions & 0 deletions include/bout/boundary_region.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ class BoundaryRegion;
#ifndef BOUT_BNDRY_REGION_H
#define BOUT_BNDRY_REGION_H

#include "bout/mesh.hxx"
#include "bout/region.hxx"
#include "bout/sys/parallel_stencils.hxx"
#include <string>
#include <utility>

Expand Down
5 changes: 3 additions & 2 deletions include/bout/coordinates.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,10 @@ public:
transform = std::move(pt);
}

bool hasParallelTransform() const { return transform != nullptr; }
/// Return the parallel transform
ParallelTransform& getParallelTransform() {
ASSERT1(transform != nullptr);
ParallelTransform& getParallelTransform() const {
ASSERT1(hasParallelTransform());
return *transform;
}

Expand Down
Loading