1.2.1
CCC
 
thresh.cpp File Reference
#include "geoslib_old_f.h"
#include "Basic/Utilities.hpp"
#include "Basic/String.hpp"
#include "Basic/OptDbg.hpp"
#include "Basic/VectorHelper.hpp"
#include "LithoRule/RuleProp.hpp"
#include "LithoRule/PropDef.hpp"
#include "LithoRule/Rule.hpp"
#include "LithoRule/RuleShift.hpp"
#include "LithoRule/RuleShadow.hpp"
#include "Db/Db.hpp"
#include "Db/DbGrid.hpp"
#include "Variogram/Vario.hpp"
#include "Model/Model.hpp"

Functions

Rulerule_free (const Rule *rule)
 
void proportion_rule_process (PropDef *propdef, const EProcessOper &mode)
 
void proportion_print (PropDef *propdef)
 
int rule_thresh_define_shadow (PropDef *propdef, Db *db, const RuleShadow *rule, int facies, int iech, int isimu, int nbsimu, double *t1min, double *t1max, double *t2min, double *t2max, double *sh_dsup, double *sh_down)
 
int rule_thresh_define (PropDef *propdef, Db *db, const Rule *rule, int facies, int iech, int isimu, int nbsimu, int flag_check, double *t1min, double *t1max, double *t2min, double *t2max)
 
int db_rule_shadow (Db *db, Db *dbprop, RuleShadow *rule, Model *model, const VectorDouble &props, int flag_stat, int nfacies)
 
int _db_rule (Db *db, const RuleProp *ruleprop, Model *model, const NamingConvention &namconv)
 
int db_bounds_shadow (Db *db, Db *dbprop, RuleShadow *rule, Model *model, const VectorDouble &props, int flag_stat, int nfacies)
 
int _db_bounds (Db *db, const RuleProp *ruleprop, Model *model, const NamingConvention &namconv)
 
void propdef_reset (PropDef *propdef)
 
PropDefproportion_manage (int mode, int flag_facies, int flag_stat, int ngrf1, int ngrf2, int nfac1, int nfac2, Db *db, const Db *dbprop, const VectorDouble &propcst, PropDef *proploc)
 
int _db_threshold (Db *db, const RuleProp *ruleprop, Model *model, const NamingConvention &namconv)
 
Modelmodel_rule_combine (const Model *model1, const Model *model2, const Rule *rule)
 

Function Documentation

int _db_bounds ( Db db,
const RuleProp ruleprop,
Model model,
const NamingConvention namconv 
)

Apply the Rule transformation to derive the bounds variables for a Db

Returns
Error return code
Parameters
[in]dbDb structure
[in]rulepropRuleProp structure
[in]modelFirst Model structure (only for SHIFT)
[in]namconvNaming convention
int _db_rule ( Db db,
const RuleProp ruleprop,
Model model,
const NamingConvention namconv 
)

Apply the Rule transformation to convert a set of Gaussian vectors into the corresponding Facies in a Db

Returns
Error return code
Parameters
[in]dbOutput Db structure
[in]rulepropRuleProp structure
[in]modelFirst Model structure (only for SHIFT)
[in]namconvNaming convention
Remarks
The input variable must be locatorized as Z or ELoc::SIMU
int _db_threshold ( Db db,
const RuleProp ruleprop,
Model model,
const NamingConvention namconv 
)

Calculate all the thresholds at each sample of a Db

Returns
Error return code
Parameters
[in]dbDb structure
[in]rulepropRuleProp structure
[in]modelFirst Model structure (only for SHIFT)
[in]namconvNaming Convention
int db_bounds_shadow ( Db db,
Db dbprop,
RuleShadow rule,
Model model,
const VectorDouble props,
int  flag_stat,
int  nfacies 
)

Apply the Rule transformation to derive the bounds variables for a Db (Shadow case)

Returns
Error return code
Parameters
[in]dbDb structure
[in]dbpropDb structure used for proportions (non-stationary case)
[in]ruleLithotype Rule definition
[in]modelFirst Model structure (only for SHIFT)
[in]propsArray of proportions for the facies
[in]flag_stat1 for stationary; 0 otherwise
[in]nfaciesNumber of facies
int db_rule_shadow ( Db db,
Db dbprop,
RuleShadow rule,
Model model,
const VectorDouble props,
int  flag_stat,
int  nfacies 
)

Apply the Rule transformation to the GRFs of a Db (Shadow case)

