MADNESS 0.10.1
madness::BoxSurfaceDisplacementRange< NDIM > Class Template Reference

#include <displacements.h>

Collaboration diagram for madness::BoxSurfaceDisplacementRange< NDIM >:

Classes

class  Iterator
 Iterator class for lazy generation of surface points. More...

Public Types

using Displacement = Key<NDIM>
using Point = Key<NDIM>
using PointPattern = Vector<std::optional<Translation>, NDIM>
using Validator = BoxSurfaceDisplacementValidator<NDIM>

Public Member Functions

 BoxSurfaceDisplacementRange (const Key< NDIM > &center, const std::array< std::optional< std::int64_t >, NDIM > &box_radius, const std::array< std::optional< std::int64_t >, NDIM > &surface_thickness, const array_of_bools< NDIM > &is_lattice_summed, std::optional< Validator > validator={})
 Constructs a box with different radii and thicknesses for each dimension.
auto begin () const
 Returns an iterator to the beginning of the surface points.
const std::array< std::optional< int64_t >, NDIM > & box_radius () const
const Key< NDIM > & center () const
 Returns a view over the surface points.
auto end () const
 Returns an iterator to the end of the surface points.
bool face_skipped (size_t face_dimension) const
const array_of_bools< NDIM > & is_lattice_summed () const
const Displacement & probing_displacement (size_t face_dimension) const
const std::array< std::optional< Displacement >, NDIM > & probing_displacements () const
void skip_face (size_t face_dimension)
const std::array< std::optional< int64_t >, NDIM > & surface_thickness () const

Private Types

using Box = std::array<std::pair<Translation, Translation>, NDIM>
using BoxRadius = std::array<std::optional<Translation>, NDIM>
using Hollowness = std::array<bool, NDIM>
using Periodicity = array_of_bools<NDIM>
using SurfaceThickness = std::array<std::optional<Translation>, NDIM>

Private Member Functions

Displacement compute_probing_displacement (const size_t face_dimension) const

Private Attributes

Box box_
 box bounds in each dimension.
BoxRadius box_radius_
 halved size of the box in each dimension, in half-SimulationCells.
Point center_
 Center point of the box.
Hollowness hollowness_
 does box contain non-surface points along each dimension?
Box initial_bounds_
 bounds of the boxes to be iterated over, before any face is processed: the box plus its surface thickness, or, along a lattice-summed dimension, one period ending at the top layer (so that each equivalence class of boxes appears exactly once)
Periodicity is_lattice_summed_
 which dimensions are lattice summed?
std::array< std::optional< Displacement >, NDIM > probing_displacements_
 for each finite-radius dimension, a displacement to a nearby point on the faces normal to it (the pair of hyperplanes at -radius and +radius, which lattice summation folds onto each other); it may not be able to pass the filter, but among the displacements those faces contribute it errs toward the largest norm, so that a decaying kernel can be screened with it
std::array< bool, NDIM > skip_face_ {}
 faces excluded from iteration (see skip_face())
SurfaceThickness surface_thickness_
 surface thickness in each dimension, measured in boxes. Real-space surface size is thus n-dependent.
std::optional< Validator > validator_
 optional filter; also the source of the reach of the standard displacements, which the probing displacements are placed outside of

Friends

class Iterator

Member Typedef Documentation

◆ Box

template<std::size_t NDIM>
using madness::BoxSurfaceDisplacementRange< NDIM >::Box = std::array<std::pair<Translation, Translation>, NDIM>
private

◆ BoxRadius

template<std::size_t NDIM>
using madness::BoxSurfaceDisplacementRange< NDIM >::BoxRadius = std::array<std::optional<Translation>, NDIM>
private

◆ Displacement

template<std::size_t NDIM>
using madness::BoxSurfaceDisplacementRange< NDIM >::Displacement = Key<NDIM>

◆ Hollowness

template<std::size_t NDIM>
using madness::BoxSurfaceDisplacementRange< NDIM >::Hollowness = std::array<bool, NDIM>
private

◆ Periodicity

template<std::size_t NDIM>
using madness::BoxSurfaceDisplacementRange< NDIM >::Periodicity = array_of_bools<NDIM>
private

◆ Point

template<std::size_t NDIM>
using madness::BoxSurfaceDisplacementRange< NDIM >::Point = Key<NDIM>

◆ PointPattern

template<std::size_t NDIM>
using madness::BoxSurfaceDisplacementRange< NDIM >::PointPattern = Vector<std::optional<Translation>, NDIM>

◆ SurfaceThickness

template<std::size_t NDIM>
using madness::BoxSurfaceDisplacementRange< NDIM >::SurfaceThickness = std::array<std::optional<Translation>, NDIM>
private

◆ Validator

template<std::size_t NDIM>
using madness::BoxSurfaceDisplacementRange< NDIM >::Validator = BoxSurfaceDisplacementValidator<NDIM>

Constructor & Destructor Documentation

◆ BoxSurfaceDisplacementRange()

template<std::size_t NDIM>
madness::BoxSurfaceDisplacementRange< NDIM >::BoxSurfaceDisplacementRange ( const Key< NDIM > & center,
const std::array< std::optional< std::int64_t >, NDIM > & box_radius,
const std::array< std::optional< std::int64_t >, NDIM > & surface_thickness,
const array_of_bools< NDIM > & is_lattice_summed,
std::optional< Validator > validator = {} )
inlineexplicit

Constructs a box with different radii and thicknesses for each dimension.

Parameters
centerCenter primitive box of the box. All displacements will share the n of this arg.
box_radiusBox radius in each dimension, in half-SimulationCells. Omit for dim i to signal that the bound for dim i is simply the simulation cell.
surface_thicknessSurface thickness in each dimension, measured in number of addl. boxes on each half of the surface box proper. Omit for dim i if and only if omitted in box_radius
is_lattice_summedwhether each dimension is lattice summed; along lattice summed dimensions only one side of the box is iterated over.
validatorOptional filter (if returns false, displacement is dropped; default: no filter); it also maps displacements along lattice-summed axes into the simulation cell, and carries the real-space reach of the standard displacements it filters out as duplicates, outside of which the probing displacements are placed. Its lattice-summation flags must match is_lattice_summed. If omitted (or if it carries no reach) nothing is known to be filtered out: the surface then reaches all the way in to center, and the probes fall back to the on-site displacement, which screens nothing.
Precondition
surface_radius[d]>0 && surface_thickness[d]<=surface_radius[d]

References box_radius(), center(), is_lattice_summed(), NDIM, and surface_thickness().

Referenced by madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::Iterator().

Member Function Documentation

◆ begin()

template<std::size_t NDIM>
auto madness::BoxSurfaceDisplacementRange< NDIM >::begin ( ) const
inline

Returns an iterator to the beginning of the surface points.

Returns
Iterator pointing to the first surface point

References madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::Begin, and Iterator.

Referenced by main().

◆ box_radius()

template<std::size_t NDIM>
const std::array< std::optional< int64_t >, NDIM > & madness::BoxSurfaceDisplacementRange< NDIM >::box_radius ( ) const
inline
Returns
the radius of the box in each dimension

References box_radius_, and NDIM.

Referenced by BoxSurfaceDisplacementRange().

◆ center()

template<std::size_t NDIM>
const Key< NDIM > & madness::BoxSurfaceDisplacementRange< NDIM >::center ( ) const
inline

Returns a view over the surface points.

This operator allows the class to be used with C++20 ranges.

Returns
A view over the surface points

References center_.

Referenced by BoxSurfaceDisplacementRange().

◆ compute_probing_displacement()

template<std::size_t NDIM>
Displacement madness::BoxSurfaceDisplacementRange< NDIM >::compute_probing_displacement ( const size_t face_dimension) const
inlineprivate

◆ end()

template<std::size_t NDIM>
auto madness::BoxSurfaceDisplacementRange< NDIM >::end ( ) const
inline

Returns an iterator to the end of the surface points.

Returns
Iterator indicating the end of iteration

References madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::End, and Iterator.

Referenced by main().

◆ face_skipped()

template<std::size_t NDIM>
bool madness::BoxSurfaceDisplacementRange< NDIM >::face_skipped ( size_t face_dimension) const
inline
Returns
whether the faces normal to face_dimension are excluded from iteration

References skip_face_.

◆ is_lattice_summed()

template<std::size_t NDIM>
const array_of_bools< NDIM > & madness::BoxSurfaceDisplacementRange< NDIM >::is_lattice_summed ( ) const
inline
Returns
flags indicating whether each dimension is lattice summed

References is_lattice_summed_.

Referenced by BoxSurfaceDisplacementRange().

◆ probing_displacement()

template<std::size_t NDIM>
const Displacement & madness::BoxSurfaceDisplacementRange< NDIM >::probing_displacement ( size_t face_dimension) const
inline
Parameters
face_dimensiona dimension with finite radius; its faces are the pair of hyperplanes normal to it at -radius and +radius (which lattice summation folds onto each other)
Returns
"probing" displacement to a nearby point on the faces normal to face_dimension; it may not necessarily be in the range of iteration (e.g., it may not be able to pass the filter) but, among the displacements those faces contribute, it errs toward the largest norm, so that a decaying kernel can be screened with it. One probe serves both faces since the real-space distance of a displacement depends on its magnitude along each axis only.

