MADNESS
version 0.9
|
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"
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) |
Code for the nanophotonics example in the article M.G. Reuter et al., Comput. Phys. Commun. 183, pp. 1-7 (2012).
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.
int main | ( | int | argc, |
char ** | argv | ||
) |
References madness::LoadBalanceDeux< NDIM >::add_tree(), madness::WorldGopInterface::broadcast(), madness::WorldGopInterface::broadcast_serializable(), madness::Function< T, NDIM >::clear(), madness::archive::BaseParallelArchive< Archive >::close(), SafeMPI::COMM_WORLD, madness::Function< T, NDIM >::compress(), madness::copy(), DENSITY, DIRICHLET_RHS, DOMAIN_MASK, ELECTRON_DENSITY, madness::archive::BaseParallelArchive< BinaryFstreamInputArchive >::exists(), madness::finalize(), TipMolecule::fop, G, madness::GMRES(), madness::World::gop, madness::initialize(), k, madness::LoadBalanceDeux< NDIM >::load_balance(), maxiter, mol_geom(), madness::constants::pi, madness::World::rank(), read_states(), madness::FunctionDefaults< NDIM >::redistribute(), madness::Function< T, NDIM >::scale(), madness::FunctionDefaults< NDIM >::set_cell(), madness::FunctionDefaults< NDIM >::set_k(), madness::FunctionDefaults< NDIM >::set_thresh(), madness::startup(), SURFACE, thresh, madness::Function< T, NDIM >::trace(), and vtk_output().
int mol_geom | ( | std::vector< Atom * > & | atoms | ) |
Make the molecular geometry.
Referenced by main().
void read_states | ( | int | nstate, |
int | nbasis, | ||
Tensor< double > & | coeffs | ||
) |
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().