gstlearn  1.0.0
CCC
CalcSimuEden Class Reference

#include <CalcSimuEden.hpp>

Inheritance diagram for CalcSimuEden:
ACalcSimulation AStringable ISkinFunctions ACalcInterpolator ACalcDbToDb ACalculator

Public Member Functions

 CalcSimuEden (int nfacies=0, int nfluids=0, int niter=1, int nbsimu=0, int seed=4324324, bool verbose=false)
 
 CalcSimuEden (const CalcSimuEden &r)=delete
 
CalcSimuEdenoperator= (const CalcSimuEden &r)=delete
 
virtual ~CalcSimuEden ()
 
virtual String toString (const AStringFormat *strfmt=nullptr) const override
 Interface to AStringable. More...
 
int isAlreadyFilled (int ipos) const override
 Interface to ISkinFunctions. More...
 
int isToBeFilled (int ipos) const override
 
double getWeight (int ipos, int idir) const override
 
void setIndFacies (int indFacies)
 
void setIndFluid (int indFluid)
 
void setIndPerm (int indPerm)
 
void setIndPoro (int indPoro)
 
void setSpeeds (const VectorInt &speeds)
 
void setNumberMax (double numberMax)
 
void setShowFluid (bool showFluid)
 
void setVolumeMax (double volumeMax)
 
- Public Member Functions inherited from ACalcSimulation
 ACalcSimulation (int nbimu, int seed=4324324)
 
 ACalcSimulation (const ACalcSimulation &r)=delete
 
ACalcSimulationoperator= (const ACalcSimulation &r)=delete
 
virtual ~ACalcSimulation ()
 
int getSeed () const
 
int getNbSimu () const
 
void setSeed (int seed)
 
void setNbSimu (int nbsimu)
 
- Public Member Functions inherited from ACalcInterpolator
 ACalcInterpolator ()
 
 ACalcInterpolator (const ACalcInterpolator &r)=delete
 
ACalcInterpolatoroperator= (const ACalcInterpolator &r)=delete
 
virtual ~ACalcInterpolator ()
 
void setModel (Model *model)
 
void setNeigh (ANeigh *neigh)
 
ModelgetModel () const
 
ANeighgetNeigh () const
 
bool hasModel (bool verbose=true) const
 
bool hasNeigh (bool verbose=true) const
 
- Public Member Functions inherited from ACalcDbToDb
 ACalcDbToDb (bool mustShareSameSpaceDimension=true)
 
 ACalcDbToDb (const ACalcDbToDb &r)=delete
 
ACalcDbToDboperator= (const ACalcDbToDb &r)=delete
 
virtual ~ACalcDbToDb ()
 
void setDbin (Db *dbin)
 
void setDbout (Db *dbout)
 
void setNamingConvention (const NamingConvention &namconv)
 
void setMustShareSpaceDimension (bool mustShareSpaceDimension)
 
DbgetDbin () const
 
DbgetDbout () const
 
DbGridgetGridin () const
 
DbGridgetGridout () const
 
bool hasDbin (bool verbose=true) const
 
bool hasDbout (bool verbose=true) const
 
bool isGridIn (bool verbose=true) const
 
bool isGridOut (bool verbose=true) const
 
- Public Member Functions inherited from ACalculator
 ACalculator ()
 
 ACalculator (const ACalculator &r)=delete
 
ACalculatoroperator= (const ACalculator &r)=delete
 
virtual ~ACalculator ()
 
bool run ()
 
- Public Member Functions inherited from AStringable
 AStringable ()
 
 AStringable (const AStringable &r)
 
AStringableoperator= (const AStringable &r)
 
virtual ~AStringable ()
 
virtual void display (const AStringFormat *strfmt=nullptr) const final
 
virtual void display (int level) const final
 
- Public Member Functions inherited from ISkinFunctions
 ISkinFunctions ()
 
virtual ~ISkinFunctions ()
 

Private Member Functions

virtual bool _check () override
 
