Skip to content

Commit 666daab

Browse files
committed
Merge branch '4.19-devel'
2 parents b24b4f3 + 0131ad4 commit 666daab

32 files changed

+95
-157
lines changed

.github/workflows/build_test.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
if: github.event_name != 'pull_request_review' ||
2020
contains(github.event.pull_request.labels.*.name, 'auto-pr')
2121
# The type of runner that the job will run on
22-
runs-on: ubuntu-20.04
22+
runs-on: ubuntu-latest
2323
strategy:
2424
matrix:
2525
include:
@@ -31,7 +31,7 @@ jobs:
3131
define: >-
3232
-DPER_SPECIES_WEIGHT -DZERO_CURRENT_PARTICLES -DNO_PARTICLE_PROBES
3333
-DPARTICLE_SHAPE_TOPHAT -DPARTICLE_ID -DPHOTONS -DTRIDENT_PHOTONS
34-
-DBREMSSTRAHLUNG -DPARSER_DEBUG -DNO_IO -DCOLLISIONS_TEST
34+
-DBREMSSTRAHLUNG -DPARSER_DEBUG -DNO_IO
3535
-DPER_PARTICLE_CHARGE_MASS -DPARSER_CHECKING -DNO_USE_ISATTY
3636
-DWORK_DONE_INTEGRATED -DHC_PUSH -DNO_MPI3 -DDECK_DEBUG
3737
- mode:
@@ -49,14 +49,10 @@ jobs:
4949

5050
steps:
5151
- name: Install dependencies
52-
run: sudo apt update &&
53-
sudo apt install -y
54-
python3-dev
55-
python3-numpy
56-
python3-nose
57-
python3-matplotlib
58-
libpython3-dev
59-
mpich
52+
run: |
53+
sudo apt update &&
54+
sudo apt install -y python3-dev python3-numpy python3-nose python3-matplotlib libpython3-dev openmpi-bin libopenmpi-dev
55+
pip install sdfr
6056
6157
- name: Checkout code
6258
uses: actions/checkout@v4

epoch1d/Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,6 @@ DEFINES := $(DEFINE)
234234
# Don't generate any output at all. Useful for benchmarking.
235235
#DEFINES += $(D)NO_IO
236236

237-
# Bypass the main simulation and only perform collision tests.
238-
# This flag should only ever be used for testing purposes.
239-
#DEFINES += $(D)COLLISIONS_TEST
240-
241237
# Specify charge and mass per particle rather than per species.
242238
# This is a legacy option which will be removed soon.
243239
#DEFINES += $(D)PER_PARTICLE_CHARGE_MASS

epoch1d/src/boundary.F90

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -496,9 +496,9 @@ SUBROUTINE efield_bcs
496496
! Perfectly conducting boundaries
497497
DO i = c_bd_x_min, c_bd_x_max, c_bd_x_max - c_bd_x_min
498498
IF (bc_field(i) == c_bc_conduct) THEN
499-
CALL field_clamp_zero(ex, ng, c_stagger_ex, i)
500-
CALL field_zero_gradient(ey, c_stagger_ey, i)
501-
CALL field_zero_gradient(ez, c_stagger_ez, i)
499+
CALL field_zero_gradient(ex, c_stagger_ex, i)
500+
CALL field_clamp_zero(ey, ng, c_stagger_ey, i)
501+
CALL field_clamp_zero(ez, ng, c_stagger_ez, i)
502502
END IF
503503
END DO
504504

@@ -541,9 +541,9 @@ SUBROUTINE bfield_bcs(mpi_only)
541541
! Perfectly conducting boundaries
542542
DO i = c_bd_x_min, c_bd_x_max, c_bd_x_max - c_bd_x_min
543543
IF (bc_field(i) == c_bc_conduct) THEN
544-
CALL field_zero_gradient(bx, c_stagger_bx, i)
545-
CALL field_clamp_zero(by, ng, c_stagger_by, i)
546-
CALL field_clamp_zero(bz, ng, c_stagger_bz, i)
544+
CALL field_clamp_zero(bx, ng, c_stagger_bx, i)
545+
CALL field_zero_gradient(by, c_stagger_by, i)
546+
CALL field_zero_gradient(bz, c_stagger_bz, i)
547547
END IF
548548
END DO
549549

epoch1d/src/housekeeping/partlist.F90

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ SUBROUTINE set_partlist_size
5858
#if defined(PARTICLE_ID) || defined(PARTICLE_ID4)
5959
nvar = nvar+1
6060
#endif
61-
#ifdef COLLISIONS_TEST
62-
nvar = nvar+1
63-
#endif
6461
#ifdef PHOTONS
6562
nvar = nvar+1
6663
#endif
@@ -444,10 +441,6 @@ SUBROUTINE pack_particle(array, a_particle)
444441
array(cpos) = REAL(a_particle%id, num)
445442
cpos = cpos+1
446443
#endif
447-
#ifdef COLLISIONS_TEST
448-
array(cpos) = REAL(a_particle%coll_count, num)
449-
cpos = cpos+1
450-
#endif
451444
#ifdef PHOTONS
452445
array(cpos) = a_particle%optical_depth
453446
cpos = cpos+1
@@ -523,10 +516,6 @@ SUBROUTINE unpack_particle(array, a_particle)
523516
a_particle%id = NINT(array(cpos),i8)
524517
cpos = cpos+1
525518
#endif
526-
#ifdef COLLISIONS_TEST
527-
a_particle%coll_count = NINT(array(cpos))
528-
cpos = cpos+1
529-
#endif
530519
#ifdef PHOTONS
531520
a_particle%optical_depth = array(cpos)
532521
cpos = cpos+1
@@ -585,9 +574,6 @@ SUBROUTINE init_particle(new_particle)
585574
#if defined(PARTICLE_ID) || defined(PARTICLE_ID4)
586575
new_particle%id = 0
587576
#endif
588-
#ifdef COLLISIONS_TEST
589-
new_particle%coll_count = 0
590-
#endif
591577
#if defined(PHOTONS) || defined(BREMSSTRAHLUNG)
592578
! This assigns an optical depth to newly created particle
593579
new_particle%particle_energy = 0.0_num

