Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
365 commits
Select commit Hold shift + click to select a range
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
be5e285
fix bad merge
dschwoerer Mar 14, 2025
092c578
Apply clang-format changes
dschwoerer Mar 14, 2025
2fb1b34
Add option to copy parallel slices at setBoundaryTo
dschwoerer Mar 14, 2025
7a1d061
Print timings for petsc solver in test
dschwoerer Mar 14, 2025
a6be0ab
Add Field2D::splitParallelSlices() for writing FCI aware code
dschwoerer Mar 14, 2025
862f7fd
Introduce Field3DParallel
dschwoerer Jun 26, 2025
d1c5689
No need for orderedDicts
dschwoerer Jun 26, 2025
e01bda2
Remove wrong comment, FieldPerp is present
dschwoerer Jun 26, 2025
86dc232
Implement more of Field3DParallel
dschwoerer Jul 10, 2025
167e39e
Start using Field3DParallel for derivatives
dschwoerer Jul 10, 2025
59445b6
Do not use separate derivative store for Field3DParallel
dschwoerer Jul 16, 2025
1f3521f
Apply clang-format changes
dschwoerer Jul 16, 2025
8c40bad
Do not change non-FCI fields
dschwoerer Jul 16, 2025
3f859b3
Merge remote-tracking branch 'origin/next' into f3dwy
dschwoerer Jul 17, 2025
58811c8
Merge remote-tracking branch 'origin/next' into fci-auto-with-debug-h…
dschwoerer Jul 17, 2025
05dd58e
Merge branch 'fci-auto-with-debug-higher-order' into f3dwy
dschwoerer Jul 17, 2025
784d381
Add function to header file
dschwoerer Jul 17, 2025
b880846
Ensure emptyFrom works
dschwoerer Jul 17, 2025
844f2d4
Use f3dwy to preserve parallel fields
dschwoerer Jul 17, 2025
25fd12f
Also load dy
dschwoerer Jul 17, 2025
5e1a3df
Preserve parallel fields for d1_dy calculation
dschwoerer Jul 17, 2025
e034ddd
Add overloads for DD?(Field3DParallel)
dschwoerer Jul 17, 2025
cdcb380
Apply clang-format changes
dschwoerer Jul 17, 2025
da7865d
add asF3dwy() stub to Field2D
dschwoerer Jul 18, 2025
6a75dfc
Apply clang-format changes
dschwoerer Jul 18, 2025
79af980
Loosen tolerance for hypre3d test
dschwoerer Mar 11, 2025
cb29794
Merge remote-tracking branch 'origin/next' into f3dwy
dschwoerer Jul 18, 2025
3e9bdfd
Add some documentation
dschwoerer Jul 18, 2025
24e96d0
Be more explicit in the naming
dschwoerer Jul 18, 2025
196138a
Apply clang-tidy fix
dschwoerer Jul 18, 2025
a7acfc3
Disable hypre3d test
dschwoerer Jul 21, 2025
b8da0fb
do not use const for BoutReal in signature
dschwoerer Jul 21, 2025
f32693d
Add Field3DParallel + Field2D fieldops
dschwoerer Jul 21, 2025
0ecf55c
Move function definition after class definition
dschwoerer Jul 21, 2025
3012a22
Prefer std::move
dschwoerer Jul 21, 2025
63a78d9
Apply clang-format changes
dschwoerer Jul 21, 2025
2f98162
Add binary operators Field2D - FieldPerp
dschwoerer Jul 21, 2025
fdbbed6
Remove some FCI_AUTOMAGIC
dschwoerer Jul 21, 2025
cb643eb
Only use "parallel_neumann_o2" if no other parallel bc set
dschwoerer Jul 21, 2025
86fc85b
Apply clang-format changes
dschwoerer Jul 21, 2025
857e8c3
Declare Field3DParallel
dschwoerer Jul 21, 2025
e105d03
Do not automatically apply parallel BCs
dschwoerer Aug 18, 2025
fa51a14
Add default argument like for Field3D
dschwoerer Aug 21, 2025
f18392d
Add missing functions
dschwoerer Aug 21, 2025
d915bfb
Ensure assignment to a Field3DParallel does not fail
dschwoerer Aug 21, 2025
a5c36b1
set parallel Bxy consistent with J and g_22
dschwoerer Aug 21, 2025
6a05d58
Add fix also to source of the generated code
dschwoerer Aug 21, 2025
96e710b
Prefer std::vector::emplace_back to work around cuda compiler issue
dschwoerer Aug 21, 2025
baa56fe
Apply clang-format changes
dschwoerer Aug 21, 2025
28dec7a
remove unneeded std::move
dschwoerer Aug 21, 2025
0560964
add filledFrom for Field3DParallel
dschwoerer Aug 25, 2025
c964ff6
Allocate before usage
dschwoerer Aug 25, 2025
2f239ad
Merge remote-tracking branch 'origin/next' into f3dwy
dschwoerer Aug 25, 2025
b968273
Allow more parallel boundary regions
dschwoerer Sep 1, 2025
43bfa9a
Add limit_at_least function to boundary_iterator
dschwoerer Sep 1, 2025
370c42d
Preserve more when coping Field3D
dschwoerer Sep 30, 2025
107b518
add resetRegionParallel
dschwoerer Sep 30, 2025
4789b41
Set regions on parallel slices
dschwoerer Sep 30, 2025
6b993da
Add check that parallel slices have valid region
dschwoerer Sep 30, 2025
705414c
Remove commented out code
dschwoerer Sep 30, 2025
36f19fa
CI: Don't run clang-{tidy,format} on RC branches
ZedThree Oct 6, 2025
aaa4600
Fix reorder warning from snes
ZedThree Oct 6, 2025
e48cc34
Fix some easy clang-tidy snes warnings
ZedThree Oct 6, 2025
a855c06
Bump bundled fmt
ZedThree Oct 6, 2025
e2cd97c
Fix deprecation warning
ZedThree Oct 6, 2025
89b0855
Remove `boututils` from requirements; bump `boutdata`
ZedThree Oct 6, 2025
1704a4a
Suppress warning from `nodiscard` function
ZedThree Oct 6, 2025
8c26fe3
Add shim for ARKodeGetNumRhsEvals
ZedThree Oct 6, 2025
ef744ea
tests: Ruff fixes for FCI runtest
ZedThree Oct 7, 2025
d889ecf
tests: Expand FCI MMS test to `Grad2_par2`
ZedThree Oct 7, 2025
122c39a
tests: Generalise FCI MMS test to allow for more cases
ZedThree Oct 7, 2025
1a0af58
tests: Add test for FCI `Div_par`
ZedThree Oct 7, 2025
1e912bd
tests: Make MMS script update input in-place
ZedThree Oct 7, 2025
560b005
tests: Add test for FCI `Div_par_K_Grad_par`
ZedThree Oct 7, 2025
8910b61
Many small fixes for FCI
ZedThree Oct 7, 2025
d170ca8
tests: Fix for 3D metric in FCI test
ZedThree Oct 8, 2025
bdef58e
tests: Add test for FCI `Laplace_par`
ZedThree Oct 8, 2025
969997c
Reduce duplication in FCI mms script
ZedThree Oct 8, 2025
3468db4
Remove circular include
ZedThree Oct 8, 2025
aee8ecc
tests: Add cases for FCI interpolation methods
ZedThree Oct 8, 2025
8e9c0fc
tests: Increase nx for hermitespline interpolation boundary problem
ZedThree Oct 9, 2025
6a4204f
tests: Add monotonichermitespline, decrease resolution scan
ZedThree Oct 9, 2025
07987ac
Add check for flux conservation
dschwoerer Oct 21, 2025
f6b7b9e
Interpolate sheath is at least o2
dschwoerer Oct 21, 2025
086d68c
Apply clang-format changes
dschwoerer Oct 21, 2025
23a79a1
Interpolate sheath is at least o2
dschwoerer Oct 21, 2025
a680c16
add asField3DParallel() const
dschwoerer Oct 21, 2025
ac95a37
Add limitFreeScale and SheathLimitMode
dschwoerer Oct 21, 2025
0b8e27d
Add extrapolate_sheath_free
dschwoerer Oct 21, 2025
cffe52d
Add set_free
dschwoerer Oct 21, 2025
a0de0c7
add missing interpolate_sheath_o2(func) to FA
dschwoerer Oct 22, 2025
267d376
add is_lower() to check for which direction the boundary is
dschwoerer Oct 22, 2025
d8c3169
Add Field3DParallel::allocate
dschwoerer Oct 23, 2025
ffb69be
Apply clang-format changes
dschwoerer Oct 23, 2025
b1acf2c
Mark Field3DParallel constructors explicit
dschwoerer Oct 29, 2025
5a1419f
Add implict constructors only for Field2D and Field3D
dschwoerer Oct 29, 2025
3b86ba9
Apply clang-format changes
dschwoerer Oct 29, 2025
8879da7
Merge branch 'next' into fci-tests
ZedThree Nov 3, 2025
760a24f
tests: Small refactor of FCI tests
ZedThree Nov 3, 2025
58e2673
Apply black changes
ZedThree Nov 3, 2025
10b0d40
Apply clang-format changes
ZedThree Nov 4, 2025
4f34c70
Merge remote-tracking branch 'origin/next' into f3dwy
dschwoerer Nov 4, 2025
27db65c
Merge remote-tracking branch 'origin/fci-tests' into f3dwy
dschwoerer Nov 4, 2025
ec4148f
Remove workaround
dschwoerer Nov 4, 2025
4c12e70
Merge remote-tracking branch 'origin/f3dwy' into f3dwy
dschwoerer Nov 4, 2025
f25bb0f
Apply clang-format changes
dschwoerer Nov 4, 2025
99e28ca
Fix bad merge: Add Tensor::operator[](Ind3D)
dschwoerer Nov 4, 2025
ad30f00
Apply clang-tidy fixes to FCI tests
ZedThree Nov 4, 2025
f17d21a
Fix comment formatting
ZedThree Nov 4, 2025
8afbcbc
add yup and ydown property
dschwoerer Nov 5, 2025
28b2192
simplify template
dschwoerer Nov 5, 2025
698b6cf
Add some asserts for Field3DParallel
dschwoerer Nov 5, 2025
6e428c1
Ensure parallel slices are present
dschwoerer Nov 5, 2025
346ff3d
Simplify div_par
dschwoerer Nov 5, 2025
96f792f
Do not communicate the magnetic field
dschwoerer Nov 5, 2025
aad0182
Ensure parallel slices are set in FIELD_FUNC
dschwoerer Nov 5, 2025
281a115
Merge branch 'f3dwy' of https://github.com/boutproject/BOUT-dev into …
dschwoerer Nov 5, 2025
87cc79a
fixup bad merge
dschwoerer Nov 5, 2025
ec8b6d4
Apply clang-format changes
dschwoerer Nov 5, 2025
9de0c34
Only run fci test for 3D metric
dschwoerer Nov 5, 2025
b97b8c1
Apply suggestion from clang-tidy
dschwoerer Nov 6, 2025
732f4de
Use size_t consistently
dschwoerer Nov 6, 2025
abb5f90
Apply suggestions from clang-tidy
dschwoerer Nov 6, 2025
0751957
Apply clang-format changes
dschwoerer Nov 6, 2025
fb73f9b
clang-tidy fixes for f3dwy
dschwoerer Nov 6, 2025
6aed3df
Apply clang-format changes
dschwoerer Nov 6, 2025
f286975
Move const in front of type
dschwoerer Nov 6, 2025
783968a
Apply suggestion from @dschwoerer
ZedThree Nov 6, 2025
c8faf01
tests: Fix typo that made tests always pass
ZedThree Nov 6, 2025
3dbed9a
tests: Remove monotonichermitespline FCI case
ZedThree Nov 6, 2025
4c4190b
Fix issues from clang-tidy
dschwoerer Nov 7, 2025
c6d7644
Merge remote-tracking branch 'origin/fci-tests' into f3dwy
dschwoerer Nov 7, 2025
f3f3545
Revert "tests: Remove monotonichermitespline FCI case"
dschwoerer Nov 7, 2025
5fb8f47
Merge branch 'f3dwy' of https://github.com/boutproject/BOUT-dev into …
dschwoerer Nov 7, 2025
c58bf64
Merge remote-tracking branch 'origin/f3dwy-clang-tidy' into f3dwy
dschwoerer Nov 10, 2025
b55faaf
Load parallel magnetic field
dschwoerer Nov 10, 2025
b8b565e
Use parallel B rather then J, to conserve flux
dschwoerer Nov 10, 2025
f08c257
Apply clang-format changes
dschwoerer Nov 10, 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
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,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 @@ -376,6 +377,7 @@ if (zoidberg_FOUND EQUAL 0)
else()
set(zoidberg_FOUND OFF)
endif()
message(STATUS "Found Zoidberg for FCI tests: ${zoidberg_FOUND}")

