Loading...
Searching...
No Matches
Opm::BaseOutputModule< TypeTag > Class Template Referenceabstract

The base class for writer modules. More...

`#include <baseoutputmodule.hh>`

Inheritance diagram for Opm::BaseOutputModule< TypeTag >:

## Public Types

using | ScalarBuffer = BaseOutputWriter::ScalarBuffer
using | VectorBuffer = BaseOutputWriter::VectorBuffer
using | TensorBuffer = BaseOutputWriter::TensorBuffer
using | EqBuffer = std::array<ScalarBuffer, numEq>
using | PhaseBuffer = std::array<ScalarBuffer, numPhases>
using | ComponentBuffer = std::array<ScalarBuffer, numComponents>
using | PhaseComponentBuffer = std::array<std::array<ScalarBuffer, numComponents>, numPhases>
using | PhaseVectorBuffer = std::array<VectorBuffer, numPhases>

## Public Member Functions

| BaseOutputModule (const Simulator &simulator)
virtual void | allocBuffers ()=0
| Allocate memory for the scalar fields we would like to write to disk.
virtual void | processElement (const ElementContext &elemCtx)=0
| Modify the internal buffers according to the intensive quanties relevant for an element.
virtual void | commitBuffers (BaseOutputWriter &writer)=0
| Add all buffers to the VTK output writer.
virtual bool | needExtensiveQuantities () const
| Returns true iff the module needs to access the extensive quantities of a context to do its job.

## Protected Types

enum class | BufferType { Dof , Vertex , Element }

## Protected Member Functions

void | resizeScalarBuffer_ (ScalarBuffer &buffer, BufferType bufferType)
| Allocate the space for a buffer storing a scalar quantity.
void | resizeTensorBuffer_ (TensorBuffer &buffer, BufferType bufferType)
| Allocate the space for a buffer storing a tensorial quantity.
void | resizeVectorBuffer_ (VectorBuffer &buffer, BufferType bufferType)
void | resizeEqBuffer_ (EqBuffer &buffer, BufferType bufferType)
| Allocate the space for a buffer storing a equation specific quantity.
void | resizePhaseBuffer_ (PhaseBuffer &buffer, BufferType bufferType)
| Allocate the space for a buffer storing a phase-specific quantity.
void | resizeComponentBuffer_ (ComponentBuffer &buffer, BufferType bufferType)
| Allocate the space for a buffer storing a component specific quantity.
void | resizePhaseComponentBuffer_ (PhaseComponentBuffer &buffer, BufferType bufferType)
| Allocate the space for a buffer storing a phase and component specific buffer.
void | commitScalarBuffer_ (BaseOutputWriter &baseWriter, const char *name, ScalarBuffer &buffer, BufferType bufferType)
| Add a buffer containing scalar quantities to the result file.
void | commitVectorBuffer_ (BaseOutputWriter &baseWriter, const char *name, VectorBuffer &buffer, BufferType bufferType)
| Add a buffer containing vectorial quantities to the result file.
void | commitTensorBuffer_ (BaseOutputWriter &baseWriter, const char *name, TensorBuffer &buffer, BufferType bufferType)
| Add a buffer containing tensorial quantities to the result file.
void | commitPriVarsBuffer_ (BaseOutputWriter &baseWriter, const char *pattern, EqBuffer &buffer, BufferType bufferType)
| Add a buffer with as many variables as PDEs to the result file.
void | commitEqBuffer_ (BaseOutputWriter &baseWriter, const char *pattern, EqBuffer &buffer, BufferType bufferType)
| Add a buffer with as many variables as PDEs to the result file.
void | commitPhaseBuffer_ (BaseOutputWriter &baseWriter, const char *pattern, PhaseBuffer &buffer, BufferType bufferType)
| Add a phase-specific buffer to the result file.
void | commitComponentBuffer_ (BaseOutputWriter &baseWriter, const char *pattern, ComponentBuffer &buffer, BufferType bufferType)
| Add a component-specific buffer to the result file.
void | commitPhaseComponentBuffer_ (BaseOutputWriter &baseWriter, const char *pattern, PhaseComponentBuffer &buffer, BufferType bufferType)
| Add a phase and component specific quantities to the output.
void | attachScalarElementData_ (BaseOutputWriter &baseWriter, ScalarBuffer &buffer, const char *name)
void | attachScalarVertexData_ (BaseOutputWriter &baseWriter, ScalarBuffer &buffer, const char *name)
void | attachVectorElementData_ (BaseOutputWriter &baseWriter, VectorBuffer &buffer, const char *name)
void | attachVectorVertexData_ (BaseOutputWriter &baseWriter, VectorBuffer &buffer, const char *name)
void | attachTensorElementData_ (BaseOutputWriter &baseWriter, TensorBuffer &buffer, const char *name)
void | attachTensorVertexData_ (BaseOutputWriter &baseWriter, TensorBuffer &buffer, const char *name)
std::size_t | getBufferSize (BufferType bufferType) const

## Protected Attributes

const Simulator & | simulator_

## Detailed Description

template<class TypeTag>
class Opm::BaseOutputModule< TypeTag >

The base class for writer modules.

This class also provides some convenience methods for buffer management and is the base class for all other output writer modules.

## Member Enumeration Documentation

## BufferType

template<class TypeTag>

enum class Opm::BaseOutputModule::BufferType

strong protected

Enumerator
Dof | Buffer contains data associated with the degrees of freedom.
Vertex | Buffer contains data associated with the grid's vertices.
Element | Buffer contains data associated with the grid's elements.

## Member Function Documentation

## allocBuffers()

template<class TypeTag>

virtual void Opm::BaseOutputModule< TypeTag >::allocBuffers | ( |  | ) |

pure virtual

Allocate memory for the scalar fields we would like to write to disk.

The module can dynamically cast the writer to the desired concrete class. If the writer is incompatible with the module, this method should become a no-op.

Implemented in Opm::VtkBlackOilBioeffectsModule< TypeTag >, Opm::VtkBlackOilEnergyModule< TypeTag >, Opm::VtkBlackOilModule< TypeTag >, Opm::VtkBlackOilPolymerModule< TypeTag >, Opm::VtkBlackOilSolventModule< TypeTag >, Opm::VtkCompositionModule< TypeTag >, Opm::VtkDiffusionModule< TypeTag >, Opm::VtkDiscreteFractureModule< TypeTag >, Opm::VtkEnergyModule< TypeTag >, Opm::VtkMultiPhaseModule< TypeTag >, Opm::VtkPhasePresenceModule< TypeTag >, Opm::VtkPrimaryVarsModule< TypeTag >, Opm::VtkPTFlashModule< TypeTag >, Opm::VtkTemperatureModule< TypeTag >, and Opm::VtkTracerModule< TypeTag >.

## commitBuffers()

template<class TypeTag>

virtual void Opm::BaseOutputModule< TypeTag >::commitBuffers | ( | BaseOutputWriter & | writer | ) |

pure virtual

Add all buffers to the VTK output writer.

Implemented in Opm::VtkBlackOilBioeffectsModule< TypeTag >, Opm::VtkBlackOilEnergyModule< TypeTag >, Opm::VtkBlackOilModule< TypeTag >, Opm::VtkBlackOilPolymerModule< TypeTag >, Opm::VtkBlackOilSolventModule< TypeTag >, Opm::VtkCompositionModule< TypeTag >, Opm::VtkDiffusionModule< TypeTag >, Opm::VtkDiscreteFractureModule< TypeTag >, Opm::VtkEnergyModule< TypeTag >, Opm::VtkMultiPhaseModule< TypeTag >, Opm::VtkPhasePresenceModule< TypeTag >, Opm::VtkPrimaryVarsModule< TypeTag >, Opm::VtkPTFlashModule< TypeTag >, Opm::VtkTemperatureModule< TypeTag >, and Opm::VtkTracerModule< TypeTag >.

## needExtensiveQuantities()

template<class TypeTag>

virtual bool Opm::BaseOutputModule< TypeTag >::needExtensiveQuantities | ( |  | ) | const

inline virtual

Returns true iff the module needs to access the extensive quantities of a context to do its job.

For example, this happens if velocities or gradients should be written.

Always returning true here does not do any harm from the correctness perspective, but it slows down writing the output fields. Since most output modules only write intensive quantities, this method returns 'false' by default.

Reimplemented in Opm::VtkMultiPhaseModule< TypeTag >.

## processElement()

template<class TypeTag>

virtual void Opm::BaseOutputModule< TypeTag >::processElement | ( | const ElementContext & | elemCtx | ) |

pure virtual

Modify the internal buffers according to the intensive quanties relevant for an element.

The module can dynamically cast the writer to the desired concrete class. If the writer is incompatible with the module, this method should become a no-op.

Implemented in Opm::VtkBlackOilBioeffectsModule< TypeTag >, Opm::VtkBlackOilEnergyModule< TypeTag >, Opm::VtkBlackOilModule< TypeTag >, Opm::VtkBlackOilPolymerModule< TypeTag >, Opm::VtkBlackOilSolventModule< TypeTag >, Opm::VtkCompositionModule< TypeTag >, Opm::VtkDiffusionModule< TypeTag >, Opm::VtkDiscreteFractureModule< TypeTag >, Opm::VtkEnergyModule< TypeTag >, Opm::VtkMultiPhaseModule< TypeTag >, Opm::VtkPhasePresenceModule< TypeTag >, Opm::VtkPrimaryVarsModule< TypeTag >, Opm::VtkPTFlashModule< TypeTag >, Opm::VtkTemperatureModule< TypeTag >, and Opm::VtkTracerModule< TypeTag >.

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

- opm/models/io/baseoutputmodule.hh