Skip to content

Commit 91166ef

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

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

src/Iteration.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,12 @@ void Iteration::flush(internal::FlushParams const &flushParams)
364364
}
365365
meshes.flush(s.meshesPath(), flushParams);
366366
for (auto &m : meshes)
367-
m.second.flush(m.first, flushParams);
367+
{
368+
if (m.second.dirtyRecursive())
369+
{
370+
m.second.flush(m.first, flushParams);
371+
}
372+
}
368373
}
369374
else
370375
{
@@ -380,7 +385,12 @@ void Iteration::flush(internal::FlushParams const &flushParams)
380385
}
381386
particles.flush(s.particlesPath(), flushParams);
382387
for (auto &species : particles)
383-
species.second.flush(species.first, flushParams);
388+
{
389+
if (species.second.dirtyRecursive())
390+
{
391+
species.second.flush(species.first, flushParams);
392+
}
393+
}
384394
}
385395
else
386396
{

0 commit comments

Comments
 (0)