gstlearn  1.0.0
CCC
RuleShadow Class Reference

#include <RuleShadow.hpp>

Inheritance diagram for RuleShadow:
Rule AStringable ASerializable

Public Member Functions

 RuleShadow ()
 
 RuleShadow (double slope, double sh_dsup, double sh_down, const VectorDouble &shift)
 
 RuleShadow (const RuleShadow &r)
 
RuleShadowoperator= (const RuleShadow &r)
 
virtual ~RuleShadow ()
 
String displaySpecific () const override
 
int particularities (Db *db, const Db *dbprop, Model *model, int flag_grid_check, int flag_stat) const override
 
int gaus2facData (PropDef *propdef, Db *dbin, Db *dbout, int *flag_used, int ipgs, int isimu, int nbsimu) override
 
int gaus2facResult (PropDef *propdef, Db *dbout, int *flag_used, int ipgs, int isimu, int nbsimu) const override
 
int evaluateBounds (PropDef *propdef, Db *dbin, Db *dbout, int isimu, int igrf, int ipgs, int nbsimu) const override
 
double getShDown () const
 
double getShDsup () const
 
double getSlope () const
 
double getDMax () const
 
double getTgte () const
 
double getIncr () const
 
const VectorDoublegetShift () const
 
double getShift (int idim) const
 
- Public Member Functions inherited from Rule
 Rule (double rho=0.)
 
 Rule (const Rule &r)
 
Ruleoperator= (const Rule &r)
 
virtual ~Rule ()
 
virtual String toString (const AStringFormat *strfmt=nullptr) const override
 
int resetFromNames (const VectorString &nodnames, double rho=0.)
 
int resetFromCodes (const VectorInt &nodes, double rho=0.)
 
int resetFromNumericalCoding (const VectorInt &n_type, const VectorInt &n_facs, double rho=0.)
 
int resetFromFaciesCount (int nfacies, double rho=0.)
 
virtual bool checkModel (const Model *model, int nvar=0) const
 
int getFlagProp () const
 
const ERule & getModeRule () const
 
double getRho () const
 
const NodegetMainNode () const
 
void setFlagProp (int flagProp)
 
void setRho (double rho) const
 
void setModeRule (const ERule &modeRule)
 TODO : Check if mutable is really necessary. More...
 
int setProportions (const VectorDouble &proportions=VectorDouble()) const
 
int statistics (int verbose, int *node_tot, int *nfac_tot, int *nmax_tot, int *ny1_tot, int *ny2_tot, double *prop_tot) const
 
int getFaciesNumber () const
 
int getGRFNumber () const
 
int getY1Number () const
 
int getY2Number () const
 
bool isYUsed (int igrf) const
 
VectorInt whichGRFUsed () const
 
double getProportion (int facies)
 
VectorDouble getThresh (int facies) const
 
VectorDouble getThreshFromRectangle (int rect, int *facies)
 
int getFaciesFromGaussian (double y1, double y2) const
 
void updateShift () const
 
- 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 ASerializable
 ASerializable ()
 
 ASerializable (const ASerializable &r)
 
ASerializableoperator= (const ASerializable &r)
 
virtual ~ASerializable ()
 
bool deserialize (std::istream &is, bool verbose=true)
 
bool serialize (std::ostream &os, bool verbose=true) const
 
bool dumpToNF (const String &neutralFilename, bool verbose=false) const
 

Protected Member Functions

virtual bool _serialize (std::ostream &os, bool verbose=false) const override
 Interface for ASerializable. More...
 
virtual bool _deserialize (std::istream &is, bool verbose=false) override
 
String _getNFName () const override
 
- Protected Member Functions inherited from Rule
void setMainNodeFromNodNames (const VectorInt &n_type, const VectorInt &n_facs)
 
void setMainNodeFromNodNames (const VectorString &nodnames)
 
int setMainNodeFromNodNames (const VectorInt &nodes)
 
int replicateInvalid (Db *dbin, Db *dbout, int jech) const
 
VectorString buildNodNames (int nfacies)
 
- Protected Member Functions inherited from ASerializable
bool _fileOpenWrite (const String &filename, std::ofstream &os, bool verbose=false) const
 
bool _fileOpenRead (const String &filename, std::ifstream &is, bool verbose=false) const
 

Private Member Functions

void _st_shadow_max (const Db *dbprop, int flag_stat, double *sh_dsup_max, double *sh_down_max) const
 
