Skip to content

Allow X splitting with FCI#2651

Merged
bendudson merged 49 commits into
nextfrom
fci-splitting
Oct 12, 2025
Merged

Allow X splitting with FCI#2651
bendudson merged 49 commits into
nextfrom
fci-splitting

Conversation

@dschwoerer
Copy link
Copy Markdown
Contributor

Uses PETSc. Currently only implemented for hermitespline.

dschwoerer and others added 21 commits February 8, 2023 10:05
Might help with performance
Otherwise the regions aren't cached.
Might help with performance
Precalculate the matrix. This hard-codes the DDX and DDZ derivative to
C2.

Rather than taking derivatives, this first does the matrix-matrix
multiplication and then does only a single matrix-vector operation,
rather than 4.

Retains a switch to go back to the old version.
release leaks the pointer, reset free's the object.
* helped finding the bug for the boundary
* rather slow (around 1 minute)
* needs internet connectivity
@dschwoerer
Copy link
Copy Markdown
Contributor Author

Requires #2324

@dschwoerer dschwoerer changed the title Allow X splitting with FCI [blocked] Allow X splitting with FCI Feb 8, 2023
@dschwoerer dschwoerer closed this Feb 8, 2023
@dschwoerer dschwoerer changed the title [blocked] Allow X splitting with FCI Allow X splitting with FCI Feb 8, 2023
@dschwoerer dschwoerer reopened this Feb 8, 2023
@dschwoerer dschwoerer marked this pull request as draft February 8, 2023 13:10
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

