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

Use new stair-case approximation in hybrid solver #5558

Merged
merged 45 commits into from
Jan 22, 2025

Conversation

RemiLehe
Copy link
Member

@RemiLehe RemiLehe commented Jan 14, 2025

Merge #5534 first.

This extends the changes of #5534 and #5574 to the hybrid solver.
Note that this effectively changes the definition of the stair-cased embedded boundary for the hybrid solver.

@RemiLehe RemiLehe changed the title Use new stair-case approximation in hybrid solver ; do not allocate edge_lengths and face_areas anymore Use new stair-case approximation in hybrid solver Jan 18, 2025
@RemiLehe RemiLehe changed the title Use new stair-case approximation in hybrid solver [WIP] Use new stair-case approximation in hybrid solver Jan 18, 2025
RemiLehe added a commit that referenced this pull request Jan 21, 2025
When updating `E` (and when initializing the field values for `E` and
`B` with a parser), we used to check somewhat complicated conditions
that relied on the MultiFabs `edge_lengths` and `face_areas`.

This PR introduces separate arrays (`m_eb_update_E` and `m_eb_update_B`,
which are `iMultiFab` instead of `MultiFab` and thus take up much less
memory). These arrays contain flags that keep track of where to udpate
the fields (i.e. the black crosses in the above figure). These arrays
are initialized in separate functions which keep the same EB definition.
(PR #5534 will then change this definition.) The code for the field
pusher and field initialization uses these arrays (instead of
edge_lengths and face_areas. It is thus significantly simpler and avoids
duplicating complicated if conditions.

The above changes have not yet been implemented for the hybrid solver.
This will instead be done in a separate PR:
#5558. Once this is complete, the
MultiFab `edge_lengths` and `face_areas` will not be needed anymore
(except for the ECT solver), and we will thus only allocate them for the
ECT solver. This should save a significant amount of memory.

---------

Co-authored-by: Roelof Groenewald <[email protected]>
Copy link
Member

@roelof-groenewald roelof-groenewald left a comment

Choose a reason for hiding this comment

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

This looks good. I'll just give it a final look through once #5534 is merged and any conflicts are resolved before approving.

Copy link
Member

@roelof-groenewald roelof-groenewald left a comment

Choose a reason for hiding this comment

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

Just a few more comments for typos I spotted.

Source/WarpX.H Outdated
@@ -927,8 +927,7 @@ public:
* \param[in] fx_parser parser function to initialize x-field
* \param[in] fy_parser parser function to initialize y-field
* \param[in] fz_parser parser function to initialize z-field
* \param[in] edge_lengths edge lengths information
* \param[in] face_areas face areas information
* \param[in] eb_update_field flag indicating which gridpoints should be modified by this functions
Copy link
Member

Choose a reason for hiding this comment

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

The topology parameter description below this line can be removed.

@RemiLehe RemiLehe changed the title [WIP] Use new stair-case approximation in hybrid solver Use new stair-case approximation in hybrid solver Jan 22, 2025
Co-authored-by: Roelof Groenewald <[email protected]>
@RemiLehe RemiLehe enabled auto-merge (squash) January 22, 2025 00:38
@ax3l ax3l added the component: boundary PML, embedded boundaries, et al. label Jan 22, 2025
Copy link
Member

@roelof-groenewald roelof-groenewald left a comment

Choose a reason for hiding this comment

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

Looks good!

@RemiLehe RemiLehe merged commit eaaaef5 into ECP-WarpX:development Jan 22, 2025
37 checks passed
RemiLehe added a commit that referenced this pull request Jan 22, 2025
…er (#5593)

Following #5558, the MultiFab `edge_lengths` and `face_areas` are not
used anymore, expect for the ECT solver. Thus, only allocateing them
when using the ECT solver saves a considerable amount of memory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: boundary PML, embedded boundaries, et al.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants