MADNESS 0.10.1
Classes | Macros | Functions | Variables
derivatives.cc File Reference
#include <madness/mra/mra.h>
#include <madness/mra/funcplot.h>
#include <string>
Include dependency graph for derivatives.cc:

Classes

struct  F
 

Macros

#define DOIT1
 
#define DOIT2
 
#define DOIT3
 
#define PRINT(what, value)   print("@", initial_level, ",", k, ",", thresh, ",", model, ",", what, ",", value)
 

Functions

double gaussian (const coord_3d &r)
 
double gaussian1 (const coord_3d &r)
 
double gaussian2 (const coord_3d &r)
 
double gaussian3 (const coord_3d &r)
 
double gaussian_energy ()
 
int main (int argc, char **argv)
 
std::vector< coord_3dmake_pts (size_t n, double lo, double hi)
 
char * p (char *buf, const char *name, int k, int initial_level, double thresh, int order)
 
void plotter1 (const std::string &fname, const std::vector< coord_3d > &pts, real_function_3d &g0, real_function_3d &g1, real_function_3d &g2, real_function_3d &g3)
 
void plotter2 (const std::string &fname, const std::vector< coord_3d > &pts, real_function_3d &g0, real_function_3d &g2)
 
void plotter3 (const std::string &fname, const std::vector< coord_3d > &pts, real_function_3d &g0, real_function_3d &g3)
 
template<typename funcT >
Tensor< double > tabulate (funcT &f, const std::vector< coord_3d > &pts)
 
void test (World &world, int k, int initial_level, double thresh, int truncmode, bool refine)
 

Variables

const double a_gaussian = 1.0
 
const std::size_t bufsize =256
 
double(* energy )() = gaussian_energy
 
double(* f )(const coord_3d &) = gaussian
 
double(* f1 )(const coord_3d &) = gaussian1
 
double(* f2 )(const coord_3d &) = gaussian2
 
double(* f3 )(const coord_3d &) = gaussian3
 
const std::string funcname = "gaussian"
 
const double L = 16.0
 

Macro Definition Documentation

◆ DOIT1

#define DOIT1
Value:
real_function_3d g1 = D(g); \
real_function_3d g2 = D(g1); \
real_function_3d g3 = D(g2); \
PRINT("relerrg1", g1.err(f1)/g1norm); \
PRINT("relerrg2", g2.err(f2)/g2norm); \
PRINT("relerrg3", g3.err(f3)/g3norm); \
PRINT("e-<g1|g1>", e-g1.inner(g1)); \
PRINT("e+<g|g2>", e+g.inner(g2)); \
plotter1(p(buf,model.c_str(),k,initial_level,thresh,1), pts, g, g1, g2, g3);
double err(const funcT &func) const
Returns an estimate of the difference ||this-func|| ... global sum performed.
Definition mra.h:440
double(* f1)(const coord_3d &)
Definition derivatives.cc:55
double(* f3)(const coord_3d &)
Definition derivatives.cc:57
char * p(char *buf, const char *name, int k, int initial_level, double thresh, int order)
Definition derivatives.cc:72
double(* f2)(const coord_3d &)
Definition derivatives.cc:56
NDIM const Function< R, NDIM > & g
Definition mra.h:2416
static const double thresh
Definition rk.cc:45
static const long k
Definition rk.cc:44
Definition test_ar.cc:204
void e()
Definition test_sig.cc:75

◆ DOIT2

#define DOIT2
Value:
real_function_3d g2 = D(g); \
PRINT("relerrg2", g2.err(f2)/g2norm); \
PRINT("e+<g|g2>", e+g.inner(g2)); \
plotter2(p(buf,model.c_str(),k,initial_level,thresh,2), pts, g, g2);

◆ DOIT3

#define DOIT3
Value:
real_function_3d g3 = D(g); \
PRINT("relerrg3", g3.err(f3)/g3norm); \
plotter3(p(buf,model.c_str(),k,initial_level,thresh,3), pts, g, g3);

◆ PRINT

#define PRINT (   what,
  value 
)    print("@", initial_level, ",", k, ",", thresh, ",", model, ",", what, ",", value)

Function Documentation

◆ gaussian()

double gaussian ( const coord_3d r)

References a, a_gaussian, and madness::constants::pi.

◆ gaussian1()

double gaussian1 ( const coord_3d r)

References a, a_gaussian, and madness::constants::pi.

◆ gaussian2()

double gaussian2 ( const coord_3d r)

◆ gaussian3()

double gaussian3 ( const coord_3d r)

References a, a_gaussian, and madness::constants::pi.

◆ gaussian_energy()

double gaussian_energy ( )

References a, and a_gaussian.

◆ main()

int main ( int  argc,
char **  argv 
)

◆ make_pts()

std::vector< coord_3d > make_pts ( size_t  n,
double  lo,
double  hi 
)

References h(), and lo.

Referenced by test().

◆ p()

char * p ( char *  buf,
const char *  name,
int  k,
int  initial_level,
double  thresh,
int  order 
)

References bufsize, k, madness::name(), and thresh.

Referenced by madness::CubicInterpolationTable< T >::CubicInterpolationTable(), madness::Gnuplot::Gnuplot(), madness::particle< PDIM >::particle(), PartitionPmap::PartitionPmap(), madness::SystolicMatrixAlgorithm< T >::SystolicMatrixAlgorithm(), madness::CoeffTracker< T, NDIM >::activate(), Akernel(), madness::TDHF::analyze(), madness::FunctionImpl< T, NDIM >::apply(), madness::TDHF::apply_G(), madness::FunctionImpl< T, NDIM >::apply_source_driven(), madness::GFit< T, NDIM >::bsh_fit_ndim(), check_multiplication_table_c2v(), check_operator_multiplications_2d(), check_operator_multiplications_3d(), madness::Nemo::compute_all_cphf(), madness::Zcis::compute_fock_pt(), madness::MP3::compute_mp3_ef_with_permutational_symmetry(), madness::Zcis::compute_residuals(), madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::continue_recursion(), madness::Pairs< T >::convert(), TestCalculationParameters::copy_and_replace_key_in_parameters(), madness::WorldMemInfo::do_del(), madness::FunctionImpl< T, NDIM >::do_dirac_convolution(), madness::WorldMemInfo::do_new(), madness::MacroTaskMp2ConstantPart::ConstantPartPartitioner::do_partitioning(), madness::MacroTaskConstantPart::ConstantPartPartitioner::do_partitioning(), madness::MacroTaskMp2UpdatePair::UpdatePairPartitioner::do_partitioning(), madness::MacroTaskIteratePair::IteratePairPartitioner::do_partitioning(), madness::Coulomb< T, NDIM >::MacroTaskCoulomb::MacroTaskPartitionerCoulomb::do_partitioning(), madness::NuclearCorrelationFactor::dsmoothed_unitvec(), E0(), madness::PNOPairs::empty(), errsq(), madness::CoreOrbital::eval(), madness::FunctionImpl< T, NDIM >::eval_cube(), madness::CoreOrbital::eval_derivative(), AtomicBasis::eval_guess_density(), madness::AtomicBasis::eval_guess_density(), madness::CoreOrbital::eval_spherical_harmonics(), f1(), madness::fcube(), fit(), fit(), Key::foreach_child(), madness::from_json(), G(), madness::gauss_legendre_numeric(), madness::DistributedMatrixDistribution::get_colrange(), madness::LowRankFunction< T, NDIM, LDIM >::get_functions(), GridBuilder::get_points(), madness::DistributedMatrixDistribution::get_range(), madness::Convolution1D< Q >::get_rnlp(), madness::DistributedMatrixDistribution::get_rowrange(), madness::SeparatedConvolution< Q, NDIM >::getop_modified(), madness::SeparatedConvolution< Q, NDIM >::getop_ns(), madness::gprofexit(), ground_exchange(), madness::FunctionImpl< T, NDIM >::hartree_product(), madness::BinSorter< T, inserterT >::insert(), madness::OEP::iterate(), madness::CC2::iterate_lrcc2_pairs(), madness::legendre_polynomials(), madness::legendre_scaling_functions(), madness::archive::ArchiveLoadImpl< Archive, const DerivativeBase< T, NDIM > * >::load(), madness::archive::ArchiveLoadImpl< Archive, const SeparatedConvolution< T, NDIM > * >::load(), madness::archive::ArchiveLoadImpl< Archive, detail::WorldPtr< T > >::load(), madness::archive::ArchiveLoadImpl< Archive, std::map< T, Q, Compare, Alloc >, std::enable_if_t< is_serializable_v< Archive, T > &&is_serializable_v< Archive, Q > > >::load(), madness::archive::ArchiveLoadImpl< ParallelInputArchive< archiveT >, CCPairFunction< T, NDIM > >::load(), madness::detail::RemoteCounter::load_(), madness::LoadBalanceDeux< NDIM >::load_balance(), madness::OEP::load_restartdata(), main(), main(), madness::CubicInterpolationTable< T >::make_interpolation(), madness::MP2::make_pair(), makedata(), madness::Convolution1D< Q >::mod_nonstandard(), madness::mTxm(), madness::FunctionImpl< T, NDIM >::multiply(), madness::XCfunctional::munge_old(), madness::mxm(), myp(), madness::Convolution1D< Q >::nonstandard(), madness::MomentFunctor::operator()(), SurfaceMoleculeInteraction::Bop::operator()(), Uop::operator()(), madness::dens_inv::operator()(), madness::FunctionImpl< T, NDIM >::recursive_apply_op< opT, LDIM >::operator()(), madness::FunctionImpl< T, NDIM >::recursive_apply_op2< opT >::operator()(), madness::World::hashvoidp::operator()(), madness::GenericConvolution1D< Q, opT >::Shmoo::operator()(), operator<<(), madness::operator<<(), madness::operator<<(), operator<<(), madness::operator<<(), operator<<(), madness::operators::operator<<(), madness::operator<<(), madness::ConcurrentHashMap< keyT, valueT, hashfunT >::operator=(), madness::QCCalculationParametersBase::operator==(), madness::operator>>(), opt(), opt(), optimize_coeffs(), madness::outer_result(), madness::particle< PDIM >::particle1(), madness::particle< PDIM >::particle2(), periodic_sum_accelerated(), madness::FunctionImpl< T, NDIM >::phi_for_mul(), plot(), plot_symmetry_operators(), madness::XCfunctional::polyn(), madness::MyPmap< D >::prepare_not_so_simple_map(), madness::Molecule::print(), print_cube(), print_cube(), print_cube(), madness::print_seq(), madness::print_seq(), madness::print_seq(), madness::print_seq(), madness::QCCalculationParametersBase::print_to_string(), printfunc(), madness::WorldObject< Derived >::process_pending(), madness::FunctionImpl< T, NDIM >::project_refine_op(), projector_external_dof(), madness::MolecularOptimizer::projector_external_dof(), madness::GenTensor< T >::ptr(), madness::World::random_proc_not_me(), madness::Molecule::read(), madness::read_data(), madness::read_orbital(), madness::read_potential(), madness::FunctionImpl< T, NDIM >::recursive_apply(), madness::WorldProfile::recv_stats(), madness::detail::RemoteCounter::register_ptr_(), madness::archive::BaseParallelArchive< Archive >::remove(), madness::commandlineparser::remove_extension(), response_exchange(), madness::Convolution1D< Q >::rnlij(), madness::GaussianConvolution1D< Q >::rnlp(), run(), TestBarrier::run(), madness::OEP::save_restartdata(), madness::DQueue< T >::scan(), madness::archive::BaseParallelArchive< Archive >::set_nclient(), madness::ProjectorBase::set_particle(), madness::SeparatedConvolution< Q, NDIM >::set_particle(), madness::QProjector< T, NDIM >::set_particle(), madness::MacroTaskQ::set_printlevel(), madness::MacroTaskBase::set_priority(), madness::Projector< T, NDIM >::set_spaces(), madness::QProjector< T, NDIM >::set_spaces(), madness::StrongOrthogonalityProjector< T, NDIM >::set_spaces(), madness::DQueue< T >::set_wait_policy(), madness::ConditionVariable::set_wait_policy(), madness::CC2::solve_cc2(), madness::CC2::solve_mp2_coupled(), MolecularMaskBase::special_points(), madness::archive::ArchiveStoreImpl< Archive, detail::WorldPtr< T > >::store(), madness::archive::ArchiveStoreImpl< Archive, std::map< T, Q, Compare, Alloc >, std::enable_if_t< is_serializable_v< Archive, T > &&is_serializable_v< Archive, Q > > >::store(), madness::archive::ArchiveStoreImpl< ParallelOutputArchive< localarchiveT >, WorldContainer< keyT, valueT > >::store(), test(), test2(), test6(), test8(), test_apply(), test_consolidate(), test_constructor(), test_he_potential(), test_hf_be(), test_hf_he(), test_in(), test_math(), test_multiply(), test_norm(), test_operator_apply(), test_out(), test_partitioner(), test_projector(), test_scalar_multiplication(), test_swap_particles(), test_xc2(), testNavierStokes(), testPeriodicCoulomb3d(), madness::QCCalculationParametersBase::to_json(), madness::QCCalculationParametersBase::to_json(), madness::FunctionImpl< T, NDIM >::traverse_tree(), madness::MutexFair::unlock(), updatex(), madness::Nemo::value(), and madness::archive::wrap_ptr().

◆ plotter1()

void plotter1 ( const std::string &  fname,
const std::vector< coord_3d > &  pts,
real_function_3d g0,
real_function_3d g1,
real_function_3d g2,
real_function_3d g3 
)

References f, f1, f2, f3, and tabulate().

◆ plotter2()

void plotter2 ( const std::string &  fname,
const std::vector< coord_3d > &  pts,
real_function_3d g0,
real_function_3d g2 
)

References f, f2, and tabulate().

◆ plotter3()

void plotter3 ( const std::string &  fname,
const std::vector< coord_3d > &  pts,
real_function_3d g0,
real_function_3d g3 
)

References f, f3, and tabulate().

◆ tabulate()

template<typename funcT >
Tensor< double > tabulate ( funcT &  f,
const std::vector< coord_3d > &  pts 
)

References f, and v.

Referenced by main(), plotter1(), plotter2(), and plotter3().

◆ test()

void test ( World world,
int  k,
int  initial_level,
double  thresh,
int  truncmode,
bool  refine 
)

Variable Documentation

◆ a_gaussian

const double a_gaussian = 1.0

◆ bufsize

const std::size_t bufsize =256

◆ energy

double(* energy) () ( ) = gaussian_energy

◆ f

double(* f) (const coord_3d &) ( const coord_3d ) = gaussian

◆ f1

double(* f1) (const coord_3d &) ( const coord_3d ) = gaussian1

Referenced by madness::CCPairFunction< T, NDIM >::CCPairFunction(), madness::CCPairFunction< T, NDIM >::CCPairFunction(), madness::CCPairFunction< T, NDIM >::CCPairFunction(), madness::CCPairFunction< T, NDIM >::CCPairFunction(), madness::CCPairFunction< T, NDIM >::CCPairFunction(), madness::FunctionImpl< T, NDIM >::multiply_op< LDIM >::activate(), madness::FunctionImpl< T, NDIM >::add_op::activate(), madness::FunctionImpl< T, NDIM >::recursive_apply_op< opT, LDIM >::activate(), madness::FunctionImpl< T, NDIM >::recursive_apply_op2< opT >::activate(), madness::apply(), c_uks_vwn5__(), madness::c_uks_vwn5__(), madness::FunctionImpl< T, NDIM >::add_op::forward_ctor(), madness::FunctionImpl< T, NDIM >::multiply_op< LDIM >::forward_ctor(), madness::FunctionImpl< T, NDIM >::recursive_apply_op< opT, LDIM >::forward_ctor(), madness::inner(), madness::inner(), madness::inner(), madness::inner(), madness::inner(), madness::CCPairFunction< T, NDIM >::inner_internal(), QuasiNewton::line_search(), madness::QuasiNewton::line_search(), madness::Localizer::localize_boys(), madness::Localizer::localize_new(), main(), main(), main(), make_kinetic_matrix(), madness::Solver< T, NDIM >::make_kinetic_matrix(), make_kinetic_matrix(), madness::ProjRLMStore::nlmproj(), norm(), norm(), madness::SeparatedConvolution< Q, NDIM >::operator()(), MicroTask::operator()(), MicroTask1::operator()(), madness::SeparatedConvolution< Q, NDIM >::operator()(), ScalarTask::operator()(), MicroTask2::operator()(), VectorOfScalarTask::operator()(), Calculation::plot_p(), plotter1(), print_cube(), print_cube(), madness::CCPair::serialize(), test(), test_apply(), test_constructor(), test_converged_function(), test_conversion(), test_fock(), test_inner(), test_inner(), test_load_store(), test_math(), test_multiply(), test_operator_apply(), test_partial_inner_3d(), test_partial_inner_6d(), test_projector(), test_projector(), test_projector_outer(), test_Q12_projector(), test_scalar_multiplication(), test_swap_particles(), test_transformations(), and test_XCOperator().

◆ f2

double(* f2) (const coord_3d &) ( const coord_3d ) = gaussian2

◆ f3

double(* f3) (const coord_3d &) ( const coord_3d ) = gaussian3

◆ funcname

const std::string funcname = "gaussian"

Referenced by test().

◆ L

const double L = 16.0

Referenced by test().