epoch1d/src/housekeeping/window.F90

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,10 @@ SUBROUTINE insert_particles
216216
IF (npart_frac < random()) CYCLE
217217
END IF
218218
CALL create_particle(current)
219+
#ifdef PER_PARTICLE_CHARGE_MASS
220+
current%mass = species%mass
221+
current%charge = species%charge
222+
#endif
219223
current%part_pos = x0 + random() * dx
220224

221225
IF (species%ic_df_type == c_ic_df_thermal) THEN

epoch1d/src/sdf_reader_example.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ SUBROUTINE particles_for_rank(npart, rank, n_procs, npart_proc, start)
269269
! Size per processor
270270
npart_proc_gen = npart / n_procs
271271

272-
IF (rank == n_procs) THEN
272+
IF (rank == n_procs-1) THEN
273273
! Last processor takes excess particles to make starts easier
274274
npart_proc = npart - MAX(npart_proc_gen * (n_procs - 1), 0_i8)
275275
ELSE

epoch1d/src/shared_data.F90

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,6 @@ MODULE shared_data
113113
#elif PARTICLE_ID
114114
INTEGER(i8) :: id
115115
#endif
116-
#ifdef COLLISIONS_TEST
117-
INTEGER :: coll_count
118-
#endif
119116
#ifdef WORK_DONE_INTEGRATED
120117
REAL(num) :: work_x
121118
REAL(num) :: work_y

epoch1d/tests/test_custom_stencils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import numpy as np
2424
import matplotlib; matplotlib.use('Agg')
2525
import matplotlib.pyplot as plt
26-
import sdf
26+
import sdfr
2727

2828
from . import SimTest
2929

@@ -86,7 +86,7 @@ def setUpClass(cls):
8686
l = dumps.setdefault(solver, [])
8787
for dump in [osp.join(solver, '{:04d}.sdf'.format(i))
8888
for i in range(8)]:
89-
l.append(sdf.read(dump, dict=True))
89+
l.append(sdfr.read(dump, dict=True))
9090

9191
def test_createplot(self):
9292
if platform.system() == 'Darwin':

epoch1d/tests/test_landau.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1717

1818
import numpy as np
19-
import sdf
19+
import sdfr
2020
import matplotlib; matplotlib.use('Agg')
2121
import matplotlib.pyplot as plt
2222
import unittest
@@ -25,20 +25,20 @@
2525

2626

2727
def showdatafields(sdffile):
28-
data = sdf.read(sdffile, dict=True)
28+
data = sdfr.read(sdffile, dict=True)
2929
print('Data fields present in "' + sdffile + '":')
3030
print(data.keys())
3131

3232

3333
def plotdump(sdffile, key, ax):
34-
data = sdf.read(sdffile, dict=True)
34+
data = sdfr.read(sdffile, dict=True)
3535
array = data[key].data
3636
ax.plot(array)
3737
ax.set_title(r'{:2.1f} ms'.format(data['Header']['time']*1e3))
3838

3939

4040
def plotdump2d(sdffile, key, ax):
41-
data = sdf.read(sdffile, dict=True)
41+
data = sdfr.read(sdffile, dict=True)
4242
if len(data[key].dims) == 3:
4343
array = data[key].data[:, :, 0]
4444
else:

epoch1d/tests/test_laser.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1717

1818
import numpy as np
19-
import sdf
19+
import sdfr
2020
import matplotlib; matplotlib.use('Agg')
2121
import matplotlib.pyplot as plt
2222
import unittest
@@ -25,13 +25,13 @@
2525

2626

2727
def showdatafields(sdffile):
28-
data = sdf.read(sdffile, dict=True)
28+
data = sdfr.read(sdffile, dict=True)
2929
print('Data fields present in "' + sdffile + '":')
3030
print(data.keys())
3131

3232

3333
def plotdump(sdffile, key, ax):
34-
data = sdf.read(sdffile, dict=True)
34+
data = sdfr.read(sdffile, dict=True)
3535
array = data[key].data
3636
ax.plot(array)
3737
ax.set_title('{:2.1f} fs'.format(data['Header']['time']*1e15))
@@ -57,7 +57,7 @@ def createplots():
5757
class test_laser(SimTest):
5858

5959
def totaleyassert(self, dump, val):
60-
data = sdf.read(dump, dict=True)
60+
data = sdfr.read(dump, dict=True)
6161
ey = data['Electric Field/Ey'].data**2
6262
eysum = np.sum(ey)
6363
test = np.isclose(eysum, val)

0 commit comments

Comments
 (0)