ECP-WarpX / WarpX

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

SIGABRT in Yee method with divE_cleaning = 1 and divB_cleaning = 1 #4516

Open zhazhajust opened 9 months ago

zhazhajust commented 9 months ago

I find that when Yee method using divE_cleaning = 1 and divB_cleaning = 1, the code will be SIGABRT. And when i use gdb to catch the C++ Exception, it will not to be stop.

STEP 5 starts ...
0::Assertion `ng[dir] >= num_shift' failed, file "/home/user/.local/WarpX/Source/Utils/WarpXMovingWindow.cpp", line 468 !!!
SIGABRT
//WarpXMovingWindow.cpp
    using namespace amrex::literals;
    WARPX_PROFILE("WarpX::shiftMF()");
    const amrex::BoxArray& ba = mf.boxArray();
    const amrex::DistributionMapping& dm = mf.DistributionMap();
    const int nc = mf.nComp();
    const amrex::IntVect& ng = mf.nGrowVect();

    AMREX_ALWAYS_ASSERT(ng[dir] >= num_shift);

    amrex::MultiFab tmpmf(ba, dm, nc, ng);
    amrex::MultiFab::Copy(tmpmf, mf, 0, 0, nc, ng);
RemiLehe commented 9 months ago

Thanks for reporting this issue. Could you share the input script for which you observed this error?

RemiLehe commented 9 months ago

Also @zhazhajust, could you check whether this change fixes the issue: https://github.com/ECP-WarpX/WarpX/pull/4557/files

zhazhajust commented 8 months ago

Thanks for help @RemiLehe , and this is my input file, I'll try to check it letter if which could be fix by above issue.

# algo
algo.load_balance_intervals = 150
algo.maxwell_solver = Yee
algo.particle_shape = 3

# amr
amr.blocking_factor = 32
amr.max_grid_size = 32
amr.max_grid_size_x = 64 64
amr.max_grid_size_y = 32 32
amr.max_level = 1
amr.n_cell = 608 224
amr.ref_ratio_vect = 4 4

# boundary
boundary.field_hi = pml pml
boundary.field_lo = pml pml
boundary.particle_hi = absorbing absorbing
boundary.particle_lo = absorbing absorbing

# diagnostics
diagnostics.diags_names = species

# electrons
electrons.charge = -q_e
electrons.density = 1.74e+24
electrons.do_continuous_injection = 1
electrons.initialize_self_fields = 0
electrons.injection_style = nuniformpercell
electrons.mass = m_e
electrons.momentum_distribution_type = constant
electrons.num_particles_per_cell_each_dim = 2 2 2
electrons.profile = constant
electrons.ux = 0.0
electrons.uy = 0.0
electrons.uz = 0.0
electrons.xmax = 0.0006
electrons.xmin = 0.0
electrons.zmax = 0.00015
electrons.zmin = -0.00015

# geometry
geometry.dims = 2
geometry.prob_hi = 0.0 0.0001
geometry.prob_lo = -0.0002 -0.0001

# laser1
laser1.direction = 1 0 0
laser1.do_continuous_injection = 0
laser1.e_max = 30210000000000.0
laser1.polarization = 0 1 0
laser1.position = -1e-06 0.0 0.0
laser1.profile = Gaussian
laser1.profile_duration = 3.2e-14
laser1.profile_focal_distance = 1e-05
laser1.profile_t_peak = 6.4e-14
laser1.profile_waist = 1e-05
laser1.wavelength = 8e-07

# lasers
lasers.names = laser1

# max_step
max_step = 13000

# particles
particles.species_names = electrons

# species
species.diag_type = Full
species.electrons.variables = ux uy uz w
species.fields_to_plot = none
species.file_prefix = ./SpecDiagnostic/
species.format = openpmd
species.intervals = 200
species.openpmd_backend = h5
species.species = electrons
species.write_species = 1

# warpx
warpx.cfl = 0.95
warpx.do_dive_cleaning = 1
warpx.do_moving_window = 1
warpx.fine_tag_hi = 0.0 4e-05
warpx.fine_tag_lo = -5e-05 -4e-05
warpx.moving_window_dir = x
warpx.moving_window_v = 1.0
warpx.serialize_initial_conditions = 1
warpx.use_filter = 1
warpx.verbose = 1
zhazhajust commented 8 months ago

Unfortunately, this issue #4557 can't fix this problem.

zhazhajust commented 8 months ago

By the way, there didn't exist any species in species diag hdf5 file.