References MADNESS_ASSERT, NDIM, and probing_displacements_.

◆ probing_displacements()

template<std::size_t NDIM>
const std::array< std::optional< Displacement >, NDIM > & madness::BoxSurfaceDisplacementRange< NDIM >::probing_displacements ( ) const
inline
Returns
probing displacements for the faces normal to every dimension; null for dimensions of unlimited size, which have no faces
See also
probing_displacement()

References NDIM, and probing_displacements_.

◆ skip_face()

template<std::size_t NDIM>
void madness::BoxSurfaceDisplacementRange< NDIM >::skip_face ( size_t face_dimension)
inline

Excludes the faces normal to face_dimension (both, if not lattice summed) from iteration, e.g. because their probing displacement showed their contributions to be negligible. The edge boxes they share with faces that are not skipped are still visited through those faces, i.e. a box is visited iff it lies on at least one face that is not skipped.

Parameters
face_dimensiona dimension with finite radius
Precondition
no iterator has been obtained from this object yet

References box_radius_, MADNESS_ASSERT, NDIM, and skip_face_.

◆ surface_thickness()

template<std::size_t NDIM>
const std::array< std::optional< int64_t >, NDIM > & madness::BoxSurfaceDisplacementRange< NDIM >::surface_thickness ( ) const
inline
Returns
the surface thickness in each dimension

References NDIM, and surface_thickness_.

Referenced by BoxSurfaceDisplacementRange().

◆ Iterator

template<std::size_t NDIM>
friend class Iterator
friend

Referenced by begin(), and end().

Member Data Documentation

◆ box_

template<std::size_t NDIM>
Box madness::BoxSurfaceDisplacementRange< NDIM >::box_
private

box bounds in each dimension.

Referenced by compute_probing_displacement().

◆ box_radius_

template<std::size_t NDIM>
BoxRadius madness::BoxSurfaceDisplacementRange< NDIM >::box_radius_
private

halved size of the box in each dimension, in half-SimulationCells.

Referenced by box_radius(), compute_probing_displacement(), and skip_face().

◆ center_

template<std::size_t NDIM>
Point madness::BoxSurfaceDisplacementRange< NDIM >::center_
private

◆ hollowness_

template<std::size_t NDIM>
Hollowness madness::BoxSurfaceDisplacementRange< NDIM >::hollowness_
private

does box contain non-surface points along each dimension?

◆ initial_bounds_

template<std::size_t NDIM>
Box madness::BoxSurfaceDisplacementRange< NDIM >::initial_bounds_
private

bounds of the boxes to be iterated over, before any face is processed: the box plus its surface thickness, or, along a lattice-summed dimension, one period ending at the top layer (so that each equivalence class of boxes appears exactly once)

◆ is_lattice_summed_

template<std::size_t NDIM>
Periodicity madness::BoxSurfaceDisplacementRange< NDIM >::is_lattice_summed_
private

which dimensions are lattice summed?

Referenced by compute_probing_displacement(), and is_lattice_summed().

◆ probing_displacements_

template<std::size_t NDIM>
std::array<std::optional<Displacement>, NDIM> madness::BoxSurfaceDisplacementRange< NDIM >::probing_displacements_
private

for each finite-radius dimension, a displacement to a nearby point on the faces normal to it (the pair of hyperplanes at -radius and +radius, which lattice summation folds onto each other); it may not be able to pass the filter, but among the displacements those faces contribute it errs toward the largest norm, so that a decaying kernel can be screened with it

Referenced by probing_displacement(), and probing_displacements().

◆ skip_face_

template<std::size_t NDIM>
std::array<bool, NDIM> madness::BoxSurfaceDisplacementRange< NDIM >::skip_face_ {}
private

faces excluded from iteration (see skip_face())

Referenced by face_skipped(), and skip_face().

◆ surface_thickness_

template<std::size_t NDIM>
SurfaceThickness madness::BoxSurfaceDisplacementRange< NDIM >::surface_thickness_
private

surface thickness in each dimension, measured in boxes. Real-space surface size is thus n-dependent.

Referenced by compute_probing_displacement(), and surface_thickness().

◆ validator_

template<std::size_t NDIM>
std::optional<Validator> madness::BoxSurfaceDisplacementRange< NDIM >::validator_
private

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