MADNESS 0.10.1
Public Types | Public Member Functions | Private Attributes | List of all members
madness::BoxSurfaceDisplacementFilter< NDIM > Class Template Reference

#include <displacements.h>

Collaboration diagram for madness::BoxSurfaceDisplacementFilter< NDIM >:
Collaboration graph
[legend]

Public Types

using Displacement = Key< NDIM >
 
using DistanceSquaredFunc = std::function< Translation(const Displacement &)>
 
using Periodicity = array_of_bools< NDIM >
 
using Point = Key< NDIM >
 
using PointPattern = Vector< std::optional< Translation >, NDIM >
 

Public Member Functions

 BoxSurfaceDisplacementFilter (const array_of_bools< NDIM > &domain_is_infinite, const array_of_bools< NDIM > &domain_is_periodic, const std::array< KernelRange, NDIM > &range, DistanceSquaredFunc default_distance_squared, Translation max_distsq_reached)
 
bool operator() (const Level level, const PointPattern &dest, std::optional< Displacement > &displacement) const
 Apply filter to a displacement ending up at a point or a group of points (point pattern)
 

Private Attributes

DistanceSquaredFunc default_distance_squared_
 
array_of_bools< NDIMdomain_is_infinite_
 
array_of_bools< NDIMdomain_is_periodic_
 
Translation max_distsq_reached_
 
std::array< KernelRange, NDIMrange_
 

Detailed Description

template<size_t NDIM>
class madness::BoxSurfaceDisplacementFilter< NDIM >

This is used to filter out box surface displacements that

Member Typedef Documentation

◆ Displacement

template<size_t NDIM>
using madness::BoxSurfaceDisplacementFilter< NDIM >::Displacement = Key<NDIM>

◆ DistanceSquaredFunc

template<size_t NDIM>
using madness::BoxSurfaceDisplacementFilter< NDIM >::DistanceSquaredFunc = std::function<Translation(const Displacement&)>

◆ Periodicity

template<size_t NDIM>
using madness::BoxSurfaceDisplacementFilter< NDIM >::Periodicity = array_of_bools<NDIM>

◆ Point

template<size_t NDIM>
using madness::BoxSurfaceDisplacementFilter< NDIM >::Point = Key<NDIM>

◆ PointPattern

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

Constructor & Destructor Documentation

◆ BoxSurfaceDisplacementFilter()

template<size_t NDIM>
madness::BoxSurfaceDisplacementFilter< NDIM >::BoxSurfaceDisplacementFilter ( const array_of_bools< NDIM > &  domain_is_infinite,
const array_of_bools< NDIM > &  domain_is_periodic,
const std::array< KernelRange, NDIM > &  range,
DistanceSquaredFunc  default_distance_squared,
Translation  max_distsq_reached 
)
inline
Parameters
domain_is_infinitewhether the domain along each axis is finite (simulation cell) or infinite (the entire axis); if true for a given axis then any destination coordinate is valid, else only values in [0,2^n) are valid
domain_is_periodicif true for a given axis, displacement to x and x+2^n are equivalent, hence will be canonicalized to end up in the simulation cell. Periodic axes imply infinite domain.
rangethe kernel range for each axis
default_distance_squaredfunction that converts a displacement to its effective distance squared (effective may be different from the real distance squared due to periodicity)
max_distsq_reachedmax effective distance squared reached by standard displacements

Member Function Documentation

◆ operator()()

template<size_t NDIM>
bool madness::BoxSurfaceDisplacementFilter< NDIM >::operator() ( const Level  level,
const PointPattern dest,
std::optional< Displacement > &  displacement 
) const
inline

Apply filter to a displacement ending up at a point or a group of points (point pattern)

Parameters
levelthe tree level
destthe target point (when all elements are nonnull) or point pattern (when only some are). The latter is useful to skip the entire surface layer. The point coordinates are only used to determine whether we end up in or out of the domain.
displacementthe optional displacement; if given then will check if it's among the standard displacement and whether it was used as part of the standard displacement set; if it has not been used and the operator is lattice summed, the displacement will be adjusted to end up in the simulation cell.
Returns
true if the displacement is to be used

References std::abs(), madness::Displacements< NDIM >::bmax_default(), d, madness::BoxSurfaceDisplacementFilter< NDIM >::default_distance_squared_, madness::displacement(), madness::BoxSurfaceDisplacementFilter< NDIM >::domain_is_infinite_, madness::BoxSurfaceDisplacementFilter< NDIM >::domain_is_periodic_, MADNESS_ASSERT, madness::BoxSurfaceDisplacementFilter< NDIM >::max_distsq_reached_, N, NDIM, and madness::BoxSurfaceDisplacementFilter< NDIM >::range_.

Member Data Documentation

◆ default_distance_squared_

template<size_t NDIM>
DistanceSquaredFunc madness::BoxSurfaceDisplacementFilter< NDIM >::default_distance_squared_
private

◆ domain_is_infinite_

template<size_t NDIM>
array_of_bools<NDIM> madness::BoxSurfaceDisplacementFilter< NDIM >::domain_is_infinite_
private

◆ domain_is_periodic_

template<size_t NDIM>
array_of_bools<NDIM> madness::BoxSurfaceDisplacementFilter< NDIM >::domain_is_periodic_
private

◆ max_distsq_reached_

template<size_t NDIM>
Translation madness::BoxSurfaceDisplacementFilter< NDIM >::max_distsq_reached_
private

◆ range_

template<size_t NDIM>
std::array<KernelRange, NDIM> madness::BoxSurfaceDisplacementFilter< NDIM >::range_
private

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