gstlearn  1.0.0
CCC
SimuRefine Class Reference

#include <SimuRefine.hpp>

Inheritance diagram for SimuRefine:
ACalcSimulation ACalcInterpolator ACalcDbToDb ACalculator

Public Member Functions

 SimuRefine (int nbsimu=0, int seed=4324324)
 
 SimuRefine (const SimuRefine &r)=delete
 
SimuRefineoperator= (const SimuRefine &r)=delete
 
virtual ~SimuRefine ()
 
DbGridsimulate (DbGrid *dbin, Model *model, const SimuRefineParam &param)
 
- 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 ()
 

Private Member Functions

virtual bool _run () override
 
void _dim_1_to_2 (DbGrid *db)
 
void _dim_2_to_1 (DbGrid *db)
 
int _kriging_define ()
 
void _neigh_simfine (int type, int rank, int idx, int idy, int idz)
 
void _merge_data (DbGrid *db1, int iatt1, DbGrid *db2, int iatt2)
 
double _read (DbGrid *db, int iatt, int ix0, int iy0, int iz0, int idx, int idy, int idz)
 
void _write (DbGrid *db, int iatt, int ix0, int iy0, int iz0, double value)
 
void _truncate_result (DbGrid *db2, int iatt2, DbGrid *db1, int iatt1)
 
int _kriging_solve (int type, int rank, int nb, bool verbose=false)
 
void _simulate_nodes (DbGrid *db, int iatt)
 
void _simulate_target (DbGrid *db, int type, int iatt, int ix0, int iy0, int iz0)
 
int _getNDim () const
 

Private Attributes

SimuRefineParam _param
 
Model_model
 
VectorInt _nx1
 
VectorDouble _dx1
 
VectorDouble _x01
 
VectorInt _nx2
 
VectorDouble _dx2
 
VectorDouble _x02
 
int _IXYZ [3][2][5]
 
double _XYZN [3][2][5]
 
double _WGT [2][2][5]
 
double _STDV [2][2]
 

Additional Inherited Members

- Protected Member Functions inherited from ACalcSimulation
virtual bool _check () override
 
virtual bool _preprocess () override
 
- Protected Member Functions inherited from ACalcInterpolator
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
 
- Protected Member Functions inherited from ACalculator
virtual bool _postprocess ()
 
virtual void _rollback ()
 

Constructor & Destructor Documentation

◆ SimuRefine() [1/2]

SimuRefine::SimuRefine ( int  nbsimu = 0,
int  seed = 4324324 
)

◆ SimuRefine() [2/2]

SimuRefine::SimuRefine ( const SimuRefine r)
delete

◆ ~SimuRefine()

SimuRefine::~SimuRefine ( )
virtual

Member Function Documentation

◆ _dim_1_to_2()

void SimuRefine::_dim_1_to_2 ( DbGrid db)
private

Define the characteristics from Db1 to Db2

Parameters
[in]dbStaring grid Db structure

◆ _dim_2_to_1()

void SimuRefine::_dim_2_to_1 ( DbGrid db)
private

Define the characteristics from Db2 to Db1

Parameters
[in]dbStarting grid Db structure

◆ _getNDim()

int SimuRefine::_getNDim ( ) const
privatevirtual

Reimplemented from ACalcInterpolator.

◆ _kriging_define()

int SimuRefine::_kriging_define ( )
private

Establish and solve the different Kriging systems

Returns
Error return code

◆ _kriging_solve()

int SimuRefine::_kriging_solve ( int  type,
int  rank,
int  nb,
bool  verbose = false 
)
private

Solve the kriging system

Returns
Error return code
Parameters
[in]typeType of kriging
[in]rankRank of the neighboring data
[in]nbNumber of equations
[in]verboseVerbose flag

◆ _merge_data()

void SimuRefine::_merge_data ( DbGrid db1,
int  iatt1,
DbGrid db2,
int  iatt2 
)
private

Copy the initial information from db1 into db2

Parameters
[in]db1Input grid Db structure
[in]iatt1Rank of the attribute to be read from db1
[in]db2Output grid Db structure
[in]iatt2Rank of the attribute to be written into db2

◆ _neigh_simfine()

void SimuRefine::_neigh_simfine ( int  type,
int  rank,
int  idx,
int  idy,
int  idz 
)
private

Define the location of a neighborhood point

Parameters
[in]typeType of kriging
[in]rankRank of the neighboring data
[in]idxShift along X
[in]idyShift along Y
[in]idzShift along Z

◆ _read()

double SimuRefine::_read ( DbGrid db,
int  iatt,
int  ix0,
int  iy0,
int  iz0,
int  idx,
int  idy,
int  idz 
)
private

Read a value in a Db

Returns
The value read
Parameters
[in]dbGrid Db structure
[in]iattRank of the attribute to be read
[in]ix0Index of the target along X
[in]iy0Index of the target along Y
[in]iz0Index of the target along Z
[in]idxShift along X
[in]idyShift along Y
[in]idzShift along Z

◆ _run()

bool SimuRefine::_run ( )
overrideprivatevirtual

Implements ACalculator.

◆ _simulate_nodes()

void SimuRefine::_simulate_nodes ( DbGrid db,
int  iatt 
)
private

Simulate the missing nodes

Parameters
[in]dbGrid Db structure
[in]iattRank of the column

◆ _simulate_target()

void SimuRefine::_simulate_target ( DbGrid db,
int  type,
int  iatt,
int  ix0,
int  iy0,
int  iz0 
)
private

Simulate the target cell

Parameters
[in]dbGrid Db structure
[in]typeType of kriging
[in]iattRank of the attribute to be read
[in]ix0Index of the target along X
[in]iy0Index of the target along Y
[in]iz0Index of the target along Z

◆ _truncate_result()

void SimuRefine::_truncate_result ( DbGrid db2,
int  iatt2,
DbGrid db1,
int  iatt1 
)
private

Truncate the resulting information from db2 into db1

Parameters
[in]db2Input grid Db structure
[in]iatt2Rank of the attribute to be read from db2
[in]db1Output grid Db structure
[in]iatt1Rank of the attribute to be written into db1

◆ _write()

void SimuRefine::_write ( DbGrid db,
int  iatt,
int  ix0,
int  iy0,
int  iz0,
double  value 
)
private

Write a value in a Db

Parameters
[in]dbGrid Db structure
[in]iattRank of the attribute to be written
[in]ix0Index of the target along X
[in]iy0Index of the target along Y
[in]iz0Index of the target along Z
[in]valueValue to be written

◆ operator=()

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

◆ simulate()

DbGrid * SimuRefine::simulate ( DbGrid dbin,
Model model,
const SimuRefineParam param 
)

Refine the simulation

Returns
Refined Grid
Parameters
[in]dbinInput grid Db structure
[in]modelModel structure
[in]paramSimuRefineParam structure

Member Data Documentation

◆ _dx1

VectorDouble SimuRefine::_dx1
private

◆ _dx2

VectorDouble SimuRefine::_dx2
private

◆ _IXYZ

int SimuRefine::_IXYZ[3][2][5]
private

◆ _model

Model* SimuRefine::_model
private

◆ _nx1

VectorInt SimuRefine::_nx1
private

◆ _nx2

VectorInt SimuRefine::_nx2
private

◆ _param

SimuRefineParam SimuRefine::_param
private

◆ _STDV

double SimuRefine::_STDV[2][2]
private

◆ _WGT

double SimuRefine::_WGT[2][2][5]
private

◆ _x01

VectorDouble SimuRefine::_x01
private

◆ _x02

VectorDouble SimuRefine::_x02
private

◆ _XYZN

double SimuRefine::_XYZN[3][2][5]
private

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