Opm::ConvergenceOutputThread Class Reference

#include <ExtraConvergenceOutputThread.hpp>

Public Types

using ComponentToPhaseName = std::function< std::string_view(int)>
 
using ConvertToTimeUnits = std::function< double(double)>
 

Public Member Functions

 ConvergenceOutputThread (std::string_view outputDir, std::string_view baseName, ComponentToPhaseName getPhaseName, ConvertToTimeUnits convertTime, ConvergenceOutputConfiguration config, ConvergenceReportQueue &queue)
 
 ConvergenceOutputThread (const ConvergenceOutputThread &src)=delete
 Deleted copy constructor. More...
 
 ConvergenceOutputThread (ConvergenceOutputThread &&src)
 Move constructor. More...
 
ConvergenceOutputThreadoperator= (const ConvergenceOutputThread &src)=delete
 Deleted assignment operator. More...
 
ConvergenceOutputThreadoperator= (ConvergenceOutputThread &&src)=delete
 Deleted move-assignment operator. More...
 
 ~ConvergenceOutputThread ()
 
void writeSynchronous (std::vector< ConvergenceReportQueue::OutputRequest > &&requests)
 
void writeASynchronous ()
 

Detailed Description

Encapsulating object for thread processing producer's convergence output requests.

Member Typedef Documentation

◆ ComponentToPhaseName

using Opm::ConvergenceOutputThread::ComponentToPhaseName = std::function<std::string_view(int)>

Protocol for converting a phase/component ID into a human readable phase/component name.

◆ ConvertToTimeUnits

using Opm::ConvergenceOutputThread::ConvertToTimeUnits = std::function<double(double)>

Protocol for converting an SI elapsed time value into an equivalent time value in the run's output conventions.

Will typically use

UnitSystem::from_si()

.

Constructor & Destructor Documentation

◆ ConvergenceOutputThread() [1/3]

Opm::ConvergenceOutputThread::ConvergenceOutputThread ( std::string_view  outputDir,
std::string_view  baseName,
ComponentToPhaseName  getPhaseName,
ConvertToTimeUnits  convertTime,
ConvergenceOutputConfiguration  config,
ConvergenceReportQueue queue 
)
explicit

Constructor.

Parameters
[in]outputDir– Name of run's output directory. Any file output will be written to this directory.
[in]baseName– Run's base name. Output files will have this name and a type-specific file extension.
[in]getPhaseName– Callable object for converting component indices into human readable component names.
[in]convertTime– Callable object for converting SI elapsed time values into equivalent elapsed time values using run's time conventions.
[in]config– Convergence output configuration options. Determines whether to output additional convergence information and, if so, what information to output.
[in]queue– Communication channel between producer thread and this output thread. User must form a valid queue prior to creating the output thread object.

◆ ConvergenceOutputThread() [2/3]

Opm::ConvergenceOutputThread::ConvergenceOutputThread ( const ConvergenceOutputThread src)
delete

Deleted copy constructor.

◆ ConvergenceOutputThread() [3/3]

Opm::ConvergenceOutputThread::ConvergenceOutputThread ( ConvergenceOutputThread &&  src)

Move constructor.

◆ ~ConvergenceOutputThread()

Opm::ConvergenceOutputThread::~ConvergenceOutputThread ( )

Destructor.

Needed for pimpl idiom.

Member Function Documentation

◆ operator=() [1/2]

ConvergenceOutputThread & Opm::ConvergenceOutputThread::operator= ( const ConvergenceOutputThread src)
delete

Deleted assignment operator.

◆ operator=() [2/2]

ConvergenceOutputThread & Opm::ConvergenceOutputThread::operator= ( ConvergenceOutputThread &&  src)
delete

Deleted move-assignment operator.

◆ writeASynchronous()

void Opm::ConvergenceOutputThread::writeASynchronous ( )

Output thread worker function

This is the endpoint that users should associate to a

std::thread

object.

Returns once last pending output request is written (cf.

.)

Referenced by Opm::SimulatorFullyImplicitBlackoil< TypeTag >::startConvergenceOutputThread().

◆ writeSynchronous()

void Opm::ConvergenceOutputThread::writeSynchronous ( std::vector< ConvergenceReportQueue::OutputRequest > &&  requests)

Perform synchronous file output of a sequence of requests.

Mostly for development and debugging purposes.

Parameters
[in]requestsOutput request sequence. Thread takes ownership.

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