Loading [MathJax]/extensions/TeX/AMSsymbols.js
SIRIUS 7.5.0
Electronic structure library and applications
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
sirius::Spheric_function< domain_t, T > Class Template Reference

Function in spherical harmonics or spherical coordinates representation. More...

#include <spheric_function.hpp>

Inherits sirius::sddk::mdarray< std::complex< double >, 2 >.

Public Member Functions

 Spheric_function ()
 Constructor of the empty function. More...
 
 Spheric_function (int angular_domain_size__, Radial_grid< double > const &radial_grid__)
 Constructor. More...
 
 Spheric_function (T *ptr__, int angular_domain_size__, Radial_grid< double > const &radial_grid__)
 Constructor. More...
 
 Spheric_function (sddk::memory_pool &mp__, int angular_domain_size__, Radial_grid< double > const &radial_grid__)
 Constructor. More...
 
 Spheric_function (Spheric_function< domain_t, T > &&src__)
 Move constructor. More...
 
Spheric_function< domain_t, T > & operator= (Spheric_function< domain_t, T > &&src__)
 Move asigment operator. More...
 
Spheric_function< domain_t, T > & operator+= (Spheric_function< domain_t, T > const &rhs__)
 
Spheric_function< domain_t, T > & operator+= (Spheric_function< domain_t, T > &&rhs__)
 
Spheric_function< domain_t, T > & operator-= (Spheric_function< domain_t, T > const &rhs__)
 
Spheric_function< domain_t, T > & operator-= (Spheric_function< domain_t, T > &&rhs__)
 
Spheric_function< domain_t, T > & operator*= (double alpha__)
 Multiply by a constant. More...
 
int angular_domain_size () const
 
auto const & radial_grid () const
 
auto component (int lm__) const
 
value (double theta__, double phi__, int jr__, double dr__) const
 
- Public Member Functions inherited from sirius::sddk::mdarray< std::complex< double >, 2 >
 mdarray ()
 Default constructor. More...
 
 mdarray (std::array< mdarray_index_descriptor, N > const dims__, memory_t memory__=memory_t::host, std::string label__="")
 N-dimensional array with index bounds. More...
 
 mdarray (mdarray_index_descriptor const &d0, memory_t memory__=memory_t::host, std::string label__="")
 1D array with memory allocation. More...
 
 mdarray (mdarray_index_descriptor const &d0, memory_pool &mp__, std::string label__="")
 1D array with memory pool allocation. More...
 
 mdarray (std::complex< double > *ptr__, mdarray_index_descriptor const &d0, std::string label__="")
 1D array with host pointer wrapper. More...
 
 mdarray (std::complex< double > *ptr__, std::complex< double > *ptr_device__, mdarray_index_descriptor const &d0, std::string label__="")
 1D array with host and device pointer wrapper. More...
 
 mdarray (mdarray_index_descriptor const &d0, mdarray_index_descriptor const &d1, memory_t memory__=memory_t::host, std::string label__="")
 2D array with memory allocation. More...
 
 mdarray (mdarray_index_descriptor const &d0, mdarray_index_descriptor const &d1, mdarray_index_descriptor const &d2, memory_t memory__=memory_t::host, std::string label__="")
 3D array with memory allocation. More...
 
 mdarray (mdarray_index_descriptor const &d0, mdarray_index_descriptor const &d1, mdarray_index_descriptor const &d2, mdarray_index_descriptor const &d3, memory_t memory__=memory_t::host, std::string label__="")
 4D array with memory allocation. More...
 
 mdarray (mdarray_index_descriptor const &d0, mdarray_index_descriptor const &d1, mdarray_index_descriptor const &d2, mdarray_index_descriptor const &d3, mdarray_index_descriptor const &d4, memory_t memory__=memory_t::host, std::string label__="")
 5D array with memory allocation. More...
 
 mdarray (mdarray_index_descriptor const &d0, mdarray_index_descriptor const &d1, mdarray_index_descriptor const &d2, mdarray_index_descriptor const &d3, mdarray_index_descriptor const &d4, mdarray_index_descriptor const &d5, memory_t memory__=memory_t::host, std::string label__="")
 6D array with memory allocation. More...
 
 mdarray (std::complex< double > *ptr__, mdarray_index_descriptor const &d0, mdarray_index_descriptor const &d1, std::string label__="")
 Wrap a pointer into 2D array. More...
 
 mdarray (std::complex< double > *ptr__, std::complex< double > *ptr_device__, mdarray_index_descriptor const &d0, mdarray_index_descriptor const &d1, std::string label__="")
 
 mdarray (mdarray_index_descriptor const &d0, mdarray_index_descriptor const &d1, memory_pool &mp__, std::string label__="")
 2D array with memory pool allocation. More...
 
 mdarray (std::complex< double > *ptr__, mdarray_index_descriptor const &d0, mdarray_index_descriptor const &d1, mdarray_index_descriptor const &d2, std::string label__="")
 
 mdarray (std::complex< double > *ptr__, std::complex< double > *ptr_device__, mdarray_index_descriptor const &d0, mdarray_index_descriptor const &d1, mdarray_index_descriptor const &d2, std::string label__="")
 
 mdarray (mdarray_index_descriptor const &d0, mdarray_index_descriptor const &d1, mdarray_index_descriptor const &d2, memory_pool &mp__, std::string label__="")
 3D array with memory pool allocation. More...
 
 mdarray (std::complex< double > *ptr__, mdarray_index_descriptor const &d0, mdarray_index_descriptor const &d1, mdarray_index_descriptor const &d2, mdarray_index_descriptor const &d3, std::string label__="")
 
 mdarray (std::complex< double > *ptr__, mdarray_index_descriptor const &d0, mdarray_index_descriptor const &d1, mdarray_index_descriptor const &d2, mdarray_index_descriptor const &d3, mdarray_index_descriptor const &d4, std::string label__="")
 
 mdarray (std::complex< double > *ptr__, mdarray_index_descriptor const &d0, mdarray_index_descriptor const &d1, mdarray_index_descriptor const &d2, mdarray_index_descriptor const &d3, mdarray_index_descriptor const &d4, mdarray_index_descriptor const &d5, std::string label__="")
 
 mdarray (mdarray< std::complex< double >, N > &&src)
 Move constructor. More...
 
mdarray< std::complex< double >, N > & operator= (mdarray< std::complex< double >, N > &&src)
 Move assignment operator. More...
 
mdarray< std::complex< double >, N > & operator= (std::function< std::complex< double >(void)> f__)
 
mdarray< std::complex< double >, N > & operator= (std::function< std::complex< double >(index_type)> f__)
 
mdarray< std::complex< double >, N > & operator= (std::function< std::complex< double >(index_type, index_type)> f__)
 
 ~mdarray ()
 Destructor. More...
 
mdarray< std::complex< double >, N > & allocate (memory_t memory__)
 Allocate memory for array. More...
 
mdarray< std::complex< double >, N > & allocate (memory_pool &mp__)
 Allocate memory from the pool. More...
 
void deallocate (memory_t memory__)
 Deallocate host or device memory. More...
 
std::complex< double > const & operator() (Args... args) const
 Access operator() for the elements of multidimensional array. More...
 
std::complex< double > & operator() (Args... args)
 Access operator() for the elements of multidimensional array. More...
 
std::complex< double > const & operator[] (size_t const idx__) const
 Access operator[] for the elements of multidimensional array using a linear index in the range [0, size). More...
 
std::complex< double > & operator[] (size_t const idx__)
 Access operator[] for the elements of multidimensional array using a linear index in the range [0, size). More...
 
std::complex< double > const * at (memory_t mem__, Args... args) const
 
std::complex< double > * at (memory_t mem__, Args... args)
 
std::complex< double > const * at (memory_t mem__) const
 Return pointer to the beginning of array. More...
 
std::complex< double > * at (memory_t mem__)
 Return pointer to the beginning of array. More...
 
std::complex< double > * host_data ()
 
const std::complex< double > * host_data () const
 
std::complex< double > * device_data ()
 
const std::complex< double > * device_data () const
 
size_t size () const
 Return total size (number of elements) of the array. More...
 
size_t size (int i) const
 Return size of particular dimension. More...
 
mdarray_index_descriptor dim (int i) const
 Return a descriptor of a dimension. More...
 
uint32_t ld () const
 Return leading dimension size. More...
 
uint64_t hash (uint64_t h__=5381) const
 Compute hash of the array. More...
 
std::complex< double > checksum_w (size_t idx0__, size_t size__) const
 Compute weighted checksum. More...
 
std::complex< double > checksum (size_t idx0__, size_t size__) const
 Compute checksum. More...
 
std::complex< double > checksum () const
 
std::complex< double > * begin ()
 
std::complex< double > const * begin () const
 
std::complex< double > * end ()
 
std::complex< double > const * end () const
 
void zero (memory_t mem__, size_t idx0__, size_t n__)
 Zero n elements starting from idx0. More...
 
void zero (memory_t mem__=memory_t::host)
 Zero the entire array. More...
 
void copy_to (memory_t mem__, size_t idx0__, size_t n__, acc::stream_id sid=acc::stream_id(-1))
 Copy n elements starting from idx0 from one memory type to another. More...
 
void copy_to (memory_t mem__, acc::stream_id sid=acc::stream_id(-1))
 Copy entire array from one memory type to another. More...
 
bool on_device () const
 Check if device pointer is available. More...
 
auto label () const
 
bool on_host () const
 

Private Member Functions

 Spheric_function (Spheric_function< domain_t, T > const &src__)=delete
 
Spheric_function< domain_t, T > & operator= (Spheric_function< domain_t, T > const &src__)=delete
 

Private Attributes

Radial_grid< double > const * radial_grid_ {nullptr}
 Radial grid. More...
 
int angular_domain_size_
 Size of the angular domain. More...
 

Additional Inherited Members

- Public Types inherited from sirius::sddk::mdarray< std::complex< double >, 2 >
using index_type = mdarray_index_descriptor::index_type
 

Detailed Description

template<function_domain_t domain_t, typename T = std::complex<double>>
class sirius::Spheric_function< domain_t, T >

Function in spherical harmonics or spherical coordinates representation.

This class works in conjugation with SHT class which provides the transformation between spherical harmonics and spherical coordinates and also a conversion between real and complex spherical harmonics.

Definition at line 43 of file spheric_function.hpp.

Constructor & Destructor Documentation

◆ Spheric_function() [1/5]

template<function_domain_t domain_t, typename T = std::complex<double>>
sirius::Spheric_function< domain_t, T >::Spheric_function ( )
inline

Constructor of the empty function.

Definition at line 63 of file spheric_function.hpp.

◆ Spheric_function() [2/5]

template<function_domain_t domain_t, typename T = std::complex<double>>
sirius::Spheric_function< domain_t, T >::Spheric_function ( int  angular_domain_size__,
Radial_grid< double > const &  radial_grid__ 
)
inline

Constructor.

Definition at line 68 of file spheric_function.hpp.

◆ Spheric_function() [3/5]

template<function_domain_t domain_t, typename T = std::complex<double>>
sirius::Spheric_function< domain_t, T >::Spheric_function ( T *  ptr__,
int  angular_domain_size__,
Radial_grid< double > const &  radial_grid__ 
)
inline

Constructor.

Definition at line 76 of file spheric_function.hpp.

◆ Spheric_function() [4/5]

template<function_domain_t domain_t, typename T = std::complex<double>>
sirius::Spheric_function< domain_t, T >::Spheric_function ( sddk::memory_pool mp__,
int  angular_domain_size__,
Radial_grid< double > const &  radial_grid__ 
)
inline

Constructor.

Definition at line 84 of file spheric_function.hpp.

◆ Spheric_function() [5/5]

template<function_domain_t domain_t, typename T = std::complex<double>>
sirius::Spheric_function< domain_t, T >::Spheric_function ( Spheric_function< domain_t, T > &&  src__)
inline

Move constructor.

Definition at line 92 of file spheric_function.hpp.

Member Function Documentation

◆ operator=()

template<function_domain_t domain_t, typename T = std::complex<double>>
Spheric_function< domain_t, T > & sirius::Spheric_function< domain_t, T >::operator= ( Spheric_function< domain_t, T > &&  src__)
inline

Move asigment operator.

Definition at line 100 of file spheric_function.hpp.

◆ operator+=() [1/2]

template<function_domain_t domain_t, typename T = std::complex<double>>
Spheric_function< domain_t, T > & sirius::Spheric_function< domain_t, T >::operator+= ( Spheric_function< domain_t, T > const &  rhs__)
inline

Definition at line 110 of file spheric_function.hpp.

◆ operator+=() [2/2]

template<function_domain_t domain_t, typename T = std::complex<double>>
Spheric_function< domain_t, T > & sirius::Spheric_function< domain_t, T >::operator+= ( Spheric_function< domain_t, T > &&  rhs__)
inline

Definition at line 120 of file spheric_function.hpp.

◆ operator-=() [1/2]

template<function_domain_t domain_t, typename T = std::complex<double>>
Spheric_function< domain_t, T > & sirius::Spheric_function< domain_t, T >::operator-= ( Spheric_function< domain_t, T > const &  rhs__)
inline

Definition at line 131 of file spheric_function.hpp.

◆ operator-=() [2/2]

template<function_domain_t domain_t, typename T = std::complex<double>>
Spheric_function< domain_t, T > & sirius::Spheric_function< domain_t, T >::operator-= ( Spheric_function< domain_t, T > &&  rhs__)
inline

Definition at line 141 of file spheric_function.hpp.

◆ operator*=()

template<function_domain_t domain_t, typename T = std::complex<double>>
Spheric_function< domain_t, T > & sirius::Spheric_function< domain_t, T >::operator*= ( double  alpha__)
inline

Multiply by a constant.

Definition at line 152 of file spheric_function.hpp.

◆ angular_domain_size()

template<function_domain_t domain_t, typename T = std::complex<double>>
int sirius::Spheric_function< domain_t, T >::angular_domain_size ( ) const
inline

Definition at line 163 of file spheric_function.hpp.

◆ radial_grid()

template<function_domain_t domain_t, typename T = std::complex<double>>
auto const & sirius::Spheric_function< domain_t, T >::radial_grid ( ) const
inline

Definition at line 168 of file spheric_function.hpp.

◆ component()

template<function_domain_t domain_t, typename T = std::complex<double>>
auto sirius::Spheric_function< domain_t, T >::component ( int  lm__) const
inline

Definition at line 174 of file spheric_function.hpp.

◆ value()

template<function_domain_t domain_t, typename T = std::complex<double>>
T sirius::Spheric_function< domain_t, T >::value ( double  theta__,
double  phi__,
int  jr__,
double  dr__ 
) const
inline

Definition at line 188 of file spheric_function.hpp.

Member Data Documentation

◆ radial_grid_

template<function_domain_t domain_t, typename T = std::complex<double>>
Radial_grid<double> const* sirius::Spheric_function< domain_t, T >::radial_grid_ {nullptr}
private

Radial grid.

Definition at line 48 of file spheric_function.hpp.

◆ angular_domain_size_

template<function_domain_t domain_t, typename T = std::complex<double>>
int sirius::Spheric_function< domain_t, T >::angular_domain_size_
private

Size of the angular domain.

This is either a total number of spherical harmonics or a number of (theta, phi) anles covering the sphere.

Definition at line 52 of file spheric_function.hpp.


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