1.8.0
CCC
 
Loading...
Searching...
No Matches
gstlrn::Rule Class Reference

#include <Rule.hpp>

Inheritance diagram for gstlrn::Rule:
gstlrn::AStringable gstlrn::ASerializable gstlrn::RuleShadow gstlrn::RuleShift

Public Member Functions

 Rule (double rho=0.)
 
 Rule (const Rule &m)
 
Ruleoperator= (const Rule &m)
 
virtual ~Rule ()
 
String toString (const AStringFormat *strfmt=nullptr) const override
 
Id resetFromNames (const VectorString &nodnames, double rho=0.)
 
Id resetFromCodes (const 1 &nodes, double rho=0.)
 
Id resetFromNumericalCoding (const 1 &n_type, const 1 &n_facs, double rho=0.)
 
Id resetFromFaciesCount (Id nfacies, double rho=0.)
 
virtual String displaySpecific () const
 
virtual Id particularities (Db *db, const Db *dbprop, Model *model, Id flag_grid_check, Id flag_stat) const
 
virtual bool checkModel (const Model *model, Id nvar=0) const
 
virtual Id gaus2facData (PropDef *propdef, Db *dbin, Db *dbout, Id *flag_used, Id ipgs, Id isimu, Id nbsimu)
 
virtual Id gaus2facResult (PropDef *propdef, Db *dbout, Id *flag_used, Id ipgs, Id isimu, Id nbsimu) const
 
virtual Id evaluateBounds (PropDef *propdef, Db *dbin, Db *dbout, Id isimu, Id igrf, Id ipgs, Id nbsimu) const
 
Id getFlagProp () const
 
const ERule & getModeRule () const
 
double getRho () const
 
const NodegetMainNode () const
 
void setFlagProp (Id flagProp)
 
void setRho (double rho) const
 
void setModeRule (const ERule &modeRule)
 TODO : Check if mutable is really necessary.
 
Id setProportions (const 1 &proportions=1()) const
 
Id statistics (Id verbose, Id *node_tot, Id *nfac_tot, Id *nmax_tot, Id *ny1_tot, Id *ny2_tot, double *prop_tot) const
 
Id getNFacies () const
 
Id getNGRF () const
 
Id getNY1 () const
 
Id getNY2 () const
 
bool isYUsed (Id igrf) const
 
 whichGRFUsed () const
 
double getProportion (Id facies)
 
std::array< double, 4 > getThresh (Id facies) const
 
 getThreshFromRectangle (Id rect, Id *facies)
 
Id getFaciesFromGaussian (double y1, double y2) const
 
 getNodes () const
 
void updateShift () const
 
- Public Member Functions inherited from gstlrn::AStringable
 AStringable ()
 
 AStringable (const AStringable &r)
 
AStringableoperator= (const AStringable &r)
 
virtual ~AStringable ()
 
virtual void display (const AStringFormat *strfmt=nullptr) const final
 
virtual void display (Id level) const final
 
- Public Member Functions inherited from gstlrn::ASerializable
 ASerializable ()
 
 ASerializable (const ASerializable &r)
 
ASerializableoperator= (const ASerializable &r)
 
 ASerializable (ASerializable &&r) noexcept
 
ASerializableoperator= (ASerializable &&r) noexcept
 
virtual ~ASerializable ()
 
bool dumpToNF (const String &NFFilename, const EFormatNF &format=EFormatNF::fromKey("DEFAULT"), bool verbose=false) const
 Dump the contents of an object into an Output File using a given Output NF Format.
 
void setDefaultFormatNF (const EFormatNF &format)
 

Static Public Member Functions

static Rulecreate (double rho=0.)
 
static RulecreateFromNF (const String &NFFilename, bool verbose=true)
 
static RulecreateFromNames (const VectorString &nodnames, double rho=0.)
 
static RulecreateFromCodes (const 1 &nodes, double rho=0.)
 
static RulecreateFromNumericalCoding (const 1 &n_type, const 1 &n_facs, double rho=0.)
 
static RulecreateFromFaciesCount (Id nfacies, double rho=0.)
 
- Static Public Member Functions inherited from gstlrn::ASerializable
static String buildFileName (Id status, const String &filename, bool ensureDirExist=false)
 
static String getFileIdentity (const String &filename, bool verbose=false)
 
static void setPrefixName (const String &prefixName)
 
static void unsetPrefixName ()
 
static const StringgetPrefixName ()
 

Constructor & Destructor Documentation

◆ Rule() [1/2]

gstlrn::Rule::Rule ( double  rho = 0.)

◆ Rule() [2/2]

gstlrn::Rule::Rule ( const Rule m)

◆ ~Rule()

gstlrn::Rule::~Rule ( )
virtual

Member Function Documentation

◆ checkModel()

bool gstlrn::Rule::checkModel ( const Model model,
Id  nvar = 0 
) const
virtual

Reimplemented in gstlrn::RuleShift.

◆ create()

Rule * gstlrn::Rule::create ( double  rho = 0.)
static

◆ createFromCodes()

Rule * gstlrn::Rule::createFromCodes ( const 1 &  nodes,
double  rho = 0. 
)
static

◆ createFromFaciesCount()

Rule * gstlrn::Rule::createFromFaciesCount ( Id  nfacies,
double  rho = 0. 
)
static

◆ createFromNames()

Rule * gstlrn::Rule::createFromNames ( const VectorString nodnames,
double  rho = 0. 
)
static

◆ createFromNF()

Rule * gstlrn::Rule::createFromNF ( const String NFFilename,
bool  verbose = true 
)
static

◆ createFromNumericalCoding()

Rule * gstlrn::Rule::createFromNumericalCoding ( const 1 &  n_type,
const 1 &  n_facs,
double  rho = 0. 
)
static

◆ displaySpecific()

String gstlrn::Rule::displaySpecific ( ) const
virtual

Reimplemented in gstlrn::RuleShadow, and gstlrn::RuleShift.

◆ evaluateBounds()

Id gstlrn::Rule::evaluateBounds ( PropDef propdef,
Db dbin,
Db dbout,
Id  isimu,
Id  igrf,
Id  ipgs,
Id  nbsimu 
) const
virtual

Set the bounds and possibly add replicates

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 in gstlrn::RuleShadow, and gstlrn::RuleShift.

◆ gaus2facData()

Id gstlrn::Rule::gaus2facData ( PropDef propdef,
Db dbin,
Db dbout,
Id flag_used,
Id  ipgs,
Id  isimu,
Id  nbsimu 
)
virtual

Combine the underlying GRF into a facies value at data points

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 in gstlrn::RuleShadow.

◆ gaus2facResult()

Id gstlrn::Rule::gaus2facResult ( PropDef propdef,
Db dbout,
Id flag_used,
Id  ipgs,
Id  isimu,
Id  nbsimu 
) const
virtual

Combine the underlying GRF into a facies value

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 in gstlrn::RuleShadow, and gstlrn::RuleShift.

◆ getFaciesFromGaussian()

Id gstlrn::Rule::getFaciesFromGaussian ( double  y1,
double  y2 
) const

Convert the two underlying GRFs into facies

Returns
The facies rank or 0 (facies not found)
Parameters
[in]y1Value of the first underlying GRF
[in]y2Value of the second underlying GRF
Remarks
If one of the two GRF is undefined, the resulting facies is 0

◆ getFlagProp()

Id gstlrn::Rule::getFlagProp ( ) const
inline

◆ getMainNode()

const Node * gstlrn::Rule::getMainNode ( ) const
inline

◆ getModeRule()

const ERule & gstlrn::Rule::getModeRule ( ) const
inline

◆ getNFacies()

Id gstlrn::Rule::getNFacies ( ) const

◆ getNGRF()

Id gstlrn::Rule::getNGRF ( ) const

◆ getNodes()

