MADNESS 0.10.1
madness::WignerSeitzPotentialFunctor Class Reference

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

#include <potentialmanager.h>

Inheritance diagram for madness::WignerSeitzPotentialFunctor:
Collaboration diagram for madness::WignerSeitzPotentialFunctor:

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_3d > special_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 > &, double *, int) const
virtual void operator() (const Vector< double *, 2 > &, double *, int) const
virtual void operator() (const Vector< double *, 3 > &, double *, int) const
virtual void operator() (const Vector< double *, 4 > &, double *, int) const
virtual void operator() (const Vector< double *, 5 > &, double *, int) const
virtual void operator() (const Vector< double *, 6 > &, double *, int) 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 > &, const Vector< double, NDIM > &) 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 &, const Tensor< double > &) 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 Molecule & atoms
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< NDIM > keyT
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 atoms, b, bc, c, cell, cell_width, d, lattice_sum_range, MADNESS_ASSERT, range, and rcell_width.

Referenced by WignerSeitzPotentialFunctor().

◆ 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.

References WignerSeitzPotentialFunctor(), atoms, b, c, and make_default_lattice_sum_range().

Member Function Documentation

◆ make_default_lattice_sum_range()

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

◆ 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.

Member Data Documentation

◆ atoms

const Molecule& madness::WignerSeitzPotentialFunctor::atoms
private

◆ 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

◆ lattice_sum_range

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

◆ range

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

◆ rcell_width

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

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