36#ifndef FUNCTIONCOMMONDATA_H_
37#define FUNCTIONCOMMONDATA_H_
51 template<
typename T, std::
size_t NDIM>
64 for (
int i = 0; i < 4; ++i)
65 s[i] =
Slice(i *
k, (i + 1) *
k - 1);
66 s0 = std::vector<Slice>(
NDIM);
67 sh = std::vector<Slice>(
NDIM);
68 vk = std::vector<long>(
NDIM);
69 vq = std::vector<long>(
NDIM);
71 for (std::size_t i = 0; i <
NDIM; ++i) {
91 std::vector<Slice>
s0;
92 std::vector<Slice>
sh;
94 std::vector<long>
v2k;
134 template<
typename T, std::
size_t NDIM>
187 bool found=map2.
find(acc, -10);
191 [[maybe_unused]]
auto&& [it, inserted] = map2.
insert(std::pair<int,double>(-10,time));
196 if (time<0.1) ilog=-1;
197 else if (time<1.0) ilog=0;
198 else if (time<10.0) ilog=1;
199 else if (time<100.0) ilog=2;
202 found=map2.
find(acc, ilog);
206 [[maybe_unused]]
auto&& [it, inserted] = map2.
insert(std::pair<int,long>(ilog,1));
216 void print(std::string line=
"")
const {
221 bool found=
data.find(acc, -10);
224 found=
data.find(acc, -1);
226 found=
data.find(acc, 0);
228 found=
data.find(acc, 1);
230 found=
data.find(acc, 2);
232 found=
data.find(acc, 3);
Definition worldhashmap.h:396
std::pair< iterator, bool > insert(const datumT &datum)
Definition worldhashmap.h:468
iterator find(const keyT &key)
Definition worldhashmap.h:524
void clear()
Definition worldhashmap.h:556
FunctionCommonData holds all Function data common for given k.
Definition function_common_data.h:52
std::vector< Slice > sh
Slice(0,(k-1)/2) in each dimension for autorefine test.
Definition function_common_data.h:92
Tensor< double > g1
The separate blocks of twoscale coefficients.
Definition function_common_data.h:105
Tensor< double > quad_phit
transpose of quad_phi
Definition function_common_data.h:102
Tensor< double > quad_phi
quad_phi(i,j) = at x[i] value of phi[j]
Definition function_common_data.h:101
Tensor< double > h0T
Definition function_common_data.h:106
std::vector< long > v2k
(2k,...) used to initialize Tensors
Definition function_common_data.h:94
FunctionCommonData(int k)
Private. Do first use initialization via get.
Definition function_common_data.h:61
Tensor< double > quad_phiw
quad_phiw(i,j) = at x[i] value of w[i]*phi[j]
Definition function_common_data.h:103
std::vector< long > vk
(k,...) used to initialize Tensors
Definition function_common_data.h:93
Tensor< T > tensorT
Type of tensor used to hold coeff.
Definition function_common_data.h:86
int npt
no. of quadrature points
Definition function_common_data.h:89
Tensor< double > g0
Definition function_common_data.h:105
Tensor< double > g1T
The separate blocks of twoscale coefficients.
Definition function_common_data.h:106
Tensor< double > hgT
The full twoscale coeff (2k,2k) and transpose.
Definition function_common_data.h:107
Tensor< double > quad_w
quadrature weights
Definition function_common_data.h:100
std::vector< Slice > s0
s[0] in each dimension to get scaling coeff
Definition function_common_data.h:91
Slice s[4]
s[0]=Slice(0,k-1), s[1]=Slice(k,2*k-1), etc.
Definition function_common_data.h:90
Tensor< double > h0
Definition function_common_data.h:105
std::vector< long > vq
(npt,...) used to initialize Tensors
Definition function_common_data.h:95
int k
order of the wavelet
Definition function_common_data.h:88
static const FunctionCommonData< T, NDIM > & get(int k)
Definition function_common_data.h:111
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.
Definition mraimpl.h:88
Tensor< double > hg
Definition function_common_data.h:107
Key< NDIM > key0
Key for root node.
Definition function_common_data.h:97
Tensor< double > hgsonly
hg[0:k,:]
Definition function_common_data.h:108
Tensor< double > quad_x
quadrature points
Definition function_common_data.h:99
Tensor< double > h1T
Definition function_common_data.h:106
Tensor< double > g0T
Definition function_common_data.h:106
Tensor< double > h1
Definition function_common_data.h:105
void _init_twoscale()
Private. Initialize the twoscale coefficients.
Definition mraimpl.h:67
collect common functionality does not need to be member function of funcimpl
Definition function_common_data.h:135
GenTensor< T > values2coeffs(const Key< NDIM > &key, const GenTensor< T > &values) const
Definition function_common_data.h:160
const FunctionCommonData< T, NDIM > & cdata
Definition function_common_data.h:138
Tensor< T > coeffs2values(const Key< NDIM > &key, const Tensor< T > &coeff) const
Definition function_common_data.h:147
GenTensor< T > coeffs2values(const Key< NDIM > &key, const GenTensor< T > &coeff) const
Definition function_common_data.h:142
FunctionCommonFunctionality(const long k)
Definition function_common_data.h:140
Tensor< T > values2coeffs(const Key< NDIM > &key, const Tensor< T > &values) const
Definition function_common_data.h:155
FunctionCommonFunctionality(const FunctionCommonData< T, NDIM > &cdata)
Definition function_common_data.h:139
FunctionDefaults holds default paramaters as static class members.
Definition funcdefaults.h:204
Definition lowranktensor.h:59
Definition worldhashmap.h:330
Key is the index for a node of the 2^NDIM-tree.
Definition key.h:66
Level level() const
Definition key.h:159
A slice defines a sub-range or patch of a dimension.
Definition slice.h:103
A tensor is a multidimension array.
Definition tensor.h:317
Definition function_common_data.h:169
Timer()
start timer
Definition function_common_data.h:179
void print(std::string line="") const
print timer
Definition function_common_data.h:216
map data
Definition function_common_data.h:174
void accumulate(const double time) const
accumulate timer
Definition function_common_data.h:183
ConcurrentHashMap< int, double > map
Definition function_common_data.h:171
void reset() const
Definition function_common_data.h:210
ConcurrentHashMap< int, double >::accessor accessor
Definition function_common_data.h:172
static const int itotal
Definition function_common_data.h:175
A simple, fixed dimension vector.
Definition vector.h:64
Provides FunctionDefaults and utilities for coordinate transformation.
auto T(World &world, response_space &f) -> response_space
Definition global_functions.cc:34
static double pow(const double *a, const double *b)
Definition lda.h:74
#define MADNESS_PRAGMA_CLANG(x)
Definition madness_config.h:200
#define MADNESS_ASSERT(condition)
Assert a condition that should be free of side-effects since in release builds this might be a no-op.
Definition madness_exception.h:134
Namespace for all elements and tools of MADNESS.
Definition DFParameters.h:10
response_space scale(response_space a, double b)
std::vector< Function< TENSOR_RESULT_TYPE(T, R), NDIM > > transform(World &world, const std::vector< Function< T, NDIM > > &v, const Tensor< R > &c, bool fence=true)
Transforms a vector of functions according to new[i] = sum[j] old[j]*c[j,i].
Definition vmra.h:689
static double pop(std::vector< double > &v)
Definition SCF.cc:113
void print(const T &t, const Ts &... ts)
Print items to std::cout (items separated by spaces) and terminate with a new line.
Definition print.h:225
static const int MAXK
The maximum wavelet order presently supported.
Definition funcdefaults.h:51
static const long k
Definition rk.cc:44
Definition test_ccpairfunction.cc:22
static const std::size_t NDIM
Definition testpdiff.cc:42