AMReX-Codes / amrex

AMReX: Software Framework for Block Structured AMR
https://amrex-codes.github.io/amrex
Other
519 stars 339 forks source link

how to sum all the value of a multifabs? #3858

Closed ztdepztdep closed 3 months ago

ztdepztdep commented 4 months ago

I tried to use amrex::ParallelAllReduce::Sum(f ,MPI_COMM_WORLD) ; but it doesn't work. Could you please give me some advices.

WeiqunZhang commented 4 months ago

my_multifab.sum()

https://github.com/AMReX-Codes/amrex/blob/47347f785f5c26f1f9e65bef8e10f2d383406ef7/Src/Base/AMReX_MultiFab.H#L238