gstlearn  1.0.0
CCC
Skin Class Reference

#include <Skin.hpp>

Public Member Functions

 Skin (const ISkinFunctions *skf, DbGrid *dbgrid=nullptr)
 
 Skin (const Skin &r)
 
Skinoperator= (const Skin &r)
 
virtual ~Skin ()
 
int gridShift (int lec, int dir)
 
int init (bool verbose=false)
 
int remains (bool verbose=false)
 
void getNext (int *rank, int *ipos)
 
int unstack (int rank0, int ipos0)
 
void skinPrint ()
 

Private Member Functions

double _getWeight (int ipos, int idir)
 
int _gridShift (const VectorInt &indg0, int dir)
 
void _cellDelete (int rank)
 
int _cellAlreadyFilled (int ipos)
 
void _cellModify (int rank, double energy)
 
int _cellAdd (int ipos, double energy)
 
int _getNDim () const
 

Private Attributes

const ISkinFunctions_skf
 
DbGrid_dbgrid
 
int _nxyz
 
int _nval
 
int _date
 
int _nvalMax
 
double _total
 
double _totalMax
 
VectorInt _address
 
VectorDouble _energy
 

Constructor & Destructor Documentation

◆ Skin() [1/2]

Skin::Skin ( const ISkinFunctions skf,
DbGrid dbgrid = nullptr 
)

◆ Skin() [2/2]

Skin::Skin ( const Skin r)

◆ ~Skin()

Skin::~Skin ( )
virtual

Member Function Documentation

◆ _cellAdd()

int Skin::_cellAdd ( int  ipos,
double  energy 
)
private

Add a cell to the skin (if not already in the skin)

Returns
Error returned code
Parameters
[in]iposCell location
[in]energyEnergy for the new cell

◆ _cellAlreadyFilled()

int Skin::_cellAlreadyFilled ( int  ipos)
private

Checks if a cell already belongs to the skin

Returns
Rank within the skin or -1 if the cell does not belong to the skin
Parameters
[in]iposCell location

◆ _cellDelete()

void Skin::_cellDelete ( int  rank)
private

Delete a cell from the skin

Parameters
[in]rankRank of the cell to be deleted
Remarks
When deleting a cell from the skin, the last cell is copied
in the place of the deleted one

◆ _cellModify()

void Skin::_cellModify ( int  rank,
double  energy 
)
private

Modify the energy for a cell which already belongs to the skin

Parameters
[out]rankLocation of the cell in the skin
[in]energyAdditional energy for the new cell

◆ _getNDim()

int Skin::_getNDim ( ) const
private

◆ _getWeight()

double Skin::_getWeight ( int  ipos,
int  idir 
)
private

Returns the weight for a given cell and direction

Returns
The weight
Parameters
[in]iposAbsolute grid index of the input grid node
[in]idirRank of the direction

◆ _gridShift()

int Skin::_gridShift ( const VectorInt indg0,
int  dir 
)
private

Returns the shifted node of a skin

Returns
Absolute sample address (or ITEST)
Parameters
[in]indg0Array of directional grid indices
[in]dirRank of the direction

◆ getNext()

void Skin::getNext ( int *  rank,
int *  ipos 
)

Find the next cell at random within the skin

Parameters
[out]rankLocation of the cell in the skin
[out]iposCell location

◆ gridShift()

int Skin::gridShift ( int  lec,
int  dir 
)

Returns the shifted node of a skin

Returns
The absolute sample address
Parameters
[in]lecAbsolute grid index of the input grid node
[in]dirRank of the direction

◆ init()

int Skin::init ( bool  verbose = false)

Initialize the skin

Returns
Error returned code
Parameters
[in]verboseVerbose flag

◆ operator=()

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

◆ remains()

int Skin::remains ( bool  verbose = false)

Returns the number of cells still to be processed

Returns
Returns the number of cells still to be processed

◆ skinPrint()

void Skin::skinPrint ( )

Print the computing information concerning the skin algorithm

◆ unstack()

int Skin::unstack ( int  rank0,
int  ipos0 
)

Suppress the current cell from the skin

Returns
Error return code
Parameters
[in]rank0Rank of the current cell in the skin
[in]ipos0Cell location

Member Data Documentation

◆ _address

VectorInt Skin::_address
private

◆ _date

int Skin::_date
private

◆ _dbgrid

DbGrid* Skin::_dbgrid
private

◆ _energy

VectorDouble Skin::_energy
private

◆ _nval

int Skin::_nval
private

◆ _nvalMax

int Skin::_nvalMax
private

◆ _nxyz

int Skin::_nxyz
private

◆ _skf

const ISkinFunctions* Skin::_skf
private

◆ _total

double Skin::_total
private

◆ _totalMax

double Skin::_totalMax
private

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