From b73c8531e852552ede1c421cc90d7068b109969b Mon Sep 17 00:00:00 2001 From: JGonzalez Date: Sun, 6 Aug 2023 19:45:48 +0200 Subject: [PATCH] Fix an issue with different time steps Sometimes the division between number of steps and time step was not giving the right results. Nevertheless, this just indicates that the species have to be in separated arrays so that the assignment of particles in list, pushing and scattering can be dealt independently. Thus, this is the first step in creating separate arrays of particles per species. --- data/see/{constant.dat => constant_yield.dat} | 0 src/modules/mesh/moduleMesh.f90 | 3 +-- src/modules/solver/moduleSolver.f90 | 7 ++++++- 3 files changed, 7 insertions(+), 3 deletions(-) rename data/see/{constant.dat => constant_yield.dat} (100%) diff --git a/data/see/constant.dat b/data/see/constant_yield.dat similarity index 100% rename from data/see/constant.dat rename to data/see/constant_yield.dat diff --git a/src/modules/mesh/moduleMesh.f90 b/src/modules/mesh/moduleMesh.f90 index 7e30326..e8e38f7 100644 --- a/src/modules/mesh/moduleMesh.f90 +++ b/src/modules/mesh/moduleMesh.f90 @@ -816,9 +816,8 @@ MODULE moduleMesh IF (MOD(t, everyColl) == 0) THEN !Collisions need to be performed in this iteration - !$OMP DO SCHEDULE(DYNAMIC) PRIVATE(part_i, part_j, partTemp_i, partTemp_j) + !$OMP DO SCHEDULE(DYNAMIC) PRIVATE(part_i, part_j, partTemp_i, partTemp_j, cell) DO e=1, self%numCells - cell => self%cells(e)%obj !TODO: Simplify this, to many sublevels diff --git a/src/modules/solver/moduleSolver.f90 b/src/modules/solver/moduleSolver.f90 index e539fed..de544ba 100644 --- a/src/modules/solver/moduleSolver.f90 +++ b/src/modules/solver/moduleSolver.f90 @@ -123,7 +123,12 @@ MODULE moduleSolver END SELECT self%pushSpecies = .FALSE. - self%every = INT(tauSp/tau) + self%every = FLOOR(tauSp/tau) + !Correct value if not fulfilled + IF (tau*REAL(self%every) < tauSp) THEN + self%every = self%every + 1 + + END IF END SUBROUTINE initPusher