virtual bool _preprocess () override
 
virtual bool _run () override
 
virtual bool _postprocess () override
 
virtual void _rollback () override
 
bool _simulate ()
 
bool _fluid_check (void)
 
int _getWT (int ifacies, int ifluid, int perm, int idir)
 
int _getFACIES (int iech) const
 
int _getFLUID (int iech) const
 
int _getFLUID_OLD (int iech) const
 
int _getPERM (int iech) const
 
double _getDATE (int iech)
 
double _getPORO (int iech) const
 
void _setFLUID (int iech, int ifluid)
 
void _setFACIES (int iech, int ifacies)
 
void _setFACIES_CORK (int iech)
 
void _setDATE (int iech, int idate)
 
void _printParams (bool verbose)
 
void _statsDefine (void)
 
void _statsReset ()
 
void _statsInit ()
 
void _setStatNumber (int ifacies, int ifluid, int value)
 
void _setStatVolume (int ifacies, int ifluid, double value)
 
void _addStatNumber (int ifacies, int ifluid, int value)
 
void _addStatVolume (int ifacies, int ifluid, double value)
 
void _checkInconsistency (bool verbose)
 
int _getStatNumber (int ifacies, int ifluid) const
 
double _getStatVolume (int ifacies, int ifluid) const
 
int _checkMax (double number_max, double volume_max)
 
int _fluidModify (Skin *skin, int ipos, int *ref_fluid_loc)
 
void _statsPrint (const char *title)
 
void _statsEmpty (const char *title)
 
void _calculateCumul (void)
 
void _updateResults (int reset_facies, int show_fluid)
 
void _normalizeCumul (int niter)
 
int _countAlreadyFilled () const
 
int _countIsToBeFilled () const
 

Private Attributes

bool _verbose
 
bool _showFluid
 1 for modifying the value of the cells to show More...
 
int _iptrStatFluid
 
int _iptrStatCork
 
int _iptrFluid
 
int _iptrDate
 
int _niter
 
int _nfacies
 Number of iterations. More...
 
int _nfluids
 number of facies (facies 0 excluded) More...
 
VectorInt _speeds
 number of fluids More...
 
double _numberMax
 array containing the travel speeds More...
 
double _volumeMax
 Maximum count of cells invaded (or TEST) More...
 
int _indFacies
 Maximum volume invaded (or TEST) More...
 
int _indFluid
 Rank of the variable containing the Facies. More...
 
int _indPerm
 Rank of the variable containing the Fluid. More...
 
int _indPoro
 Rank of the variable containing the Permeability. More...
 
int _indDate
 Rank of the variable containing the Porosity. More...
 
int _nxyz
 
int _ncork
 
VectorInt _numbers
 
VectorDouble _volumes
 

Additional Inherited Members

- Protected Member Functions inherited from ACalcInterpolator
virtual int _getNDim () const override
 
virtual int _getNVar () const override
 
virtual int _getNCova () const
 
int _centerDataToGrid (DbGrid *dbgrid)
 
- Protected Member Functions inherited from ACalcDbToDb
int _addVariableDb (int whichDb, int status, const ELoc &locatorType, int locatorIndex=0, int number=1, double valinit=0.)
 
void _renameVariable (int whichDb, const VectorString &names, const ELoc &locatorType, int nvar, int iptr, const String &name, int count, bool flagSetLocator=true, int shift=0)
 
void _storeInVariableList (int whichDb, int status, const VectorInt &iuids)
 
int _expandInformation (int mode, const ELoc &locatorType)
 
void _cleanVariableDb (int status)
 
Db_whichDb (int whichDb)
 
String _identifyVariable (int iuid) const
 

Detailed Description

Multivariate multiphase propagation into a set of components constrained by initial conditions and fluid densities

Remarks
Directions are ordered as follows :
0: +X; 1: -X; 2: +Y; 3: -Y; 4: +Z(up); 5: -Z(down)
The coding of the matrix is:
facies + nfacies * fluid
Facies: 0 (Shale), 1 to nfacies, -1 (Cork)
Fluids: 0 (undefined), 1 to nfluids, -1 (No Fluid)
Fluids should be ordered by increasing weight
A Permeability variable is a value (>=1) which divides
the velocities. This variable is optional.
A Porosity variable is a value (in [0,1]) which multiplies
the volumes. This variable is optional.
Volume_max represents the volumic part of the invaded area:
it is always <= number of cells invaded.

Constructor & Destructor Documentation

◆ CalcSimuEden() [1/2]

CalcSimuEden::CalcSimuEden ( int  nfacies = 0,
int  nfluids = 0,
int  niter = 1,
int  nbsimu = 0,
int  seed = 4324324,
bool  verbose = false 
)

◆ CalcSimuEden() [2/2]

CalcSimuEden::CalcSimuEden ( const CalcSimuEden r)
delete

◆ ~CalcSimuEden()

CalcSimuEden::~CalcSimuEden ( )
virtual

Member Function Documentation

◆ _addStatNumber()

void CalcSimuEden::_addStatNumber ( int  ifacies,
int  ifluid,
int  value 
)
private

◆ _addStatVolume()

void CalcSimuEden::_addStatVolume ( int  ifacies,
int  ifluid,
double  value 
)
private

◆ _calculateCumul()

void CalcSimuEden::_calculateCumul ( void  )
private

Calculate the statistics on Fluids and Corks

◆ _check()

bool CalcSimuEden::_check ( )
overrideprivatevirtual

Reimplemented from ACalcSimulation.

◆ _checkInconsistency()

void CalcSimuEden::_checkInconsistency ( bool  verbose)
private

Initialize and check Facies & Fluid matrices

◆ _checkMax()

int CalcSimuEden::_checkMax ( double  number_max,
double  volume_max 
)
private

Check that the Maximum quantities have been reached

◆ _countAlreadyFilled()

int CalcSimuEden::_countAlreadyFilled ( ) const
private

◆ _countIsToBeFilled()

int CalcSimuEden::_countIsToBeFilled ( ) const
private

◆ _fluid_check()

bool CalcSimuEden::_fluid_check ( void  )
private

Check the validity of the array Speed

Returns
Error return code

◆ _fluidModify()

int CalcSimuEden::_fluidModify ( Skin skin,
int  ipos,
int *  ref_fluid_loc 
)
private

Calculate the new value for the fluid of the target cell

Returns
0 for a regular cell and 1 for a newly generated cork
Parameters
[in]skinPointer to the skin
[in]iposCell location
[out]ref_fluid_locCurrent fluid value for the target cell

◆ _getDATE()

double CalcSimuEden::_getDATE ( int  iech)
private

Get the Date value for a grid node

Returns
Date value
Parameters
[in]iechRank of the sample

◆ _getFACIES()

int CalcSimuEden::_getFACIES ( int  iech) const
private

Get the Facies value for a grid node

Returns
Facies value
Parameters
[in]iechRank of the sample

◆ _getFLUID()

int CalcSimuEden::_getFLUID ( int  iech) const
private

Get the Fluid value for a grid node

Returns
Fluid value
Parameters
[in]iechRank of the grid node

◆ _getFLUID_OLD()

int CalcSimuEden::_getFLUID_OLD ( int  iech) const
private

Get the Fluid value for a grid node This routine is meant for questionning the old Fluid variable

Returns
Fluid value
Parameters
[in]iechRank of the grid node

◆ _getPERM()

int CalcSimuEden::_getPERM ( int  iech) const
private

Get the Permeability value for a grid node

Returns
Permeability value (>= 1)
Parameters
[in]iechRank of the sample

◆ _getPORO()

double CalcSimuEden::_getPORO ( int  iech) const
private

Get the Porosity value for a grid node

Returns
Porosity value (in [0,1])
Parameters
[in]iechRank of the sample

◆ _getStatNumber()

int CalcSimuEden::_getStatNumber ( int  ifacies,
int  ifluid 
) const
private

◆ _getStatVolume()

double CalcSimuEden::_getStatVolume ( int  ifacies,
int  ifluid 
) const
private

◆ _getWT()

int CalcSimuEden::_getWT ( int  ifacies,
int  ifluid,
int  perm,
int  idir 
)
private

Transition speed for a Facies/Fluid pair in a given direction

Returns
Transition speed
Parameters
[in]ifaciesFacies value
[in]ifluidFluid value
[in]permPermeability value
[in]idirDirection value

◆ _normalizeCumul()

void CalcSimuEden::_normalizeCumul ( int  niter)
private

Normalize the statistics on Fluids and Corks

Parameters
[in]niterNumber of iterations

◆ _postprocess()

bool CalcSimuEden::_postprocess ( )
overrideprivatevirtual

Reimplemented from ACalculator.

◆ _preprocess()

bool CalcSimuEden::_preprocess ( )
overrideprivatevirtual

Reimplemented from ACalcSimulation.

◆ _printParams()

void CalcSimuEden::_printParams ( bool  verbose)
private

Print the parameters of the fluid propagation simulation

◆ _rollback()

void CalcSimuEden::_rollback ( )
overrideprivatevirtual

Reimplemented from ACalculator.

◆ _run()

bool CalcSimuEden::_run ( )
overrideprivatevirtual

Implements ACalculator.

◆ _setDATE()

void CalcSimuEden::_setDATE ( int  iech,
int  idate 
)
private

Set the Date for a grid node

Parameters
[in]iechRank of the grid node
[in]idateRank of the iteration

◆ _setFACIES()

void CalcSimuEden::_setFACIES ( int  iech,
int  ifacies 
)
private

Set the Facies value for a grid node

Parameters
[in]iechRank of the grid node
[in]ifaciesFacies value

◆ _setFACIES_CORK()

void CalcSimuEden::_setFACIES_CORK ( int  iech)
private

Turn the Facies into Cork

Parameters
[in]iechRank of the grid node

◆ _setFLUID()

void CalcSimuEden::_setFLUID ( int  iech,
int  ifluid 
)
private

Set the Fluid value for a grid node

Parameters
[in]iechRank of the grid node
[in]ifluidFluid value

◆ _setStatNumber()

void CalcSimuEden::_setStatNumber ( int  ifacies,
int  ifluid,
int  value 
)
private

◆ _setStatVolume()

void CalcSimuEden::_setStatVolume ( int  ifacies,
int  ifluid,
double  value 
)
private

◆ _simulate()

bool CalcSimuEden::_simulate ( )
private

Multivariate multiphase propagation into a set of components constrained by initial conditions and fluid densities

Returns
Error return code : 1 no fluid to propagate

◆ _statsDefine()

void CalcSimuEden::_statsDefine ( void  )
private

Allocate the Eden_Stats structure

◆ _statsEmpty()

void CalcSimuEden::_statsEmpty ( const char *  title)
private

Print the statistics for the cells not filled

Parameters
[in]titleTitle

◆ _statsInit()

void CalcSimuEden::_statsInit ( )
private

Initialize the Eden_Stats structure

◆ _statsPrint()

void CalcSimuEden::_statsPrint ( const char *  title)
private

Print the statistics

Parameters
[in]titleTitle

◆ _statsReset()

void CalcSimuEden::_statsReset ( )
private

Reset the Eden_Stats structure

◆ _updateResults()

void CalcSimuEden::_updateResults ( int  reset_facies,
int  show_fluid 
)
private

Update the fluid at data location

Parameters
[in]reset_faciesoption
  • 1 to reset the cork facies to initial value
  • 0 to set the facies to CORK_FACIES
[in]show_fluid1 for modifying the value of the cells to show:
  • the initial valid fluid information
  • the cork (different from shale)

◆ getWeight()

double CalcSimuEden::getWeight ( int  ipos,
int  idir 
) const
overridevirtual

