(git:ccc2433)
grid_sphere_cache.h
Go to the documentation of this file.
1 /*----------------------------------------------------------------------------*/
2 /* CP2K: A general program to perform molecular dynamics simulations */
3 /* Copyright 2000-2024 CP2K developers group <https://cp2k.org> */
4 /* */
5 /* SPDX-License-Identifier: BSD-3-Clause */
6 /*----------------------------------------------------------------------------*/
7 
8 #ifndef GRID_SPHERE_CACHE_H
9 #define GRID_SPHERE_CACHE_H
10 
11 /*******************************************************************************
12  * \brief Struct holding the sphere cache for one grid as specified by dr[3].
13  * \author Ole Schuett
14  ******************************************************************************/
15 typedef struct {
16  double dr[3];
17  double drmin;
18  double drmin_inv;
19  int max_imr;
20  int *offsets;
21  int *storage;
23 
24 /*******************************************************************************
25  * \brief Struct holding the entire sphere cache, ie. for all grids.
26  * \author Ole Schuett
27  ******************************************************************************/
28 typedef struct {
29  int size;
33 
34 /*******************************************************************************
35  * \brief Lookup the sphere bounds from the cache and compute them when missing.
36  * \param radius Non-discretized radius.
37  * \param dh Incremental grid matrix.
38  * \param dh_inv Inverse incremental grid matrix.
39  * \param sphere_bounds Returned pointer to sphere bounds.
40  * \param discr_radius Returned discretized radius.
41  * \author Ole Schuett
42  ******************************************************************************/
43 void grid_sphere_cache_lookup(const double radius, const double dh[3][3],
44  const double dh_inv[3][3], int **sphere_bounds,
45  double *discretized_radius);
46 
47 /*******************************************************************************
48  * \brief Free the memory of the sphere cache.
49  * \author Ole Schuett
50  ******************************************************************************/
52 
53 #endif
54 
55 // EOF
void grid_sphere_cache_free(grid_sphere_cache *cache)
Free the memory of the sphere cache.
void grid_sphere_cache_lookup(const double radius, const double dh[3][3], const double dh_inv[3][3], int **sphere_bounds, double *discretized_radius)
Lookup the sphere bounds from the cache and compute them when missing.
Struct holding the sphere cache for one grid as specified by dr[3].
int * storage
double drmin
int max_imr
double drmin_inv
int * offsets
Struct holding the entire sphere cache, ie. for all grids.
grid_sphere_cache_entry * entries