gstlrn::Rule::getNodes ( ) const

◆ getNY1()

Id gstlrn::Rule::getNY1 ( ) const

◆ getNY2()

Id gstlrn::Rule::getNY2 ( ) const

◆ getProportion()

double gstlrn::Rule::getProportion ( Id  facies)

Returns the proportion of a given facies

Parameters
faciesFacies rank (starting from 1)
Returns
Proportion of the given Facies

◆ getRho()

double gstlrn::Rule::getRho ( ) const
inline

◆ getThresh()

std::array< double, 4 > gstlrn::Rule::getThresh ( Id  facies) const

Return the vector of bounds for a given facies

Parameters
faciesRank of the target facies (starting from 1)
Returns
The vector of bounds organized as [t1min, t1max, t2min, t2max]

◆ getThreshFromRectangle()

gstlrn::Rule::getThreshFromRectangle ( Id  rect,
Id facies 
)

◆ isYUsed()

bool gstlrn::Rule::isYUsed ( Id  igrf) const

◆ operator=()

Rule & gstlrn::Rule::operator= ( const Rule m)

◆ particularities()

Id gstlrn::Rule::particularities ( Db db,
const Db dbprop,
Model model,
Id  flag_grid_check,
Id  flag_stat 
) const
virtual

Define the particularities of the PGS model

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 in gstlrn::RuleShadow, and gstlrn::RuleShift.

◆ resetFromCodes()

Id gstlrn::Rule::resetFromCodes ( const 1 &  nodes,
double  rho = 0. 
)

◆ resetFromFaciesCount()

Id gstlrn::Rule::resetFromFaciesCount ( Id  nfacies,
double  rho = 0. 
)

◆ resetFromNames()

Id gstlrn::Rule::resetFromNames ( const VectorString nodnames,
double  rho = 0. 
)

◆ resetFromNumericalCoding()

Id gstlrn::Rule::resetFromNumericalCoding ( const 1 &  n_type,
const 1 &  n_facs,
double  rho = 0. 
)

This entry is specific for the Rule inference procedure

Parameters
n_typeVector of items: 0 for Facies, 1 for G1 threshold; 2 for G2 threshold
n_facsVector of facies: XXX for Facies, 0 for thresholds
rhoGRFs correlation coefficient
Returns

◆ setFlagProp()

void gstlrn::Rule::setFlagProp ( Id  flagProp)
inline

◆ setModeRule()

void gstlrn::Rule::setModeRule ( const ERule &  modeRule)
inline

TODO : Check if mutable is really necessary.

◆ setProportions()

Id gstlrn::Rule::setProportions ( const 1 &  proportions = 1()) const

Define constant proportions

Parameters
proportionsThe vector of constant proportions. It should be dimensioned to the number of facies. If absent, all proportions are considered equal.
Returns

◆ setRho()

void gstlrn::Rule::setRho ( double  rho) const
inline

◆ statistics()

Id gstlrn::Rule::statistics ( Id  verbose,
Id node_tot,
Id nfac_tot,
Id nmax_tot,
Id ny1_tot,
Id ny2_tot,
double *  prop_tot 
) const

Calculates the statistics from the Lithotype Rule

Returns
Error return code
Parameters
[in]verbose1 for a verbose output; 0 otherwise
[out]node_totNumber of nodes
[out]nfac_totNumber of facies
[out]nmax_totNumber of (different) facies
[out]ny1_totNumber of thresholds for Y1
[out]ny2_totNumber of thresholds for Y2
[out]prop_totTotal proportion
Remarks
The tolerance on the sum of the proportions can be defined
using set_keypair("TolSumProportions",newtol)

◆ toString()

String gstlrn::Rule::toString ( const AStringFormat strfmt = nullptr) const
overridevirtual

Reimplemented from gstlrn::AStringable.

◆ updateShift()

void gstlrn::Rule::updateShift ( ) const

◆ whichGRFUsed()

gstlrn::Rule::whichGRFUsed ( ) const

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