Pteros  2.0
Molecular modeling library for human beings!
pteros::Grid Class Reference

Sorting the atoms from given selection into the cells of 3D grid with given dimensions. More...

#include <grid.h>

Public Member Functions

 Grid (int X, int Y, int Z)
 
void clear ()
 
void resize (int X, int Y, int Z)
 
GridCell & cell (int i, int j, int k)
 
GridCell & cell (Vector3i_const_ref ind)
 
const GridCell & cell (Vector3i_const_ref ind) const
 
void populate (const Selection &sel, bool abs_index=false)
 Non-periodic populate.
 
void populate (const Selection &sel, Vector3f_const_ref min, Vector3f_const_ref max, bool abs_index)
 
void populate_periodic (const Selection &sel, Vector3i_const_ref pbc_dims=fullPBC, bool abs_index=false)
 Periodic populate.
 
void populate_periodic (const Selection &sel, const PeriodicBox &box, Vector3i_const_ref pbc_dims=fullPBC, bool abs_index=false)
 

Detailed Description

Sorting the atoms from given selection into the cells of 3D grid with given dimensions.

Useful for producing volumetric datasets or various 3D histrograms (for examples density or the residence time maps).

// Create 100x100x100 grid
Grid g(100,100,100);
// Populate it from given selection
// in periodic manner
g.populate_periodic(sel);
// Print number of atoms in the grid cells
for(int i=0;i< 100;++i){
for(int j=0;j< 100;++j)
for(int k=0;k< 100;++k)
cout << g.cell(i,j,k).size() << endl;

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