Skip to content

Commit

Permalink
Merge pull request #70 from Team-RADDISH/tk/fix-IO-at-t0
Browse files Browse the repository at this point in the history
Mean and Var need to be calculated for IO after initial state
  • Loading branch information
giordano committed May 21, 2020
2 parents 2d20221 + 6156d25 commit 938f9b7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/TDAC.jl
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,12 @@ function tdac(params::tdac_params)

end

# Write initial state
if params.verbose
# Calculate statistical quantities
@timeit_debug timer "Particle Mean" Statistics.mean!(states.avg, states.particles)
@timeit_debug timer "Particle Variance" states.var .= dropdims(Statistics.var(states.particles; dims=4), dims=4)

# Write initial state
@timeit_debug timer "IO" write_snapshot(states, 0, params)
end
for it in 1:params.n_time_step
Expand Down Expand Up @@ -539,7 +543,7 @@ function tdac(params::tdac_params)
@timeit_debug timer "Resample" resample!(states.resampled, states.particles, weights)
@timeit_debug timer "State Copy" states.particles .= states.resampled

# Calculate statistical values
# Calculate statistical quantities
@timeit_debug timer "Particle Mean" Statistics.mean!(states.avg, states.particles)
@timeit_debug timer "Particle Variance" states.var .= dropdims(Statistics.var(states.particles; dims=4), dims=4)

Expand Down

0 comments on commit 938f9b7

Please sign in to comment.