Skip to content

Conversation

@JustinRayAngus
Copy link
Contributor

@JustinRayAngus JustinRayAngus commented Nov 11, 2025

This PR makes a few modifications to the direct mass matrix deposition routine.

  1. The switching between doing a full mass matrix deposition and just depositing the diagonal elements of the diagonal mass matrices for the preconditioner (PC) is now controlled with a template parameter just as it is in the villasenor deposition. This removes an if check inside hot loops.

  2. The full mass matrices are deposited using the product of shape factors for current and field interpolation (shape_J x shape_E). In other words, for each particle location where current J is deposited, the code loops over all field interpolation points E (the same locations used for J) and deposits the corresponding mass matrix contribution with shape_J x shape_E. In the current development branch, when only the diagonal elements of the diagonal mass matrices are used for the PC, the deposition still uses shape_J x shape_E, which is non-conservative. With this PR, when operating in this way, the deposition instead uses only the current deposition shape factor (shape_J). This makes the deposition conservative, consistent with the J deposition scheme. Mathematically, this is equivalent to depositing to all E-location for each J-location (as is done for the full mass matrices) and summing the contributions. @RemiLehe

@JustinRayAngus JustinRayAngus added the component: implicit solvers Anything related to implicit solvers label Nov 11, 2025
@EZoni EZoni added the KISMET label Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: implicit solvers Anything related to implicit solvers KISMET

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants