Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read external fields from file in restarted simulation #4547

Merged
merged 12 commits into from
Jan 6, 2024

Conversation

RemiLehe
Copy link
Member

@RemiLehe RemiLehe commented Dec 20, 2023

When restarting a simulation, the grid external field from file were not read.
As a result, a restarted simulation (e.g. with the electrostatic solver, were the grid external fields are applied at every iteration) would suddenly not feature these fields (without any error or warning message).

@RemiLehe RemiLehe changed the title Read external fields from file even in restarted simulation [WIP] Read external fields from file even in restarted simulation Dec 20, 2023
@RemiLehe RemiLehe marked this pull request as draft December 20, 2023 03:14
@RemiLehe RemiLehe force-pushed the fix_external_field_restart branch from 3cf26e5 to b63faf8 Compare January 5, 2024 00:07
@RemiLehe RemiLehe changed the title [WIP] Read external fields from file even in restarted simulation Read external fields from file even in restarted simulation Jan 5, 2024
@RemiLehe RemiLehe marked this pull request as ready for review January 5, 2024 00:48
@RemiLehe RemiLehe closed this Jan 5, 2024
@RemiLehe RemiLehe reopened this Jan 5, 2024
@RemiLehe RemiLehe changed the title Read external fields from file even in restarted simulation Read external fields from file in restarted simulation Jan 5, 2024
# Diagnostics
diagnostics.diags_names = diag1
Copy link
Member Author

Choose a reason for hiding this comment

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

This test is now a restart test ; as a consequence, the checkpoints need to be saved.

@@ -728,6 +728,9 @@ void
WarpX::PostRestart ()
{
mypc->PostRestart();
Copy link
Member Author

Choose a reason for hiding this comment

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

This now loads external fields from file when restarting a simulation

@@ -901,34 +904,7 @@ WarpX::InitLevelData (int lev, Real /*time*/)
}
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Cleaning up by putting the code below in a separate function.

@ax3l ax3l added bug Something isn't working bug: affects latest release Bug also exists in latest release version component: checkpoint/restart Checkpointing & restarts labels Jan 5, 2024
Copy link
Member

@ax3l ax3l left a comment

Choose a reason for hiding this comment

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

Thank you for this fix, looks good!

Agreed to add the docstring / todo's in your PR description, but will approve already.

@ax3l ax3l self-assigned this Jan 5, 2024
@RemiLehe RemiLehe enabled auto-merge (squash) January 5, 2024 22:04
Copy link
Member

@ax3l ax3l left a comment

Choose a reason for hiding this comment

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

Docs look great, thx.

@RemiLehe RemiLehe merged commit 125ccef into ECP-WarpX:development Jan 6, 2024
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: affects latest release Bug also exists in latest release version bug Something isn't working component: checkpoint/restart Checkpointing & restarts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants