Skip to content

Conversation

@UCaromel
Copy link
Contributor

This branch is on top of #1061 and #1062.

This adds the TensorFieldOverlap and modifies the TensorFieldData and Geometry to work with it. The goal is to have a SAMRAI algorithm for an entire TensorField without relying on several RegisterRefine with different fillpaterns per geometry, which we saw was not a solution as SAMRAI remove our fill patern in its internal schedules (eg copy to a temporary level) thus putting each component in a single equivalent class and using the same geometry for all components.
With this PR the overlaps for all components are computed together and used for copy and refinement.

What's WIP:

  • debug the failing tests
  • refactor the TensorFieldData to use FieldDatas and FieldData functions directly
  • remove any debug prints that may still be there

UCaromel added 2 commits July 10, 2025 16:41
BROKEN

adding the patch refine strategy for the magnetic field

3D for magnetic regriding

the path of the SAMRAI

cleanup and comments

back to NaNs

3d fixes + refactoring

back to iterating on the fine field box (in mpi the fine_box might be different from the patch box)

pr comments

initial commit, E accumulation

BROKEN

refluxing without divB

new magnetic field refinement implementing Toth and Roe (2002)

adding the patch refine strategy for the magnetic field

forcing even number of ghost cells

3D for magnetic regriding

the path of the SAMRAI

cleanup and comments

back to NaNs

3d fixes + refactoring

back to iterating on the fine field box (in mpi the fine_box might be different from the patch box)

pr comments

initial commit, E accumulation

BROKEN

adding the patch refine strategy for the magnetic field

3D for magnetic regriding

the path of the SAMRAI

cleanup and comments

back to NaNs

3d fixes + refactoring

back to iterating on the fine field box (in mpi the fine_box might be different from the patch box)

pr comments

BROKEN

refluxing without divB

rebase master
@coderabbitai
Copy link

coderabbitai bot commented Jul 30, 2025

Important

Review skipped

Ignore keyword(s) in the title.

⛔ Ignored keywords (1)
  • WIP

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@UCaromel UCaromel marked this pull request as draft July 30, 2025 17:18
auto& by = FieldDataT::getField(fine, by_id_);
auto& bz = FieldDataT::getField(fine, bz_id_);
auto& fields = TensorFieldDataT::getFields(fine, b_id_);
auto& [bx, by, bz] = fields;

Check notice

Code scanning / CodeQL

Unused local variable

Variable by is not used.
auto& by = FieldDataT::getField(fine, by_id_);
auto& bz = FieldDataT::getField(fine, bz_id_);
auto& fields = TensorFieldDataT::getFields(fine, b_id_);
auto& [bx, by, bz] = fields;

Check notice

Code scanning / CodeQL

Unused local variable

Variable bz is not used.
{
auto static constexpr dim = Dst::dimension;

auto const& [localDestBox, localSrcBox, alpha] = std::forward_as_tuple(args...);

Check notice

Code scanning / CodeQL

Unused local variable

Variable (unnamed local variable) is not used.
class HybridMessengerInfo : public IMessengerInfo
{
using VecFieldNames = core::VecFieldNames;
// using std::string = core::std::string;

Check notice

Code scanning / CodeQL

Commented-out code

This comment appears to contain commented-out code.
#include "core/def.hpp"
#include "core/data/field/field.hpp"
#include "core/utilities/types.hpp"
// #include "core/data/field/field.hpp"

Check notice

Code scanning / CodeQL

Commented-out code

This comment appears to contain commented-out code.
Comment on lines +158 to +160
// EXPECT_EQ("EM_B_x", modelInfo.modelMagnetic.xName);
// EXPECT_EQ("EM_B_y", modelInfo.modelMagnetic.yName);
// EXPECT_EQ("EM_B_z", modelInfo.modelMagnetic.zName);

Check notice

Code scanning / CodeQL

Commented-out code

This comment appears to contain commented-out code.
Comment on lines +163 to +165
// EXPECT_EQ("EM_E_x", modelInfo.modelElectric.xName);
// EXPECT_EQ("EM_E_y", modelInfo.modelElectric.yName);
// EXPECT_EQ("EM_E_z", modelInfo.modelElectric.zName);

Check notice

Code scanning / CodeQL

Commented-out code

This comment appears to contain commented-out code.


TYPED_TEST(SimulatorTest, knowsWhichSolverisOnAGivenLevel)
TYPED_TEST(SimulatorTest, knowsWhichSolverIsOnAGivenLevel)

Check notice

Code scanning / CodeQL

Unused static variable

Static variable gtest_SimulatorTest_knowsWhichSolverIsOnAGivenLevel_registered_ is never read.


TYPED_TEST(SimulatorTest, returnsCorrecMessengerForEachLevel)
TYPED_TEST(SimulatorTest, returnsCorrectMessengerForEachLevel)

Check notice

Code scanning / CodeQL

Unused static variable

Static variable gtest_SimulatorTest_returnsCorrectMessengerForEachLevel_registered_ is never read.

// no fill pattern given for this init
// will use boxgeometryvariable fillpattern, itself using the
// gield geometry with overwrit_interior true from SAMRAI
Copy link
Member

Choose a reason for hiding this comment

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

gield :D

Comment on lines +82 to +83
// auto& mhdModel = *sim.getMHDModel();
//

Check notice

Code scanning / CodeQL

Commented-out code

This comment appears to contain commented-out code.
Comment on lines +86 to +102
// if (isInMHDdRange(iLevel))
// {
// auto Bid = mhdModel.resourcesManager->getIDs(mhdModel.state.B);
// auto Vid = mhdModel.resourcesManager->getIDs(mhdModel.state.V);
//
// std::array<std::vector<int> const*, 2> allIDs{{&Bid, &Vid}};
//
// for (auto& idVec : allIDs)
// {
// for (auto& id : *idVec)
// {
// auto level = hierarchy.getPatchLevel(iLevel);
// auto patch = level->begin();
// EXPECT_TRUE(patch->checkAllocated(id));
// }
// }
// }

Check notice

Code scanning / CodeQL

Commented-out code

This comment appears to contain commented-out code.
extra_diag_options["mode"] = "overwrite"
extra_diag_options["dir"] = diag_outputs
self.register_diag_dir_for_cleanup(diag_outputs)
# self.register_diag_dir_for_cleanup(diag_outputs)
Copy link
Member

Choose a reason for hiding this comment

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

we probably want to revert this

PhilipDeegan and others added 21 commits August 1, 2025 13:42
* PatchGhostLess

* comments

* Update particles_variable_fill_pattern.hpp

* slightly raise empirical threshold for PGL

* blackened \m/

* torm

* point conventions

---------

Co-authored-by: Nicolas Aunai <[email protected]>
- PatchData NaN initialized on construction
- fix tests failing as result of above
- comment a field refinement test (useless, wrong refinement op for E,B)
- debug plots for advance field overlap test
- copy done before refinement (boolean false in variable)
- overwrite_interior false also for refinement is default for
  FieldFillPattern
- J manually init to zero in model init, fine init and regrid init (Jx
  unused in ampere but used in Ohm with its now NaN values)
- Grid/NdarrayVector take default value overrides (for test)
- UsableTensorField is default constructed with zero init.
@UCaromel
Copy link
Contributor Author

UCaromel commented Aug 1, 2025

replaced by #1068

@UCaromel UCaromel closed this Aug 1, 2025
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.

3 participants