MADNESS 0.10.1
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
madness::WignerSeitzPotentialFunctor Class Reference

Functor for evaluating the Wigner-Seitz potential in a simulation cell. More...

#include <potentialmanager.h>

Inheritance diagram for madness::WignerSeitzPotentialFunctor:
Inheritance graph
[legend]
Collaboration diagram for madness::WignerSeitzPotentialFunctor:
Collaboration graph
[legend]

Public Member Functions

 WignerSeitzPotentialFunctor (const Molecule &atoms, Tensor< double > c, BoundaryConditions< 3 > b, std::array< KernelRange, 3 > r)
 Constructs a WignerSeitzPotentialFunctor with default lattice sum range.
 
template<typename Int >
 WignerSeitzPotentialFunctor (const Molecule &atoms, Tensor< double > c, BoundaryConditions< 3 > b, std::array< KernelRange, 3 > r, std::array< Int, 3 > lattice_sum_range)
 Constructs a WignerSeitzPotentialFunctor evaluating the potential in a simulation cell due to point charges, optionally with periodic boundary conditions and a specified lattice summation range.
 
double operator() (const coord_3d &x) const final
 
std::vector< coord_3dspecial_points () const final
 Override this to return list of special points to be refined more deeply.
 
- Public Member Functions inherited from madness::FunctionFunctorInterface< double, 3 >
 FunctionFunctorInterface ()
 
virtual ~FunctionFunctorInterface ()
 
virtual coeffT coeff (const keyT &) const
 
virtual void operator() (const Vector< double *, 1 > &xvals, double *fvals, int npts) const
 
virtual void operator() (const Vector< double *, 2 > &xvals, double *fvals, int npts) const
 
virtual void operator() (const Vector< double *, 3 > &xvals, double *fvals, int npts) const
 
virtual void operator() (const Vector< double *, 4 > &xvals, double *fvals, int npts) const
 
virtual void operator() (const Vector< double *, 5 > &xvals, double *fvals, int npts) const
 
virtual void operator() (const Vector< double *, 6 > &xvals, double *fvals, int npts) const
 
virtual double operator() (const Vector< double, NDIM > &x) const=0
 You should implement this to return f(x)
 
virtual bool provides_coeff () const
 does this functor directly provide sum coefficients? or only function values?
 
virtual bool screened (const Vector< double, NDIM > &c1, const Vector< double, NDIM > &c2) const
 Can we screen this function based on the bounding box information?
 
void set_length_scale (double lo)
 adapt the special level to resolve the smallest length scale
 
virtual Level special_level () const
 Override this to change the minimum level of refinement at special points (default is 6)
 
virtual bool supports_vectorized () const
 Does the interface support a vectorized operator()?
 
virtual coeffT values (const keyT &key, const Tensor< double > &tensor) const
 

Static Public Member Functions

static std::array< std::int64_t, 3 > make_default_lattice_sum_range (const BoundaryConditions< 3 > &bc, const std::array< KernelRange, 3 > &range)
 

Private Attributes

const Moleculeatoms
 
const BoundaryConditions< 3 > bc
 
const Tensor< double > cell
 
const std::array< double, 3 > cell_width
 
const std::array< std::int64_t, 3 > lattice_sum_range
 
const std::array< KernelRange, 3 > range
 
const std::array< double, 3 > rcell_width
 

Additional Inherited Members

- Public Types inherited from madness::FunctionFunctorInterface< double, 3 >
typedef GenTensor< double > coeffT
 
typedef Key< NDIMkeyT
 
typedef double value_type
 
- Public Attributes inherited from madness::FunctionFunctorInterface< double, 3 >
Level special_level_
 

Detailed Description

Functor for evaluating the Wigner-Seitz potential in a simulation cell.

This class implements a functor that evaluates the electrostatic potential in a simulation cell due to a set of point charges, with optional periodic boundary conditions and configurable lattice summation range.

The potential is computed by summing contributions from point charges in the simulation cell and their periodic images, as determined by the specified boundary conditions and kernel range.

Note
The lattice summation range can be overridden by the user, or determined automatically based on the boundary conditions and kernel range.

Constructor & Destructor Documentation

◆ WignerSeitzPotentialFunctor() [1/2]

template<typename Int >
madness::WignerSeitzPotentialFunctor::WignerSeitzPotentialFunctor ( const Molecule atoms,
Tensor< double >  c,
BoundaryConditions< 3 >  b,
std::array< KernelRange, 3 >  r,
std::array< Int, 3 >  lattice_sum_range 
)
inline

Constructs a WignerSeitzPotentialFunctor evaluating the potential in a simulation cell due to point charges, optionally with periodic boundary conditions and a specified lattice summation range.

Template Parameters
IntInteger type for the lattice summation range.
Parameters
atomsList of point charges in the simulation cell.
cThe simulation cell dimensions.
bThe boundary conditions.
rThe kernel range along each Cartesian direction.
lattice_sum_rangeOverrides the default lattice summation range along each axis. By default, this is determined by the number of cells in each direction with nonzero contributions to the simulation cell.

References d, and MADNESS_ASSERT.

◆ WignerSeitzPotentialFunctor() [2/2]

madness::WignerSeitzPotentialFunctor::WignerSeitzPotentialFunctor ( const Molecule atoms,
Tensor< double >  c,
BoundaryConditions< 3 >  b,
std::array< KernelRange, 3 >  r 
)
inline

Constructs a WignerSeitzPotentialFunctor with default lattice sum range.

This constructor initializes the WignerSeitzPotentialFunctor using the provided molecule, coefficients tensor, boundary conditions, and kernel ranges. It automatically computes the default lattice sum range using the given boundary conditions and kernel ranges.

Parameters
atomsThe molecule containing the atomic positions and properties.
cThe tensor of coefficients for the potential calculation.
bThe boundary conditions for the simulation cell.
rThe kernel ranges for each spatial dimension.
Note
This constructor delegates to the main constructor, passing the default lattice sum range. In this case, the move is a cast, and calling make_default_lattice_sum_range like this is OK.

Member Function Documentation

◆ make_default_lattice_sum_range()

static std::array< std::int64_t, 3 > madness::WignerSeitzPotentialFunctor::make_default_lattice_sum_range ( const BoundaryConditions< 3 > &  bc,
const std::array< KernelRange, 3 > &  range 
)
inlinestatic

References d.

◆ operator()()

double madness::WignerSeitzPotentialFunctor::operator() ( const coord_3d x) const
final

◆ special_points()

std::vector< coord_3d > madness::WignerSeitzPotentialFunctor::special_points ( ) const
finalvirtual

Override this to return list of special points to be refined more deeply.

Reimplemented from madness::FunctionFunctorInterface< double, 3 >.

References atoms, and madness::Molecule::get_all_coords_vec().

Member Data Documentation

◆ atoms

const Molecule& madness::WignerSeitzPotentialFunctor::atoms
private

Referenced by operator()(), and special_points().

◆ bc

const BoundaryConditions<3> madness::WignerSeitzPotentialFunctor::bc
private

◆ cell

const Tensor<double> madness::WignerSeitzPotentialFunctor::cell
private

◆ cell_width

const std::array<double, 3> madness::WignerSeitzPotentialFunctor::cell_width
private

Referenced by operator()().

◆ lattice_sum_range

const std::array<std::int64_t, 3> madness::WignerSeitzPotentialFunctor::lattice_sum_range
private

Referenced by operator()().

◆ range

const std::array<KernelRange, 3> madness::WignerSeitzPotentialFunctor::range
private

Referenced by operator()().

◆ rcell_width

const std::array<double, 3> madness::WignerSeitzPotentialFunctor::rcell_width
private

Referenced by operator()().


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