First implementation of multiple pushers for different species
This commit is contained in:
parent
bf5310c2c3
commit
d0bd6e73ed
7 changed files with 238 additions and 92 deletions
|
|
@ -6,7 +6,7 @@ MODULE moduleSpecies
|
|||
TYPE, ABSTRACT:: speciesGeneric
|
||||
CHARACTER(:), ALLOCATABLE:: name
|
||||
REAL(8):: m=0.D0, weight=0.D0
|
||||
INTEGER:: pt=0
|
||||
INTEGER:: sp=0
|
||||
END TYPE speciesGeneric
|
||||
|
||||
TYPE, EXTENDS(speciesGeneric):: speciesNeutral
|
||||
|
|
@ -29,8 +29,8 @@ MODULE moduleSpecies
|
|||
TYPE particle
|
||||
REAL(8):: r(1:3) !Position
|
||||
REAL(8):: v(1:3) !Velocity
|
||||
INTEGER:: pt !Particle species id
|
||||
INTEGER:: e_p !Index of element in which the particle is located
|
||||
INTEGER:: sp !Particle species id
|
||||
INTEGER:: vol !Index of element in which the particle is located
|
||||
REAL(8):: xi(1:3) !Logical coordinates of particle in element e_p.
|
||||
LOGICAL:: n_in !Flag that indicates if a particle is in the domain
|
||||
REAL(8):: weight=0.D0 !weight of particle
|
||||
|
|
@ -46,17 +46,17 @@ MODULE moduleSpecies
|
|||
TYPE(particle), ALLOCATABLE, DIMENSION(:), TARGET:: partInj !array of inject particles
|
||||
|
||||
CONTAINS
|
||||
FUNCTION speciesName2Index(speciesName) RESULT(pt)
|
||||
FUNCTION speciesName2Index(speciesName) RESULT(sp)
|
||||
IMPLICIT NONE
|
||||
|
||||
CHARACTER(:), ALLOCATABLE:: speciesName
|
||||
INTEGER:: pt
|
||||
INTEGER:: sp
|
||||
INTEGER:: n
|
||||
|
||||
pt = 0
|
||||
sp = 0
|
||||
DO n = 1, nSpecies
|
||||
IF (speciesName == species(n)%obj%name) THEN
|
||||
pt = species(n)%obj%pt
|
||||
sp = species(n)%obj%sp
|
||||
EXIT
|
||||
END IF
|
||||
END DO
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue