|
PolyFEM
|
Ordered output with one pending frame in addition to the active frame. More...
#include <OutputWriter.hpp>
Classes | |
| class | Impl |
Public Types | |
| using | Job = std::function< void()> |
| using | Prepare = std::function< Job()> |
Public Member Functions | |
| OutputWriter (bool asynchronous=true) | |
| ~OutputWriter () | |
| OutputWriter (const OutputWriter &)=delete | |
| OutputWriter & | operator= (const OutputWriter &)=delete |
| void | enqueue (const Prepare &prepare) |
| Wait for the pending slot, then prepare its owned frame on the caller. | |
| void | execute (const Job &compute) |
| Run simulation work with one thread reserved for asynchronous output. | |
| void | flush () |
| Wait for all accepted frames and propagate output failures. | |
| void | finish () |
| Drain accepted frames, stop the worker, and propagate output failures. | |
| bool | asynchronous () const |
Private Attributes | |
| std::unique_ptr< Impl > | impl_ |
Ordered output with one pending frame in addition to the active frame.
CPP and TBB use a dedicated consumer thread; TBB work is limited to a one-thread arena. The serial backend runs writes on the caller.
Definition at line 11 of file OutputWriter.hpp.
| using polyfem::io::OutputWriter::Job = std::function<void()> |
Definition at line 14 of file OutputWriter.hpp.
| using polyfem::io::OutputWriter::Prepare = std::function<Job()> |
Definition at line 15 of file OutputWriter.hpp.
|
explicit |
Definition at line 216 of file OutputWriter.cpp.
|
default |
|
delete |
| bool polyfem::io::OutputWriter::asynchronous | ( | ) | const |
Definition at line 222 of file OutputWriter.cpp.
References impl_.
Referenced by polyfem::varform::NavierStokesFSIVarForm::save_fsi_timestep().
| void polyfem::io::OutputWriter::enqueue | ( | const Prepare & | prepare | ) |
Wait for the pending slot, then prepare its owned frame on the caller.
Definition at line 218 of file OutputWriter.cpp.
References impl_.
Referenced by polyfem::varform::NavierStokesFSIVarForm::save_fsi_timestep().
| void polyfem::io::OutputWriter::execute | ( | const Job & | compute | ) |
Run simulation work with one thread reserved for asynchronous output.
Definition at line 219 of file OutputWriter.cpp.
References impl_.
Referenced by polyfem::varform::VarForm::solve().
| void polyfem::io::OutputWriter::finish | ( | ) |
Drain accepted frames, stop the worker, and propagate output failures.
Definition at line 221 of file OutputWriter.cpp.
References impl_.
Referenced by polyfem::varform::VarForm::solve().
| void polyfem::io::OutputWriter::flush | ( | ) |
Wait for all accepted frames and propagate output failures.
Definition at line 220 of file OutputWriter.cpp.
References impl_.
|
delete |
|
private |
Definition at line 34 of file OutputWriter.hpp.
Referenced by asynchronous(), enqueue(), execute(), finish(), and flush().