Skip to content

Commit

Permalink
Merge pull request #386 from Warwick-Plasma/4.18-devel
Browse files Browse the repository at this point in the history
Updating to EPOCH 4.18
  • Loading branch information
keithbennett authored Sep 26, 2022
2 parents 3088d84 + e85c3f1 commit 4d63b86
Show file tree
Hide file tree
Showing 408 changed files with 10,324 additions and 9,535 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/auto_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: auto-pr

on:
push:
branches:
- 4.*-devel

jobs:
pull-request:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set branch variables
run: BASE_REF=$(echo $GITHUB_REF | cut -f3- -d\/);
major=$(echo $BASE_REF | cut -f1 -d\.);
minor=$(echo $BASE_REF | cut -f2 -d\. | cut -f1 -d\-);
DEST_BRANCH=$major.$((minor+1))-devel;
git branch -a | grep "origin/$DEST_BRANCH" || {
DEST_BRANCH=$((major+1)).0-devel;
git branch -a | grep "origin/$DEST_BRANCH" || exit 1;
};
echo "BASE_REF=$BASE_REF" >> $GITHUB_ENV;
echo "DEST_BRANCH=$DEST_BRANCH" >> $GITHUB_ENV;

- name: Create Pull Request
id: open-pr
uses: repo-sync/pull-request@v2
with:
destination_branch: ${{ env.DEST_BRANCH }}
github_token: ${{ secrets.GITHUB_TOKEN }}
pr_title: "Pull $BASE_REF into $DEST_BRANCH"
pr_label: "auto-pr"

- name: Auto approve
uses: hmarr/auto-approve-action@v2
with:
github-token: ${{ secrets.GH_APPROVE }}
pull-request-number: ${{ steps.open-pr.outputs.pr_number }}
18 changes: 18 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: automerge

# Controls when the action will run.
on:
pull_request_review:
branches:
- main
- '*-devel'

jobs:
automerge:
if: contains(github.event.pull_request.labels.*.name, 'auto-pr')
runs-on: ubuntu-20.04
steps:
- name: Auto merge
uses: alexwilson/enable-github-automerge-action@1.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
68 changes: 38 additions & 30 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@ name: CI

# Controls when the action will run.
on:
push:
branches: [ main, '*-devel' ]
pull_request:
branches: [ main, '*-devel' ]
branches:
- main
- '*-devel'
pull_request_review:
branches:
- main
- '*-devel'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build_and_test:
if: github.event_name != 'pull_request_review' ||
contains(github.event.pull_request.labels.*.name, 'auto-pr')
# The type of runner that the job will run on
runs-on: ubuntu-20.04
strategy:
Expand All @@ -37,36 +43,38 @@ jobs:
MPIPROCS: 2
MODE: ${{ matrix.mode }}
DEFINE: ${{ matrix.define }}
GH_BASE: ${{ github.event.pull_request.base.ref }}
GH_HEAD: ${{ github.event.pull_request.head.ref }}
GH_SHA: ${{ github.event.pull_request.head.sha }}

steps:
- name: Install dependencies
run: sudo apt update &&
sudo apt install -y
python3-dev
python3-numpy
python3-nose
python3-matplotlib
libpython3-dev
mpich
- name: Install dependencies
run: sudo apt update &&
sudo apt install -y
python3-dev
python3-numpy
python3-nose
python3-matplotlib
libpython3-dev
mpich

- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0

- name: Merge branch
if: github.event_name == 'pull_request'
run: git config user.email "test@example.com" &&
git config user.name "test" &&
git checkout -b $GITHUB_HEAD_REF $GITHUB_SHA &&
git checkout -b $GITHUB_BASE_REF origin/$GITHUB_BASE_REF &&
git merge --no-ff $GITHUB_HEAD_REF
- name: Merge branch
run: git config user.email "test@example.com" &&
git config user.name "test" &&
git checkout -b $GH_HEAD $GH_SHA &&
git checkout -b $GH_BASE origin/$GH_BASE &&
git merge --no-ff $GH_HEAD

- name: Cleanup
run: cd epoch1d && make cleanall &&
cd ../epoch2d && make cleanall &&
cd ../epoch3d && make cleanall
- name: Cleanup
run: cd epoch1d && make cleanall &&
cd ../epoch2d && make cleanall &&
cd ../epoch3d && make cleanall

- name: Compile and run tests
run: ./scripts/run-tests-epoch-all.sh ${{ matrix.flag }}
- name: Compile and run tests
run: ./scripts/run-tests-epoch-all.sh ${{ matrix.flag }}
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
## v4.17.0 to v4.18.0

* PIC loop re-organised to ensure output files are dumped at the correct
time-step.

* Fixed over-flow bug in dist_fn.

* Input deck can now store logical constants (value T or F).

* Added new n_coll_steps parameter to collisions block. This sub-cycles the
collisions, running them once every n steps. Collisions are run assuming a
time-step of n*dt, to retain the same physical behaviour.

* Added use_bremsstrahlung_scatter parameter to bremsstrahlung block. This
samples photon emission angle from the bremsstrahlung angular distribution.
The model comes from the Geant4 Physics Reference Manual, which parametrises
Tsai 1974, DOI: https://doi.org/10.1103/RevModPhys.46.815

* Fixed bug in non-relativistic bremsstrahlung cross-sections.

## v4.16.0 to v4.17.0

* Added volume correction sampling Zenitani 2015 DOI 10.1063/1.4919383
Expand Down
2 changes: 1 addition & 1 deletion epoch1d/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ balance.o: balance.F90 boundary.o constants.o mpi_subtype_control.o \
redblack_module.o timer.o utilities.o
boundary.o: boundary.F90 injectors.o laser.o mpi_subtype_control.o \
particle_id_hash.o particle_temperature.o partlist.o utilities.o
bremsstrahlung.o: bremsstrahlung.F90 calc_df.o partlist.o setup.o
bremsstrahlung.o: bremsstrahlung.F90 calc_df.o particles.o partlist.o setup.o
calc_df.o: calc_df.F90 boundary.o
collisions.o: collisions.F90 calc_df.o prefetch.o
constants.o: constants.F90 $(SDFMOD)
Expand Down
65 changes: 65 additions & 0 deletions epoch1d/example_decks/electron_ion_equilibration.deck
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
begin:constant

dl = 7.4e-10

end:constant

begin:control

x_min = 0.0
x_max = 100*dl
nx = 5
t_end = 20e-12
stdout_frequency = 1000
print_eta_string = T
smooth_currents = T

end:control

begin:boundaries

bc_x_max = periodic
bc_x_min = periodic

end:boundaries

begin:species

name = protons
charge = 1
mass = 1836
temp_ev = 50
npart_per_cell = 5000
density = 1e22/cc

end:species

begin:species

name = electrons
charge = -1
mass = 1
temp_ev = 100
npart_per_cell = 5000
density = 1e22/cc

end:species

begin:collisions

use_collisions = T
coulomb_log = 5
collide = all
use_nanbu = T

end:collisions

begin:output

nstep_snapshot = 1000
grid = always
temperature = always + species
number_density = always + species
ekbar = always + species

end:output
57 changes: 57 additions & 0 deletions epoch1d/example_decks/electron_isotropisation.deck
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
begin:constant

dl = 7.4e-10

end:constant

begin:control

x_min = 0.0
x_max = 100*dl
nx = 10
t_end = 5e-14
stdout_frequency = 1000
print_eta_string = T
smooth_currents = T

end:control

begin:boundaries
bc_x_max = periodic
bc_x_min = periodic
end:boundaries

begin:species

name = electrons
charge = -1
mass = 1
temp_x_ev = 150
temp_y_ev = 50
temp_z_ev = 50
npart_per_cell = 5000
density = 1e22/cc

end:species

begin:collisions

use_collisions = T
coulomb_log = 5
collide = all
use_nanbu = T

end:collisions

begin:output

nstep_snapshot = 10
grid = always
temperature = always + species
number_density = always + species
ekbar = always + species
temperature_x = always + species
temperature_y = always + species
temperature_z = always + species

end:output
Loading

0 comments on commit 4d63b86

Please sign in to comment.