Opm::SimulationDataContainer Class Reference

#include <SimulationDataContainer.hpp>

Public Member Functions

 SimulationDataContainer (size_t num_cells, size_t num_faces, size_t num_phases)
 
 SimulationDataContainer (const SimulationDataContainer &)
 
SimulationDataContaineroperator= (const SimulationDataContainer &)
 
void swap (SimulationDataContainer &other)
 Efficient O(1) swap. More...
 
size_t numPhases () const
 
size_t numFaces () const
 
size_t numCells () const
 
bool hasCellData (const std::string &name) const
 
void registerCellData (const std::string &name, size_t components, double initialValue=0.0)
 
std::vector< double > & getCellData (const std::string &name)
 
const std::vector< double > & getCellData (const std::string &name) const
 
bool hasFaceData (const std::string &name) const
 
void registerFaceData (const std::string &name, size_t components, double initialValue=0.0)
 
std::vector< double > & getFaceData (const std::string &name)
 
const std::vector< double > & getFaceData (const std::string &name) const
 

:

Will return the number of components of the celldata with name

numCellDataComponents( "PRESSURE" ) -> 1 numCellDataComponents( "SATURATION" ) -> 3

for a three phase model.

size_t numCellDataComponents (const std::string &name) const
 
bool equal (const SimulationDataContainer &other) const
 
void setCellDataComponent (const std::string &key, size_t component, const std::vector< int > &cells, const std::vector< double > &values)
 
std::vector< double > & pressure ()
 
std::vector< double > & temperature ()
 
std::vector< double > & saturation ()
 
std::vector< double > & facepressure ()
 
std::vector< double > & faceflux ()
 
const std::vector< double > & pressure () const
 
const std::vector< double > & temperature () const
 
const std::vector< double > & saturation () const
 
const std::vector< double > & facepressure () const
 
const std::vector< double > & faceflux () const
 
const std::map< std::string, std::vector< double > > & cellData () const
 
std::map< std::string, std::vector< double > > & cellData ()
 

Detailed Description

The SimulationDataContainer is a simple container to manage simulation data. The container is instantiated with information of how many cells, faces and phases are present in the reservoirmodel. You can then add data to the container by using the

registerCellData() registerFaceData()

functions. The container owns and manages the data, but mutable references are returned with the getCellData() and getFaceData() methods, and the content will typically be modified by external scope.

Constructor & Destructor Documentation

◆ SimulationDataContainer() [1/2]

Opm::SimulationDataContainer::SimulationDataContainer ( size_t  num_cells,
size_t  num_faces,
size_t  num_phases 
)

Main constructor setting the sizes for the contained data types.

Parameters
num_cellsnumber of elements in cell data vectors
num_facesnumber of elements in face data vectors
num_phasesnumber of phases, the number of components in any data vector must equal 1 or this number (this behaviour and argument is deprecated).

◆ SimulationDataContainer() [2/2]

Opm::SimulationDataContainer::SimulationDataContainer ( const SimulationDataContainer )

Copy constructor. Must be defined explicitly because class contains non-value objects (the reference pointers pressure_ref_ etc.) that should not simply be copied.

Member Function Documentation

◆ cellData() [1/2]

std::map< std::string, std::vector< double > > & Opm::SimulationDataContainer::cellData ( )

◆ cellData() [2/2]

const std::map< std::string, std::vector< double > > & Opm::SimulationDataContainer::cellData ( ) const

◆ equal()

bool Opm::SimulationDataContainer::equal ( const SimulationDataContainer other) const

◆ faceflux() [1/2]

std::vector< double > & Opm::SimulationDataContainer::faceflux ( )
inline

◆ faceflux() [2/2]

const std::vector< double > & Opm::SimulationDataContainer::faceflux ( ) const
inline

◆ facepressure() [1/2]

std::vector< double > & Opm::SimulationDataContainer::facepressure ( )
inline

◆ facepressure() [2/2]

const std::vector< double > & Opm::SimulationDataContainer::facepressure ( ) const
inline

◆ getCellData() [1/2]

std::vector< double > & Opm::SimulationDataContainer::getCellData ( const std::string name)

◆ getCellData() [2/2]

const std::vector< double > & Opm::SimulationDataContainer::getCellData ( const std::string name) const

◆ getFaceData() [1/2]

std::vector< double > & Opm::SimulationDataContainer::getFaceData ( const std::string name)

◆ getFaceData() [2/2]

const std::vector< double > & Opm::SimulationDataContainer::getFaceData ( const std::string name) const

◆ hasCellData()

bool Opm::SimulationDataContainer::hasCellData ( const std::string name) const

◆ hasFaceData()

bool Opm::SimulationDataContainer::hasFaceData ( const std::string name) const

◆ numCellDataComponents()

size_t Opm::SimulationDataContainer::numCellDataComponents ( const std::string name) const

◆ numCells()

size_t Opm::SimulationDataContainer::numCells ( ) const

◆ numFaces()

size_t Opm::SimulationDataContainer::numFaces ( ) const

◆ numPhases()

size_t Opm::SimulationDataContainer::numPhases ( ) const

◆ operator=()

SimulationDataContainer & Opm::SimulationDataContainer::operator= ( const SimulationDataContainer )

Copy assignment operator. Must be defined explicitly because class contains non-value objects (the reference pointers pressure_ref_ etc.) that should not simply be copied.

◆ pressure() [1/2]

std::vector< double > & Opm::SimulationDataContainer::pressure ( )
inline

◆ pressure() [2/2]

const std::vector< double > & Opm::SimulationDataContainer::pressure ( ) const
inline

◆ registerCellData()

void Opm::SimulationDataContainer::registerCellData ( const std::string name,
size_t  components,
double  initialValue = 0.0 
)

Will register a data vector of size numCells() * components.

◆ registerFaceData()

void Opm::SimulationDataContainer::registerFaceData ( const std::string name,
size_t  components,
double  initialValue = 0.0 
)

◆ saturation() [1/2]

std::vector< double > & Opm::SimulationDataContainer::saturation ( )
inline

◆ saturation() [2/2]

const std::vector< double > & Opm::SimulationDataContainer::saturation ( ) const
inline

◆ setCellDataComponent()

void Opm::SimulationDataContainer::setCellDataComponent ( const std::string key,
size_t  component,
const std::vector< int > &  cells,
const std::vector< double > &  values 
)

Will set the values of component nr @component in the field @key. All the cells in @cells will be set to the values in @values.

◆ swap()

void Opm::SimulationDataContainer::swap ( SimulationDataContainer other)

Efficient O(1) swap.

◆ temperature() [1/2]

std::vector< double > & Opm::SimulationDataContainer::temperature ( )
inline

◆ temperature() [2/2]

const std::vector< double > & Opm::SimulationDataContainer::temperature ( ) const
inline

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