ECP-WarpX / WarpX

WarpX is an advanced electromagnetic & electrostatic Particle-In-Cell code.
https://ecp-warpx.github.io
Other
290 stars 184 forks source link

EBs: Should not Fail 2D or RZ if not used #3385

Open ax3l opened 1 year ago

ax3l commented 1 year ago

When compiling with -DWarpX_EB=ON -DWarpX_PSATD=ON, the RZ geometry cannot be used anymore.

This can be seen by running the Examples/Physics_applications/laser_acceleration/inputs_rz test, which does not use EB (or PSATD).

./warpx.RZ.MPI.HIP.DP.PDP.OPMD.PSATD.EB.QED ../../Examples/Physics_applications/laser_acceleration/inputs_rz 
Initializing HIP...
HIP initialized.
MPI initialized with 1 MPI processes
MPI initialized with thread support level 3
AMReX (22.09) initialized
0::Assertion `do_electrostatic!=ElectrostaticSolverAlgo::None' failed, file "/ccs/home/huebl/src/warpx/Source/WarpX.cpp", line 680, Msg: 
### ERROR   : Currently, the embedded boundary in RZ only works for
#            electrostatic solvers.
 !!!
SIGABRT
See Backtrace.0 file for details
MPICH ERROR [Rank 0] [job id ] [Mon Sep 12 14:53:37 2022] [crusher068] - Abort(6) (rank 0 in comm 496): application called MPI_Abort(comm=0x84000000, 6) - process 0

The current unconditional assert should check if EBs are used at runtime.

Related to #3280

RemiLehe commented 1 year ago

It would be nice to have a runtime helper function do determine whether the EB are being used (impl. function or STL or constructive geometry) - instead of using compilation flags.

ax3l commented 1 year ago

Regular 2D simulations also crash if EBs are on, even if not used: #3686.

It would be nice to have a runtime helper function do determine whether the EB are being used (impl. function or STL or constructive geometry) - instead of using compilation flags.

@WeiqunZhang are you able help with that? :) I think you are code author of these input routines.

ax3l commented 1 year ago

Discussed today: We can also add a plain runtime option

warpx.embedded_boundaries = true
ax3l commented 1 year ago

Also gives us the opportunity to raise an error if EBs are to be used in inputs but were not compiled.