double _st_grid_eval (DbGrid *dbgrid, int isimu, int icase, int nbsimu, VectorDouble &xyz0) const
 
void _normalizeShift ()
 

Private Attributes

double _shDsup
 
double _shDown
 
double _slope
 
VectorDouble _shift
 
double _dMax
 
double _tgte
 
double _incr
 
VectorDouble _xyz
 
VectorInt _ind1
 
VectorInt _ind2
 

Additional Inherited Members

- Static Public Member Functions inherited from Rule
static Rulecreate (double rho=0.)
 
static RulecreateFromNF (const String &neutralFilename, bool verbose=true)
 
static RulecreateFromNames (const VectorString &nodnames, double rho=0.)
 
static RulecreateFromCodes (const VectorInt &nodes, double rho=0.)
 
static RulecreateFromNumericalCoding (const VectorInt &n_type, const VectorInt &n_facs, double rho=0.)
 
static RulecreateFromFaciesCount (int nfacies, double rho=0.)
 
- Static Public Member Functions inherited from ASerializable
static String buildFileName (int status, const String &filename, bool ensureDirExist=false)
 
static String getHomeDirectory (const String &sub="")
 
static String getWorkingDirectory ()
 
static String getTestData (const String &subdir, const String &filename)
 
static String getFileIdentity (const String &filename, bool verbose=false)
 
static void setContainerName (bool useDefault, const String &containerName="", bool verbose=false)
 
static void unsetContainerName ()
 
static void setPrefixName (const String &prefixName)
 
static void unsetPrefixName ()
 
static const StringgetContainerName ()
 
static const StringgetPrefixName ()
 
static bool createDirectory (const String &dir)
 
static String getExecDirectory ()
 
static String getDirectory (const String &path)
 
- Static Protected Member Functions inherited from ASerializable
static bool _commentWrite (std::ostream &os, const String &comment)
 
template<typename T >
static bool _recordWrite (std::ostream &os, const String &title, const T &val)
 
template<typename T >
static bool _recordWriteVec (std::ostream &os, const String &title, const VectorT< T > &vec)
 
template<typename T >
static bool _recordRead (std::istream &is, const String &title, T &val)
 
template<typename T >
static bool _recordReadVec (std::istream &is, const String &title, VectorT< T > &vec, int nvalues)
 
static bool _onlyBlanks (char *string)
 
static bool _tableRead (std::istream &is, const String &string, int ntab, double *tab)
 
static bool _tableWrite (std::ostream &os, const String &string, int ntab, const VectorDouble &tab)
 

Constructor & Destructor Documentation

◆ RuleShadow() [1/3]

RuleShadow::RuleShadow ( )

◆ RuleShadow() [2/3]

RuleShadow::RuleShadow ( double  slope,
double  sh_dsup,
double  sh_down,
const VectorDouble shift 
)

Defining the Lithotype Rule in the case of Shadow

Parameters
slopeSlope definition
sh_dsupMaximum threshold
sh_downMinimum threshold
shiftShift orientation

◆ RuleShadow() [3/3]

RuleShadow::RuleShadow ( const RuleShadow r)

◆ ~RuleShadow()

RuleShadow::~RuleShadow ( )
virtual

Member Function Documentation

◆ _deserialize()

bool RuleShadow::_deserialize ( std::istream &  is,
bool  verbose = false 
)
overrideprotectedvirtual

Reimplemented from Rule.

◆ _getNFName()

String RuleShadow::_getNFName ( ) const
inlineoverrideprotectedvirtual

Reimplemented from Rule.

◆ _normalizeShift()

void RuleShadow::_normalizeShift ( )
private

◆ _serialize()

bool RuleShadow::_serialize ( std::ostream &  os,
bool  verbose = false 
) const
overrideprotectedvirtual

Interface for ASerializable.

Reimplemented from Rule.

◆ _st_grid_eval()

double RuleShadow::_st_grid_eval ( DbGrid dbgrid,
int  isimu,
int  icase,
int  nbsimu,
VectorDouble xyz0 
) const
private

Evaluation of the value from a grid by inverse square distance interpolation from the 4 surrounding grid nodes

Returns
Interpolated value or FFFF if out of grid
Parameters
[in]dbgridDb structure
[in]isimuRank of the simulation
[in]icaseRank of the Simulation storage
[in]nbsimuNumber of simulations
[out]xyz0Working array

◆ _st_shadow_max()

void RuleShadow::_st_shadow_max ( const Db dbprop,
int  flag_stat,
double *  sh_dsup_max,
double *  sh_down_max 
) const
private

◆ displaySpecific()

String RuleShadow::displaySpecific ( ) const
overridevirtual

Reimplemented from Rule.

◆ evaluateBounds()

int RuleShadow::evaluateBounds ( PropDef propdef,
Db dbin,
Db dbout,
int  isimu,
int  igrf,
int  ipgs,
int  nbsimu 
) const
overridevirtual

Set the bounds and possibly add replicates (Shadow)

Returns
Error return code
Parameters
[in]propdefPropDef structure
[in]dbinDb structure
[in]dboutDb grid structure
[in]isimuRank of the simulation (if EProcessOper::CONDITIONAL)
[in]igrfRank of the GRF
[in]ipgsRank of the GS
[in]nbsimuNumber of simulations (if EProcessOper::CONDITIONAL)

Reimplemented from Rule.

◆ gaus2facData()

int RuleShadow::gaus2facData ( PropDef propdef,
Db dbin,
Db dbout,
int *  flag_used,
int  ipgs,
int  isimu,
int  nbsimu 
)
overridevirtual

Combine the underlying GRF into a facies value at data points (Shadow)

Returns
Error return code
Parameters
[in]propdefProps structure
[in]dbinDb input structure
[in]dboutDb output structure
[in]flag_used1 if the gaussian is used; 0 otherwise
[in]ipgsRank of the PGS
[in]isimuRank of the simulation
[in]nbsimuNumber of simulations
Remarks
Attributes ELoc::GAUSFAC are mandatory
Attributes ELoc::FACIES are mandatory

Reimplemented from Rule.

◆ gaus2facResult()

int RuleShadow::gaus2facResult ( PropDef propdef,
Db dbout,
int *  flag_used,
int  ipgs,
int  isimu,
int  nbsimu 
) const
overridevirtual

Combine the underlying GRF into a facies value (Shadow case)

Returns
Error return code
Parameters
[in]propdefProps structure
[in]dboutDb output structure
[in]flag_used1 if the gaussian is used; 0 otherwise
[in]ipgsRank of the PGS
[in]isimuRank of the simulation
[in]nbsimuNumber of simulations
Remarks
Attributes ELoc::FACIES and ELoc::SIMU are mandatory

Reimplemented from Rule.

◆ getDMax()

double RuleShadow::getDMax ( ) const
inline

◆ getIncr()

double RuleShadow::getIncr ( ) const
inline

◆ getShDown()

double RuleShadow::getShDown ( ) const
inline

◆ getShDsup()

double RuleShadow::getShDsup ( ) const
inline

◆ getShift() [1/2]

const VectorDouble& RuleShadow::getShift ( ) const
inline

◆ getShift() [2/2]

double RuleShadow::getShift ( int  idim) const
inline

◆ getSlope()

double RuleShadow::getSlope ( ) const
inline

◆ getTgte()

double RuleShadow::getTgte ( ) const
inline

◆ operator=()

RuleShadow & RuleShadow::operator= ( const RuleShadow r)

◆ particularities()

int RuleShadow::particularities ( Db db,
const Db dbprop,
Model model,
int  flag_grid_check,
int  flag_stat 
) const
overridevirtual

Define the particularities of the PGS model (for Shadow)

Returns
Error return code
Parameters
[in]dbDb structure
[in]dbpropDb structure used for proportions
[in]modelModel structure (only used for shift option)
[in]flag_grid_check1 if grid is compulsory; 0 otherwise (only for SHIFT)
[in]flag_stat1 for stationary; 0 otherwise

Reimplemented from Rule.

Member Data Documentation

◆ _dMax

double RuleShadow::_dMax
mutableprivate

◆ _incr

double RuleShadow::_incr
mutableprivate

◆ _ind1

VectorInt RuleShadow::_ind1
mutableprivate

◆ _ind2

VectorInt RuleShadow::_ind2
mutableprivate

◆ _shDown

double RuleShadow::_shDown
private

◆ _shDsup

double RuleShadow::_shDsup
private

◆ _shift

VectorDouble RuleShadow::_shift
private

◆ _slope

double RuleShadow::_slope
private

◆ _tgte

double RuleShadow::_tgte
mutableprivate

◆ _xyz

VectorDouble RuleShadow::_xyz
mutableprivate

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