1.5.0
CCC
 
DbGrid Class Reference

Class containing the Data Information organized as a Regular Grid. More...

#include <DbGrid.hpp>

Inheritance diagram for DbGrid:
Db AStringable ASerializable ICloneable DbMeshTurbo

Detailed Description

Class containing the Data Information organized as a Regular Grid.

This class is derived from the Db class, with a specific decoration: its samples correspond to the nodes of a regular grid defined in the current space.

A regular grid is a tessellation of n-dimensional Euclidean space by congruent parallelotopes (e.g. bricks). The number of meshes along each space direction is defined by NX and the total number of samples is equal to: NX[1] x NX[2] x ... x NX[NDIM] where NDIM is he space dimension.

Note that this particular Db does not allow the modification of the sample number by addition or deletion.

The grid decoration contains the following information:

  • the number of meshes per direction (NX)
  • the coordinates of the grid origin (X0) defined as the node located in first position (smallest index) along each space direction
  • the mesh value along each space direction (DX)
  • the rotation angles around the grid origin (the origin is invariant through this rotation).

Note that rotation is defined by as many angles as the space dimension. This general property is not valid:

  • for 1D where the rotation concept does not make sense
  • for 2D where a single angle would be sufficient: however a second dummy angle (always set to 0) is used for generality sake.

Note that this grid decoration essentially describes the organization of the grid nodes. Then the same grid can be considered as a grid of points (punctual grid) or a grid of cells (block grid). In the latter case:

  • the origin is (currently) the lower-left corner (for 2D) or the origin cell.
  • the extensions of the cells are considered as constant by default and equal to DX. However, they can be replaced by a set of variables allowing the user to assign a variable cell extension for each cell.

Public Member Functions

 DbGrid ()
 
 DbGrid (const DbGrid &r)
 
DbGridoperator= (const DbGrid &r)
 
virtual ~DbGrid ()
 
virtual String toString (const AStringFormat *strfmt=nullptr) const override
 ICloneable interface. More...
 
bool isGrid () const override
 Db Interface. More...
 
double getCoordinate (int iech, int idim, bool flag_rotate=true) const override
 
void getCoordinatesPerSampleInPlace (int iech, VectorDouble &coor, bool flag_rotate=true) const override
 
double getUnit (int idim=0) const override
 
int getNDim () const override
 
bool mayChangeSampleNumber () const override
 
void resetDims (int ncol, int nech) override
 
bool isConsistent () const override
 
int reset (const VectorInt &nx, const VectorDouble &dx=VectorDouble(), const VectorDouble &x0=VectorDouble(), const VectorDouble &angles=VectorDouble(), const ELoadBy &order=ELoadBy::fromKey("SAMPLE"), const VectorDouble &tab=VectorDouble(), const VectorString &names=VectorString(), const VectorString &locatorNames=VectorString(), bool flagAddSampleRank=true, bool flagAddCoordinates=true)
 
int resetCoveringDb (const Db *db, const VectorInt &nx=VectorInt(), const VectorDouble &dx=VectorDouble(), const VectorDouble &x0=VectorDouble(), const VectorDouble &margin=VectorDouble())
 
int resetFromPolygon (Polygons *polygon, const VectorInt &nodes, const VectorDouble &dcell, bool flagAddSampleRank=true)
 
DbGridcoarsify (const VectorInt &nmult)
 
DbGridrefine (const VectorInt &nmult)
 
bool migrateAllVariables (Db *dbin, bool flag_fill=true, bool flag_inter=true, bool flag_ball=false, bool flagAddSampleRank=true)
 
const GridgetGrid () const
 
void generateCoordinates (const String &radix="x")
 
VectorDouble getColumnSubGrid (const String &name, int idim0, int rank, bool useSel=false)
 
int gridDefine (const VectorInt &nx, const VectorDouble &dx=VectorDouble(), const VectorDouble &x0=VectorDouble(), const VectorDouble &angles=VectorDouble())
 
void gridCopyParams (int mode, const Grid &gridaux)
 
bool isSameGrid (const Grid &grid) const
 
bool isSameGridMesh (const DbGrid &dbaux) const
 
bool isSameGridRotation (const DbGrid &dbaux) const
 
bool isGridRotated () const
 
int getNTotal () const
 
double getCellSize () const
 
double getVolume () const
 
VectorDouble getExtends () const
 
double getExtend (int idim) const
 
int getNX (int idim) const
 
VectorInt getNXs () const
 
VectorInt getNXsExt (int ndimMax) const
 
bool hasSingleBlock () const
 
double getDX (int idim) const
 
VectorDouble getDXs () const
 
double getX0 (int idim) const
 
VectorDouble getX0s () const
 
double getAngle (int idim) const
 
VectorDouble getAngles () const
 
VectorDouble getRotMat () const
 
void setNX (int idim, int value)
 
void setX0 (int idim, double value)
 
void setDX (int idim, double value)
 
VectorDouble getGridAxis (int idim) const
 
VectorDouble getCoordinateFromCorner (const VectorInt &icorner) const
 
VectorDouble getCoordinatesByIndice (const VectorInt &indice, bool flag_rotate=true, const VectorInt &shift=VectorInt(), const VectorDouble &dxsPerCell=VectorDouble()) const
 
VectorDouble getCoordinatesPerSample (int iech, bool flag_rotate=true) const
 
int coordinateToRank (const VectorDouble &coor, bool centered=false, double eps=EPSILON6) const
 
VectorInt coordinateToIndices (const VectorDouble &coor, bool centered=false, double eps=EPSILON6) const
 
int coordinateToIndicesInPlace (const VectorDouble &coor, VectorInt &indices, bool centered=false, double eps=EPSILON6) const
 
VectorInt getCenterIndices () const
 
int indiceToRank (const VectorInt &indice) const
 
void rankToIndice (int node, VectorInt &indices, bool minusOne=false) const
 
void rankToCoordinatesInPlace (int rank, VectorDouble &coor, const VectorDouble &percent=VectorDouble()) const
 
VectorDouble rankToCoordinates (int rank, const VectorDouble &percent=VectorDouble()) const
 
void indicesToCoordinateInPlace (const VectorInt &indice, VectorDouble &coor, const VectorDouble &percent=VectorDouble()) const
 
VectorDouble indicesToCoordinate (const VectorInt &indice, const VectorDouble &percent=VectorDouble()) const
 
bool sampleBelongsToCell (const VectorDouble &coor, int rank, const VectorDouble &dxsPerCell=VectorDouble()) const
 
int centerCoordinateInPlace (VectorDouble &coor, bool centered=false, bool stopIfOut=false, double eps=EPSILON6) const
 
VectorInt locateDataInGrid (const Db *data, const VectorInt &rankIn=VectorInt(), bool centered=false, bool useSel=false) const
 
int getMirrorIndex (int idim, int ix) const
 
VectorVectorDouble getSlice (const String &name, int pos=0, int indice=0, bool useSel=false) const
 
VectorDouble getOneSlice (const String &name, int posx=0, int posy=1, const VectorInt &corner=VectorInt(), bool useSel=false) const
 
int assignGridColumn (const String &name, int idim, int rank, double value, bool useSel=false)
 
VectorDouble getBlockExtensions (int node) const
 
VectorVectorDouble getCellEdges (int node=0, bool forceGridMesh=false) const
 
VectorVectorDouble getAllCellsEdges (bool forceGridMesh=false) const
 
VectorVectorDouble getGridEdges () const
 
VectorDouble getCodir (const VectorInt &grincr) const
 
VectorVectorInt getLimitsFromVariableExtend (const String &nameTop, const String &nameBot, const VectorInt &dimExclude=VectorInt()) const
 
int setSelectionFromVariableExtend (const String &nameTop, const String &nameBot)
 
void clean3DFromSurfaces (const VectorString &names, const DbGrid *surf2D, const String &nameTop=String(), const String &nameBot=String(), bool verbose=false)
 
int morpho (const EMorpho &oper, double vmin=0.5, double vmax=1.5, int option=0, const VectorInt &radius=VectorInt(), bool flagDistErode=false, bool verbose=false, const NamingConvention &namconv=NamingConvention("Morpho"))
 
int smooth (ANeigh *neigh, int type=1, double range=1., const NamingConvention &namconv=NamingConvention("Smooth"))
 
int addSelectionFromDbByMorpho (Db *db, int nmin=0, int radius=0, int option=0, const VectorInt &dilation=VectorInt(), bool verbose=false, const NamingConvention &namconv=NamingConvention("Morpho", false, false, true, ELoc::fromKey("SEL")))
 
void getSampleAsSTInPlace (int iech, SpaceTarget &P) const override
 
VectorVectorDouble getDiscretizedBlock (const VectorInt &ndiscs, int iech=0, bool flagPerCell=false, bool flagRandom=false, int seed=132433) const
 
void getGridPileInPlace (int iuid, const VectorInt &indg, int idim0, VectorDouble &vec) const
 
void setGridPileInPlace (int iuid, const VectorInt &indg, int idim0, const VectorDouble &vec)
 
- Public Member Functions inherited from Db
 Db ()
 
 Db (const Db &r)
 
Dboperator= (const Db &r)
 
virtual ~Db ()
 
virtual bool isLine () const
 
virtual bool isMesh () const
 
virtual void getCoordinatesPerSampleInPlace (int iech, vect coor, bool flag_rotate=true) const
 
int resetFromSamples (int nech, const ELoadBy &order=ELoadBy::fromKey("SAMPLE"), const VectorDouble &tab=VectorDouble(), const VectorString &names=VectorString(), const VectorString &locatorNames=VectorString(), bool flagAddSampleRank=true)
 
int resetFromCSV (const String &filename, bool verbose, const CSVformat &csvfmt, int ncol_max=-1, int nrow_max=-1, bool flagAddSampleRank=true)
 
int resetFromBox (int nech, const VectorDouble &coormin, const VectorDouble &coormax, int ndim=2, double extend=0., int seed=321415, bool flagAddSampleRank=true)
 
int resetFromOnePoint (const VectorDouble &tab=VectorDouble(), bool flagAddSampleRank=true)
 
int resetSamplingDb (const Db *dbin, double proportion=0, int number=0, const VectorString &names=VectorString(), int seed=23241, bool verbose=false, bool flagAddSampleRank=true)
 
int resetReduce (const Db *dbin, const VectorString &names=VectorString(), const VectorInt &ranks=VectorInt(), bool verbose=false)
 
const VectorDoublegetArrays () const
 
String getNameByLocator (const ELoc &locatorType, int locatorIndex=0) const
 
String getNameByColIdx (int icol) const
 
String getNameByUID (int iuid) const
 
VectorString getName (const String &name) const
 
VectorString getNames (const VectorString &names) const
 
VectorString getNamesByLocator (const ELoc &locatorType) const
 
VectorString getNamesByColIdx (const VectorInt &icols) const
 
VectorString getNamesByUID (const VectorInt &iuids) const
 
VectorString getAllNames (bool excludeRankAndCoordinates=false, bool verbose=false) const
 
void setName (const String &old_name, const String &name)
 
void setName (const VectorString &list, const String &name)
 
void setNameByUID (int iuid, const String &name)
 
void setNameByColIdx (int icol, const String &name)
 
void setNameByLocator (const ELoc &locatorType, const String &name)
 
VectorString expandNameList (const VectorString &names) const
 
VectorString expandNameList (const String &names) const
 
VectorString identifyNames (const VectorString &names) const
 
int getUIDMaxNumber () const
 
int getColumnNumber () const
 
int getSampleNumber (bool useSel=false) const
 
int getNumberActiveAndDefined (int item) const
 
int getActiveSampleNumber () const
 
int getRankRelativeToAbsolute (int irel) const
 
int getRankAbsoluteToRelative (int iabs) const
 
void clearLocators (const ELoc &locatorType)
 
void clearSelection ()
 
void setLocatorByUID (int iuid, const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), int locatorIndex=0, bool cleanSameLocator=false)
 
void setLocatorByColIdx (int icol, const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), int locatorIndex=0, bool cleanSameLocator=false)
 
void setLocator (const String &name, const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), int locatorIndex=0, bool cleanSameLocator=false)
 
void setLocators (const VectorString &names, const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), int locatorIndex=0, bool cleanSameLocator=false)
 
void setLocatorsByUID (int number, int iuid, const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), int locatorIndex=0, bool cleanSameLocator=false)
 
void setLocatorsByUID (const VectorInt &iuids, const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), int locatorIndex=0, bool cleanSameLocator=false)
 
void setLocatorsByColIdx (const VectorInt &icols, const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), int locatorIndex=0, bool cleanSameLocator=false)
 
void addColumnsByVVD (const VectorVectorDouble &tab, const String &radix, const ELoc &locatorType, int locatorIndex=0, bool useSel=false)
 
int addColumns (const VectorDouble &tab, const String &radix="New", const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), int locatorIndex=0, bool useSel=false, double valinit=0., int nvar=1)
 
int addColumnsByConstant (int nadd=1, double valinit=0., const String &radix="New", const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), int locatorIndex=0, int nechInit=0)
 
int addColumnsRandom (int nadd, const String &radix="New", const ELoc &locatorType=ELoc::fromKey("Z"), int locatorIndex=0, int seed=1352, int nechInit=0)
 
int addSelection (const VectorDouble &tab=VectorDouble(), const String &name="NewSel", const String &combine="set")
 
int addSelectionByRanks (const VectorInt &ranks, const String &name="NewSel", const String &combine="set")
 
int addSelectionByLimit (const String &testvar, const Limits &limits=Limits(), const String &name="NewSel", const String &combine="set")
 
int addSelectionFromDbByConvexHull (Db *db, double dilate=0., bool verbose=false, const NamingConvention &namconv=NamingConvention("Hull", true, true, true, ELoc::fromKey("SEL")))
 
int addSelectionRandom (double prop, int seed=138213, const String &name="NewSel", const String &combine="set")
 
int addSamples (int nadd, double valinit=TEST)
 
int deleteSample (int e_del)
 
int deleteSamples (const VectorInt &e_dels)
 
void switchLocator (const ELoc &locatorType_in, const ELoc &locatorType_out)
 
int getLastUID (int number=0) const
 
String getLastName (int number=0) const
 
int getColIdx (const String &name) const
 
int getColIdxByUID (int iuid) const
 
int getColIdxByLocator (const ELoc &locatorType, int locatorIndex=0) const
 
VectorInt getColIdxs (const String &name) const
 
VectorInt getColIdxs (const VectorString &names) const
 
VectorInt getColIdxsByUID (const VectorInt &iuids) const
 
VectorInt getColIdxsByLocator (const ELoc &locatorType) const
 
void setColumn (const VectorDouble &tab, const String &name, const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), int locatorIndex=0, bool useSel=false)
 
void setColumnByUIDOldStyle (const double *tab, int iuid, bool useSel=false)
 
void setColumnByUID (const VectorDouble &tab, int iuid, bool useSel=false)
 
void setColumnByColIdx (const VectorDouble &tab, int icol, bool useSel=false)
 
void setColumnsByColIdx (const VectorDouble &tabs, const VectorInt &icols, bool useSel=false)
 
void setColumnByColIdxOldStyle (const double *tab, int icol, bool useSel=false)
 
void duplicateColumnByUID (int iuid_in, int iuid_out)
 
VectorVectorDouble getItem (const VectorInt &rows, const VectorString &colnames, bool useSel=false) const
 
VectorVectorDouble getItem (const VectorInt &rows, const String &colname, bool useSel=false) const
 
VectorVectorDouble getItem (const VectorInt &rows, const ELoc &locatorType, bool useSel=false) const
 
VectorVectorDouble getItem (const VectorString &colnames, bool useSel=false) const
 
VectorVectorDouble getItem (const String &colname, bool useSel=false) const
 
VectorVectorDouble getItem (const ELoc &locatorType, bool useSel=false) const
 
VectorString getItemNames (const VectorString &colnames) const
 
VectorString getItemNames (const String &colname) const
 
VectorString getItemNames (const ELoc &locatorType) const
 
int setItem (const VectorInt &rows, const VectorString &colnames, const VectorVectorDouble &values, bool useSel=false)
 
int setItem (const VectorInt &rows, const ELoc &locatorType, const VectorVectorDouble &values, bool useSel=false)
 
int setItem (const VectorString &colnames, const VectorVectorDouble &values, bool useSel=false)
 
int setItem (const ELoc &locatorType, const VectorVectorDouble &values, bool useSel=false)
 
int setItem (const VectorInt &rows, const String &colname, const VectorDouble &values, bool useSel=false)
 
int setItem (const String &colname, const VectorDouble &values, bool useSel=false)
 
bool getLocator (const String &name, ELoc *ret_locatorType, int *ret_locatorIndex) const
 
bool getLocatorByColIdx (int icol, ELoc *ret_locatorType, int *ret_locatorIndex) const
 
bool getLocatorByUID (int iuid, ELoc *ret_locatorType, int *ret_locatorIndex) const
 
VectorString getLocators (bool anyLocator=true, const ELoc &locatorType=ELoc::fromKey("UNKNOWN")) const
 
int getLocatorNumber (const ELoc &locatorType) const
 
bool isUIDDefined (int iuid) const
 
int getUID (const String &name) const
 
int getUIDByColIdx (int icol) const
 
int getUIDByLocator (const ELoc &locatorType, int locatorIndex=0) const
 
VectorInt getUIDs (const VectorString &names) const
 
VectorInt getUIDsByLocator (const ELoc &locatorType) const
 
VectorInt getUIDsByColIdx (const VectorInt &icols) const
 
VectorInt getAllUIDs () const
 
void copyByUID (int iuidIn, int iuidOut)
 
void copyByCol (int icolIn, int icolOut)
 
int getFaciesNumber (void) const
 
bool hasLocatorDefined (const String &name, const ELoc &locatorType, int locatorIndex=0) const
 
VectorDouble getSampleCoordinates (int iech) const
 
void getSampleAsSPInPlace (SpacePoint &P) const
 
void getSampleCoordinatesInPlace (int iech, VectorDouble &coor) const
 
VectorDouble getSampleLocators (const ELoc &locatorType, int iech) const
 
VectorVectorDouble getIncrements (const VectorInt &iechs, const VectorInt &jechs) const
 
VectorDouble getCoordinates (int idim, bool useSel=false, bool flag_rotate=true) const
 
VectorVectorDouble getAllCoordinates (bool useSel=false) const
 
MatrixRectangular getAllCoordinatesMat () const
 
void setCoordinate (int iech, int idim, double value)
 
void setCoordinates (int idim, const VectorDouble &coor, bool useSel=false)
 
void setSampleCoordinates (int iech, const VectorDouble &coor)
 
double getDistance1D (int iech, int jech, int idim=0, bool flagAbs=false) const
 
double getDistance (int iech, int jech) const
 
int getDistanceVecInPlace (int iech, int jech, VectorDouble &dd, const Db *db2=nullptr) const
 
double getValue (const String &name, int iech) const
 
void setValue (const String &name, int iech, double value)
 
double getArray (int iech, int iuid) const
 
void getArrayVec (const VectorInt &iechs, int iuid, VectorDouble &values) const
 
void setArray (int iech, int iuid, double value)
 
void setArrayVec (const VectorInt &iechs, int iuid, const VectorDouble &values)
 
void updArray (int iech, int iuid, const EOperator &oper, double value)
 
void updArrayVec (const VectorInt &iechs, int iuid, const EOperator &oper, VectorDouble &values)
 
VectorDouble getArrayByUID (int iuid, bool useSel=false) const
 
VectorDouble getArrayBySample (int iech) const
 
void setArrayBySample (int iech, const VectorDouble &vec)
 
void getSamplesAsSP (std::vector< SpacePoint > &pvec, const ASpace *space, bool useSel=false) const
 
bool hasLocator (const ELoc &locatorType) const
 
int getFromLocatorNumber (const ELoc &locatorType) const
 
double getFromLocator (const ELoc &locatorType, int iech, int locatorIndex=0) const
 
void setFromLocator (const ELoc &locatorType, int iech, int locatorIndex, double value)
 
double getValueByColIdx (int iech, int icol) const
 
void setValueByColIdx (int iech, int icol, double value)
 
VectorDouble getValuesByNames (const VectorInt &iechs, const VectorString &names, bool bySample=false) const
 
VectorDouble getValuesByColIdx (const VectorInt &iechs, const VectorInt &icols, bool bySample=false) const
 
void setValuesByNames (const VectorInt &iechs, const VectorString &names, const VectorDouble &values, bool bySample=false)
 
void setValuesByColIdx (const VectorInt &iechs, const VectorInt &icols, const VectorDouble &values, bool bySample=false)
 
int getLocNumber (const ELoc &loctype) const
 
bool hasLocVariable (const ELoc &loctype) const
 
double getLocVariable (const ELoc &loctype, int iech, int item) const
 
void setLocVariable (const ELoc &loctype, int iech, int item, double value)
 
void updLocVariable (const ELoc &loctype, int iech, int item, const EOperator &oper, double value)
 
int getZNumber () const
 
bool hasZVariable () const
 
double getZVariable (int iech, int item) const
 
void setZVariable (int iech, int item, double value)
 
void updZVariable (int iech, int item, const EOperator &oper, double value)
 
VectorDouble getLocVariables (const ELoc &loctype, int iech, int nitemax=0) const
 
void setLocVariables (const ELoc &loctype, int iech, const VectorDouble &values)
 
bool isVariableNumberComparedTo (int nvar, int compare=0) const
 
bool isIsotopic (int iech, int nvar_max=-1) const
 
bool isAllUndefined (int iech) const
 
bool isAllUndefinedByType (const ELoc &loctype, int iech) const
 
bool isAllIsotopic () const
 
void setInterval (int iech, int item, double rklow=TEST, double rkup=TEST)
 
int getIntervalNumber () const
 
void setBound (int iech, int item, double lower=TEST, double upper=TEST)
 
VectorDouble getWithinBounds (int item, bool useSel=false) const
 
VectorDouble getGradient (int item, bool useSel=false) const
 
VectorDouble getTangent (int item, bool useSel=false) const
 
VectorDouble getCodeList (void) const
 
int getSelection (int iech) const
 
VectorDouble getSelections (void) const
 
VectorInt getRanksActive (const VectorInt &nbgh=VectorInt(), int item=-1, bool useSel=true, bool useVerr=false) const
 
VectorVectorInt getMultipleRanksActive (const VectorInt &ivars=VectorInt(), const VectorInt &nbgh=VectorInt(), bool useSel=true, bool useVerr=false) const
 
VectorDouble getMultipleValuesActive (const VectorInt &ivars=VectorInt(), const VectorInt &nbgh=VectorInt(), const VectorDouble &means=VectorDouble(), bool useSel=true, bool useVerr=false) const
 
double getWeight (int iech) const
 
VectorDouble getWeights (bool useSel=false) const
 
double getSimvar (const ELoc &locatorType, int iech, int isimu, int ivar, int icase, int nbsimu, int nvar) const
 
void setSimvar (const ELoc &locatorType, int iech, int isimu, int ivar, int icase, int nbsimu, int nvar, double value)
 
void updSimvar (const ELoc &locatorType, int iech, int isimu, int ivar, int icase, int nbsimu, int nvar, const EOperator &oper, double value)
 
bool isActive (int iech) const
 
bool isActiveDomain (int iech) const
 
bool isActiveAndDefined (int iech, int item) const
 
int getActiveAndDefinedNumber (int item) const
 
int getActiveAndDefinedNumber (const String &name) const
 
VectorBool getActiveArray () const
 
VectorInt getSortArray () const
 
double getCosineToDirection (int iech1, int iech2, const VectorDouble &codir) const
 
VectorDouble getColumn (const String &name, bool useSel=false, bool flagCompress=true) const
 
VectorDouble getColumnByUID (int iuid, bool useSel=false, bool flagCompress=true) const
 
VectorDouble getColumnByLocator (const ELoc &locatorType, int locatorIndex=0, bool useSel=false, bool flagCompress=true) const
 
VectorDouble getColumnByColIdx (int icol, bool useSel=false, bool flagCompress=true) const
 
VectorDouble getAllColumns (bool useSel=false, bool flagCompress=true) const
 
VectorDouble getColumns (const VectorString &names=VectorString(), bool useSel=false, bool flagCompress=true, const VectorDouble &origins=VectorDouble()) const
 
VectorVectorDouble getColumnsAsVVD (const VectorString &names=VectorString(), bool useSel=false, bool flagCompress=true) const
 
MatrixRectangular getColumnsAsMatrix (const VectorString &names, bool useSel=false, bool flagCompress=true) const
 
VectorDouble getColumnsByColIdx (const VectorInt &icols=VectorInt(), bool useSel=false, bool flagCompress=true, const VectorDouble &origins=VectorDouble()) const
 
VectorDouble getColumnsByColIdxInterval (int icol_beg, int icol_end, bool useSel=false, bool flagCompress=true) const
 
VectorDouble getColumnsActiveAndDefined (const ELoc &locatorType, const VectorDouble &origins=VectorDouble()) const
 
VectorDouble getColumnsByLocator (const ELoc &locatorType, bool useSel=false, bool flagCompress=true, const VectorDouble &origins=VectorDouble()) const
 
VectorDouble getColumnsByUID (const VectorInt &iuids, bool useSel=false, bool flagCompress=true, const VectorDouble &origins=VectorDouble()) const
 
VectorDouble getColumnsByUIDInterval (int iuid_beg, int iuid_end, bool useSel=false, bool flagCompress=true) const
 
void setAllColumns (const VectorVectorDouble &tabs)
 
void deleteColumn (const String &name)
 
void deleteColumnByUID (int iuid_del)
 
void deleteColumnByColIdx (int icol_del)
 
void deleteColumns (const VectorString &names)
 
void deleteColumnsByLocator (const ELoc &locatorType)
 
void deleteColumnsByUID (const VectorInt &iuids)
 
void deleteColumnsByColIdx (const VectorInt &icols)
 
void deleteColumnsByUIDRange (int i_del, int n_del)
 
VectorDouble getExtrema (int idim, bool useSel=false) const
 
VectorVectorDouble getExtremas (bool useSel=false) const
 
VectorDouble getCoorMinimum (bool useSel=false) const
 
VectorDouble getCoorMaximum (bool useSel=false) const
 
double getExtension (int idim, bool useSel=false) const
 
double getExtensionDiagonal (bool useSel=false) const
 
double getCenter (int idim, bool useSel=false) const
 
VectorDouble getCenters (bool useSel=false) const
 
void getExtensionInPlace (VectorDouble &mini, VectorDouble &maxi, bool flagPreserve=false, bool useSel=false) const
 
double getMinimum (const String &name, bool useSel=false) const
 
double getMaximum (const String &name, bool useSel=false) const
 
VectorDouble getRange (const String &name, bool useSel=false) const
 
double getMean (const String &name, bool useSel=false) const
 
double getVariance (const String &name, bool useSel=false) const
 
double getStdv (const String &name, bool useSel=false) const
 
double getCorrelation (const String &name1, const String &name2, bool useSel=false) const
 
bool hasSameDimension (const Db *dbaux) const
 
bool hasLargerDimension (const Db *dbaux) const
 
bool isColIdxValid (int icol) const
 
bool isUIDValid (int iuid) const
 
bool isSampleIndexValid (int iech) const
 
bool isSampleIndicesValid (const VectorInt &iechs, bool useSel=false) const
 
bool isLocatorIndexValid (const ELoc &locatorType, int locatorIndex) const
 
bool isDimensionIndexValid (int idim) const
 
void combineSelection (VectorDouble &sel, const String &combine="set") const
 
void generateRank (const String &radix="rank")
 
VectorInt shrinkToValidRows (const VectorInt &rows) const
 
VectorInt shrinkToValidCols (const VectorInt &cols) const
 
void statisticsBySample (const VectorString &names, const std::vector< EStatOption > &opers=EStatOption::fromKeys({"MEAN"}), bool flagIso=true, double proba=TEST, double vmin=TEST, double vmax=TEST, const NamingConvention &namconv=NamingConvention("Stats"))
 
VectorDouble statisticsMulti (const VectorString &names, bool flagIso=true, bool verbose=false, const String &title="")
 
bool areSame (const String &name1, const String &name2, double eps=EPSILON3, bool useSel=true, bool verbose=false) const
 
VectorInt filter (const String &name, const Interval &interval, int belowRow=ITEST, int aboveRow=ITEST) const
 
VectorInt getSampleRanks () const
 
Table printOneSample (int iech, const VectorString &names=VectorString(), bool excludeCoordinates=true, bool skipTitle=false) 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
 
- Public Member Functions inherited from ICloneable
 ICloneable ()
 
virtual ~ICloneable ()
 
virtual ICloneableclone () const =0
 

Static Public Member Functions

static DbGridcreateFromNF (const String &neutralFilename, bool verbose=true)
 
static DbGridcreate (const VectorInt &nx, const VectorDouble &dx=VectorDouble(), const VectorDouble &x0=VectorDouble(), const VectorDouble &angles=VectorDouble(), const ELoadBy &order=ELoadBy::fromKey("SAMPLE"), const VectorDouble &tab=VectorDouble(), const VectorString &names=VectorString(), const VectorString &locatorNames=VectorString(), bool flagAddSampleRank=true, bool flagAddCoordinates=true)
 
static DbGridcreateCoveringDb (const Db *dbin, const VectorInt &nx=VectorInt(), const VectorDouble &dx=VectorDouble(), const VectorDouble &x0=VectorDouble(), const VectorDouble &margin=VectorDouble())
 
static DbGridcreateFromPolygon (Polygons *polygon, const VectorInt &nodes, const VectorDouble &dcell, bool flagAddSampleRank=true)
 
static DbGridcreateCoarse (DbGrid *dbin, const VectorInt &nmult, bool flagCell=true, bool flagAddSampleRank=true)
 
static DbGridcreateRefine (DbGrid *dbin, const VectorInt &nmult, bool flagCell=true, bool flagAddSampleRank=true)
 
static DbGridcreateFromGridExtend (const DbGrid &gridIn, const VectorString &tops, const VectorString &bots, const VectorInt &nxnew, bool verbose=false, double eps=EPSILON3)
 
static DbGridcreateFromGridShrink (const DbGrid &gridIn, const VectorInt &deletedRanks)
 
static DbGridcreateGrid2D (const ELoadBy &order, int nx, int ny, double x0=0., double y0=0., double dx=1., double dy=1., double angle=0., bool flagAddSampleRank=true, const VectorDouble &tab=VectorDouble())
 
static DbGridcreateSqueezeAndStretchForward (const DbGrid *grid3Din, const DbGrid *surf2D, const String &nameTop, const String &nameBot, const VectorString &names, int nzout, double thickmin=0.)
 
static DbGridcreateSqueezeAndStretchBackward (const DbGrid *grid3Din, const DbGrid *surf2D, const String &nameTop, const String &nameBot, const VectorString &names, int nzout, double z0out, double dzout)
 
static DbGridcreateSubGrid (const DbGrid *gridin, VectorVectorInt limits, bool flagAddCoordinates=false)
 
static DbGridcreateMultiple (DbGrid *dbin, const VectorInt &nmult, bool flagAddSampleRank)
 
static DbGridcreateDivider (DbGrid *dbin, const VectorInt &nmult, bool flagAddSampleRank)
 
- Static Public Member Functions inherited from Db
static Dbcreate ()
 
static DbcreateFromNF (const String &neutralFilename, bool verbose=true)
 
static DbcreateFromSamples (int nech, const ELoadBy &order=ELoadBy::fromKey("SAMPLE"), const VectorDouble &tab=VectorDouble(), const VectorString &names=VectorString(), const VectorString &locatorNames=VectorString(), bool flagAddSampleRank=true)
 
static DbcreateFromCSV (const String &filename, const CSVformat &csv=CSVformat(), bool verbose=false, int ncol_max=-1, int nrow_max=-1, bool flagAddSampleRank=true)
 
static DbcreateFromBox (int nech, const VectorDouble &coormin, const VectorDouble &coormax, int seed=43241, bool flag_exact=true, bool flag_repulsion=false, double range=0., double beta=0., double extend=0., bool flagAddSampleRank=true)
 
static DbcreateFromOnePoint (const VectorDouble &tab=VectorDouble(), bool flagAddSampleRank=true)
 
static DbcreateSamplingDb (const Db *dbin, double proportion=0., int number=0, const VectorString &names=VectorString(), int seed=23241, bool verbose=false, bool flagAddSampleRank=true)
 
static DbcreateFromDbGrid (int nech, DbGrid *dbgrid, int seed=432423, bool flag_exact=true, bool flag_repulsion=false, double range=0., double beta=0., bool flagAddSampleRank=true)
 
static DbcreateReduce (const Db *dbin, const VectorString &names=VectorString(), const VectorInt &ranks=VectorInt(), bool verbose=false)
 
static DbcreateFillRandom (int ndat, int ndim=2, int nvar=1, int nfex=0, int ncode=0, double varmax=0., double selRatio=0., const VectorDouble &heteroRatio=VectorDouble(), const VectorDouble &coormin=VectorDouble(), const VectorDouble &coormax=VectorDouble(), int seed=124234, bool flagAddSampleRank=true)
 
static int getNEloc ()
 
static VectorInt getMultipleSelectedIndices (const VectorVectorInt &index, const VectorInt &ivars=VectorInt(), const VectorInt &nbgh=VectorInt())
 Return the vector of the ranks within 'index' of data beloging: More...
 
static VectorInt getMultipleSelectedVariables (const VectorVectorInt &index, const VectorInt &ivars=VectorInt(), const VectorInt &nbgh=VectorInt())
 
static int getSimRank (int isimu, int ivar, int icase, int nbsimu, int nvar)
 
- 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)
 

Additional Inherited Members

- Public Attributes inherited from Db
 DECLARE_TOTL
 Has a specific implementation in the Target language. More...
 

Constructor & Destructor Documentation

◆ DbGrid() [1/2]

DbGrid::DbGrid ( )

◆ DbGrid() [2/2]

DbGrid::DbGrid ( const DbGrid r)

◆ ~DbGrid()

DbGrid::~DbGrid ( )
virtual

Member Function Documentation

◆ addSelectionFromDbByMorpho()

int DbGrid::addSelectionFromDbByMorpho ( Db db,
int  nmin = 0,
int  radius = 0,
int  option = 0,
const VectorInt dilation = VectorInt(),
bool  verbose = false,
const NamingConvention namconv = NamingConvention("Morpho", false, false, true,                                     ELoc::fromKey("SEL")) 
)

Create a selection based on the count of active samples of 'db'

Parameters
dbDb used for statistics
nminMinimum number of samples
radiusRadius of the cell neighborhood used when counting the samples
optionType of structuring element: 0 for Cross and 1 for Block
dilationVector giving the radius extension for Dilation operation
verboseVerbose flag
namconvNaming convention
Returns

◆ assignGridColumn()

int DbGrid::assignGridColumn ( const String name,
int  idim,
int  rank,
double  value,
bool  useSel = false 
)

Set all elements of a column (1-D) along a given space dimension to a constant value

Parameters
nameName of the target variable
idimRank of the Space dimension
rankRank of the target Column
valueAssigned value
useSelUse the selection

◆ centerCoordinateInPlace()

int DbGrid::centerCoordinateInPlace ( VectorDouble coor,
bool  centered = false,
bool  stopIfOut = false,
double  eps = EPSILON6 
) const

◆ clean3DFromSurfaces()

void DbGrid::clean3DFromSurfaces ( const VectorString names,
const DbGrid surf2D,
const String nameTop = String(),
const String nameBot = String(),
bool  verbose = false 
)

Clean the contents of a 3D file by using surfaces extracted from the 2D file

Parameters
namesVector of variable of the current grid which must be processed
surf2DName of the 2-D grid file containing the surfaces
nameTopName of the Top surface (optional)
nameBotName of the Bottom surface (optional)
verboseVerbose flag
Remarks
The input file 'surf2D' and the current grid should match (in 2-D)

◆ coarsify()

DbGrid * DbGrid::coarsify ( const VectorInt nmult)

◆ coordinateToIndices()

VectorInt DbGrid::coordinateToIndices ( const VectorDouble coor,
bool  centered = false,
double  eps = EPSILON6 
) const

◆ coordinateToIndicesInPlace()

int DbGrid::coordinateToIndicesInPlace ( const VectorDouble coor,
VectorInt indices,
bool  centered = false,
double  eps = EPSILON6 
) const

◆ coordinateToRank()

int DbGrid::coordinateToRank ( const VectorDouble coor,
bool  centered = false,
double  eps = EPSILON6 
) const

◆ create()

DbGrid * DbGrid::create ( const VectorInt nx,
const VectorDouble dx = VectorDouble(),
const VectorDouble x0 = VectorDouble(),
const VectorDouble angles = VectorDouble(),
const ELoadBy &  order = ELoadBy::fromKey("SAMPLE"),
const VectorDouble tab = VectorDouble(),
const VectorString names = VectorString(),
const VectorString locatorNames = VectorString(),
bool  flagAddSampleRank = true,
bool  flagAddCoordinates = true 
)
static

◆ createCoarse()

DbGrid * DbGrid::createCoarse ( DbGrid dbin,
const VectorInt nmult,
bool  flagCell = true,
bool  flagAddSampleRank = true 
)
static

◆ createCoveringDb()

DbGrid * DbGrid::createCoveringDb ( const Db dbin,
const VectorInt nx = VectorInt(),
const VectorDouble dx = VectorDouble(),
const VectorDouble x0 = VectorDouble(),
const VectorDouble margin = VectorDouble() 
)
static

◆ createDivider()

DbGrid * DbGrid::createDivider ( DbGrid dbin,
const VectorInt nmult,
bool  flagAddSampleRank 
)
static

Create a Grid Db as a divider of another Grid Db

Returns
Pointer to the newly created Db grid structure
Parameters
[in]dbinInitial Db Grid
[in]nmultArray of subdivision coefficients
[in]flagAddSampleRanktrue to add the 'rank' as first column

◆ createFromGridExtend()

DbGrid * DbGrid::createFromGridExtend ( const DbGrid gridIn,
const VectorString tops,
const VectorString bots,
const VectorInt nxnew,
bool  verbose = false,
double  eps = EPSILON3 
)
static

Create a new Grid, starting from an initial Grid, and extending its space dimensions A set of Top and Bottom variables is provided which serve in designing the Top and Bottom of the new coordinates.

Parameters
gridInInitial
topsVector of Variable names which define the Tops
botsVector of Variable names which define the Bottoms
nxnewVector giving the number of meshes for each additional space dimension
verboseVerbose flag
epsEach new coordinate is calculated from the top to bottom extension inflated by eps
Returns

◆ createFromGridShrink()

DbGrid * DbGrid::createFromGridShrink ( const DbGrid gridIn,
const VectorInt deletedRanks 
)
static

Create a new grid, from an Initial Grid, by suppressing a set of space dimensions

Parameters
gridInInitial grid
deletedRanksVector of indices of space dimensions to be suppressed
Returns

◆ createFromNF()

DbGrid * DbGrid::createFromNF ( const String neutralFilename,
bool  verbose = true 
)
static

Create a Db by loading the contents of a Neutral File

Parameters
neutralFilenameName of the Neutral File (Db format)
verboseVerbose
Remarks
The name does not need to be completed in particular when defined by absolute path
or read from the Data Directory (in the gstlearn distribution)

◆ createFromPolygon()

DbGrid * DbGrid::createFromPolygon ( Polygons polygon,
const VectorInt nodes,
const VectorDouble dcell,
bool  flagAddSampleRank = true 
)
static

◆ createGrid2D()

DbGrid * DbGrid::createGrid2D ( const ELoadBy &  order,
int  nx,
int  ny,
double  x0 = 0.,
double  y0 = 0.,
double  dx = 1.,
double  dy = 1.,
double  angle = 0.,
bool  flagAddSampleRank = true,
const VectorDouble tab = VectorDouble() 
)
static

Create a 2-D Db structure

Returns
Pointer to the newly created 2-D Db grid structure
Parameters
[in]orderManner in which values in tab are ordered (ELoadBy)
[in]flagAddSampleRanktrue to add 'rank' as a supplementary field
[in]nxNumber of grid nodes along X
[in]nyNumber of grid nodes along Y
[in]x0Grid origin along X
[in]y0Grid origin along Y
[in]dxGrid mesh along X
[in]dyGrid mesh along Y
[in]angleRotation angle
[in]tabArray containing the data

◆ createMultiple()

DbGrid * DbGrid::createMultiple ( DbGrid dbin,
const VectorInt nmult,
bool  flagAddSampleRank 
)
static

Create a Grid Db as a multiple of another Grid Db

Returns
Pointer to the newly created Db grid structure
Parameters
[in]dbinInitial Db Grid
[in]nmultArray of multiplicity coefficients
[in]flagAddSampleRanktrue to add the 'rank' as first column **

◆ createRefine()

DbGrid * DbGrid::createRefine ( DbGrid dbin,
const VectorInt nmult,
bool  flagCell = true,
bool  flagAddSampleRank = true 
)
static

◆ createSqueezeAndStretchBackward()

DbGrid * DbGrid::createSqueezeAndStretchBackward ( const DbGrid grid3Din,
const DbGrid surf2D,
const String nameTop,
const String nameBot,
const VectorString names,
int  nzout,
double  z0out,
double  dzout 
)
static

Creating a 3D grid by squeeze-and-stretch backwards, i.e. from sugar box to structural, from:

  • a 3D grid containing the relevant information
  • a 2D grid containing the top and bottom information
    Parameters
    grid3Din3D input grid
    surf2D2D grid of surfaces
    nameTopName of the variable in 'surf2D' containing the top information
    nameBotName of the variable in 'surf2D' containing the bottom information
    namesVector of names in 'grid3D' to be exported in output 3D grid
    nzout,z0out,dzoutSpecification along third dimension of the output 3D Grid
    Returns
    The output 3D grid (or nullptr in case of error)
    Remarks
    :
  • the grid files 'surf2D' and 'grid3Din' should match (in 2-D)
  • the grid 'surf2D' contains the top and bottom (identified by the corresponding locators)
  • the grid 'surf2D' contains a selection which designates the only pixels where 'top' and 'bot' are defined and correctly ordered (o save time)

◆ createSqueezeAndStretchForward()

DbGrid * DbGrid::createSqueezeAndStretchForward ( const DbGrid grid3Din,
const DbGrid surf2D,
const String nameTop,
const String nameBot,
const VectorString names,
int  nzout,
double  thickmin = 0. 
)
static

Creating a 3D grid by squeeze-and-stretch forwards, i.e. from structural to sugar box, from:

  • a 3D grid containing the relevant information
  • a 2D grid containing the top and bottom information
    Parameters
    grid3Din3D input grid
    surf2D2D grid of surfaces
    nameTopName of the variable in 'surf2D' containing the top information
    nameBotName of the variable in 'surf2D' containing the bottom information
    namesVector of names in 'grid3D' to be exported in output 3D grid
    nzoutNumber of Vertical meshes in the output 3D grid
    thickminThe algorithm is not applied if
    Returns
    The output 3D grid (or nullptr in case of error)
    Remarks
    :
  • the grid files 'surf2D' and 'grid3Din' should match (in 2-D)
  • the grid 'surf2D' contains the top and bottom (identified by the corresponding locators)
  • the grid 'surf2D' contains a selection which designates the only pixels where 'top' and 'bot' are defined and correctly ordered (o save time)

◆ createSubGrid()

DbGrid * DbGrid::createSubGrid ( const DbGrid gridIn,
VectorVectorInt  limits,
bool  flagAddCoordinates = false 
)
static

Create the sub-grid, extracted from 'gridIn' and reduced to the vector of limits

Parameters
gridInInput grid
limitsA vector of Min and Max per space dimension (Dimension: [ndim][2])
flagAddCoordinatesTrue if the grid coordinates must be included in the output file
Returns

◆ generateCoordinates()

void DbGrid::generateCoordinates ( const String radix = "x")

◆ getAllCellsEdges()

VectorVectorDouble DbGrid::getAllCellsEdges ( bool  forceGridMesh = false) const

◆ getAngle()

double DbGrid::getAngle ( int  idim) const
inline

◆ getAngles()

VectorDouble DbGrid::getAngles ( ) const
inline

◆ getBlockExtensions()

VectorDouble DbGrid::getBlockExtensions ( int  node) const

◆ getCellEdges()

VectorVectorDouble DbGrid::getCellEdges ( int  node = 0,
bool  forceGridMesh = false 
) const

Return the VectorVectorDouble containing the borders of a cell

Parameters
nodeTarget cell
forceGridMeshWhen TRUE, returns the edges of the standard grid mesh even if a variable block extension is defined
Returns

◆ getCellSize()

double DbGrid::getCellSize ( ) const
inline

◆ getCenterIndices()

VectorInt DbGrid::getCenterIndices ( ) const
inline

◆ getCodir()

VectorDouble DbGrid::getCodir ( const VectorInt grincr) const

◆ getColumnSubGrid()

VectorDouble DbGrid::getColumnSubGrid ( const String name,
int  idim0,
int  rank,
bool  useSel = false 
)

◆ getCoordinate()

double DbGrid::getCoordinate ( int  iech,
int  idim,
bool  flag_rotate = true 
) const
overridevirtual

Return the coordinate of a sample along one Space Dimension

Parameters
iechRank of the sample
idimRank of the Space Dimension
flag_rotateUse the rotation (only for Grid)
Returns

Reimplemented from Db.

◆ getCoordinateFromCorner()

VectorDouble DbGrid::getCoordinateFromCorner ( const VectorInt icorner) const
inline

◆ getCoordinatesByIndice()

VectorDouble DbGrid::getCoordinatesByIndice ( const VectorInt indice,
bool  flag_rotate = true,
const VectorInt shift = VectorInt(),
const VectorDouble dxsPerCell = VectorDouble() 
) const
inline

◆ getCoordinatesPerSample()

VectorDouble DbGrid::getCoordinatesPerSample ( int  iech,
bool  flag_rotate = true 
) const
inline

◆ getCoordinatesPerSampleInPlace()

void DbGrid::getCoordinatesPerSampleInPlace ( int  iech,
VectorDouble coor,
bool  flag_rotate = true 
) const
overridevirtual

Reimplemented from Db.

◆ getDiscretizedBlock()

VectorVectorDouble DbGrid::getDiscretizedBlock ( const VectorInt ndiscs,
int  iech = 0,
bool  flagPerCell = false,
bool  flagRandom = false,
int  seed = 132433 
) const

Generate a set of discretization locations, relative to the block center Dimension: number of discretization locations, space dimension

Parameters
ndiscsNumber of discretization (per space dimension)
iechRank of the target sample (used if flagPerCell = true)
flagPerCellTRUE when the cell dimension are read from the Db (BLEX)
flagRandomTRUE if the discretization location must be randomized
seedSeed for random number generator
Returns
Remarks
: Although randomization can be performed, this process does not consume random numbers.

◆ getDX()

double DbGrid::getDX ( int  idim) const
inline

◆ getDXs()

VectorDouble DbGrid::getDXs ( ) const
inline

◆ getExtend()

double DbGrid::getExtend ( int  idim) const
inline

◆ getExtends()

VectorDouble DbGrid::getExtends ( ) const
inline

◆ getGrid()

const Grid& DbGrid::getGrid ( ) const
inline

◆ getGridAxis()

VectorDouble DbGrid::getGridAxis ( int  idim) const
inline

◆ getGridEdges()

VectorVectorDouble DbGrid::getGridEdges ( ) const

Return the VectorVectorDouble containing the borders of the grid

Returns

◆ getGridPileInPlace()

void DbGrid::getGridPileInPlace ( int  iuid,
const VectorInt indg,
int  idim0,
VectorDouble vec 
) const

◆ getLimitsFromVariableExtend()

VectorVectorInt DbGrid::getLimitsFromVariableExtend ( const String nameTop,
const String nameBot,
const VectorInt dimExclude = VectorInt() 
) const

Returns the minimum and maximum indices of the subgrid where variables 'nameTop' and 'nameBot' are both defined

Parameters
nameTopName of the Top variable
nameBotName of the Bottom variable
dimExcludeArray giving excluding dimension (see details)
Returns
A vector of Min and Max per space dimension (Dimension: [ndim][2])

: When a dimension is 'excluded', the reduction of the output grid should not be applied to this dimension

◆ getMirrorIndex()

int DbGrid::getMirrorIndex ( int  idim,
int  ix 
) const
inline

◆ getNDim()

int DbGrid::getNDim ( ) const
overridevirtual

Reimplemented from Db.

◆ getNTotal()

int DbGrid::getNTotal ( ) const
inline

◆ getNX()

int DbGrid::getNX ( int  idim) const
inline

◆ getNXs()

VectorInt DbGrid::getNXs ( ) const
inline

◆ getNXsExt()

VectorInt DbGrid::getNXsExt ( int  ndimMax) const

◆ getOneSlice()

VectorDouble DbGrid::getOneSlice ( const String name,
int  posx = 0,
int  posy = 1,
const VectorInt corner = VectorInt(),
bool  useSel = false 
) const

Returns the contents of one slice extracted from a DbGrid

Parameters
nameName of the targte variable
posxRank of the first extracted coordinate (in [0, ndim[)
posyRank of the second extracted coordinate (in [0, ndim[)
cornerVector giving a reference node that belongs to the extracted section
useSelUse of the current Selection
Returns
Remarks
The argument 'corner' gives the indices of a node that belongs to the
extracted section. Obviously corner[posx] and corner[posy] are not used

◆ getRotMat()

VectorDouble DbGrid::getRotMat ( ) const
inline

◆ getSampleAsSTInPlace()

void DbGrid::getSampleAsSTInPlace ( int  iech,
SpaceTarget P 
) const
overridevirtual

Load a Space Target with all possible contents gathered from Db

Parameters
iechRank of the target sample
PSpace Target (used to store information)

Reimplemented from Db.

◆ getSlice()

VectorVectorDouble DbGrid::getSlice ( const String name,
int  pos = 0,
int  indice = 0,
bool  useSel = false 
) const

Extracts a slice from a 3-D Grid

Parameters
nameName of the target variable
posType of section: 0 for YoZ; 1 for XoZ and 2 for XoY
indiceRank of the section
useSelUse the active selection
Returns
A VectorVectorDouble with 4 columns, i.e: X, Y, Z, Var
Remarks
In presence of a selection and if useSel is TRUE,
values are returned but set to TEST

◆ getUnit()

double DbGrid::getUnit ( int  idim = 0) const
overridevirtual

Return a Unit calculated for a Db (in a given Space dimension)

Parameters
idimRank of the Space dimension
Returns
Remarks
This unit is defined as 1/1000 of the extension in the given space dimension

Reimplemented from Db.

◆ getVolume()

double DbGrid::getVolume ( ) const
inline

◆ getX0()

double DbGrid::getX0 ( int  idim) const
inline

◆ getX0s()

VectorDouble DbGrid::getX0s ( ) const
inline

◆ gridCopyParams()

void DbGrid::gridCopyParams ( int  mode,
const Grid gridaux 
)

◆ gridDefine()

int DbGrid::gridDefine ( const VectorInt nx,
const VectorDouble dx = VectorDouble(),
const VectorDouble x0 = VectorDouble(),
const VectorDouble angles = VectorDouble() 
)

◆ hasSingleBlock()

bool DbGrid::hasSingleBlock ( ) const

◆ indicesToCoordinate()

VectorDouble DbGrid::indicesToCoordinate ( const VectorInt indice,
const VectorDouble percent = VectorDouble() 
) const
inline

◆ indicesToCoordinateInPlace()

void DbGrid::indicesToCoordinateInPlace ( const VectorInt indice,
VectorDouble coor,
const VectorDouble percent = VectorDouble() 
) const
inline

◆ indiceToRank()

int DbGrid::indiceToRank ( const VectorInt indice) const
inline

◆ isConsistent()

bool DbGrid::isConsistent ( ) const
overridevirtual

Reimplemented from Db.

Reimplemented in DbMeshTurbo.

◆ isGrid()

bool DbGrid::isGrid ( ) const
inlineoverridevirtual

Db Interface.

Reimplemented from Db.

◆ isGridRotated()

bool DbGrid::isGridRotated ( ) const

◆ isSameGrid()

bool DbGrid::isSameGrid ( const Grid grid) const

◆ isSameGridMesh()

bool DbGrid::isSameGridMesh ( const DbGrid dbaux) const

◆ isSameGridRotation()

bool DbGrid::isSameGridRotation ( const DbGrid dbaux) const

◆ locateDataInGrid()

VectorInt DbGrid::locateDataInGrid ( const Db data,
const VectorInt rankIn = VectorInt(),
bool  centered = false,
bool  useSel = false 
) const

◆ mayChangeSampleNumber()

bool DbGrid::mayChangeSampleNumber ( ) const
inlineoverridevirtual

Reimplemented from Db.

Reimplemented in DbMeshTurbo.

◆ migrateAllVariables()

bool DbGrid::migrateAllVariables ( Db dbin,
bool  flag_fill = true,
bool  flag_inter = true,
bool  flag_ball = false,
bool  flagAddSampleRank = true 
)

Migrate all the variables (Z_locator) from 'dbin' on the nodes of 'this' (grid)

Parameters
dbinInput Db
flagAddSampleRanktrue if the rank of the samples must be aaded
flag_fillFilling option
flag_interInterpolation
flag_ballUse BallTree sorting algorithm when available
Returns

◆ morpho()

int DbGrid::morpho ( const EMorpho &  oper,
double  vmin = 0.5,
double  vmax = 1.5,
int  option = 0,
const VectorInt radius = VectorInt(),
bool  flagDistErode = false,
bool  verbose = false,
const NamingConvention namconv = NamingConvention("Morpho") 
)

◆ operator=()

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

◆ rankToCoordinates()

VectorDouble DbGrid::rankToCoordinates ( int  rank,
const VectorDouble percent = VectorDouble() 
) const
inline

◆ rankToCoordinatesInPlace()

void DbGrid::rankToCoordinatesInPlace ( int  rank,
VectorDouble coor,
const VectorDouble percent = VectorDouble() 
) const
inline

◆ rankToIndice()

void DbGrid::rankToIndice ( int  node,
VectorInt indices,
bool  minusOne = false 
) const
inline

◆ refine()

DbGrid * DbGrid::refine ( const VectorInt nmult)

◆ reset()

int DbGrid::reset ( const VectorInt nx,
const VectorDouble dx = VectorDouble(),
const VectorDouble x0 = VectorDouble(),
const VectorDouble angles = VectorDouble(),
const ELoadBy &  order = ELoadBy::fromKey("SAMPLE"),
const VectorDouble tab = VectorDouble(),
const VectorString names = VectorString(),
const VectorString locatorNames = VectorString(),
bool  flagAddSampleRank = true,
bool  flagAddCoordinates = true 
)

Creating a Db regular grid of any dimension

Parameters
nxA vector of the number of grid meshes. The number of items in this argument gives the dimension of the space. (size = ndim)
dxVector cell meshes size in each direction (size = ndim) (by default, use 1)
x0Vector of origin coordinates (size = ndim) (by default, use 0)
anglesArray giving the rotation angles (only for dimension 2 or 3). The first angle corresponds to the rotation around OZ axis, the second to a rotation around OY'and the third one around Ox. The dimension of this array cannot exceed the space dimension.
orderFlag for values order in 'tab' (defined ELoadBy.hpp)
tabVariable values array (size = nvar * nsamples)
namesNames of the Variables of 'tab' (size = nvar)
locatorNamesLocators for each variable of array 'tab' (size = nvar)
flagAddSampleRankIf true, add an automatic rank variable
flagAddCoordinatesIf TRUE, add the grid coordinates

◆ resetCoveringDb()

int DbGrid::resetCoveringDb ( const Db db,
const VectorInt nx = VectorInt(),
const VectorDouble dx = VectorDouble(),
const VectorDouble x0 = VectorDouble(),
const VectorDouble margin = VectorDouble() 
)

Creating a Grid Db which covers the extension of the input 'Db'

Parameters
dbInput Db from which the newly created Db is constructed
nxVector of the expected number of grid nodes (default = 10)
dxVector of the expected sizes for the grid meshes (in distance)
x0Vector of the expected origin of the grid (in coordinate)
marginVector of the expected margins of the grid (in distance)
Remarks
Arguments 'nodes' and 'dcell' are disjunctive. If both defined, 'dcell' prevails

Load the data

◆ resetDims()

void DbGrid::resetDims ( int  ncol,
int  nech 
)
overridevirtual

Set dimension

Parameters
ncolNumber of columns (= variables)
nechNumber of samples (ignore in case of Grid)

Reimplemented from Db.

◆ resetFromPolygon()

int DbGrid::resetFromPolygon ( Polygons polygon,
const VectorInt nodes,
const VectorDouble dcell,
bool  flagAddSampleRank = true 
)

Creating a regular grid Db which covers the input Polygon

Parameters
polygonPointer to the input Polygon
nodesVector of the expected number of nodes
dcellVector of the expected dimensions for the grid cells
flagAddSampleRanktrue if the sample rank must be generated

Load the data

◆ sampleBelongsToCell()

bool DbGrid::sampleBelongsToCell ( const VectorDouble coor,
int  rank,
const VectorDouble dxsPerCell = VectorDouble() 
) const
inline

◆ setDX()

void DbGrid::setDX ( int  idim,
double  value 
)
inline

◆ setGridPileInPlace()

void DbGrid::setGridPileInPlace ( int  iuid,
const VectorInt indg,
int  idim0,
const VectorDouble vec 
)

◆ setNX()

void DbGrid::setNX ( int  idim,
int  value 
)
inline

◆ setSelectionFromVariableExtend()

int DbGrid::setSelectionFromVariableExtend ( const String nameTop,
const String nameBot 
)

Defines a selection in the current grid where variables 'nameTop' and 'nameBot' are both defined and ordered properly

Parameters
nameTopName of the Top variable
nameBotName of the Bottom variable

: This method also adds a selection in the current grid which masks off the pixels where 'nameTop' and 'nameBot' are defined but not correctly ordered. This is the reason why this method cannot be 'const'

◆ setX0()

void DbGrid::setX0 ( int  idim,
double  value 
)
inline

◆ smooth()

int DbGrid::smooth ( ANeigh neigh,
int  type = 1,
double  range = 1.,
const NamingConvention namconv = NamingConvention("Smooth") 
)

◆ toString()

String DbGrid::toString ( const AStringFormat strfmt = nullptr) const
overridevirtual

ICloneable interface.

AStringable Interface

Reimplemented from Db.

Reimplemented in DbMeshTurbo.


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