#include <stormfaciesgrid.hpp>

Inheritance diagram for NRLib::StormFaciesGrid:
Inheritance graph

Public Types

enum  FileFormat { STORM_BINARY = 0 , STORM_ASCII }
 
typedef std::vector< int >::iterator iterator
 
typedef std::vector< int >::const_iterator const_iterator
 
typedef std::vector< int >::reference reference
 
typedef std::vector< int >::const_reference const_reference
 

Public Member Functions

 StormFaciesGrid (const std::string &filename, Endianess file_format=END_BIG_ENDIAN)
 
 StormFaciesGrid (size_t nx=0, size_t ny=0, size_t nz=0)
 
 StormFaciesGrid (const Volume &vol, size_t nx, size_t ny, size_t nz)
 
void SetMissingCode (int missing_code)
 
int GetMissingCode () const
 
bool IsMissing (int val) const
 
void SetFormat (FileFormat format)
 
FileFormat GetFormat () const
 
void SetModelFileName (const std::string &filename)
 
std::string GetModelFileName () const
 
void SetZoneNumber (int zone_number)
 
int GetZoneNumber () const
 
int GetFaciesCode (int body_index) const
 
int GetFaciesFromCell (size_t cell_index) const
 
int GetFaciesFromCell (size_t i, size_t j, size_t k) const
 
const std::stringGetFaciesName (int facies_code) const
 
void SetBodyFacies (const std::vector< int > &body_facies)
 
void SetFaciesNames (const std::vector< std::string > &facies_names)
 
void WriteToFile (const std::string &filename, Endianess file_format=END_BIG_ENDIAN) const
 
void ReadFromFile (const std::string &filename, bool commonPath=true, Endianess file_format=END_BIG_ENDIAN)
 
void CheckConsistency () const
 Check that all the facies value for each body, and the body values inside the grid are inside the given range. More...
 
double GetDX () const
 
double GetDY () const
 
size_t FindIndex (double x, double y, double z) const
 
void FindIndex (double x, double y, double z, size_t &i_out, size_t &j_out, size_t &k_out) const
 
void FindCenterOfCell (size_t i, size_t j, size_t k, double &x, double &y, double &z) const
 
void Resize (size_t ni, size_t nj, size_t nk, const int &val=int())
 
void GetAvgMinMax (int &avg, int &min, int &max)
 
void GetAvgMinMaxWithMissing (int &avg, int &min, int &max, int missing)
 
void LogTransform (int missing)
 
reference operator() (size_t i, size_t j, size_t k)
 
reference operator() (size_t index)
 
const_reference operator() (size_t i, size_t j, size_t k) const
 
const_reference operator() (size_t index) const
 
reference GetValue (size_t i, size_t j, size_t k)
 
const_reference GetValue (size_t i, size_t j, size_t k) const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
size_t GetNI () const
 
size_t GetNJ () const
 
size_t GetNK () const
 
size_t GetN () const
 
size_t GetIndex (size_t i, size_t j, size_t k) const
 
void GetIJK (size_t index, size_t &i, size_t &j, size_t &k) const
 
void SetValue (size_t i, size_t j, size_t k, const int &value)
 
void Swap (Grid< int > &other)
 
void SetDimensions (double x_min, double y_min, double lx, double ly)
 
void SetAngle (double angle)
 
void SetTolerance (double tolerance)
 
double GetTolerance ()
 
double GetXMin () const
 
double GetYMin () const
 
double GetZMin (size_t nx, size_t ny) const
 Get extreme values of z for volume, with nx, ny resolution. More...
 
double GetZMax (size_t nx, size_t ny) const
 
double GetLX () const
 
double GetLY () const
 
double GetAngle () const
 
double GetLZ () const
 Maximum height of grid. More...
 
void GetXYFromRelative (double rel_x, double rel_y, double &x, double &y) const
 rel_x and rel_y in [0,1]. More...
 
double GetTopZMin (size_t nx, size_t ny) const
 Get z-range for top and bottom surfaces, with nx, ny resolution. More...
 
double GetTopZMax (size_t nx, size_t ny) const
 
double GetBotZMin (size_t nx, size_t ny) const
 
double GetBotZMax (size_t nx, size_t ny) const
 
void SetSurfaces (const Surface< double > &top_surf, const Surface< double > &bot_surf, bool skip_check=true)
 Set surfaces. More...
 
const Surface< double > & GetTopSurface () const
 
Surface< double > & GetTopSurface ()
 
const Surface< double > & GetBotSurface () const
 
Surface< double > & GetBotSurface ()
 
int IsInside (double x, double y) const
 
bool IsInside (double x, double y, double z) const
 
int IsInsideTolerance (double x, double y) const
 
bool IsInsideZTolerance (double x, double y, double z, double tolerance) const
 
void FindCenter (double &x, double &y, double &z) const
 
bool CheckSurface (const Surface< double > &surface) const
 Checks if surface covers the whole volume. More...
 

Protected Member Functions

void WriteVolumeToFile (std::ofstream &file, const std::string &filename, bool remove_path=true) const
 Reader and writer on storm-format. More...
 
void ReadVolumeFromFile (std::ifstream &file, int line, const std::string &path)
 
void GlobalToLocalCoord (double global_x, double global_y, double &local_x, double &local_y) const
 The local coorinates are (0,0) in (x_min, y_min), and have the same orientation as the volume. More...
 
void LocalToGlobalCoord (double local_x, double local_y, double &global_x, double &global_y) const
 

Member Typedef Documentation

◆ const_iterator

typedef std::vector<int >::const_iterator NRLib::Grid< int >::const_iterator
inherited

◆ const_reference

typedef std::vector<int >::const_reference NRLib::Grid< int >::const_reference
inherited

◆ iterator

typedef std::vector<int >::iterator NRLib::Grid< int >::iterator
inherited

◆ reference

typedef std::vector<int >::reference NRLib::Grid< int >::reference
inherited

Member Enumeration Documentation

◆ FileFormat

Enumerator
STORM_BINARY 
STORM_ASCII 

Constructor & Destructor Documentation

◆ StormFaciesGrid() [1/3]

NRLib::StormFaciesGrid::StormFaciesGrid ( const std::string filename,
Endianess  file_format = END_BIG_ENDIAN 
)
explicit

◆ StormFaciesGrid() [2/3]

NRLib::StormFaciesGrid::StormFaciesGrid ( size_t  nx = 0,
size_t  ny = 0,
size_t  nz = 0 
)
explicit

◆ StormFaciesGrid() [3/3]

NRLib::StormFaciesGrid::StormFaciesGrid ( const Volume vol,
size_t  nx,
size_t  ny,
size_t  nz 
)
explicit

Member Function Documentation

◆ begin() [1/2]

iterator NRLib::Grid< int >::begin ( )
inlineinherited

◆ begin() [2/2]

const_iterator NRLib::Grid< int >::begin ( ) const
inlineinherited

◆ CheckConsistency()

void NRLib::StormFaciesGrid::CheckConsistency ( ) const

Check that all the facies value for each body, and the body values inside the grid are inside the given range.

◆ CheckSurface()

bool NRLib::Volume::CheckSurface ( const Surface< double > &  surface) const
inherited

Checks if surface covers the whole volume.

◆ end() [1/2]

iterator NRLib::Grid< int >::end ( )
inlineinherited

◆ end() [2/2]

const_iterator NRLib::Grid< int >::end ( ) const
inlineinherited

◆ FindCenter()

void NRLib::Volume::FindCenter ( double &  x,
double &  y,
double &  z 
) const
inherited

◆ FindCenterOfCell()

void NRLib::StormFaciesGrid::FindCenterOfCell ( size_t  i,
size_t  j,
size_t  k,
double &  x,
double &  y,
double &  z 
) const

◆ FindIndex() [1/2]

size_t NRLib::StormFaciesGrid::FindIndex ( double  x,
double  y,
double  z 
) const

◆ FindIndex() [2/2]

void NRLib::StormFaciesGrid::FindIndex ( double  x,
double  y,
double  z,
size_t &  i_out,
size_t &  j_out,
size_t &  k_out 
) const

◆ GetAngle()

double NRLib::Volume::GetAngle ( ) const
inlineinherited

◆ GetAvgMinMax()

void NRLib::Grid< int >::GetAvgMinMax ( int &  avg,
int &  min,
int &  max 
)
inherited

◆ GetAvgMinMaxWithMissing()

void NRLib::Grid< int >::GetAvgMinMaxWithMissing ( int &  avg,
int &  min,
int &  max,
int  missing 
)
inherited

◆ GetBotSurface() [1/2]

Surface< double > & NRLib::Volume::GetBotSurface ( )
inlineinherited

◆ GetBotSurface() [2/2]

const Surface< double > & NRLib::Volume::GetBotSurface ( ) const
inlineinherited

◆ GetBotZMax()

double NRLib::Volume::GetBotZMax ( size_t  nx,
size_t  ny 
) const
inherited

◆ GetBotZMin()

double NRLib::Volume::GetBotZMin ( size_t  nx,
size_t  ny 
) const
inherited

◆ GetDX()

double NRLib::StormFaciesGrid::GetDX ( ) const
inline

◆ GetDY()

double NRLib::StormFaciesGrid::GetDY ( ) const
inline

◆ GetFaciesCode()

int NRLib::StormFaciesGrid::GetFaciesCode ( int  body_index) const

◆ GetFaciesFromCell() [1/2]

int NRLib::StormFaciesGrid::GetFaciesFromCell ( size_t  cell_index) const

Referenced by GetFaciesFromCell().

◆ GetFaciesFromCell() [2/2]

int NRLib::StormFaciesGrid::GetFaciesFromCell ( size_t  i,
size_t  j,
size_t  k 
) const
inline

◆ GetFaciesName()

const std::string & NRLib::StormFaciesGrid::GetFaciesName ( int  facies_code) const

◆ GetFormat()

FileFormat NRLib::StormFaciesGrid::GetFormat ( ) const
inline

◆ GetIJK()

void NRLib::Grid< int >::GetIJK ( size_t  index,
size_t &  i,
size_t &  j,
size_t &  k 
) const
inherited

◆ GetIndex()

size_t NRLib::Grid< int >::GetIndex ( size_t  i,
size_t  j,
size_t  k 
) const
inlineinherited

◆ GetLX()

double NRLib::Volume::GetLX ( ) const
inlineinherited

◆ GetLY()

double NRLib::Volume::GetLY ( ) const
inlineinherited

◆ GetLZ()

double NRLib::Volume::GetLZ ( ) const
inlineinherited

Maximum height of grid.

◆ GetMissingCode()

int NRLib::StormFaciesGrid::GetMissingCode ( ) const
inline

◆ GetModelFileName()

std::string NRLib::StormFaciesGrid::GetModelFileName ( ) const
inline

◆ GetN()

size_t NRLib::Grid< int >::GetN ( ) const
inlineinherited

◆ GetNI()

size_t NRLib::Grid< int >::GetNI ( ) const
inlineinherited

◆ GetNJ()

size_t NRLib::Grid< int >::GetNJ ( ) const
inlineinherited

◆ GetNK()

size_t NRLib::Grid< int >::GetNK ( ) const
inlineinherited

◆ GetTolerance()

double NRLib::Volume::GetTolerance ( )
inlineinherited

◆ GetTopSurface() [1/2]

Surface< double > & NRLib::Volume::GetTopSurface ( )
inlineinherited

◆ GetTopSurface() [2/2]

const Surface< double > & NRLib::Volume::GetTopSurface ( ) const
inlineinherited

◆ GetTopZMax()

double NRLib::Volume::GetTopZMax ( size_t  nx,
size_t  ny 
) const
inherited

◆ GetTopZMin()

double NRLib::Volume::GetTopZMin ( size_t  nx,
size_t  ny 
) const
inherited

Get z-range for top and bottom surfaces, with nx, ny resolution.

◆ GetValue() [1/2]

Grid< int >::reference NRLib::Grid< int >::GetValue ( size_t  i,
size_t  j,
size_t  k 
)
inlineinherited

◆ GetValue() [2/2]

Grid< int >::const_reference NRLib::Grid< int >::GetValue ( size_t  i,
size_t  j,
size_t  k 
) const
inlineinherited

◆ GetXMin()

double NRLib::Volume::GetXMin ( ) const
inlineinherited

◆ GetXYFromRelative()

void NRLib::Volume::GetXYFromRelative ( double  rel_x,
double  rel_y,
double &  x,
double &  y 
) const
inlineinherited

rel_x and rel_y in [0,1].

References NRLib::Volume::LocalToGlobalCoord(), and exprtk::details::x().

◆ GetYMin()

double NRLib::Volume::GetYMin ( ) const
inlineinherited

◆ GetZMax()

double NRLib::Volume::GetZMax ( size_t  nx,
size_t  ny 
) const
inherited

◆ GetZMin()

double NRLib::Volume::GetZMin ( size_t  nx,
size_t  ny 
) const
inherited

Get extreme values of z for volume, with nx, ny resolution.

Referenced by NRLib::StormContGrid::GetZMin().

◆ GetZoneNumber()

int NRLib::StormFaciesGrid::GetZoneNumber ( ) const
inline

◆ GlobalToLocalCoord()

void NRLib::Volume::GlobalToLocalCoord ( double  global_x,
double  global_y,
double &  local_x,
double &  local_y 
) const
protectedinherited

The local coorinates are (0,0) in (x_min, y_min), and have the same orientation as the volume.

◆ IsInside() [1/2]

int NRLib::Volume::IsInside ( double  x,
double  y 
) const
inherited

◆ IsInside() [2/2]

bool NRLib::Volume::IsInside ( double  x,
double  y,
double  z 
) const
inherited

◆ IsInsideTolerance()

int NRLib::Volume::IsInsideTolerance ( double  x,
double  y 
) const
inherited

◆ IsInsideZTolerance()

bool NRLib::Volume::IsInsideZTolerance ( double  x,
double  y,
double  z,
double  tolerance 
) const
inherited

◆ IsMissing()

bool NRLib::StormFaciesGrid::IsMissing ( int  val) const
inline

◆ LocalToGlobalCoord()

void NRLib::Volume::LocalToGlobalCoord ( double  local_x,
double  local_y,
double &  global_x,
double &  global_y 
) const
protectedinherited

◆ LogTransform()

void NRLib::Grid< int >::LogTransform ( int  missing)
inherited

◆ operator()() [1/4]

Grid< int >::reference NRLib::Grid< int >::operator() ( size_t  i,
size_t  j,
size_t  k 
)
inlineinherited

◆ operator()() [2/4]

Grid< int >::const_reference NRLib::Grid< int >::operator() ( size_t  i,
size_t  j,
size_t  k 
) const
inlineinherited

◆ operator()() [3/4]

Grid< int >::reference NRLib::Grid< int >::operator() ( size_t  index)
inlineinherited

◆ operator()() [4/4]

Grid< int >::const_reference NRLib::Grid< int >::operator() ( size_t  index) const
inlineinherited

◆ ReadFromFile()

void NRLib::StormFaciesGrid::ReadFromFile ( const std::string filename,
bool  commonPath = true,
Endianess  file_format = END_BIG_ENDIAN 
)

◆ ReadVolumeFromFile()

void NRLib::Volume::ReadVolumeFromFile ( std::ifstream &  file,
int  line,
const std::string path 
)
protectedinherited

◆ Resize()

void NRLib::Grid< int >::Resize ( size_t  ni,
size_t  nj,
size_t  nk,
const int &  val = A() 
)
inherited

All values in the grid are erased when the grid is resized.

Parameters
valInitial cell value.

◆ SetAngle()

void NRLib::Volume::SetAngle ( double  angle)
inherited

◆ SetBodyFacies()

void NRLib::StormFaciesGrid::SetBodyFacies ( const std::vector< int > &  body_facies)

◆ SetDimensions()

void NRLib::Volume::SetDimensions ( double  x_min,
double  y_min,
double  lx,
double  ly 
)
inherited

◆ SetFaciesNames()

void NRLib::StormFaciesGrid::SetFaciesNames ( const std::vector< std::string > &  facies_names)

◆ SetFormat()

void NRLib::StormFaciesGrid::SetFormat ( FileFormat  format)
inline

References format.

◆ SetMissingCode()

void NRLib::StormFaciesGrid::SetMissingCode ( int  missing_code)
inline

◆ SetModelFileName()

void NRLib::StormFaciesGrid::SetModelFileName ( const std::string filename)
inline

◆ SetSurfaces()

void NRLib::Volume::SetSurfaces ( const Surface< double > &  top_surf,
const Surface< double > &  bot_surf,
bool  skip_check = true 
)
inherited

Set surfaces.

◆ SetTolerance()

void NRLib::Volume::SetTolerance ( double  tolerance)
inlineinherited

◆ SetValue()

void NRLib::Grid< int >::SetValue ( size_t  i,
size_t  j,
size_t  k,
const int &  value 
)
inherited

◆ SetZoneNumber()

void NRLib::StormFaciesGrid::SetZoneNumber ( int  zone_number)
inline

◆ Swap()

void NRLib::Grid< int >::Swap ( NRLib::Grid< int > &  other)
inherited

◆ WriteToFile()

void NRLib::StormFaciesGrid::WriteToFile ( const std::string filename,
Endianess  file_format = END_BIG_ENDIAN 
) const

◆ WriteVolumeToFile()

void NRLib::Volume::WriteVolumeToFile ( std::ofstream &  file,
const std::string filename,
bool  remove_path = true 
) const
protectedinherited

Reader and writer on storm-format.


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