MADNESS  version 0.9
envelopedpulse.h
Go to the documentation of this file.
1 /*
2  This file is part of MADNESS.
3 
4  Copyright (C) 2007,2010 Oak Ridge National Laboratory
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 
20  For more information please contact:
21 
22  Robert J. Harrison
23  Oak Ridge National Laboratory
24  One Bethel Valley Road
25  P.O. Box 2008, MS-6367
26 
27  email: harrisonrj@ornl.gov
28  tel: 865-241-3937
29  fax: 865-572-0680
30 
31  $Id$
32 */
33 #ifndef __enveloped_pulse__
34 #define __enveloped_pulse__
35 
36 #include <string>
37 #include <madness/constants.h>
38 #include <madness/mra/mra.h>
40 
41 using namespace std;
42 using namespace madness;
43 
45 typedef Function<complexd, 3> function;
47 
53 public:
54  // physical constants
55  const static double eps0 = 0.0795774715459477; // free-space permittivity
56  const static double mu0 = 6.69176253e-4; // free-space permeability
57  const static double c_vac = 1.370359991e2; // vacuum light speed
58 
59  // unit conversions
60  const static double nm_per_au = 0.05291772108;
61  const static double fs_per_au = 0.02418884326505;
62  const static double efield_per_mau = 5.142206435e5;
63 
64  // key parameters
65  double lambda; // driving wavelength
66  double omegabar; // corresponding driving frequency
67  double T; // Fourier period
68  double stddev; // standard deviation of the wave-shape
69  double offset; // offset of the wave-shape
70 
71  // box sizes / ranges
72  double sim_min, sim_max; // the 3-D box sizes
73  double dotp_min, dotp_max; // the dotp-product range for 1-D incident fields
74  double ws_min, ws_max; // the 1-D wave-shape function
75 
76  // polarizations: these three vectors should be normalized and
77  // mutually orthogonal
78  Vector<double, 3> prop_dir; //< Direction of field propagation
79  Vector<double, 3> e_polar; //< Initial electric field polarization
80  Vector<double, 3> h_polar; //< Initial magnetization polarization
81 
82  string basefile; // the base file *.param, *.freq.n, etc.
83  int nfreq; // the number of frequencies needed
84  int *freqs; // the list of frequencies to be computed
86 
87  EnvelopedPulse() : nfreq(0), freqs(0), wave_shape(0) {
88  prop_dir[0] = prop_dir[2] = e_polar[0] = e_polar[1] = h_polar[1] =
89  h_polar[2] = 0.0;
90  prop_dir[1] = e_polar[2] = h_polar[0] = 1.0;
91  }
92 
94  if(freqs)
95  delete [] freqs;
96  if(wave_shape)
97  delete wave_shape;
98  }
99 
102  bool read_param_file(const string &basename);
103 };
104 
107 class TimeIncident : public FunctionFunctorInterface<double, 3> {
108 protected:
109  const EnvelopedPulse &pulse; //< The incident pulse information
110  double t; //< The time at which to evaluate, in atomic units
111 
112 public:
113  TimeIncident(const EnvelopedPulse &_pulse) : pulse(_pulse), t(0.0) {}
114 
115  void setTime(double _t) {
116  t = _t;
117  }
118 
119  double getTime() const {
120  return t;
121  }
122 
125  double operator() (const Vector<double, 3> &pt) const;
126 };
127 
128 #endif
double offset
Definition: envelopedpulse.h:69
std::complex< double > double_complex
Definition: lineplot.cc:16
Main include file for MADNESS and defines Function interface.
Vector< double, 3 > h_polar
Definition: envelopedpulse.h:80
double sim_min
Definition: envelopedpulse.h:72
Defines common mathematical and physical constants.
int nfreq
Definition: envelopedpulse.h:83
Definition: mpreal.h:3066
EnvelopedPulse()
Definition: envelopedpulse.h:87
double dotp_min
Definition: envelopedpulse.h:73
Vector< double, 3 > prop_dir
Definition: envelopedpulse.h:78
double lambda
Definition: envelopedpulse.h:65
double getTime() const
Definition: envelopedpulse.h:119
double stddev
Definition: envelopedpulse.h:68
Vector< double, 3 > e_polar
Definition: envelopedpulse.h:79
const EnvelopedPulse & pulse
Definition: envelopedpulse.h:109
Definition: envelopedpulse.h:52
string basefile
Definition: envelopedpulse.h:82
A multiresolution adaptive numerical function.
Definition: derivative.h:61
TimeIncident(const EnvelopedPulse &_pulse)
Definition: envelopedpulse.h:113
Abstract base class interface required for functors used as input to Functions.
Definition: function_interface.h:58
double_complex complexd
Definition: envelopedpulse.h:44
double omegabar
Definition: envelopedpulse.h:66
Vector< function, 3 > vecfunc
Definition: envelopedpulse.h:46
double ws_min
Definition: envelopedpulse.h:74
double t
Definition: envelopedpulse.h:110
Definition: envelopedpulse.h:107
Provides 1D cubic interpolation class.
CubicInterpolationTable< double > * wave_shape
Definition: envelopedpulse.h:85
Holds machinery to set up Functions/FuncImpls using various Factories and Interfaces.
Definition: chem/atomutil.cc:45
void setTime(double _t)
Definition: envelopedpulse.h:115
~EnvelopedPulse()
Definition: envelopedpulse.h:93
int * freqs
Definition: envelopedpulse.h:84
double T
Definition: envelopedpulse.h:67