PolyFEM
Loading...
Searching...
No Matches
polyfem::io::OutputWriter Class Reference

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_
 

Detailed Description

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.

Member Typedef Documentation

◆ Job

using polyfem::io::OutputWriter::Job = std::function<void()>

Definition at line 14 of file OutputWriter.hpp.

◆ Prepare

using polyfem::io::OutputWriter::Prepare = std::function<Job()>

Definition at line 15 of file OutputWriter.hpp.

Constructor & Destructor Documentation

◆ OutputWriter() [1/2]

polyfem::io::OutputWriter::OutputWriter ( bool  asynchronous = true)
explicit

Definition at line 216 of file OutputWriter.cpp.

◆ ~OutputWriter()

polyfem::io::OutputWriter::~OutputWriter ( )
default

◆ OutputWriter() [2/2]

polyfem::io::OutputWriter::OutputWriter ( const OutputWriter &  )
delete

Member Function Documentation

◆ asynchronous()

bool polyfem::io::OutputWriter::asynchronous ( ) const

Definition at line 222 of file OutputWriter.cpp.

References impl_.

Referenced by polyfem::varform::NavierStokesFSIVarForm::save_fsi_timestep().

Here is the caller graph for this function:

◆ enqueue()

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().

Here is the caller graph for this function:

◆ execute()

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().

Here is the caller graph for this function:

◆ finish()

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().

Here is the caller graph for this function:

◆ flush()

void polyfem::io::OutputWriter::flush ( )

Wait for all accepted frames and propagate output failures.

Definition at line 220 of file OutputWriter.cpp.

References impl_.

◆ operator=()

OutputWriter & polyfem::io::OutputWriter::operator= ( const OutputWriter &  )
delete

Member Data Documentation

◆ impl_

std::unique_ptr<Impl> polyfem::io::OutputWriter::impl_
private

Definition at line 34 of file OutputWriter.hpp.

Referenced by asynchronous(), enqueue(), execute(), finish(), and flush().


The documentation for this class was generated from the following files: