MADNESS  0.10.1
Classes | Functions | Variables
siam_example.cc File Reference

A simple example of solving PDEs with MADNESS. More...

#include <madness/mra/mra.h>
#include <madness/constants.h>
#include <madness/mra/nonlinsol.h>
Include dependency graph for siam_example.cc:

Classes

class  DSphere
 Functor representing the log-derivative of $\epsilon$ along an axis. More...
 

Functions

int main (int argc, char **argv)
 Main function. Project the functions and solve the PDE. More...
 
double rho_function (const coord_3d &r)
 Function that provides the charge density, $ \rho $. More...
 

Variables

const double eps_ext =10.0
 Exterior dielectric. More...
 
const double eps_int = 1.0
 Interior dielectric. More...
 
const double R = 2.0
 Radius of sphere. More...
 
const double sigma = 0.1
 Surface "width". More...
 
const double xi = 100.0
 Exponent for delta function approx. More...
 

Detailed Description

A simple example of solving PDEs with MADNESS.

This example solves Poisson's equation for a system with an inhomogeneous dielectric constant,

\[ \nabla \cdot{} \left[ \epsilon(\vec{r}) \nabla u(\vec{r}) \right] = - 4 \pi \rho(\vec{r}). \]

$ \epsilon(\vec{r}) = \epsilon_\mathrm{int}$ for $ |\vec{r}| < R$ and $ \epsilon(\vec{r}) = \epsilon_\mathrm{ext}$ for $ |\vec{r}| > R.$ The PDE is converted to a fixed point iteration using the Green's function for the Laplacian (with free-space boundary conditions) and then solved using a fixed point iteration.

Other objectives are to demonstrate the use of functors when projecting MADNESS functions.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

◆ rho_function()

double rho_function ( const coord_3d r)

Function that provides the charge density, $ \rho $.

Parameters
[in]rThe coordinate at which to evaluate the function.
Returns
The value of $ \rho $ at the point.

References madness::constants::pi, pow(), and xi.

Referenced by main().

Variable Documentation

◆ eps_ext

const double eps_ext =10.0

Exterior dielectric.

Referenced by main().

◆ eps_int

const double eps_int = 1.0

Interior dielectric.

Referenced by main().

◆ R

const double R = 2.0

Radius of sphere.

Referenced by DSphere::operator()().

◆ sigma

const double sigma = 0.1

Surface "width".

Referenced by DSphere::operator()().

◆ xi

const double xi = 100.0

Exponent for delta function approx.

Referenced by madness::response_space::compress_rf(), madness::Nemo::compute_all_cphf(), madness::PNO::compute_cispd_correction_es(), madness::PNO::compute_cispd_correction_gs(), madness::PNO::compute_cispd_f12_correction_es(), madness::PNO::compute_cispd_f12_correction_gs(), madness::F12Potentials::compute_cispd_f12_energies(), madness::PNO::compute_cispd_fluctuation_matrix(), madness::PNO::compute_cispd_fluctuation_potential(), madness::response_space::copy(), madness::Molecule::core_derivative(), madness::CorePotentialManager::core_derivative(), madness::Molecule::core_potential_derivative(), madness::create_response_matrix(), madness::FunctionImpl< T, NDIM >::eval(), madness::CorePotential::eval_derivative(), madness::CoreOrbital::eval_derivative(), madness::FunctionImpl< T, NDIM >::eval_local_only(), madness::CoreOrbital::eval_radial_derivative(), madness::FunctionImpl< T, NDIM >::evaldepthpt(), madness::FunctionImpl< T, NDIM >::evalR(), FiniteNucleusPotential::expnt(), madness::PNO::grow_rank(), madness::Nemo::hessian(), madness::PNO::initialize_pairs(), madness::Nemo::make_incomplete_hessian_response_part(), madness::TDHF::make_potentials(), madness::make_radius(), molresponseExchange(), FiniteNucleusPotential::operator()(), madness::MomentFunctor::operator()(), madness::response_space::operator+(), madness::response_space::operator-(), madness::CorePotentialManager::potential_derivative(), FermiNucDistFunctor::print_details(), madness::response_space::reconstruct_rf(), rho_function(), madness::NuclearCorrelationFactor::smoothed_unitvec(), madness::Nemo::solve_cphf(), sympgrad4(), madness::to_conjugate_X_space(), madness::TDHF::transform(), madness::transposeResponseMatrix(), and madness::response_space::truncate_rf().