Skip to content

FieldProbe Bug #4443

Closed
Closed
@zhazhajust

Description

@zhazhajust

Description

The question is that 2 case: (1) I set a field probe line with starting locate at out of the simulation windows, and setting a moving window with "do_moving_window_FP" to be OFF, an the time that field probe line got in the simulation window, it will cause segment fault. (2) Set the "do_moving_window_FP" ON so that the field probe line will follow the moving window, but when the timestep coming into the end_moiving_step, no longer fieldprobe to be compute.

After long time debug, I find out that both the two case will cause "MyParIter" have no valide particle, so the field computation for each particles will be skip because don't have any valid particles in the iterator. But I don't know how to resolve it, because the particle "x, y, z" position work well in the init function of "FieldProbe".

//FieldProbe.cpp
    using MyParIter = FieldProbeParticleContainer::iterator;
    for (MyParIter pti(m_probe, lev); pti.isValid(); ++pti)

Input file

#algo
algo.maxwell_solver = Yee #psatd
algo.particle_shape = 3

#amr
amr.max_grid_size = 32
amr.max_level = 0
amr.n_cell = 360 80

#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 field

#electrons
electrons.charge = -q_e
electrons.density_function(x,y,z) = "(x-x1>=0)(x-x2<0)(x - x1)(n0 - 0)/(x2 - x1) + (x-x2>=0)(x-x3<0)n0 + (x-x3>=0)(x-x4<0)(x - x4)(0 - n0)/(x4 - x3)"
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 = 1 1 1
electrons.profile = parse_density_function
electrons.ux = 0.0
electrons.uy = 0.0
electrons.uz = 0.0
electrons.xmax = 0.0005
electrons.xmin = 0.0
electrons.ymax = 0.00015
electrons.ymin = -0.00015
electrons.zmax = 0.00015
electrons.zmin = -0.00015

#field
field.diag_type = Full
field.fields_to_plot = Bx By Bz Ex Ey Ez jx jy jz rho
field.file_prefix = ./FieldDiagnostic/
field.format = openpmd
field.intervals = 100
field.openpmd_backend = h5
field.write_species = 0

#geometry
geometry.dims = 2
geometry.prob_hi = 0.0 0.00001
geometry.prob_lo = -0.000060 -0.00001

#laser1
laser1.direction = 1 0 0
laser1.do_continuous_injection = 0
laser1.e_max = 3210000000000.0
laser1.polarization = 0 1 0
laser1.position = -1e-05 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 = 1000

#my_constants
my_constants.n0 = 1.74e+24
my_constants.x1 = 0.0
my_constants.x2 = 2e-05
my_constants.x3 = 0.0005
my_constants.x4 = 0.0006

#species
species.diag_type = Full
species.electrons.plot_filter_function(t,x,y,z,ux,uy,uz) = sqrt(uzuz+uxux+uy*uy) > 1.2
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 = 0
warpx.do_moving_window = 1
warpx.end_moving_window_step = 100
warpx.moving_window_dir = x
warpx.moving_window_v = 1.0
warpx.serialize_initial_conditions = 1
warpx.start_moving_window_step = 0
warpx.use_filter = 1
warpx.verbose = 1

#Diag
warpx.reduced_diags_names = FieldProbe_ScatLine
FieldProbe_ScatLine.type = FieldProbe
FieldProbe_ScatLine.intervals = 1
FieldProbe_ScatLine.probe_geometry = Line
FieldProbe_ScatLine.x_probe = -0.05e-6
FieldProbe_ScatLine.z_probe = -8e-6
FieldProbe_ScatLine.x1_probe = -0.05e-6
FieldProbe_ScatLine.z1_probe = 8e-6
FieldProbe_ScatLine.resolution = 80
FieldProbe_ScatLine.do_moving_window_FP = 1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions