MmProcess
The GeMA Mesh Mapping Process Plugin
Loading...
Searching...
No Matches
GmpMmBucketIndexBase< T > Class Template Referenceabstract

Class GmpMmBucketIndexBase. More...

#include <gmpMmBucketIndex.h>

Inheritance diagram for GmpMmBucketIndexBase< T >:
Collaboration diagram for GmpMmBucketIndexBase< T >:

Public Member Functions

 GmpMmBucketIndexBase (GmSimulationData *simulation, QString id, QString description, GSBIType type, const GmLogCategory &logger)
 
 GmpMmBucketIndexBase (GmSimulationData *simulation, GmMesh *mesh, GSBIType type, const GmLogCategory &logger, const QVariantMap &options=QVariantMap())
 Bucket index constructor for an object created by the process.
 
virtual const char * pluginName () const
 
void init (const QVariantMap &options)
 Initializes the object with the given options (or defaults in their absence)
 
virtual bool loadPrivateData (LuaTable &table)
 Loads from the given Lua table the mesh information + additional options, calling init() to effectively int a plugin created object.
 
const QVector< GmpMmBIBucket< T > > & bucketList () const
 
virtual bool activeOnly () const
 
virtual int ruleSet () const
 
virtual bool isOutsideOfDomain (const GmVector &crd) const
 
virtual const GmpMmBIBucket< T > & getBucket (const GmVector &crd, bool &ok) const
 Returns a reference to the bucket in which the given point falls in.
 
bool getClosestReference (const GmVector &crd, GmpRefDist< T > &closestRef, const PointValidator &pv=defaultPointValidator) const
 Returns the id of the closest reference.
 
void getClosestReferences (const GmVector &crd, int n, QVector< GmpRefDist< T > > &refList, bool sort, const PointValidator &pv=defaultPointValidator) const
 Returns the ids of the n closest references.
 
void getClosestReferences (const GmVector &crd, double radius, QVector< GmpRefDist< T > > &refList, bool sort, const PointValidator &pv=defaultPointValidator) const
 Returns the ids of the references which distance to crd is less than radius.
 
void printInfo ()
 
virtual void printParameters (const GmLogCategory &logger)
 
virtual int numReferences () const
 Number of stored references.
 
- Public Member Functions inherited from GmpMmBucketIndex
 GmpMmBucketIndex (GmSimulationData *simulation, QString id, QString description, GSBIType type, const GmLogCategory &logger)
 Constructor for plugin created objects.
 
 GmpMmBucketIndex (GmSimulationData *simulation, GmMesh *mesh, GSBIType type, const GmLogCategory &logger)
 Constructor for process created objects.
 
virtual ~GmpMmBucketIndex ()
 Destructor.
 
virtual GmMeshmesh () const
 
virtual const GmValueAccessorcoordAccessor () const
 
virtual int ndim () const
 
GSBIType type () const
 
- Public Member Functions inherited from GmSpatialIndex
 GmSpatialIndex (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger)
 
virtual const char * pluginCategory () const
 
virtual bool hasCapability (QString capabilityName) const=0
 
virtual bool getClosestNode (const GmVector &crd, double &sqrDist, int &outNodeId, const PointValidator &pv=defaultPointValidator) const=0
 
virtual void getClosestNodes (const GmVector &crd, int n, QVector< GmpRefDist< int > > &nodeList, bool ordered, const PointValidator &pv=defaultPointValidator) const=0
 
virtual void getClosestNodes (const GmVector &crd, double r, QVector< GmpRefDist< int > > &nodeList, bool ordered, const PointValidator &pv=defaultPointValidator) const=0
 
virtual void getClosestNodes (const GmVector &crd, int n, QVector< int > &nodeList, bool ordered, const PointValidator &pv=defaultPointValidator) const=0
 
virtual void getClosestNodes (const GmVector &crd, double r, QVector< int > &nodeList, bool ordered, const PointValidator &pv=defaultPointValidator) const=0
 
virtual GmCellgetContainingCell (const GmVector &crd) const=0
 
virtual bool getClosestGaussPoint (const GmVector &crd, double &sqrDist, GmpMmGaussData &outRef, const PointValidator &pv=defaultPointValidator) const=0
 
virtual void getClosestGaussPoints (const GmVector &crd, int n, QVector< GmpRefDist< GmpMmGaussData > > &gpList, bool ordered, const PointValidator &pv=defaultPointValidator) const=0
 
virtual void getClosestGaussPoints (const GmVector &crd, double r, QVector< GmpRefDist< GmpMmGaussData > > &gpList, bool ordered, const PointValidator &pv=defaultPointValidator) const=0
 
virtual void getClosestGaussPoints (const GmVector &crd, int n, QVector< GmpMmGaussData > &gpList, bool ordered, const PointValidator &pv=defaultPointValidator) const=0
 
virtual void getClosestGaussPoints (const GmVector &crd, double r, QVector< GmpMmGaussData > &gpList, bool ordered, const PointValidator &pv=defaultPointValidator) const=0
 
- Public Member Functions inherited from GmPluginObject
 GmPluginObject (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger)
 
QString id () const
 
QString description () const
 
QString pluginTypeName () const
 
virtual const char * pluginType () const=0
 

Protected Member Functions

bool meshHasChanged () const
 
void insertValue (const T &val, int gridId)
 Add a new reference in the bucket index.
 
bool getGridCrd (const GmVector &crd, int gridCrd[GMP_MAX_INDEX_DIM]) const
 Return the grid coordinates for a point.
 
int getGridId (const GmVector &crd) const
 Return the grid cell id in which the given point falls in.
 
int getBucketId (int gridId) const
 Return the bucket id referenced by a cell.
 
void getBoxBucketIds (const int minGrid[GMP_MAX_INDEX_DIM], const int maxGrid[GMP_MAX_INDEX_DIM], ISet &bucketIds) const
 
void getBoxBucketIds1D (int x0, int x1, ISet &buecketIds) const
 
void getBoxBucketIds2D (int x0, int x1, int y0, int y1, ISet &bucketIds) const
 
void getBoxBucketIds3D (int x0, int x1, int y0, int y1, int z0, int z1, ISet &bucketIds) const
 
void computeStep ()
 
void processRadiusLayerBucketIds (const GmVector &crd, double radius, std::function< void(int[])> &proc, int curMin[GMP_MAX_INDEX_DIM], int curMax[GMP_MAX_INDEX_DIM]) const
 
void processLayerBuckets1D (const int curMin[GMP_MAX_INDEX_DIM], const int curMax[GMP_MAX_INDEX_DIM], const int newMin[GMP_MAX_INDEX_DIM], const int newMax[GMP_MAX_INDEX_DIM], std::function< void(int[])> &proc) const
 
void processLayerBuckets2D (const int curMin[GMP_MAX_INDEX_DIM], const int curMax[GMP_MAX_INDEX_DIM], const int newMin[GMP_MAX_INDEX_DIM], const int newMax[GMP_MAX_INDEX_DIM], std::function< void(int[])> &proc) const
 
void processLayerBuckets3D (const int curMin[GMP_MAX_INDEX_DIM], const int curMax[GMP_MAX_INDEX_DIM], const int newMin[GMP_MAX_INDEX_DIM], const int newMax[GMP_MAX_INDEX_DIM], std::function< void(int[])> &proc) const
 
void getLayerBucketIds (const int gridCrd[GMP_MAX_INDEX_DIM], int layer, ISet &bucketIds, int min[GMP_MAX_INDEX_DIM], int max[GMP_MAX_INDEX_DIM], const int minBound[GMP_MAX_INDEX_DIM], const int maxBound[GMP_MAX_INDEX_DIM]) const
 
- Protected Member Functions inherited from GmPluginObject
virtual const GmLogCategorylogger () const
 
GmSimulationDatasimulationData () const
 

Protected Attributes

bool _activeOnly
 
bool _info
 
bool _maxRefineReached
 
int _ruleSet
 
double _step [GMP_MAX_INDEX_DIM]
 
double _maxStep
 
QVector< GmpMmBIBucket< T > > _bucketList
 
QVector< int > _gridIdList
 
- Protected Attributes inherited from GmpMmBucketIndex
GmMesh_mesh
 The mesh.
 
const GmCellGroupSet_cellGroup
 The cell group filter or NULL if there is none.
 
const GmNodeSet_nodeGroup
 The node group filter or NULL if there is none.
 
const GmValueAccessor_crdAcc
 The mesh accessor used for retrieving point coordinates.
 
int _nDim
 
GSBIType _type
 

Private Member Functions

void computeInitGridSize (const GmVector &bboxSize, int *initialSize, int *finalSize)
 Automatically define the initial size of the grid.
 
virtual void insertValues ()=0
 
int computeGridSize (int dim) const
 Return the number of cells in the dim axe direction.
 
int getGridSize (int dim) const
 
double getGridLength (int dim) const
 Return the grid length in the dim axe direction.
 
double getCellLength (int dim) const
 Return the cell length in the dim axe direction.
 
bool getGridDimCrd (int dim, double dimCrd, int &gridDimCrd) const
 Return the grid cell coord for an euclidean coordinate in the given dimension.
 
int getMaxCellLengthDim () const
 Return the dimension in which cells have the maximum length.
 
int getMinCellLengthDim () const
 Return the dimension in which cells have the minimum length.
 
virtual int getCrdFromRef (const GmpMmBIReference< T > &ref, GmCRVector &crd) const =0
 Get the coordinates of the point associated to the given reference.
 
void recBoxBucketIds (const int minGrid[GMP_MAX_INDEX_DIM], const int maxGrid[GMP_MAX_INDEX_DIM], int gridCrd[GMP_MAX_INDEX_DIM], int dim, ISet &bucketIds) const
 Recursively find grid ids in box.
 
void recLayerBucketIds (const int minGrid[GMP_MAX_INDEX_DIM], const int maxGrid[GMP_MAX_INDEX_DIM], const int minBound[GMP_MAX_INDEX_DIM], const int maxBound[GMP_MAX_INDEX_DIM], int gridCrd[GMP_MAX_INDEX_DIM], int dim, ISet &bucketIds) const
 Recursively find grid ids in layer.
 
int gridLinearizeCrd (const int gridCrd[GMP_MAX_INDEX_DIM]) const
 Return grid id from grid coordinates for CURRENT grid size;.
 
int gridLinearizeCrd (const int gridCrd[GMP_MAX_INDEX_DIM], const int gridSizes[GMP_MAX_INDEX_DIM]) const
 Return grid id from grid coordinates for a given grid size;.
 
void gridExtractId (int gridId, const int gridSizes[GMP_MAX_INDEX_DIM], int crd[GMP_MAX_INDEX_DIM]) const
 Extract grid coordinates from grid id.
 
int splitGrid ()
 Increase the number of splits in the dimension in which cells have the maximum length. Return the dimension.
 
bool redistributeBucket (int fullBucketId)
 Redistribute references among buckets.
 
int createBucket (int gridId)
 Create a new bucket pointing to the given cell id. Return a reference to the created bucket.
 
void splitSharedBucket (int fullBucketId, int gridId, const GmpMmBIReference< T > &ref)
 Split overflowing shared bucket.
 
bool refineGrid (int fullBucketId, const GmpMmBIReference< T > &ref)
 Refine the grid.
 
bool recRefineGrid (int fullBucketId, const GmpMmBIReference< T > &ref)
 Split overflowing non-shared bucket and recursively refine the grid.
 

Private Attributes

int _bucketCapacity
 
int _gridStartingSize
 
int _gridIdMaxSize
 
int _nRefineMax
 
int _numRefs
 
int _nSplit [GMP_MAX_INDEX_DIM]
 
int _gridSize [GMP_MAX_INDEX_DIM]
 
double _min [GMP_MAX_INDEX_DIM]
 
double _max [GMP_MAX_INDEX_DIM]
 

Additional Inherited Members

- Public Types inherited from GmpMmBucketIndex
enum  GSBIType { GSBIT_NODE , GSBIT_CELL , GSBIT_GAUSS , GSBIT_NUM_BUCKETYPES }
 
- Static Public Member Functions inherited from GmpMmBucketIndex
static QString bucketTypeToStr (GSBIType type)
 Converts an bucket index type to a string.
 
static int strToBucketType (QString str)
 Converts a string to a GSBIType. Returns -1 if no match is found.
 

Detailed Description

template<class T>
class GmpMmBucketIndexBase< T >

Class GmpMmBucketIndexBase.

Constructor & Destructor Documentation

◆ GmpMmBucketIndexBase()

template<class T >
GmpMmBucketIndexBase< T >::GmpMmBucketIndexBase ( GmSimulationData * simulation,
GmMesh * mesh,
GSBIType type,
const GmLogCategory & logger,
const QVariantMap & options = QVariantMap() )

Bucket index constructor for an object created by the process.

Parameters
simulationThe simulation data object
meshA pointer to the mesh object.
typeThe type of bucket.
loggerPlugin logger object used to emmit messages.
optionsA set of bucket options. Available options are: 'capacity' – The storing capacity of each bucket. Default = 10 'gridStartingSize' – The grid partitionning the underlying mesh domain will start with a number of cells equals to gridStartingSize in each direction. Default = -1 (the initial size is automatically computed) 'nRefineMax' – The maximum number of successive refinements a given cell should suffer before considering the bucket capacity is too small. Default = 4 'activeOnly' – Should we only store the active cells/elements of the mesh? No effect in case of nodes bucket. Default = true 'info' – Print informations about the bucket index. Default = false 'ruleSet' – Integration rules set used in case of bucket index of gauss points 'cellGroup' – An optional cell group name with the cells to index, instead of all cells in the mesh, when type is cell or gauss 'nodeSet' – An optional node set name with the nodes to index, instead of all nodes in the mesh, when type is node When filling this table, keep in mind that only options different from the default are needed. When an option is not present in the table its default value will be used.

Member Function Documentation

◆ activeOnly()

template<class T >
virtual bool GmpMmBucketIndexBase< T >::activeOnly ( ) const
inlinevirtual

Implements GmSpatialIndex.

◆ getCrdFromRef()

template<class T >
virtual int GmpMmBucketIndexBase< T >::getCrdFromRef ( const GmpMmBIReference< T > & ref,
GmCRVector & crd ) const
privatepure virtual

Get the coordinates of the point associated to the given reference.

Implemented in GmpMmCellBucketIndex, GmpMmGaussBucketIndex, and GmpMmNodeBucketIndex.

◆ isOutsideOfDomain()

template<class T >
bool GmpMmBucketIndexBase< T >::isOutsideOfDomain ( const GmVector & crd) const
virtual

Implements GmSpatialIndex.

◆ loadPrivateData()

template<class T >
bool GmpMmBucketIndexBase< T >::loadPrivateData ( LuaTable & table)
virtual

Loads from the given Lua table the mesh information + additional options, calling init() to effectively int a plugin created object.

Implements GmPluginObject.

◆ numReferences()

template<class T >
virtual int GmpMmBucketIndexBase< T >::numReferences ( ) const
inlinevirtual

Number of stored references.

Implements GmpMmBucketIndex.

◆ pluginName()

template<class T >
virtual const char * GmpMmBucketIndexBase< T >::pluginName ( ) const
inlinevirtual

Implements GmPluginObject.

◆ printParameters()

template<class T >
void GmpMmBucketIndexBase< T >::printParameters ( const GmLogCategory & logger)
virtual

Reimplemented from GmSpatialIndex.

◆ ruleSet()

template<class T >
virtual int GmpMmBucketIndexBase< T >::ruleSet ( ) const
inlinevirtual

Implements GmSpatialIndex.


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