Returns
Error return code
Parameters
[in]dbOutput Db structure
[in]dbpropDb structure used for proportions (non-stationary case)
[in]ruleLithotype Rule definition
[in]modelFirst Model structure (only for SHIFT)
[in]propsArray of proportions for the facies
[in]flag_stat1 for stationary; 0 otherwise
[in]nfaciesNumber of facies
Remarks
The input variable must be locatorized as Z or ELoc::SIMU
It will be changed in this function to locator ELoc::SIMU
Model* model_rule_combine ( const Model model1,
const Model model2,
const Rule rule 
)

Combine two basic models into a bivariate model (residuals model)

Returns
The newly Model structure
Parameters
[in]model1First input Model
[in]model2Second input Model
[in]ruleRule
Remarks
: The drift is not copied into the new model
void propdef_reset ( PropDef propdef)

Set memory proportion so as to provoke the update at first usage

Parameters
[in]propdefPointer to Propdef structure
PropDef* proportion_manage ( int  mode,
int  flag_facies,
int  flag_stat,
int  ngrf1,
int  ngrf2,
int  nfac1,
int  nfac2,
Db db,
const Db dbprop,
const VectorDouble propcst,
PropDef proploc 
)

Allocate or deallocate a proportion array

Returns
Pointer on the returned PropDef structure
Parameters
[in]mode1 for allocation; -1 for deallocation
[in]flag_facies1 if Gibbs is used for facies
[in]flag_stat1 if the proportions are stationary
[in]ngrf1Number of GRFs for the first PGS
[in]ngrf2Number of GRFs for the second PGS
[in]nfac1Number of facies for the first PGS
[in]nfac2Number of facies for the second PGS
[in]dbDb structure containing the data
[in]dbpropDb structure containing the proportions (only used in the non-stationary case)
[in]propcstConstant set of proportions (used if flag_stat)
[in]proplocPropDef structure (used for mode<0)
void proportion_print ( PropDef propdef)

Print the (non-stationary) proportions

Parameters
[in]propdefPropDef structure
void proportion_rule_process ( PropDef propdef,
const EProcessOper &  mode 
)

Set the method to compute Proportions

Parameters
[in]propdefPropDef structure
[in]modeType of operation (EProcessOper)
Rule* rule_free ( const Rule rule)

Free a Rule structure

Returns
Pointer to the newly freed Rule structure
Parameters
[in]ruleRule structure to be freed
int rule_thresh_define ( PropDef propdef,
Db db,
const Rule rule,
int  facies,
int  iech,
int  isimu,
int  nbsimu,
int  flag_check,
double *  t1min,
double *  t1max,
double *  t2min,
double *  t2max 
)

Set the (non-stationary) proportions and define thresholds

Returns
Error return code
Parameters
[in]propdefPropDef structure
[in]dbDb input structure
[in]ruleRule structure
[in]faciesFacies of interest (or ITEST) starting from 1
[in]iechRank of the data in the input Db
[in]isimuRank of the simulation (EProcessOper::CONDITIONAL)
[in]nbsimuNumber of simulations
[in]flag_check1 if the consistency check with the actual proportion of the current facies must be done
[out]t1minMinimum threshold for Y1
[out]t1maxMaximum threshold for Y1
[out]t2minMinimum threshold for Y2
[out]t2maxMaximum threshold for Y2
int rule_thresh_define_shadow ( PropDef propdef,
Db db,
const RuleShadow rule,
int  facies,
int  iech,
int  isimu,
int  nbsimu,
double *  t1min,
double *  t1max,
double *  t2min,
double *  t2max,
double *  sh_dsup,
double *  sh_down 
)

Set the (non-stationary) proportions and define thresholds (for shadow only)

Returns
Error return code
Parameters
[in]propdefPropDef structure
[in]dbDb input structure
[in]ruleRule structure
[in]faciesFacies of interest (or GV_ITEST)
[in]iechRank of the data in the input Db
[in]isimuRank of the simulation (EProcessOper::CONDITIONAL)
[in]nbsimuNumber of simulations (EProcessOper::CONDITIONAL)
[out]t1minMinimum threshold for Y1
[out]t1maxMaximum threshold for Y1
[out]t2minMinimum threshold for Y2
[out]t2maxMaximum threshold for Y2
[out]sh_dsupLocal or global upwards shift (shadow)
[out]sh_downLocal or global downwards shift (shadow)