XZHermiteSpline(const BoutMask& mask, int y_offset = 0, Mesh* mesh = nullptr)
: XZHermiteSpline(y_offset, mesh) {
region = regionFromMask(mask, localmesh);
setRegion(regionFromMask(mask, localmesh));
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 matching member function for call to 'setRegion' [clang-diagnostic-error]

    setRegion(regionFromMask(mask, localmesh));
    ^
Additional context

include/bout/interpolation_xz.hxx:77: candidate function not viable: no known conversion from 'XZHermiteSpline' to 'XZInterpolation' for object argument

  void setRegion(const std::unique_ptr<Region<Ind3D>> region) { setRegion(*region); }
       ^

include/bout/interpolation_xz.hxx:74: candidate function not viable: no known conversion from 'XZHermiteSpline' to 'XZInterpolation' for object argument

  void setRegion(const std::string& region_name) {
       ^

include/bout/interpolation_xz.hxx:78: candidate function not viable: no known conversion from 'XZHermiteSpline' to 'XZInterpolation' for object argument

  void setRegion(const Region<Ind3D>& region) {
       ^

XZLagrange4pt(const BoutMask& mask, int y_offset = 0, Mesh* mesh = nullptr)
: XZLagrange4pt(y_offset, mesh) {
region = regionFromMask(mask, localmesh);
setRegion(regionFromMask(mask, localmesh));
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 matching member function for call to 'setRegion' [clang-diagnostic-error]

    setRegion(regionFromMask(mask, localmesh));
    ^
Additional context

include/bout/interpolation_xz.hxx:77: candidate function not viable: no known conversion from 'XZLagrange4pt' to 'XZInterpolation' for object argument

  void setRegion(const std::unique_ptr<Region<Ind3D>> region) { setRegion(*region); }
       ^

include/bout/interpolation_xz.hxx:74: candidate function not viable: no known conversion from 'XZLagrange4pt' to 'XZInterpolation' for object argument

  void setRegion(const std::string& region_name) {
       ^

include/bout/interpolation_xz.hxx:78: candidate function not viable: no known conversion from 'XZLagrange4pt' to 'XZInterpolation' for object argument

  void setRegion(const Region<Ind3D>& region) {
       ^

XZBilinear(const BoutMask& mask, int y_offset = 0, Mesh* mesh = nullptr)
: XZBilinear(y_offset, mesh) {
region = regionFromMask(mask, localmesh);
setRegion(regionFromMask(mask, localmesh));
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 matching member function for call to 'setRegion' [clang-diagnostic-error]

    setRegion(regionFromMask(mask, localmesh));
    ^
Additional context

include/bout/interpolation_xz.hxx:77: candidate function not viable: no known conversion from 'XZBilinear' to 'XZInterpolation' for object argument

  void setRegion(const std::unique_ptr<Region<Ind3D>> region) { setRegion(*region); }
       ^

include/bout/interpolation_xz.hxx:74: candidate function not viable: no known conversion from 'XZBilinear' to 'XZInterpolation' for object argument

  void setRegion(const std::string& region_name) {
       ^

include/bout/interpolation_xz.hxx:78: candidate function not viable: no known conversion from 'XZBilinear' to 'XZInterpolation' for object argument

  void setRegion(const Region<Ind3D>& region) {
       ^

Comment thread include/bout/utils.hxx Outdated
return data[i.ind];
}

T& operator[](Ind3D 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: class member cannot be redeclared [clang-diagnostic-error]

  T& operator[](Ind3D i) {
     ^
Additional context

include/bout/utils.hxx:363: previous definition is here

  T& operator[](Ind3D i) {
     ^

#ifdef HS_USE_PETSC
IndConverter conv{localmesh};
#endif
BOUT_FOR(i, getRegion(region)) {
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 matching member function for call to 'getRegion' [clang-diagnostic-error]

  BOUT_FOR(i, getRegion(region)) {
              ^
Additional context

include/bout/region.hxx:135: expanded from macro 'BOUT_FOR'

  BOUT_FOR_OMP(index, region, parallel for schedule(BOUT_OPENMP_SCHEDULE))
                      ^

include/bout/region.hxx:131: expanded from macro 'BOUT_FOR_OMP'

#define BOUT_FOR_OMP(index, region, omp_pragmas) BOUT_FOR_SERIAL(index, region)
                                                                        ^

include/bout/region.hxx:119: expanded from macro 'BOUT_FOR_SERIAL'

  for (auto block = region.getBlocks().cbegin(), end = region.getBlocks().cend(); \
                    ^

include/bout/interpolation_xz.hxx:91: candidate function not viable: no known conversion from 'XZHermiteSpline' to 'const XZInterpolation' for object argument

  const Region<Ind3D>& getRegion(const std::string& region) const {
                       ^

include/bout/interpolation_xz.hxx:87: candidate function not viable: requires 0 arguments, but 1 was provided

  const Region<Ind3D>& getRegion() const {
                       ^

@@ -59,67 +59,50 @@ Field3D XZMonotonicHermiteSpline::interpolate(const Field3D& f,

const auto curregion{getRegion(region)};
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 matching member function for call to 'getRegion' [clang-diagnostic-error]

  const auto curregion{getRegion(region)};
                       ^
Additional context

include/bout/interpolation_xz.hxx:91: candidate function not viable: no known conversion from 'const XZMonotonicHermiteSpline' to 'const XZInterpolation' for object argument

  const Region<Ind3D>& getRegion(const std::string& region) const {
                       ^

include/bout/interpolation_xz.hxx:87: candidate function not viable: requires 0 arguments, but 1 was provided

  const Region<Ind3D>& getRegion() const {
                       ^

ZedThree added a commit that referenced this pull request May 24, 2024
@dschwoerer
Copy link
Copy Markdown
Contributor Author

@ZedThree clang-tidy-review is failing with:

 Removing already posted or extra comments
Traceback (most recent call last):
  File "/usr/local/bin/review", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/clang_tidy_review/review.py", line 183, in main
    post_review(
  File "/usr/local/lib/python3.12/dist-packages/clang_tidy_review/__init__.py", line 1341, in post_review
    trimmed_review = cull_comments(pull_request, decorated_review, max_comments)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/clang_tidy_review/__init__.py", line 1243, in cull_comments
    posted_comments = {HashableComment(**c) for c in pull_request.get_pr_comments()}
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/github/PaginatedList.py", line 84, in __iter__
    newElements = self._grow()
                  ^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/github/PaginatedList.py", line 95, in _grow
    newElements = self._fetchNextPage()
                  ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/github/PaginatedList.py", line 324, in _fetchNextPage
    return self._getPage(data, headers)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/github/PaginatedList.py", line 357, in _getPage
    self.__contentClass(self.__requester, headers, self._transformAttributes(element))  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: PullRequest.get_pr_comments.<locals>.get_element() missing 1 required positional argument: 'completed'

Do you know what is going on?

@ZedThree
Copy link
Copy Markdown
Member

I thought it might be from an outdated version of clang-tidy-review, but it looks like you just merged in next and I thought it was updated there

@bendudson bendudson merged commit 0400b72 into next Oct 12, 2025
30 of 31 checks passed
@bendudson bendudson deleted the fci-splitting branch October 12, 2025 20:35
@boutproject boutproject deleted a comment from github-actions Bot Oct 13, 2025
@boutproject boutproject deleted a comment from github-actions Bot Oct 13, 2025
@boutproject boutproject deleted a comment from github-actions Bot Oct 13, 2025
@boutproject boutproject deleted a comment from github-actions Bot Oct 13, 2025
@boutproject boutproject deleted a comment from github-actions Bot Oct 13, 2025
@boutproject boutproject deleted a comment from github-actions Bot Oct 13, 2025
@boutproject boutproject deleted a comment from github-actions Bot Oct 13, 2025
@boutproject boutproject deleted a comment from github-actions Bot Oct 13, 2025
@boutproject boutproject deleted a comment from github-actions Bot Oct 13, 2025
@boutproject boutproject deleted a comment from github-actions Bot Oct 13, 2025
@boutproject boutproject deleted a comment from github-actions Bot Oct 13, 2025
@boutproject boutproject deleted a comment from github-actions Bot Oct 13, 2025
@boutproject boutproject deleted a comment from github-actions Bot Oct 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants