33#ifndef MADNESS_MRA_MW_H__INCLUDED
34#define MADNESS_MRA_MW_H__INCLUDED
48template <std::
size_t NDIM,
typename Enabler =
void>
67 :
L(
L), n(n), l(l),
k(
k), twon(1 << n), one_over_twon(1. / twon),
68 sqrt_twon(sqrt(twon)), one_over_twoL(0.5/
L), one_over_sqrttwoL(sqrt(one_over_twoL)) {
75 const auto x = (r[0] +
L)/(2 *
L);
77 if (x < l * one_over_twon || x > (l + 1) * one_over_twon)
83 return values[
k] * sqrt_twon * one_over_sqrttwoL;
91 return std::vector< Vector<double,1> >(1,
Vector<double,1>{-
L + 2*
L*std::max(l+0.5,0.) * one_over_twon});
95template <std::
size_t NDIM>
97 std::array<double, NDIM>
L;
99 std::array<int, NDIM>
k;
100 std::array<ScalingFunctionFunctor<1>,
NDIM>
sf1;
103 :
L(
L), key(key),
k(
k) {
104 for (
int d = 0;
d !=
NDIM; ++
d)
110 while (result != 0. &&
d <
NDIM) {
111 result *= sf1[
d]({r[
d]});
123 for (
int d = 0;
d !=
NDIM; ++
d) {
124 r[
d] = sf1[
d].special_points().
at(0)[0];
126 return std::vector<Vector<double, NDIM>>(1, r);
Abstract base class interface required for functors used as input to Functions.
Definition function_interface.h:68
Key is the index for a node of the 2^NDIM-tree.
Definition key.h:68
Level level() const
Definition key.h:161
A simple, fixed dimension vector.
Definition vector.h:64
constexpr reference at(size_type i)
Access element i of the Vector with bounds checking.
Definition vector.h:324
Provides typedefs to hide use of templates and to increase interoperability.
#define final(a, b, c)
Definition lookup3.c:153
Macros and tools pertaining to the configuration of MADNESS.
#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
void legendre_scaling_functions(double x, long k, double *p)
Evaluate the first k Legendre scaling functions.
Definition legendre.cc:85
int64_t Translation
Definition key.h:56
int Level
Definition key.h:57
static const double d
Definition nonlinschro.cc:121
static const double L
Definition rk.cc:46
static const long k
Definition rk.cc:44
ScalingFunctionFunctor()=default
Translation twon
Definition mw.h:57
virtual Level special_level() const final
Override this to change the minimum level of refinement at special points (default is 6)
Definition mw.h:86
Translation l
Definition mw.h:56
ScalingFunctionFunctor(double L, Level n, Translation l, int k)
Definition mw.h:66
virtual std::vector< Vector< double, 1 > > special_points() const final
Override this to return list of special points to be refined more deeply.
Definition mw.h:90
double one_over_twon
Definition mw.h:59
double operator()(const coord_1d &r) const final
Definition mw.h:74
double one_over_sqrttwoL
Definition mw.h:62
double sqrt_twon
Definition mw.h:60
double one_over_twoL
Definition mw.h:61
double operator()(const Vector< double, NDIM > &r) const final
You should implement this to return f(x)
Definition mw.h:107
std::array< double, NDIM > L
Definition mw.h:97
virtual std::vector< Vector< double, NDIM > > special_points() const final
Override this to return list of special points to be refined more deeply.
Definition mw.h:121
ScalingFunctionFunctor(const std::array< double, NDIM > &L, const Key< NDIM > &key, const std::array< int, NDIM > &k)
Definition mw.h:102
virtual Level special_level() const final
Override this to change the minimum level of refinement at special points (default is 6)
Definition mw.h:117
std::array< int, NDIM > k
Definition mw.h:99
Key< NDIM > key
Definition mw.h:98
std::array< ScalingFunctionFunctor< 1 >, NDIM > sf1
Definition mw.h:100
this FunctionFunctorInterface evaluates Legendre scaling functions
Definition mw.h:49
constexpr std::size_t NDIM
Definition testgconv.cc:54