Skip to content

Field3DParallel #3149

Merged
dschwoerer merged 323 commits into
fci-auto-with-debug-higher-orderfrom
f3dwy
Nov 6, 2025
Merged

Field3DParallel #3149
dschwoerer merged 323 commits into
fci-auto-with-debug-higher-orderfrom
f3dwy

Conversation

@dschwoerer
Copy link
Copy Markdown
Contributor

This should replace #3004

ZedThree and others added 27 commits June 26, 2025 15:53
Removes some clang-tidy warnings and silences one about reinterpret_cast
---
updated-dependencies:
- dependency-name: externalpackages/boutdata
  dependency-version: 7164a89c16dba1049d42e1715506b988c0af5926
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
`FieldFactory` expects an `input` section, so this cannot be used as a
variable name in the input file
…kward euler SNES solver.

The user sets target_its a desired number of nonlinear iterations and the timestep is updated based on the ratio of that number and the actual number on nonlinear iteration of each Newton step. The exponent can be tuned to the problem needs. A smaller exponent results in smaller changes of dt.
Code changes suggested by ZedThree

Co-authored-by: Peter Hill <peter.hill@york.ac.uk>
Co-authored-by: Peter Hill <peter.hill@york.ac.uk>
Co-authored-by: Peter Hill <peter.hill@york.ac.uk>
Co-authored-by: Peter Hill <peter.hill@york.ac.uk>
Co-authored-by: Peter Hill <peter.hill@york.ac.uk>
Co-authored-by: Peter Hill <peter.hill@york.ac.uk>
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions


template <typename T>
auto& getStore() {
if constexpr (std::is_same<T, Field3DParallel>::value) {
Copy link
Copy Markdown
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 "Field3DParallel" is directly included [misc-include-cleaner]

include/bout/deriv_store.hxx:36:

- #include <bout/scorepwrapper.hxx>
+ #include "bout/field3d.hxx"
+ #include <bout/scorepwrapper.hxx>


template <typename T>
auto& getStore() {
if constexpr (std::is_same<T, Field3DParallel>::value) {
Copy link
Copy Markdown
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::is_same" is directly included [misc-include-cleaner]

include/bout/deriv_store.hxx:34:

- #include <unordered_map>
+ #include <type_traits>
+ #include <unordered_map>

template <typename T>
auto& getStore() {
if constexpr (std::is_same<T, Field3DParallel>::value) {
return DerivativeStore<Field3D>::getInstance();
Copy link
Copy Markdown
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]

    return DerivativeStore<Field3D>::getInstance();
                           ^

Comment thread include/bout/field3d.hxx
return are_unaligned ? fromFieldAligned(result, region) : result;
}
}
inline Field3D VDDY(const Field3D& v, const Field3DParallel& f,
Copy link
Copy Markdown
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 "Field3DParallel" is directly included [misc-include-cleaner]

include/bout/index_derivs_interface.hxx:31:

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

Comment thread src/field/field3d.cxx Outdated
Comment thread src/field/field3d.cxx Outdated
result.setRegion(lhs.getMesh()->getCommonRegion(lhs.getRegionID(), rhs.getRegionID()));
if (lhs.isFci()) {
result.splitParallelSlices();
for (size_t i{0}; i < lhs.numberParallelSlices(); ++i) {
Copy link
Copy Markdown
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 "size_t" is directly included [misc-include-cleaner]

src/field/generated_fieldops.cxx:7:

+ #include <cstddef>

Comment thread src/mesh/coordinates.cxx

Field3D Coordinates::DDY(const Field3D& f, CELL_LOC outloc, const std::string& method,
const std::string& region) const {
Field3D Coordinates::DDY(const Field3DParallel& f, CELL_LOC outloc,
Copy link
Copy Markdown
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 "Field3DParallel" is directly included [misc-include-cleaner]

Field3D Coordinates::DDY(const Field3DParallel& f, CELL_LOC outloc,
                               ^

Comment thread src/sys/derivs.cxx
////////////// Y DERIVATIVE /////////////////

Field3D DDY(const Field3D& f, CELL_LOC outloc, const std::string& method,
Field3D DDY(const Field3DParallel& f, CELL_LOC outloc, const std::string& method,
Copy link
Copy Markdown
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 "Field3DParallel" is directly included [misc-include-cleaner]

Field3D DDY(const Field3DParallel& f, CELL_LOC outloc, const std::string& method,
                  ^

@ZedThree
Copy link
Copy Markdown
Member

Nice, thanks @dschwoerer! Please could you add a docstring to the class to explain the motivation for it, when it should be used and how?

I think most of the clang-tidy warnings can be fixed automatically if you run it locally

ZedThree and others added 27 commits November 3, 2025 17:40
Merge Jacobian coloring into PETSc solver
MPI_Comm can be a pointer or an int (or anything else)

Co-authored-by: Peter Hill <peter.hill@york.ac.uk>
They are not needed anymore with cmake
It was very outdated
@dschwoerer dschwoerer merged commit 276917d into fci-auto-with-debug-higher-order Nov 6, 2025
26 of 27 checks passed
@dschwoerer dschwoerer deleted the f3dwy branch November 6, 2025 08:04
@dschwoerer dschwoerer restored the f3dwy branch November 6, 2025 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants