|
MADNESS 0.10.1
|
#include <madness/mra/mra.h>#include <madness/mra/vmra.h>#include <madness/mra/operator.h>#include <madness/mra/legendre.h>#include <madness/world/test_utilities.h>#include <algorithm>#include <array>#include <cmath>#include <cstdio>#include <memory>#include <random>#include <string>#include <utility>#include <vector>
Classes | |
| class | Cusp |
| exp(-Z r), refined to level 15 at the origin: a nuclear cusp More... | |
| class | Gauss |
| exp(-a |r-R|^2) More... | |
| class | GaussPotential |
| the Coulomb potential of exp(-a r^2): (pi/a)^{3/2} erf(sqrt(a) r) / r, 2 pi/a at the origin More... | |
| struct | operands |
| the operands of T1, T2, T4 at k 8, thresh 1e-6 More... | |
Functions | |
| template<typename T> | |
| static Function< T, D > | apply_with (World &world, const real_convolution_3d &P, const Function< T, D > &f, const apply_screen_t< D > &screen, std::array< long, 2 > *counts=nullptr) |
| one apply through the vector overload, with screen (none if empty); the counters cover this apply | |
| static apply_screen_t< D > | box_b_screen (const double inside, const double outside) |
| the screen of T3: inside in the boxes that intersect B = [4,8] x [-2,2] x [-2,2], outside elsewhere | |
| static std::array< double, 3 > | distribution (std::vector< double > v) |
| median, 90th percentile and max | |
| static double | eval_in_box (const Key< D > &key, const Tensor< double > &c, const std::array< double, D > &x) |
| the function in the box key at the point x in [0,1]^D of the box, from the box's scaling coefficients | |
| int | main (int argc, char **argv) |
| static operands | make_operands (World &world, const real_convolution_3d &P, const double thresh) |
| static apply_screen_t< D > | never_screen () |
| static real_function_3d | project (World &world, const std::shared_ptr< FunctionFunctorInterface< double, D > > &functor, const double thresh) |
| static std::array< long, 2 > | screen_counts (World &world) |
| blocks that passed the source test, and blocks the screen skipped, since the last reset, all ranks | |
| static void | set_defaults (const int k, const double thresh) |
| static apply_screen_t< D > | sup_screen (const std::vector< real_function_3d > &m) |
| the screen built from the multipliers' sup bounds | |
| int | test_accuracy (World &world, const real_convolution_3d &P, operands &o, const double thresh) |
| T2: the weighted error of the screened potential, for reconstructed and redundant multipliers. | |
| int | test_complex (World &world, const real_convolution_3d &P, operands &o, const double thresh) |
| T4: a complex function under a real screen. | |
| int | test_exchange_geometry (World &world, const real_convolution_3d &P, const double thresh) |
| int | test_shell_loop (World &world) |
| T3, T3b: the shell loop must reach the boxes where the multiplier lives. | |
| int | test_sup_bound (World &world, const double thresh) |
| T5: the sup bound per box bounds the function. | |
| int | test_unbounded_screen (World &world, const real_convolution_3d &P, operands &o) |
| T1: a screen that never screens reproduces the unscreened apply. | |
Variables | |
| static const double | C_T2 = 1.0 |
| static const double | C_T6 = 1.0 |
| static const std::size_t | D = 3 |
| static const double | REL_T3 = 1.e-10 |
| static const double | SLACK_T5 = 2.0 |
| static const double | THRESH_REF = 1.e-9 |
| projection threshold of the analytic reference potential | |
|
static |
one apply through the vector overload, with screen (none if empty); the counters cover this apply
References madness::apply(), f, madness::WorldGopInterface::fence(), madness::World::gop, P, madness::ApplyScreenStats::reset(), screen_counts(), and u().
Referenced by make_operands(), test_accuracy(), test_complex(), test_exchange_geometry(), test_generic_exchange(), test_shell_loop(), test_unbounded_screen(), and test_weighted_bra_exchange().
|
static |
the screen of T3: inside in the boxes that intersect B = [4,8] x [-2,2] x [-2,2], outside elsewhere
References d, madness::FunctionDefaults< NDIM >::cell, madness::FunctionDefaults< NDIM >::get_cell(), madness::FunctionDefaults< NDIM >::get_cell_width(), h(), L, and lo.
Referenced by test_shell_loop().
|
static |
|
static |
the function in the box key at the point x in [0,1]^D of the box, from the box's scaling coefficients
References c, d, madness::FunctionCommonData< T, NDIM >::data, madness::FunctionDefaults< NDIM >::get_cell_volume(), k, madness::legendre_scaling_functions(), madness::Key< NDIM >::level(), and p().
Referenced by test_sup_bound().
| int main | ( | int | argc, |
| char ** | argv ) |
References madness::CoulombOperator(), madness::WorldGopInterface::fence(), madness::finalize(), madness::World::gop, madness::initialize(), make_operands(), P, set_defaults(), madness::startup(), test_accuracy(), test_complex(), test_exchange_geometry(), test_shell_loop(), test_sup_bound(), test_unbounded_screen(), and thresh.
|
static |
References a, apply_with(), operands::g, operands::m, operands::mname, P, madness::project(), R1, R2, thresh, THRESH_REF, operands::uexact, and operands::ufull.
Referenced by main().
|
static |
a screen that never screens: the multiplier is unbounded everywhere, so the apply runs as without a screen while the counters still see every block that passes the source test
References madness::SupBoundScreen< NDIM >::unbounded().
Referenced by test_exchange_geometry(), test_shell_loop(), and test_unbounded_screen().
|
static |
|
static |
blocks that passed the source test, and blocks the screen skipped, since the last reset, all ranks
References madness::ApplyScreenStats::blocks, madness::World::gop, madness::ApplyScreenStats::skipped, and madness::WorldGopInterface::sum().
Referenced by apply_with().
|
static |
References k, madness::FunctionDefaults< NDIM >::set_cubic_cell(), madness::FunctionDefaults< NDIM >::set_initial_level(), madness::FunctionDefaults< NDIM >::set_k(), madness::FunctionDefaults< NDIM >::set_refine(), madness::FunctionDefaults< NDIM >::set_thresh(), madness::FunctionDefaults< NDIM >::set_truncate_mode(), and thresh.
Referenced by main(), and test_shell_loop().
|
static |
the screen built from the multipliers' sup bounds
References m.
Referenced by test_accuracy(), test_complex(), and test_exchange_geometry().
| int test_accuracy | ( | World & | world, |
| const real_convolution_3d & | P, | ||
| operands & | o, | ||
| const double | thresh ) |
T2: the weighted error of the screened potential, for reconstructed and redundant multipliers.
References apply_with(), operands::blocks_ref, C_T2, madness::test_output::checkpoint(), madness::copy(), madness::test_output::end(), operands::g, operands::m, madness::Function< T, NDIM >::make_redundant(), operands::mname, madness::norm2(), P, madness::World::rank(), madness::test_output::set_do_print(), sup_screen(), thresh, madness::Function< T, NDIM >::tree_size(), u(), operands::uexact, and operands::ufull.
Referenced by main().
| int test_complex | ( | World & | world, |
| const real_convolution_3d & | P, | ||
| operands & | o, | ||
| const double | thresh ) |
T4: a complex function under a real screen.
References apply_with(), operands::blocks_ref, C_T2, madness::test_output::checkpoint(), madness::convert(), madness::test_output::end(), operands::g, madness::imag(), operands::m, madness::norm2(), P, madness::World::rank(), madness::real(), madness::test_output::set_do_print(), sup_screen(), thresh, operands::uexact, and operands::ufull.
Referenced by main().
| int test_exchange_geometry | ( | World & | world, |
| const real_convolution_3d & | P, | ||
| const double | thresh ) |
T6: the exchange's own geometry. The source is the product of the multiplier with itself, as in the diagonal product bra_i vf_i of the exchange (vf = bra = ket), so the multiplier is O(1) on top of the source at every level of the source. Two multipliers: a Gaussian, whose tree stops at level 5, and a cusp, refined to level 13 at the nucleus, where a box's volume is far below one bohr^3.
References apply_with(), C_T6, madness::test_output::checkpoint(), madness::test_output::end(), madness::g, madness::name(), never_screen(), madness::norm2(), P, madness::project(), madness::World::rank(), madness::test_output::set_do_print(), sup_screen(), thresh, and u().
Referenced by main().
| int test_shell_loop | ( | World & | world | ) |
T3, T3b: the shell loop must reach the boxes where the multiplier lives.
References apply_with(), box_b_screen(), madness::test_output::checkpoint(), madness::CoulombOperator(), madness::test_output::end(), madness::g, k, never_screen(), madness::norm2(), P, madness::project(), madness::World::rank(), REL_T3, set_defaults(), madness::test_output::set_do_print(), thresh, and u().
Referenced by main().
| int test_sup_bound | ( | World & | world, |
| const double | thresh ) |
T5: the sup bound per box bounds the function.
References std::abs(), madness::all, madness::WorldContainer< keyT, valueT, hashfunT >::begin(), c, madness::test_output::checkpoint(), madness::FunctionImpl< T, NDIM >::coeffs2values(), madness::WorldGopInterface::concat0(), d, distribution(), madness::test_output::end(), madness::WorldContainer< keyT, valueT, hashfunT >::end(), eval_in_box(), exact, f, madness::FunctionDefaults< NDIM >::cell, madness::FunctionDefaults< NDIM >::get_cell(), madness::FunctionDefaults< NDIM >::get_cell_volume(), madness::FunctionDefaults< NDIM >::get_cell_width(), madness::FunctionImpl< T, NDIM >::get_coeffs(), madness::FunctionDefaults< NDIM >::get_k(), madness::World::gop, L, madness::SupBoundMap< NDIM >::leaf_bound(), madness::SupBoundMap< NDIM >::leaf_weights(), madness::Key< NDIM >::level(), madness::WorldGopInterface::max(), madness::name(), madness::project(), R1, R2, madness::World::rank(), madness::test_output::set_do_print(), madness::SupBoundMap< NDIM >::size(), SLACK_T5, madness::WorldGopInterface::sum(), madness::FunctionImpl< T, NDIM >::sup_bound_map(), thresh, madness::Key< NDIM >::translation(), v, madness::wall_time(), and madness::weights.
Referenced by main().
| int test_unbounded_screen | ( | World & | world, |
| const real_convolution_3d & | P, | ||
| operands & | o ) |
T1: a screen that never screens reproduces the unscreened apply.
References apply_with(), operands::blocks_ref, madness::test_output::checkpoint(), madness::copy(), diff(), madness::test_output::end(), operands::g, never_screen(), madness::Function< T, NDIM >::norm2(), madness::norm2(), P, madness::World::rank(), madness::test_output::set_do_print(), madness::Function< T, NDIM >::tree_size(), madness::Function< T, NDIM >::truncate(), u(), and operands::ufull.
Referenced by main().
|
static |
T2, T4: the weighted error of the screened potential stays below C_T2 * thresh (or twice the unscreened error); measured C 0.18 and 0.15, see the header
Referenced by test_accuracy(), and test_complex().
|
static |
T6: the weighted error of the screened potential against the unscreened one stays below C_T6 * thresh; measured 0.02 (Gaussian) and 3e-14 (cusp), see the header
Referenced by test_exchange_geometry().
|
static |
|
static |
T3, T3b: inside B the screened potential is the unscreened one to roundoff, relative to |chi u|; measured at most 1.4e-15 (shell loops stopped too early: 5e-8), see the header
Referenced by test_shell_loop().
|
static |
T5: the bound must lie above the analytic function less SLACK_T5 thresh, the projection's pointwise error; measured worst 1.04 thresh (m2, two of its 20000 points), every other point within the bound
Referenced by test_sup_bound().
|
static |
projection threshold of the analytic reference potential
Referenced by main(), and make_operands().