Go to the documentation of this file.
32 #if !defined(_GRID_STREAM_H_)
33 #define _GRID_STREAM_H_ 1
44 Dft::SparsePattern *pattern);
Treal template_blas_sqrt(Treal x)
int(* shlBlocks)[2]
Definition: grid_stream.cc:464
Streamlined, abstract grid generation class.
Definition: grid_stream.cc:481
real size(int dim) const
Definition: dft_common.h:141
bool contains(const real *p) const
Determines whether given point is inside the box.
Definition: dft_common.h:152
A representation of Vector or point in cartesian space.
Definition: molecule.h:60
~Stream()
Definition: grid_stream.cc:950
Definition of the main floating-point datatype used; the ergo_real type.
real * atomFactors
a triangular array
Definition: grid_stream.cc:176
void setAngularFixed(int minAng, int maxAng)
Definition: grid_stream.cc:103
std::vector< RadialGrid * > atomTypes
We store just one entry per atom type - there is no reason to have thousands identical copies.
Definition: grid_stream.cc:517
virtual void getAtom(int icent, int *cnt, real(*coor)[3], int *charge, int *mult) const =0
void grid_stream_set_sparse_pattern(ErgoGridStream *stream, Dft::SparsePattern *pattern)
Definition: grid_stream.cc:1020
unsigned getPointCount() const
Definition: grid_stream.cc:86
Common DFT routines. Mostly functional mixing.
bool res
Definition: grid_stream.cc:836
StreamSaveContext(FILE *f, BoxPartitioner &p, unsigned maxShells, unsigned rank)
Definition: grid_stream.cc:469
FILE * f
Definition: grid_stream.cc:830
static void * saveThread(void *data)
Definition: grid_stream.cc:839
~ActiveBfShells()
Definition: grid_stream.cc:433
const GridGenMolInfo & ggmi
Definition: grid_stream.cc:422
RadialGrid(int charge_, RadialScheme *rs, int angMin, int angMax)
Definition: grid_stream.cc:132
#define LOG_CAT_ERROR
Definition: output.h:47
const Stream * stream
Definition: grid_stream.cc:829
real radius() const
Returns "radius" of an atomic grid.
Definition: grid_stream.cc:150
double ergo_real
Definition: realtype.h:69
real * rj
Definition: grid_stream.cc:172
Grid::ActiveBfShells ergoShells
Definition: grid_stream.cc:974
long_real * vec
Definition: grid_stream.cc:174
unsigned maxPointCnt
Definition: grid_stream.cc:180
Definition: grid_stream.cc:143
#define END_NAMESPACE(x)
Definition: sparse_pattern.h:42
const RadialGrid & getRadialGrid() const
Definition: grid_stream.cc:147
real getDistanceTo(const real *v) const
Returns the shortest distance of the border of the box to the specified point in space.
Definition: dft_common.cc:90
static const real WEIGHT_THRESHOLD
Ignore all grid points that partitioning scales down by more than WEIGHT_THRESHOLD.
Definition: grid_stream.cc:72
real * rad
Array of radial grid points.
Definition: grid_stream.cc:78
ActiveBfShells & activeShells
Definition: grid_stream.cc:519
const Box * box
Definition: grid_stream.cc:831
RadialScheme radialGridScheme
Definition: grid_params.h:69
ActiveBfShells(const GridGenMolInfo &ggmi_)
Definition: grid_stream.cc:425
unsigned saveBatch(unsigned batchLength, real(*coor)[3], real *weight, unsigned nBlocks, int(*shlBlocks)[2], FILE *f) const
Saves a batch of grid points to given file.
Definition: grid_stream.cc:576
bool overlapsWith(const real *center, real radius) const
Definition: dft_common.h:143
ergo_real real
Definition: test.cc:46
ergo_real real
Definition: grid_stream.cc:66
Simple atom representation by its charge and cartesian coordinates.
Definition: molecule.h:51
const AtomicGrid & getAtomicGrid(unsigned i) const
Definition: grid_stream.cc:533
real getFactor(int i, int j) const
Definition: grid_stream.cc:196
unsigned myRank
Definition: grid_stream.cc:834
ErgoGridStream * grid_stream_new(const struct Dft::GridParams &ggs, const GridGenMolInfo &molInfo)
Creates the grid object.
Definition: grid_stream.cc:999
int angmax
Definition: grid_params.h:66
real lo[3]
Definition: dft_common.h:167
int charge
Definition: grid_test.cc:51
int * nAngular
array of sizes of corresponding angular grids.
Definition: grid_stream.cc:80
ergo_real radint
Definition: grid_params.h:64
@ GC2
Definition: grid_params.h:67
Definition: grid_atomic.h:60
Definition: grid_atomic.h:76
int ll_sphere(int N, real *X, real *Y, real *Z, real *W)
ll_sphere fills in arrays X, Y, Z and W with the cartesian coordinates and weights of the grid points...
Definition: lebedev_laikov.cc:317
unsigned grid_stream_generate(ErgoGridStream *stream, const char *fname, int noOfThreads)
Generate grid for given molecule.
Definition: grid_stream.cc:1033
void addAtom(const Atom &at, int atomNo)
Definition: grid_stream.cc:504
int angularMax
Definition: grid_stream.cc:522
int getMaxDim() const
Return the index of the largest Cartesian dimension: 0 for x, 1 for y and 2 for z.
Definition: dft_common.cc:111
A grid describing a radial grid for an atom with a specific charge.
Definition: grid_stream.cc:76
FILE * stream
Definition: grid_stream.cc:463
int ll_order(int npoint)
ll_order returns order of the smallest angular grid that has at least that many grid points as specif...
Definition: lebedev_laikov.cc:118
A structure describing the grid settings.
Definition: grid_params.h:59
unsigned noOfAtoms() const
Definition: grid_stream.cc:539
Saves the grid saving context.
Definition: grid_stream.cc:462
RadialScheme * radialScheme
Definition: grid_stream.cc:520
std::vector< AtomicGrid > atoms
Definition: grid_stream.cc:518
unsigned maxRelevantAtoms
Definition: grid_stream.cc:182
int noOfShells
Definition: grid_interface.h:49
int getCharge() const
Definition: grid_stream.cc:84
virtual void init(int myNumber, int charge, real threshold)=0
unsigned boxCount
Definition: grid_stream.cc:467
const unsigned * atoms
Definition: grid_stream.cc:833
Streaming grid generator.
real * invAtomDistances
a triangular array
Definition: grid_stream.cc:175
int charge() const
Definition: grid_stream.cc:153
unsigned savedPoints
Definition: grid_stream.cc:466
const real BraggRadii[]
vector of atoms' Bragg radii.
Definition: grid_atomic.cc:39
unsigned process(unsigned atomNumber, const std::vector< AtomicGrid > &atomGrids, int noOfRelevantAtoms, const unsigned *relevantAtoms, unsigned batchLength, real(*coor)[3], real *w)
Applies the partitioning factors to the the grid points associated with given atom.
Definition: grid_stream.cc:345
real * weights
Array of the weights associated with the grid points.
Definition: grid_stream.cc:79
bool saveAtomsRecursively(StreamSaveContext &ssc, const Box &box, unsigned cnt, const unsigned atoms[], int depth) const
This is a recursive procedure that generates the grid points that lie in the specified bounding box.
Definition: grid_stream.cc:735
virtual void getBlocks(const real *center, real cellsz, const real *rshell, int *nblcnt, int(*iblcks)[2]) const =0
unsigned expectedPoints
Definition: grid_stream.cc:525
Class Box provides an ability to determine box containing all Objects.
Definition: dft_common.h:137
AtomicGrid(const Atom &atom, const RadialGrid *rg)
Definition: grid_stream.cc:162
@ LMG
Definition: grid_params.h:67
int noOfAtoms
Definition: grid_interface.h:47
void print(int area, const char *routine)
Definition: utilities.h:111
int charge
Definition: grid_stream.cc:98
void getBoundingBox(Box &box, Iterator start, Iterator end)
Definition: dft_common.h:172
ergo_real v[3]
Definition: molecule.h:61
long_real * p_kg
Definition: grid_stream.cc:173
unsigned getPointCount() const
Definition: grid_stream.cc:154
int gridSize
Definition: grid_atomic.h:52
Basic OS access utilities.
unsigned atomCnt
Definition: grid_stream.cc:832
int getMaxShells() const
Definition: grid_stream.cc:430
Definition: grid_stream.cc:827
#define LOG_CAT_INFO
Definition: output.h:49
unsigned myRank
Definition: grid_stream.cc:468
unsigned maxAtomPointCnt
Definition: grid_stream.cc:181
static pthread_mutex_t fileSaveMutex
Definition: grid_stream.cc:514
const RadialGrid * rGrid
Definition: grid_stream.cc:144
void prepare(const std::vector< AtomicGrid > &atoms, unsigned noOfRelevantAtoms, const unsigned *relevantAtoms, unsigned pointCnt, const real(*gridPoints)[3])
Definition: grid_stream.cc:250
unsigned grid_stream_generate(ErgoGridStream *stream, const char *fname, int noOfThreads)
Generate grid for given molecule.
Definition: grid_stream.cc:1033
pthread_t tid
Definition: grid_stream.cc:828
@ TURBO
Definition: grid_params.h:67
ergo_long_real long_real
Definition: grid_atomic.h:43
Code organizing various settings related to grids used for numerical integration.
virtual void setShellRadii(real *shellRadii) const =0
"Block" partitioning is the only one implemented now...
Definition: grid_stream.cc:170
virtual void generate(real *r, real *w)=0
bool forceCubic
Definition: grid_stream.cc:492
void setForBox(const Box &b, int *nBlocks, int(*shlBlocks)[2]) const
the start and stop+1 indexes.
Definition: grid_stream.cc:449
real apasc
Definition: grid_stream.cc:178
void grid_stream_free(ErgoGridStream *stream)
Definition: grid_stream.cc:1064
static const int HARDNESS
Definition: grid_stream.cc:177
Stream(ActiveBfShells &abs, RadialScheme *rs, real radint, int angmin, int angmax, real boxSize, bool forceCubic)
The Stream constructor.
Definition: grid_stream.cc:940
Dft::SparsePattern * sparsePattern
Definition: grid_stream.cc:490
const unsigned BraggSize
Number of defined elements in BraggRadii array.
Definition: grid_atomic.cc:75
~BoxPartitioner()
Definition: grid_stream.cc:239
int noOfThreads
Definition: grid_stream.cc:526
A class that is able to quickly determine the active shells that overlap with given box in space.
Definition: grid_stream.cc:421
static int getNoOfShells(int nBlocks, int(*shlBlocks)[2])
Definition: grid_stream.cc:439
real hi[3]
Definition: dft_common.h:168
ergo_real charge
Definition: molecule.h:52
BoxPartitioner()
Initializez the BoxPartitioner object.
Definition: grid_stream.cc:215
Class representing a molecule as a set of atoms with assiciated coordinates and charges of the atomic...
ErgoGridStream * grid_stream_new(const struct Dft::GridParams &gss, const GridGenMolInfo &molInfo)
Creates the grid object.
Definition: grid_stream.cc:999
RadialScheme describes the radial grid.
Definition: grid_atomic.h:50
int ll_npoint(int lvalue)
ll_npoint returns number of angular grid points for given L-angular polynomial integration accuracy.
Definition: lebedev_laikov.cc:51
real * rShell2
Definition: grid_stream.cc:423
void addAtom(const real coor[3], int charge, int atomNo)
Definition: grid_stream.cc:545
AtomicGrid(const AtomicGrid &a)
Definition: grid_stream.cc:156
~StreamSaveContext()
Definition: grid_stream.cc:473
~RadialGrid()
Definition: grid_stream.cc:92
Ergo-specific GridStream implementation.
Definition: grid_stream.cc:973
real getInvDistanceBetweenAtoms(int i, int j) const
return distance between given pair of relevant atoms.
Definition: grid_stream.cc:191
const Dft::GridParams & gsSettings
Definition: grid_stream.cc:976
unsigned getPointCount() const
Definition: grid_stream.cc:489
unsigned savedPoints
Definition: grid_stream.cc:524
Definition: grid_atomic.h:68
int angularMin
Definition: grid_stream.cc:522
real xpasc[HARDNESS]
Definition: grid_stream.cc:178
Vector3D center
Definition: grid_stream.cc:146
real radialThreshold
Definition: grid_stream.cc:521
ergo_real coords[3]
Definition: molecule.h:53
real boxSize
Definition: grid_stream.cc:483
void grid_stream_set_sparse_pattern(ErgoGridStream *stream, Dft::SparsePattern *pattern)
Definition: grid_stream.cc:1020
GridGenMolInfo is an abstract class providing information about the molecule so that the grid generat...
Definition: grid_interface.h:45
int noOfRadPoints
Definition: grid_stream.cc:81
void do_output(int logCategory, int logArea, const char *format,...)
Definition: output.cc:53
int angmin
Definition: grid_params.h:65
BoxPartitioner & partitioner
Definition: grid_stream.cc:465
void grid_stream_free(ErgoGridStream *stream)
Definition: grid_stream.cc:1064
real getRadius() const
Definition: grid_stream.cc:85
const real(* coor)[3]
Definition: grid_stream.cc:171
bool saveToFile(const char *fname, int noOfThreads)
Generates the grid and saves it to the file with given name.
Definition: grid_stream.cc:874
ErgoGridStream(const Dft::GridParams &gss, const GridGenMolInfo &molInfo, RadialScheme *rs)
Definition: grid_stream.cc:981
#define LOG_AREA_DFT
Definition: output.h:62
AtomicGrid(const real c[3], const RadialGrid *rg)
Definition: grid_stream.cc:159
Time-measuring class.
Definition: utilities.h:80
Functionality for writing output messages to a text file.
int LDA
Definition: grid_stream.cc:183
unsigned saveAtomGridInBox(unsigned iAtom, const Box &box, BoxPartitioner &partitioner, unsigned cnt, const unsigned atoms[], int(*shlBlocks)[2], FILE *stream) const
Method saves all grid points associated with specified atom, located in the specified box.
Definition: grid_stream.cc:607
#define BEGIN_NAMESPACE(x)
Definition: sparse_pattern.h:41
unsigned savedPoints
Definition: grid_stream.cc:835