The integer part%sp that referenced the species index has been

substituted for a pointer to the species.
This commit is contained in:
Jorge Gonzalez 2021-03-28 15:55:26 +02:00
commit ec128902ad
13 changed files with 94 additions and 87 deletions

View file

@ -283,15 +283,15 @@ MODULE moduleInput
!Allocate new particles
DO p = 1, nNewPart
ALLOCATE(partNew)
partNew%sp = sp
partNew%v(1) = velocity(1) + vTh*randomMaxwellian()
partNew%v(2) = velocity(2) + vTh*randomMaxwellian()
partNew%v(3) = velocity(3) + vTh*randomMaxwellian()
partNew%vol = e
partNew%r = mesh%vols(e)%obj%randPos()
partNew%xi = mesh%vols(e)%obj%phy2log(partNew%r)
partNew%n_in = .TRUE.
partNew%weight = species(sp)%obj%weight
partNew%species => species(sp)%obj
partNew%v(1) = velocity(1) + vTh*randomMaxwellian()
partNew%v(2) = velocity(2) + vTh*randomMaxwellian()
partNew%v(3) = velocity(3) + vTh*randomMaxwellian()
partNew%vol = e
partNew%r = mesh%vols(e)%obj%randPos()
partNew%xi = mesh%vols(e)%obj%phy2log(partNew%r)
partNew%n_in = .TRUE.
partNew%weight = species(sp)%obj%weight
!If charged species, add qm to particle
SELECT TYPE(sp => species(sp)%obj)
TYPE IS (speciesCharged)
@ -442,8 +442,8 @@ MODULE moduleInput
!Assign shared parameters for all species
CALL config%get(object // '.name', species(i)%obj%name, found)
CALL config%get(object // '.weight', species(i)%obj%weight, found)
species(i)%obj%sp = i
species(i)%obj%m = mass
species(i)%obj%n = i
species(i)%obj%m = mass
END DO
@ -894,7 +894,7 @@ MODULE moduleInput
REAL(8):: v, T, m
!Reads species mass
m = species(inj%sp)%obj%m
m = inj%species%m
!Reads distribution functions for velocity
DO i = 1, 3
WRITE(istring, '(i2)') i