My Project
Loading...
Searching...
No Matches
Opm::ConvergenceOutputThread Class Reference

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

#include <ExtraConvergenceOutputThread.hpp>

Classes

class  Impl
 

Public Types

using ComponentToPhaseName = std::function<std::string_view(int)>
 Protocol for converting a phase/component ID into a human readable phase/component name.
 
using ConvertToTimeUnits = std::function<double(double)>
 Protocol for converting an SI elapsed time value into an equivalent time value in the run's output conventions.
 

Public Member Functions

 ConvergenceOutputThread (std::string_view outputDir, std::string_view baseName, ComponentToPhaseName getPhaseName, ConvertToTimeUnits convertTime, ConvergenceOutputConfiguration config, ConvergenceReportQueue &queue)
 Constructor.
 
 ConvergenceOutputThread (const ConvergenceOutputThread &src)=delete
 Deleted copy constructor.
 
 ConvergenceOutputThread (ConvergenceOutputThread &&src)
 Move constructor.
 
ConvergenceOutputThreadoperator= (const ConvergenceOutputThread &src)=delete
 Deleted assignment operator.
 
ConvergenceOutputThreadoperator= (ConvergenceOutputThread &&src)=delete
 Deleted move-assignment operator.
 
 ~ConvergenceOutputThread ()
 Destructor.
 
void writeSynchronous (std::vector< ConvergenceReportQueue::OutputRequest > &&requests)
 Perform synchronous file output of a sequence of requests.
 
void writeASynchronous ()
 Output thread worker function.
 

Detailed Description

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

Member Typedef Documentation

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

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

Opm::ConvergenceOutputThread::~ConvergenceOutputThread ( )
default

Destructor.

Needed for pimpl idiom.

Member Function Documentation

◆ 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.

void signalLastOutputRequest()
Signal end of output request stream.
Definition ExtraConvergenceOutputThread.cpp:377

.)

◆ 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 files: