Skip to content

ECT: CheckAreaLedger - #7245

Open
aarontran wants to merge 1 commit into
BLAST-WarpX:developmentfrom
aarontran:eb_ect_ledger
Open

ECT: CheckAreaLedger#7245
aarontran wants to merge 1 commit into
BLAST-WarpX:developmentfrom
aarontran:eb_ect_ledger

Conversation

@aarontran

@aarontran aarontran commented Sep 4, 2026

Copy link
Copy Markdown

When using embedded boundary with enlarged-cell technique (ECT) solver, check that global face area is conserved (lent area = borrowed area) to within an automatically-determined round-off error tolerance. Also check that S_mod > 0 for all participating faces to guard against an edge case wherein multiple unstable cells can "overdraft" a neighbor cell's available area.

This PR was created to help test PR #7104, which fixes area-conservation bugs related to cross-box synchronization of lent/borrowed face area.

During review of PR #7104, it was also noticed that S_mod < 0 on a face may occur due to at least one pathological case of an under-resolved embedded boundary with cut-cells at AMReX box corners. The present PR simply aborts and does not attempt to re-work the ECT algorithm for a relatively obscure edge case.

Questions and notes for reviewers:

  • Log with verbose >=1 or > 1 ?
  • @ax3l 's comment on issue ECT: Init on GPU #2257 suggests that ECT boundary face extensions may be recomputed dynamically as a simulation evolves, either PEC boundary moving or AMReX regridding. Do you think this is a serious practical concern? If so, this PR may need to be edited to prevent check from running too often: maybe 1x at init, at some regular interval, only if user requests auditing, etc...
  • Merge this PR after ECT: owner-unique cross-box borrowing and seam-synchronized conformal B push #7104 (CI compiles will break otherwise)

Example logging if checks passed for a 2D simulation:

                                   ___
    __        __             ___  /  /
    \ \      / /_ _ _ __ _ __\  \/  /
     \ \ /\ / / _` | '__| '_ \\    /
      \ V  V / (_| | |  | |_) /    \
       \_/\_/ \__,_|_|  | .__/__/\  \
                        |_|       \__\

Level 0: dt = 1.179327168e-10 ; dx = 0.05 ; dz = 0.05
--- INFO    : Embedded Boundary: ECT CheckAreaLedger after 1-way pass (idim=1)
             imbalance sum(S-S_mod) = 0.000000e+00 tolerance = 5.107026e-15 OK.
             Modified faces min(S_mod) = 1.000000e-03 > 0 OK.
--- INFO    : Embedded Boundary: ECT CheckAreaLedger after 8-way pass (idim=1)
             imbalance sum(S-S_mod) = -2.249720e-18 tolerance = 5.129230e-15
             OK. Modified faces min(S_mod) = 2.500000e-04 > 0 OK.

Grids Summary:
  Level 0   16 grids  1024 cells  100 % of domain
            smallest grid: 8 x 8  biggest grid: 8 x 8

Example logging if a check fails:

0::Assertion `balance && no_overdraft' failed, file "[...]/warpx/Source/EmbeddedBoundary/WarpXFaceExtensions.cpp", line 203, Msg:
### ERROR   : Embedded Boundary: ECT CheckAreaLedger after 1-way pass (idim=1)
#            imbalance sum(S-S_mod) = -1.734723e-18 tolerance = 9.436896e-16
#            OK. Modified faces min(S_mod) = -5.000000e-04 but expected > 0 for
#            all faces, exiting! Try resolving embedded boundary with more
#            cells, varying AMReX grid layout, and/or filing bug report.

When using embedded boundary with enlarged-cell technique (ECT) solver,
check that global face area is conserved (lent area = borrowed area) to
within an automatically-determined round-off error tolerance.
Also check that S_mod > 0 for all participating faces to guard against
an edge case wherein multiple unstable cells can "overdraft" a neighbor
cell's available area.
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.

1 participant