Loading [MathJax]/extensions/tex2jax.js
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
vesin.cpp File Reference
#include "vesin.h"
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <tuple>
#include <new>
#include <vector>
#include <array>
#include <cmath>
#include <stdexcept>
#include <string>

Classes

class  PLMD::metatensor::vesin::BoundingBox
 
struct  PLMD::metatensor::vesin::cpu::CellList::Cell
 
class  PLMD::metatensor::vesin::cpu::CellList
 The cell list is used to sort atoms inside bins/cells. More...
 
struct  PLMD::metatensor::vesin::CellShift
 A cell shift represents the displacement along cell axis between the actual position of an atom and a periodic image of this atom. More...
 
class  PLMD::metatensor::vesin::cpu::GrowableNeighborList
 Wrapper around VesinNeighborList that behaves like a std::vector, automatically growing memory allocations. More...
 
struct  PLMD::metatensor::vesin::Matrix
 
struct  PLMD::metatensor::vesin::cpu::CellList::Point
 the cells themselves are a list of points & corresponding shift to place the point inside the cell More...
 
struct  PLMD::metatensor::vesin::Vector
 

Namespaces

namespace  PLMD
 
namespace  PLMD::metatensor
 
namespace  PLMD::metatensor::vesin
 
namespace  PLMD::metatensor::vesin::cpu
 

Macros

#define MAX_NUMBER_OF_CELLS   1e5
 Maximal number of cells, we need to use this to prevent having too many cells with a small bounding box and a large cutoff.
 
#define VESIN_CPU_CELL_LIST_HPP
 
#define VESIN_MATH_HPP
 
#define VESIN_TYPES_HPP
 

Functions

template<typename scalar_t>
static scalar_t * alloc (scalar_t *ptr, size_t size, size_t new_size)
 
template<typename scalar_t, size_t N>
static scalar_t(* alloc (scalar_t(*ptr)[N], size_t size, size_t new_size))[N]
 
static std::tuple< int32_t, int32_t > divmod (int32_t a, size_t b)
 Function to compute both quotient and remainder of the division of a by b.
 
static std::tuple< std::array< int32_t, 3 >, std::array< int32_t, 3 > > divmod (std::array< int32_t, 3 > a, std::array< size_t, 3 > b)
 Apply the divmod function to three components at the time.
 
void PLMD::metatensor::vesin::cpu::free_neighbors (VesinNeighborList &neighbors)
 
void PLMD::metatensor::vesin::cpu::neighbors (const Vector *points, size_t n_points, BoundingBox cell, VesinOptions options, VesinNeighborList &neighbors)
 
Vector PLMD::metatensor::vesin::operator* (double scalar, Vector vector)
 
Vector PLMD::metatensor::vesin::operator* (Matrix matrix, Vector vector)
 
Vector PLMD::metatensor::vesin::operator* (Vector vector, double scalar)
 
Vector PLMD::metatensor::vesin::operator* (Vector vector, Matrix matrix)
 
CellShift PLMD::metatensor::vesin::operator+ (CellShift a, CellShift b)
 
Vector PLMD::metatensor::vesin::operator+ (Vector u, Vector v)
 
CellShift PLMD::metatensor::vesin::operator- (CellShift a, CellShift b)
 
Vector PLMD::metatensor::vesin::operator- (Vector u, Vector v)
 
void vesin_free (VesinNeighborList *neighbors)
 
int vesin_neighbors (const double(*points)[3], size_t n_points, const double box[3][3], bool periodic, VesinDevice device, VesinOptions options, VesinNeighborList *neighbors, const char **error_message)
 

Variables

thread_local std::string LAST_ERROR
 

Macro Definition Documentation

◆ MAX_NUMBER_OF_CELLS

#define MAX_NUMBER_OF_CELLS   1e5

Maximal number of cells, we need to use this to prevent having too many cells with a small bounding box and a large cutoff.

◆ VESIN_CPU_CELL_LIST_HPP

#define VESIN_CPU_CELL_LIST_HPP

◆ VESIN_MATH_HPP

#define VESIN_MATH_HPP

◆ VESIN_TYPES_HPP

#define VESIN_TYPES_HPP

Function Documentation

◆ alloc() [1/2]

template<typename scalar_t>
static scalar_t * alloc ( scalar_t * ptr,
size_t size,
size_t new_size )
static

◆ alloc() [2/2]

template<typename scalar_t, size_t N>
static scalar_t(* alloc ( scalar_t(*) ptr[N],
size_t size,
size_t new_size ))[N]
static

◆ divmod() [1/2]

static std::tuple< int32_t, int32_t > divmod ( int32_t a,
size_t b )
static

Function to compute both quotient and remainder of the division of a by b.

This function follows Python convention, making sure the remainder have the same sign as b.

◆ divmod() [2/2]

static std::tuple< std::array< int32_t, 3 >, std::array< int32_t, 3 > > divmod ( std::array< int32_t, 3 > a,
std::array< size_t, 3 > b )
static

Apply the divmod function to three components at the time.

◆ vesin_free()

void vesin_free ( VesinNeighborList * neighbors)

◆ vesin_neighbors()

int vesin_neighbors ( const double(*) points[3],
size_t n_points,
const double box[3][3],
bool periodic,
VesinDevice device,
VesinOptions options,
VesinNeighborList * neighbors,
const char ** error_message )

Variable Documentation

◆ LAST_ERROR

thread_local std::string LAST_ERROR