option(BOUT_GENERATE_FIELDOPS "Automatically re-generate the Field arithmetic operators from the Python templates. \
Requires Python3, clang-format, and Jinja2. Turn this OFF to skip generating them if, for example, \
Expand Down Expand Up @@ -594,6 +596,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
2 changes: 1 addition & 1 deletion cmake/SetupBOUTThirdParty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,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)])
Copy link
Contributor

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)])
        ^

Copy link
Contributor

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)])
        ^


/******************************************************************
* *
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))
Copy link
Contributor

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))
        ^

Copy link
Contributor

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))
        ^


/******************************************************************
* *
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))
Copy link
Contributor

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))
        ^

Copy link
Contributor

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))
        ^


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

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

#include <algorithm>
#include <functional>
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: included header algorithm is not used directly [misc-include-cleaner]

Suggested change
#include <functional>
#include <functional>


class BoundaryRegionIter {
Copy link
Contributor

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:13: make it public and virtual

class BoundaryRegionIter {
      ^

Copy link
Contributor

Choose a reason for hiding this comment

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

warning: class 'BoundaryRegionIter' defines a default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions]

class BoundaryRegionIter {
      ^

Copy link
Contributor

Choose a reason for hiding this comment

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

warning: class 'BoundaryRegionIter' defines a default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions]

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);
}
bool operator!=(const BoundaryRegionIter& rhs) const { return ind() != rhs.ind(); }

Ind3D ind() const { return xyz2ind(x, y, z); }
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 {
Copy link
Contributor

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"

Copy link
Contributor

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:4:

- #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 {
return (2 * f(0, ind())) - f(0, ind().yp(-by).xp(-bx));
}

BoutReal interpolate_sheath_o2(const Field3D& f) const {
return (f[ind()] + ynext(f)) * 0.5;
}

BoutReal
interpolate_sheath_o2(const std::function<BoutReal(int yoffset, Ind3D ind)>& f) const {
return (f(0, ind()) + f(0, ind().yp(-by).xp(-bx))) * 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)));
}

BoutReal extrapolate_sheath_free(const Field3D& f, SheathLimitMode mode) const {
const BoutReal fac =
bout::parallel_boundary_region::limitFreeScale(yprev(f), ythis(f), mode);
const BoutReal val = ythis(f);
const BoutReal next = mode == SheathLimitMode::linear_free ? val + fac : val * fac;
return 0.5 * (val + next);
}

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

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;
}
}

bool is_lower() const {
ASSERT2(bx == 0);
return by == -1;
}

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;
}
}

void limit_at_least(Field3D& f, BoutReal value) const {
if (ynext(f) < value) {
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: use std::max instead of < [readability-use-std-min-max]

Suggested change
if (ynext(f) < value) {
ynext(f) = std::max(ynext(f), value);

ynext(f) = value;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: use std::max instead of < [readability-use-std-min-max]

include/bout/boundary_iterator.hxx:2:

- #include "bout/mesh.hxx"
+ #include <algorithm>
+ 
+ #include "bout/mesh.hxx"
Suggested change
}
ynext(f) = std::max(ynext(f), value);

Copy link
Contributor

Choose a reason for hiding this comment

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

warning: use std::max instead of < [readability-use-std-min-max]

Suggested change
}
ynext(f) = std::max(ynext(f), value);

}

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;
}
}

static int abs_offset() { return 1; }
Copy link
Contributor

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:4:

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


Copy link
Contributor

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:4:

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

#if BOUT_USE_METRIC_3D == 0
Copy link
Contributor

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:4:

- #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)]; }
Copy link
Contributor

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:4:

- #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
Copy link
Contributor

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;
            ^

Copy link
Contributor

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;
            ^


Copy link
Contributor

Choose a reason for hiding this comment

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

warning: '~BoundaryRegionIter' cannot be the name of a variable or data member [clang-diagnostic-error]

  virtual ~BoundaryRegionIter = default;
          ^

const int dir;
Copy link
Contributor

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;
            ^

Copy link
Contributor

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;
            ^

virtual ~BoundaryRegionIter() = default;

Copy link
Contributor

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;
      ^

protected:
Copy link
Contributor

Choose a reason for hiding this comment

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

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

  int y;
      ^

int z{0};
Copy link
Contributor

Choose a reason for hiding this comment

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

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

  const int bx;
            ^

Copy link
Contributor

Choose a reason for hiding this comment

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

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

  const int bx;
            ^

Copy link
Contributor

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;
Copy link
Contributor

Choose a reason for hiding this comment

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

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

  const int by;
            ^

Copy link
Contributor

Choose a reason for hiding this comment

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

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

  const int by;
            ^

Copy link
Contributor

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;
Copy link
Contributor

Choose a reason for hiding this comment

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

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

  int y;
      ^

const int bx;
Copy link
Contributor

Choose a reason for hiding this comment

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

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

  const int bx;
            ^

Copy link
Contributor

Choose a reason for hiding this comment

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

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

  const int bx;
            ^

const int by;
Copy link
Contributor

Choose a reason for hiding this comment

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

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

  const int by;
            ^

Copy link
Contributor

Choose a reason for hiding this comment

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

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

  const int by;
            ^


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

Choose a reason for hiding this comment

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

warning: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]

Suggested change
int nz() const { return localmesh->LocalNz; }
return Ind3D{((x * ny() + y) * nz()) + z, ny(), nz()};


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

Choose a reason for hiding this comment

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

warning: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]

Suggested change
return Ind3D{(x * ny() + y) * nz() + z, ny(), nz()};
return Ind3D{((x * ny() + y) * nz()) + z, ny(), nz()};

}
Copy link
Contributor

Choose a reason for hiding this comment

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

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

class BoundaryRegionIterY : public BoundaryRegionIter {
      ^
Additional context

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

class BoundaryRegionIterY : public BoundaryRegionIter {
      ^

};

Copy link
Contributor

Choose a reason for hiding this comment

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

warning: the parameter 'r' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]

Suggested change
BoundaryRegionIterY(const RangeIterator& r, int y, int dir, bool is_end, Mesh* mesh)

class BoundaryRegionIterY : public BoundaryRegionIter {
Copy link
Contributor

Choose a reason for hiding this comment

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

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

class BoundaryRegionIterY : public BoundaryRegionIter {
      ^
Additional context

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

class BoundaryRegionIterY : public BoundaryRegionIter {
      ^

public:
BoundaryRegionIterY(RangeIterator r, int y, int dir, bool is_end, Mesh* mesh)
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: the parameter 'r' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]

Suggested change
BoundaryRegionIterY(RangeIterator r, int y, int dir, bool is_end, Mesh* mesh)
BoundaryRegionIterY(const 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;
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: 'virtual' is redundant since the function is already declared 'override' [cppcoreguidelines-explicit-virtual-functions]

Suggested change
return x != rhs.x;
void _next() override {

}

virtual void _next() override {
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: 'virtual' is redundant since the function is already declared 'override' [cppcoreguidelines-explicit-virtual-functions]

Suggested change
virtual void _next() override {
void _next() override {

++r;
x = r.ind;
}

private:
RangeIterator r;
bool is_end;
};

Copy link
Contributor

Choose a reason for hiding this comment

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

warning: the parameter 'r' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]

Suggested change
NewBoundaryRegionY(Mesh* mesh, bool lower, const RangeIterator& r)

class NewBoundaryRegionY {
Copy link
Contributor

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::move" is directly included [misc-include-cleaner]

include/bout/boundary_iterator.hxx:12:

+ #include <utility>

Copy link
Contributor

Choose a reason for hiding this comment

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

warning: passing result of std::move() as a const reference argument; no move will actually happen [performance-move-const-arg]

Suggested change
class NewBoundaryRegionY {
: mesh(mesh), lower(lower), r(r) {}
Additional context

include/bout/sys/range.hxx:26: 'RangeIterator' is not move assignable/constructible

class RangeIterator {
      ^

public:
NewBoundaryRegionY(Mesh* mesh, bool lower, RangeIterator r)
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: the parameter 'r' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]

Suggested change
NewBoundaryRegionY(Mesh* mesh, bool lower, RangeIterator r)
NewBoundaryRegionY(Mesh* mesh, bool lower, const RangeIterator& r)

: mesh(mesh), lower(lower), r(std::move(r)) {}
Copy link
Contributor

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::move" is directly included [misc-include-cleaner]

include/bout/boundary_iterator.hxx:12:

+ #include <utility>

Copy link
Contributor

Choose a reason for hiding this comment

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

warning: passing result of std::move() as a const reference argument; no move will actually happen [performance-move-const-arg]

Suggested change
: mesh(mesh), lower(lower), r(std::move(r)) {}
: mesh(mesh), lower(lower), r(r) {}
Additional context

include/bout/sys/range.hxx:26: 'RangeIterator' is not move assignable/constructible

class RangeIterator {
      ^

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"
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: included header region.hxx is not used directly [misc-include-cleaner]

Suggested change
#include "bout/sys/parallel_stencils.hxx"
#include "bout/sys/parallel_stencils.hxx"

#include <string>
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: included header parallel_stencils.hxx is not used directly [misc-include-cleaner]

Suggested change
#include <string>
#include <string>

#include <utility>

Expand Down
Loading