MADNESS  version 0.9
Functions
nanophoto.cc File Reference

Code for the nanophotonics example in the article M.G. Reuter et al., Comput. Phys. Commun. 183, pp. 1-7 (2012). More...

#include <madness/mra/mra.h>
#include <madness/tensor/gmres.h>
#include "basisfunction.h"
#include "atom.h"
#include "density.h"
Include dependency graph for nanophoto.cc:

Functions

void vtk_output (World &world, const char *funcname, const real_function_3d &func)
 Plots a function in the total domain, and also close to the tip/surface junction. More...
 
void scaled_plotvtk_begin (World &world, const char *filename, const Vector< double, 3 > &plotlo, const Vector< double, 3 > &plothi, const Vector< long, 3 > &npt, bool binary)
 Same as plotvtk_begin, but scales the coordinates back to nm. More...
 
int mol_geom (std::vector< Atom * > &atoms)
 Make the molecular geometry. More...
 
void read_states (int nstate, int nbasis, Tensor< double > &coeffs)
 Read in the occupied states from file. More...
 
int main (int argc, char **argv)
 

Detailed Description

Code for the nanophotonics example in the article M.G. Reuter et al., Comput. Phys. Commun. 183, pp. 1-7 (2012).

Note
Details on the procedure can be found in the article and in the embedded_dirichlet program in the super directory.

Sets up an example STM - molecule (H_2) - surface system for an electrostatics simulation. A paraboloidal tip is some distance above the surface with a molecule in between. A bias (electrostatic potential difference) is applied by specifying Dirichlet boundary conditions on the tip and the surface. The molecule provides an inhomogeneity in the system.

Poisson's equation is solved following the methods described elsewhere.

This code generated the data in Figure 3 of the above reference.

Function Documentation

int main ( int  argc,
char **  argv 
)
int mol_geom ( std::vector< Atom * > &  atoms)

Make the molecular geometry.

Returns
The number of (occupied) states to use in the density.

Referenced by main().

void read_states ( int  nstate,
int  nbasis,
Tensor< double > &  coeffs 
)

Read in the occupied states from file.

References madness::error().

Referenced by main().

void scaled_plotvtk_begin ( World world,
const char *  filename,
const Vector< double, 3 > &  plotlo,
const Vector< double, 3 > &  plothi,
const Vector< long, 3 > &  npt,
bool  binary = false 
)

Same as plotvtk_begin, but scales the coordinates back to nm.

References madness::f, madness::WorldGopInterface::fence(), madness::World::gop, MADNESS_EXCEPTION, PROFILE_FUNC, and madness::World::rank().

Referenced by vtk_output().

void vtk_output ( World world,
const char *  funcname,
const real_function_3d func 
)

Plots a function in the total domain, and also close to the tip/surface junction.

The filename is funcname.vts

References madness::FunctionDefaults< NDIM >::get_cell(), madness::plotvtk_data(), and scaled_plotvtk_begin().

Referenced by main().