Returns the weight of a cell in a given direction

Returns
The weight
Parameters
[in]iposCell location
[in]idirDirection value

Reimplemented from ISkinFunctions.

◆ isAlreadyFilled()

int CalcSimuEden::isAlreadyFilled ( int  ipos) const
overridevirtual

Interface to ISkinFunctions.

Check if the cell is already filled with fluid

Returns
1 if the cell (filled with facies) is already filled with Fluid
Parameters
[in]iposAbsolute grid index of the input grid node

Implements ISkinFunctions.

◆ isToBeFilled()

int CalcSimuEden::isToBeFilled ( int  ipos) const
overridevirtual

Check if the cell can be filled with fluid

Returns
1 if the cell (filled with facies) can be filled with Fluid
Parameters
[in]iposAbsolute grid index of the input grid node

Implements ISkinFunctions.

◆ operator=()

CalcSimuEden& CalcSimuEden::operator= ( const CalcSimuEden r)
delete

◆ setIndFacies()

void CalcSimuEden::setIndFacies ( int  indFacies)
inline

◆ setIndFluid()

void CalcSimuEden::setIndFluid ( int  indFluid)
inline

◆ setIndPerm()

void CalcSimuEden::setIndPerm ( int  indPerm)
inline

◆ setIndPoro()

void CalcSimuEden::setIndPoro ( int  indPoro)
inline

◆ setNumberMax()

void CalcSimuEden::setNumberMax ( double  numberMax)
inline

◆ setShowFluid()

void CalcSimuEden::setShowFluid ( bool  showFluid)
inline

◆ setSpeeds()

void CalcSimuEden::setSpeeds ( const VectorInt speeds)
inline

◆ setVolumeMax()

void CalcSimuEden::setVolumeMax ( double  volumeMax)
inline

◆ toString()

String CalcSimuEden::toString ( const AStringFormat strfmt = nullptr) const
overridevirtual

Interface to AStringable.

Reimplemented from AStringable.

Member Data Documentation

◆ _indDate

int CalcSimuEden::_indDate
private

Rank of the variable containing the Porosity.

◆ _indFacies

int CalcSimuEden::_indFacies
private

Maximum volume invaded (or TEST)

◆ _indFluid

int CalcSimuEden::_indFluid
private

Rank of the variable containing the Facies.

◆ _indPerm

int CalcSimuEden::_indPerm
private

Rank of the variable containing the Fluid.

◆ _indPoro

int CalcSimuEden::_indPoro
private

Rank of the variable containing the Permeability.

◆ _iptrDate

int CalcSimuEden::_iptrDate
private

◆ _iptrFluid

int CalcSimuEden::_iptrFluid
private

◆ _iptrStatCork

int CalcSimuEden::_iptrStatCork
private

◆ _iptrStatFluid

int CalcSimuEden::_iptrStatFluid
private

◆ _ncork

int CalcSimuEden::_ncork
private

◆ _nfacies

int CalcSimuEden::_nfacies
private

Number of iterations.

◆ _nfluids

int CalcSimuEden::_nfluids
private

number of facies (facies 0 excluded)

◆ _niter

int CalcSimuEden::_niter
private

◆ _numberMax

double CalcSimuEden::_numberMax
private

array containing the travel speeds

◆ _numbers

VectorInt CalcSimuEden::_numbers
private

◆ _nxyz

int CalcSimuEden::_nxyz
private

◆ _showFluid

bool CalcSimuEden::_showFluid
private

1 for modifying the value of the cells to show

  • the initial valid fluid information
  • the cork (different from shale)

◆ _speeds

VectorInt CalcSimuEden::_speeds
private

number of fluids

◆ _verbose

bool CalcSimuEden::_verbose
private

◆ _volumeMax

double CalcSimuEden::_volumeMax
private

Maximum count of cells invaded (or TEST)

◆ _volumes

VectorDouble CalcSimuEden::_volumes
private

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