Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BEAMS3D: Ability to mark self-generated markers with population index #307

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions BEAMS3D/Sources/beams3d_init.f90
Original file line number Diff line number Diff line change
Expand Up @@ -762,10 +762,21 @@ SUBROUTINE beams3d_init
charge = charge_in(1:nparticles)
mu_start = mu_start_in(1:nparticles)
t_end = t_end_in(1:nparticles)
beam = 1
nbeams = 1
charge_beams(1) = charge_in(1)
mass_beams(1) = mass_in(1)
IF (nparticles <= MAXBEAMS) THEN
beam(1:nparticles) = Dex_beams(1:nparticles)
charge_beams(1:nparticles) = charge(1:nparticles)
mass_beams(1:nparticles) = mass(1:nparticles)
ELSE
beam(1:MAXBEAMS) = Dex_beams(1:MAXBEAMS)
beam(MAXBEAMS+1:nparticles) = Dex_beams(MAXBEAMS)
charge_beams(1:MAXBEAMS) = charge(1:MAXBEAMS)
charge_beams(1:nparticles) = charge(MAXBEAMS)
mass_beams(1:MAXBEAMS) = mass(1:MAXBEAMS)
mass_beams(1:nparticles) = mass(MAXBEAMS)
END IF
nbeams = MAXVAL(beam)
!charge_beams(1) = charge_in(1)
!mass_beams(1) = mass_in(1)
lgc2fo_start = .FALSE.
WHERE ((vr_start == 0) .and. (vphi_start == 0) .and. (vz_start == 0))
lgc2fo_start = .TRUE.
Expand Down
7 changes: 7 additions & 0 deletions LIBSTELL/Sources/Modules/beams3d_input_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,9 @@ SUBROUTINE read_beams3d_input(filename, istat)
IF (r_start_in(ik) >= 0.0) nparticles = nparticles + 1
END DO

! Assume three is one population if dex_beams is not set.
IF (MAXVAL(Dex_beams) < 0) FORALL(ik=1:MAXBEAMS) Dex_beams(ik) = 1

#if !defined(NAG)
IF (int_type=='NAG') THEN
int_type = 'LSODE'
Expand Down Expand Up @@ -540,6 +543,10 @@ SUBROUTINE write_beams3d_namelist(iunit_out, istat)
IF (ANY(weight_in /= 1)) WRITE(iunit_out,"(2X,A,1X,'=',10(1X,ES22.12E3))") 'WEIGHT_IN',(weight_in(ik), ik=1,n)
n = COUNT(t_end_in > -1)
WRITE(iunit_out,"(2X,A,1X,'=',I6,'*',ES19.12E3)") 'T_END_IN',n,MAXVAL(t_end_in)
IF (MAXVAL(dex_beams)>0) THEN
n = COUNT(dex_beams>0)
WRITE(iunit_out,"(2X,A,1X,'=',4(1X,ES22.12E3))") 'DEX_BEAMS',(dex_beams(ik), ik=1,NION)
END IF
END IF
WRITE(iunit_out,'(A)') '/'

Expand Down
3 changes: 2 additions & 1 deletion pySTEL/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ dependencies = [
"pyvtk",
"scipy",
"vtk",
"pyyaml"
"pyyaml",
"h5py"
]

[project.urls]
Expand Down