MADNESS 0.10.1
madness::FunctionCommonData< T, NDIM > Class Template Reference

FunctionCommonData holds all Function data common for given k. More...

#include <function_common_data.h>

Collaboration diagram for madness::FunctionCommonData< T, NDIM >:

Public Types

typedef Tensor< T > tensorT
 Type of tensor used to hold coeff.

Static Public Member Functions

static void _init_quadrature (int k, int npt, Tensor< double > &quad_x, Tensor< double > &quad_w, Tensor< double > &quad_phi, Tensor< double > &quad_phiw, Tensor< double > &quad_phit)
 Initialize the quadrature information.
static const FunctionCommonData< T, NDIM > & get (int k)

Public Attributes

Tensor< double > g0
Tensor< double > g0T
Tensor< double > g1
 The separate blocks of twoscale coefficients.
Tensor< double > g1T
 The separate blocks of twoscale coefficients.
Tensor< double > h0
Tensor< double > h0T
Tensor< double > h1
Tensor< double > h1T
Tensor< double > hg
Tensor< double > hgsonly
 hg[0:k,:]
Tensor< double > hgT
 The full twoscale coeff (2k,2k) and transpose.
int k
 order of the wavelet
Key< NDIM > key0
 Key for root node.
int npt
 no. of quadrature points
Tensor< double > quad_phi
 quad_phi(i,j) = at x[i] value of phi[j]
Tensor< double > quad_phit
 transpose of quad_phi
Tensor< double > quad_phiw
 quad_phiw(i,j) = at x[i] value of w[i]*phi[j]
Tensor< double > quad_w
 quadrature weights
Tensor< double > quad_x
 quadrature points
Slice s [4]
 s[0]=Slice(0,k-1), s[1]=Slice(k,2*k-1), etc.
std::vector< Slice > s0
 s[0] in each dimension to get scaling coeff
std::vector< Slice > sh
 Slice(0,(k-1)/2) in each dimension for autorefine test.
std::vector< long > v2k
 (2k,...) used to initialize Tensors
std::vector< long > vk
 (k,...) used to initialize Tensors
std::vector< long > vq
 (npt,...) used to initialize Tensors

Private Member Functions

 FunctionCommonData (int k)
 Private. Do first use initialization via get.
void _init_twoscale ()
 Private. Initialize the twoscale coefficients.

Static Private Attributes

static const FunctionCommonData< T, NDIM > * data [MAXK]

Detailed Description

template<typename T, std::size_t NDIM>
class madness::FunctionCommonData< T, NDIM >

FunctionCommonData holds all Function data common for given k.

Since Function assignment and copy constructors are shallow it greatly simplifies maintaining consistent state to have all (permanent) state encapsulated in a single class. The state is shared between instances using a shared_ptr. Also, separating shared from instance specific state accelerates the constructor, which is important for massive parallelism, and permitting inexpensive use of temporaries. The default copy constructor and assignment operator are used but are probably never invoked.

Member Typedef Documentation

◆ tensorT

template<typename T, std::size_t NDIM>
typedef Tensor<T> madness::FunctionCommonData< T, NDIM >::tensorT

Type of tensor used to hold coeff.

Constructor & Destructor Documentation

◆ FunctionCommonData()

template<typename T, std::size_t NDIM>
madness::FunctionCommonData< T, NDIM >::FunctionCommonData ( int k)
inlineprivate

Private. Do first use initialization via get.

References _init_quadrature(), _init_twoscale(), k, key0, NDIM, npt, quad_phi, quad_phit, quad_phiw, quad_w, quad_x, s, s0, sh, v2k, vk, and vq.

Referenced by get().

Member Function Documentation

◆ _init_quadrature()

template<typename T, std::size_t NDIM>
void madness::FunctionCommonData< T, NDIM >::_init_quadrature ( int k,
int npt,
Tensor< double > & quad_x,
Tensor< double > & quad_w,
Tensor< double > & quad_phi,
Tensor< double > & quad_phiw,
Tensor< double > & quad_phit )
static

◆ _init_twoscale()

template<typename T, std::size_t NDIM>
void madness::FunctionCommonData< T, NDIM >::_init_twoscale ( )
private

Private. Initialize the twoscale coefficients.

References madness::_(), _init_twoscale(), copy(), g0, g0T, g1, g1T, h0, h0T, h1, h1T, hg, hgsonly, hgT, k, madness::transpose(), and madness::two_scale_hg().

Referenced by FunctionCommonData(), and _init_twoscale().

◆ get()

Member Data Documentation

◆ data

template<typename T, std::size_t NDIM>
const FunctionCommonData<T, NDIM>* madness::FunctionCommonData< T, NDIM >::data[MAXK]
staticprivate

Referenced by get().

◆ g0

template<typename T, std::size_t NDIM>
Tensor<double> madness::FunctionCommonData< T, NDIM >::g0

Referenced by _init_twoscale().

◆ g0T

template<typename T, std::size_t NDIM>
Tensor<double> madness::FunctionCommonData< T, NDIM >::g0T

Referenced by _init_twoscale().

◆ g1

template<typename T, std::size_t NDIM>
Tensor<double> madness::FunctionCommonData< T, NDIM >::g1

The separate blocks of twoscale coefficients.

Referenced by _init_twoscale().

◆ g1T

template<typename T, std::size_t NDIM>
Tensor<double> madness::FunctionCommonData< T, NDIM >::g1T

The separate blocks of twoscale coefficients.

Referenced by _init_twoscale().

◆ h0

template<typename T, std::size_t NDIM>
Tensor<double> madness::FunctionCommonData< T, NDIM >::h0

Referenced by _init_twoscale().

◆ h0T

template<typename T, std::size_t NDIM>
Tensor<double> madness::FunctionCommonData< T, NDIM >::h0T

Referenced by _init_twoscale().

◆ h1

template<typename T, std::size_t NDIM>
Tensor<double> madness::FunctionCommonData< T, NDIM >::h1

Referenced by _init_twoscale().

◆ h1T

template<typename T, std::size_t NDIM>
Tensor<double> madness::FunctionCommonData< T, NDIM >::h1T

Referenced by _init_twoscale().

◆ hg

template<typename T, std::size_t NDIM>
Tensor<double> madness::FunctionCommonData< T, NDIM >::hg

Referenced by _init_twoscale().

◆ hgsonly

template<typename T, std::size_t NDIM>
Tensor<double> madness::FunctionCommonData< T, NDIM >::hgsonly

hg[0:k,:]

Referenced by _init_twoscale().

◆ hgT

template<typename T, std::size_t NDIM>
Tensor<double> madness::FunctionCommonData< T, NDIM >::hgT

The full twoscale coeff (2k,2k) and transpose.

Referenced by _init_twoscale().

◆ k

template<typename T, std::size_t NDIM>
int madness::FunctionCommonData< T, NDIM >::k

order of the wavelet

Referenced by FunctionCommonData(), _init_quadrature(), _init_twoscale(), and get().

◆ key0

template<typename T, std::size_t NDIM>
Key<NDIM> madness::FunctionCommonData< T, NDIM >::key0

Key for root node.

Referenced by FunctionCommonData().

◆ npt

template<typename T, std::size_t NDIM>
int madness::FunctionCommonData< T, NDIM >::npt

no. of quadrature points

Referenced by FunctionCommonData(), and _init_quadrature().

◆ quad_phi

template<typename T, std::size_t NDIM>
Tensor<double> madness::FunctionCommonData< T, NDIM >::quad_phi

quad_phi(i,j) = at x[i] value of phi[j]

Referenced by FunctionCommonData(), and _init_quadrature().

◆ quad_phit

template<typename T, std::size_t NDIM>
Tensor<double> madness::FunctionCommonData< T, NDIM >::quad_phit

◆ quad_phiw

template<typename T, std::size_t NDIM>
Tensor<double> madness::FunctionCommonData< T, NDIM >::quad_phiw

◆ quad_w

template<typename T, std::size_t NDIM>
Tensor<double> madness::FunctionCommonData< T, NDIM >::quad_w

quadrature weights

Referenced by FunctionCommonData(), and _init_quadrature().

◆ quad_x

template<typename T, std::size_t NDIM>
Tensor<double> madness::FunctionCommonData< T, NDIM >::quad_x

◆ s

template<typename T, std::size_t NDIM>
Slice madness::FunctionCommonData< T, NDIM >::s[4]

s[0]=Slice(0,k-1), s[1]=Slice(k,2*k-1), etc.

Referenced by FunctionCommonData().

◆ s0

template<typename T, std::size_t NDIM>
std::vector<Slice> madness::FunctionCommonData< T, NDIM >::s0

◆ sh

template<typename T, std::size_t NDIM>
std::vector<Slice> madness::FunctionCommonData< T, NDIM >::sh

Slice(0,(k-1)/2) in each dimension for autorefine test.

Referenced by FunctionCommonData().

◆ v2k

template<typename T, std::size_t NDIM>
std::vector<long> madness::FunctionCommonData< T, NDIM >::v2k

(2k,...) used to initialize Tensors

Referenced by FunctionCommonData().

◆ vk

◆ vq

template<typename T, std::size_t NDIM>
std::vector<long> madness::FunctionCommonData< T, NDIM >::vq

(npt,...) used to initialize Tensors

Referenced by FunctionCommonData().


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