Skip to content

Commit 0ab5c5f

Browse files
committed
Flush only dirty meshes/species
TODO: Maybe do this in more places, and also when reading
1 parent a171345 commit 0ab5c5f

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/Iteration.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,12 @@ void Iteration::flush(internal::FlushParams const &flushParams)
363363
}
364364
meshes.flush(s.meshesPath(), flushParams);
365365
for (auto &m : meshes)
366-
m.second.flush(m.first, flushParams);
366+
{
367+
if (m.second.dirtyRecursive())
368+
{
369+
m.second.flush(m.first, flushParams);
370+
}
371+
}
367372
}
368373
else
369374
{
@@ -379,7 +384,12 @@ void Iteration::flush(internal::FlushParams const &flushParams)
379384
}
380385
particles.flush(s.particlesPath(), flushParams);
381386
for (auto &species : particles)
382-
species.second.flush(species.first, flushParams);
387+
{
388+
if (species.second.dirtyRecursive())
389+
{
390+
species.second.flush(species.first, flushParams);
391+
}
392+
}
383393
}
384394
else
385395
{

0 commit comments

Comments
 (0)