diff -Nru qwwad-1.5.1+15~ubuntu15.10.1/autogen.sh qwwad-1.5.2+15~ubuntu15.10.1/autogen.sh --- qwwad-1.5.1+15~ubuntu15.10.1/autogen.sh 2016-08-26 08:42:27.000000000 +0000 +++ qwwad-1.5.2+15~ubuntu15.10.1/autogen.sh 2016-09-02 13:30:29.000000000 +0000 @@ -20,6 +20,7 @@ exit 1 fi +mkdir -p config autoreconf -I m4 -I config --force --install cd $olddir diff -Nru qwwad-1.5.1+15~ubuntu15.10.1/configure.ac qwwad-1.5.2+15~ubuntu15.10.1/configure.ac --- qwwad-1.5.1+15~ubuntu15.10.1/configure.ac 2016-08-26 08:42:27.000000000 +0000 +++ qwwad-1.5.2+15~ubuntu15.10.1/configure.ac 2016-09-02 13:30:29.000000000 +0000 @@ -6,7 +6,7 @@ dnl List the required versions for dependencies here m4_define([libxmlpp_required_version], [2.30]) -AC_INIT([Quantum Wells, Wires and Dots], [1.5.1], [https://bugs.launchpad.net/qwwad], [qwwad], [https://launchpad.net/qwwad]) +AC_INIT([Quantum Wells, Wires and Dots], [1.5.2], [https://bugs.launchpad.net/qwwad], [qwwad], [https://launchpad.net/qwwad]) dnl If we have an old version of Autoconf, then we need to set the PACKAGE_URL variable dnl manually. diff -Nru qwwad-1.5.1+15~ubuntu15.10.1/debian/bzr-builder.manifest qwwad-1.5.2+15~ubuntu15.10.1/debian/bzr-builder.manifest --- qwwad-1.5.1+15~ubuntu15.10.1/debian/bzr-builder.manifest 2016-08-26 08:42:30.000000000 +0000 +++ qwwad-1.5.2+15~ubuntu15.10.1/debian/bzr-builder.manifest 2016-09-02 13:30:32.000000000 +0000 @@ -1,3 +1,3 @@ -# bzr-builder format 0.3 deb-version 1.5.1+15 -lp:qwwad/1.5.x revid:valavanisalex@gmail.com-20160826081519-kgsoq9v597bcql33 +# bzr-builder format 0.3 deb-version 1.5.2+15 +lp:qwwad/1.5.x revid:valavanisalex@gmail.com-20160902131632-68hq2z8sqravrs7f nest packaging lp:~qwwad-dev/qwwad/debian debian revid:valavanisalex@gmail.com-20160205102218-36lh2ktmppc6bsre diff -Nru qwwad-1.5.1+15~ubuntu15.10.1/debian/changelog qwwad-1.5.2+15~ubuntu15.10.1/debian/changelog --- qwwad-1.5.1+15~ubuntu15.10.1/debian/changelog 2016-08-26 08:42:30.000000000 +0000 +++ qwwad-1.5.2+15~ubuntu15.10.1/debian/changelog 2016-09-02 13:30:32.000000000 +0000 @@ -1,8 +1,8 @@ -qwwad (1.5.1+15~ubuntu15.10.1) wily; urgency=low +qwwad (1.5.2+15~ubuntu15.10.1) wily; urgency=low * Auto build. - -- Alex Valavanis Fri, 26 Aug 2016 08:42:30 +0000 + -- Alex Valavanis Fri, 02 Sep 2016 13:30:32 +0000 qwwad (1.2.0+15) xenial; urgency=low diff -Nru qwwad-1.5.1+15~ubuntu15.10.1/NEWS qwwad-1.5.2+15~ubuntu15.10.1/NEWS --- qwwad-1.5.1+15~ubuntu15.10.1/NEWS 2016-08-26 08:42:27.000000000 +0000 +++ qwwad-1.5.2+15~ubuntu15.10.1/NEWS 2016-09-02 13:30:29.000000000 +0000 @@ -1,3 +1,8 @@ +2016-09-02 (QWWAD 1.5.2): + * Fixed build on 32-bit systems + * Improved support for InAlGaAs band structure (bug #1616360). + Thanks to Michael Bland-Albrecht for permittivity data. + 2016-08-26 (QWWAD 1.5.1): * This preview release adds a first version of the libqwwad API, allowing you to incorporate QWWAD functionality into your own C++ programs. diff -Nru qwwad-1.5.1+15~ubuntu15.10.1/src/ppff.cpp qwwad-1.5.2+15~ubuntu15.10.1/src/ppff.cpp --- qwwad-1.5.1+15~ubuntu15.10.1/src/ppff.cpp 2016-08-26 08:42:27.000000000 +0000 +++ qwwad-1.5.2+15~ubuntu15.10.1/src/ppff.cpp 2016-09-02 13:30:29.000000000 +0000 @@ -447,43 +447,37 @@ } -/* This function reads the atomic species (defined in the file as.r) - into memory (addressed by the pointer as) and returns the start - address of this block of memory and the number of lines */ -atom *read_atoms(long unsigned int *n_atoms, const char * filename) +/** + * \brief Reads the atomic species into memory + */ +std::vector read_atoms(const char * filename) { - int ia=0; FILE *Fatoms; /* file pointer to wavefunction file */ - atom *atoms; /* atomic definitions */ if((Fatoms=fopen(filename,"r"))==0) { - fprintf(stderr,"Error: Cannot open input file 'atoms.xyz'!\n"); - exit(0); + std::ostringstream oss; + oss << "Cannot open input file " << filename; + throw std::runtime_error(oss.str()); } /* Read in the first line and hence the number of atoms */ - - size_t n_read = fscanf(Fatoms,"%lu",n_atoms); + int n_atoms=0; + size_t n_read = fscanf(Fatoms,"%d", &n_atoms); /* Allocate memory for atom definitions */ - if (n_read == 1) - atoms=(atom *)calloc(*n_atoms,sizeof(atom)); - else - { - fprintf(stderr, "Could not read number of atoms!\n"); - exit(EXIT_FAILURE); + std::vector atoms; + if (n_read == 1) { + atoms.resize(n_atoms); } - - if(atoms==0) - { - fprintf(stderr,"Cannot allocate memory!\n"); - exit(0); + else { + throw std::runtime_error("Could not read number of atoms"); } double rx; double ry; double rz; + int ia=0; while((fscanf(Fatoms,"%s %lf %lf %lf",atoms[ia].type, &rx,&ry,&rz))!=EOF) { @@ -496,11 +490,11 @@ r *= 1e-10; atoms[ia].r = r; - ia++; + ia++; } fclose(Fatoms); - return(atoms); + return atoms; } /* This function reads the reciprocal lattice vectors (defined in diff -Nru qwwad-1.5.1+15~ubuntu15.10.1/src/ppff.h qwwad-1.5.2+15~ubuntu15.10.1/src/ppff.h --- qwwad-1.5.1+15~ubuntu15.10.1/src/ppff.h 2016-08-26 08:42:27.000000000 +0000 +++ qwwad-1.5.2+15~ubuntu15.10.1/src/ppff.h 2016-09-02 13:30:29.000000000 +0000 @@ -11,6 +11,8 @@ #define PPFF_H #include +#include + typedef struct { char type[12]; @@ -22,7 +24,7 @@ double q_sqr, const char *type); -atom * read_atoms(long unsigned int *n_atoms, const char * filename); +std::vector read_atoms(const char * filename); std::vector read_rlv(double A0); #endif diff -Nru qwwad-1.5.1+15~ubuntu15.10.1/src/pplb-functions.cpp qwwad-1.5.2+15~ubuntu15.10.1/src/pplb-functions.cpp --- qwwad-1.5.1+15~ubuntu15.10.1/src/pplb-functions.cpp 2016-08-26 08:42:27.000000000 +0000 +++ qwwad-1.5.2+15~ubuntu15.10.1/src/pplb-functions.cpp 2016-09-02 13:30:29.000000000 +0000 @@ -38,27 +38,25 @@ * \param[in] A0 Lattice constant * \param[in] m_per_au conversion factor from SI to a.u. * \param[in] atoms atomic definitions - * \param[in] n_atoms number of atoms in structure * \param[in] q a reciprocal lattice vector, G'-G */ -std::complex V(double A0, - double m_per_au, - atom *atoms, - size_t n_atoms, - arma::vec const &q) +std::complex V(double A0, + double m_per_au, + std::vector const &atoms, + arma::vec const &q) { std::complex v = 0.0; // potential const double q_dot_q = dot(q,q); // Loop over all atoms in the set and add contribution from each - for(unsigned int ia=0; ia(0.0,-q_dot_t)) * vf; // [QWWAD3, 15.76] } - v *= 2.0/n_atoms; + v *= 2.0/atoms.size(); return v; } diff -Nru qwwad-1.5.1+15~ubuntu15.10.1/src/pplb-functions.h qwwad-1.5.2+15~ubuntu15.10.1/src/pplb-functions.h --- qwwad-1.5.1+15~ubuntu15.10.1/src/pplb-functions.h 2016-08-26 08:42:27.000000000 +0000 +++ qwwad-1.5.2+15~ubuntu15.10.1/src/pplb-functions.h 2016-09-02 13:30:29.000000000 +0000 @@ -14,9 +14,8 @@ int n_min, int n_max); -std::complex V(double A0, - double m_per_au, - atom *atoms, - size_t n_atoms, - arma::vec const &q); +std::complex V(double A0, + double m_per_au, + std::vector const &atoms, + arma::vec const &q); #endif diff -Nru qwwad-1.5.1+15~ubuntu15.10.1/src/qwwad_ef_band_edge.cpp qwwad-1.5.2+15~ubuntu15.10.1/src/qwwad_ef_band_edge.cpp --- qwwad-1.5.1+15~ubuntu15.10.1/src/qwwad_ef_band_edge.cpp 2016-08-26 08:42:27.000000000 +0000 +++ qwwad-1.5.2+15~ubuntu15.10.1/src/qwwad_ef_band_edge.cpp 2016-09-02 13:30:29.000000000 +0000 @@ -69,6 +69,33 @@ } }; +/** + * \brief dc relative permittivity values + * + * \todo Read from material library + */ +static double const eps_dc_GaAs = 12.9; +static double const eps_dc_AlAs = 10.06; +static double const eps_dc_InAs = 15.15; + +/** + * \brief Heavy-hole effective masses + * + * \todo Read from material library + */ +static double const m_hh_GaAs = 0.51; +static double const m_hh_AlAs = 0.76; +static double const m_hh_InAs = 0.41; + +/** + * \brief Light-hole effective masses + * + * \todo Read from material library + */ +static double const m_lh_GaAs = 0.082; +static double const m_lh_AlAs = 0.15; +static double const m_lh_InAs = 0.026; + int main(int argc,char *argv[]) { const BandEdgeOptions opt(argc, argv); @@ -146,7 +173,7 @@ } Eg = 1.426*e+dV; - eps_dc = ((x-1.0)*(-12.9) + x*10.06)*eps0; + eps_dc = ((1.0-x)*eps_dc_GaAs + x*eps_dc_AlAs)*eps0; } break; @@ -233,19 +260,31 @@ case 'h': { V=0.47*dV; - if(compute_mass) - std::cerr << "Warning: Mass data not defined for In(1-x-y)Al(x)Ga(y)As light-hole" << std::endl; + if(compute_mass) { + // Linearly interpolate between InAs, AlAs and GaAs for now + // TODO: Find a more accurate interpolation + m = (m_hh_InAs * (1.0-x-y) + m_hh_GaAs * y + m_hh_AlAs * x)*me; + } } break; case 'l': { - std::cerr << "Data not defined for In(1-x-y)Al(x)Ga(y)As light-hole" << std::endl; - exit(EXIT_FAILURE); + std::cerr << "Warning: Potential data not defined for In(1-x-y)Al(x)Ga(y)As light-hole" << std::endl; + + if(compute_mass) { + // Linearly interpolate between InAs, AlAs and GaAs for now + // TODO: Find a more accurate interpolation + m = (m_lh_InAs * (1.0-x-y) + m_lh_GaAs * y + m_lh_AlAs * x)*me; + } + } } Eg=0.36*e+dV; - std::cerr << "Warning: Unknown dc permittivity for InAlGaAs" << std::endl; + + // Linearly interpolate between InAs, AlAs and GaAs for now + // TODO: Find a more accurate interpolation + eps_dc = (eps_dc_InAs * (1.0-x-y) + eps_dc_GaAs * y + eps_dc_AlAs * x)*eps0; } break; } diff -Nru qwwad-1.5.1+15~ubuntu15.10.1/src/qwwad_pp_large_basis.cpp qwwad-1.5.2+15~ubuntu15.10.1/src/qwwad_pp_large_basis.cpp --- qwwad-1.5.1+15~ubuntu15.10.1/src/qwwad_pp_large_basis.cpp 2016-08-26 08:42:27.000000000 +0000 +++ qwwad-1.5.2+15~ubuntu15.10.1/src/qwwad_pp_large_basis.cpp 2016-09-02 13:30:29.000000000 +0000 @@ -90,9 +90,8 @@ k[ik] *= 2.0*pi/A0; } - size_t n_atoms; /* number of atoms in (large) cell */ std::string filename("atoms.xyz"); - atom *atoms = read_atoms(&n_atoms, filename.c_str()); /* read in atomic basis */ + auto const atoms = read_atoms(filename.c_str()); /* read in atomic basis */ const auto G = read_rlv(A0); // read in reciprocal lattice vectors const auto N = G.size(); // number of reciprocal lattice vectors @@ -109,7 +108,7 @@ for(unsigned int j=i;j -Vso(const atom *atoms, +Vso(const std::vector &atoms, const std::vector &G, - const size_t n_atoms, arma::vec const &k, const unsigned int i, const unsigned int j, @@ -95,9 +94,8 @@ k[ik] *= 2.0*pi/A0; } - size_t n_atoms; /* number of atoms in (large) cell */ std::string filename("atoms.xyz"); - const auto atoms = read_atoms(&n_atoms, filename.c_str()); // read in atomic basis + const auto atoms = read_atoms(filename.c_str()); // read in atomic basis const auto G = read_rlv(A0); // read in reciprocal lattice vectors const auto N = G.size(); // number of reciprocal lattice vectors @@ -115,7 +113,7 @@ for(unsigned int j=i; j -Vso(const atom *atoms, +Vso(const std::vector &atoms, const std::vector &G, - const size_t n_atoms, arma::vec const &k, const unsigned int i, const unsigned int j, @@ -232,15 +226,15 @@ // Potential term std::complex v=0; /* Initialise for sum */ - for(unsigned int ia=0;ia(0.0,-q_dot_t)); // [QWWAD3, 15.81] } v *= vso; - v/=(double)(n_atoms); + v/=atoms.size(); return v; } diff -Nru qwwad-1.5.1+15~ubuntu15.10.1/src/qwwad_pp_superlattice.cpp qwwad-1.5.2+15~ubuntu15.10.1/src/qwwad_pp_superlattice.cpp --- qwwad-1.5.1+15~ubuntu15.10.1/src/qwwad_pp_superlattice.cpp 2016-08-26 08:42:27.000000000 +0000 +++ qwwad-1.5.2+15~ubuntu15.10.1/src/qwwad_pp_superlattice.cpp 2016-09-02 13:30:29.000000000 +0000 @@ -46,17 +46,15 @@ static std::complex V(double A0, double m_per_au, - atom *atoms, - atom *atomsp, - int n_atoms, + std::vector const &atoms, + std::vector const &atomsp, arma::vec const &g); static std::complex VF(double A0, double F, double q, - atom *atoms, - int n_atoms, + std::vector const &atoms, arma::vec const &g); static std::valarray> read_ank(int N, @@ -73,8 +71,7 @@ static void write_VF(double A0, double F, double q, - atom *atoms, - int n_atoms); + std::vector const &atoms); static void clean_Hdash(std::complex *Hdash, int order); @@ -92,7 +89,6 @@ int INFO; /* LAPACK: information integer */ int Nn; /* number of bands in calculation */ int Nkxi; /* number of k points in calculation */ -size_t n_atoms; /* number of atoms in (large) cell */ int n_min; /* lowest output band */ int n_max; /* highest output band */ int i; /* loop index for matrix rows */ @@ -111,8 +107,6 @@ char p; /* the particle */ char UPLO='L'; /* LAPACK: diagonalise `L'ower triangle */ FILE *FExi; /* pointer to output energy file `Exi.r' */ -atom *atoms; /* the type and position of the atoms */ -atom *atomsp; /* the type and position of the perturbed atoms */ bool o; /* if set, output the Fourier Transform VF(g) */ /* default values */ @@ -170,9 +164,9 @@ argc--; } strcpy(filename,"atoms.xyz"); -atoms=read_atoms(&n_atoms,filename); /* read in atomic basis */ +auto const atoms=read_atoms(filename); /* read in atomic basis */ strcpy(filename,"atomsp.xyz"); -atomsp=read_atoms(&n_atoms,filename); /* read in perturbation */ +auto const atomsp=read_atoms(filename); /* read in perturbation */ auto G = read_rlv(A0); // read in reciprocal lattice vectors auto N = G.size(); // number of reciprocal lattice vectors @@ -187,7 +181,7 @@ /* Output the Fourier Transform of the electric field */ -if(o) write_VF(A0,F,q,atoms,n_atoms); +if(o) write_VF(A0,F,q,atoms); /* Allocate memory */ @@ -249,8 +243,8 @@ ) * ( - V(A0,m_per_au,atoms,atomsp,n_atoms,g) + - VF(A0,F,q,atoms,n_atoms,g) + V(A0,m_per_au,atoms,atomsp,g) + + VF(A0,F,q,atoms,g) ) ); } /* end iG */ @@ -282,8 +276,6 @@ free(Hdash); free(Exi); free(Enk); -free(atoms); -free(atomsp); return EXIT_SUCCESS; }/* end main */ @@ -492,15 +484,13 @@ * \param m_per_au conversion factor from SI to a.u. * \param atoms atomic definitions * \param atomsp atomic definitions - * \param n_atoms number of atoms in structure * \param g the vector, g=G'-G+kxi'-kxi */ static std::complex V(double A0, double m_per_au, - atom *atoms, - atom *atomsp, - int n_atoms, + std::vector const &atoms, + std::vector const &atomsp, arma::vec const &g) { std::complex v; /* potential */ @@ -509,7 +499,8 @@ v=0; // Sum over atoms [QWWAD4, 16.50] - for(int ia=0;ia VF(double A0, double F, double q, - atom *atoms, - int n_atoms, + std::vector const &atoms, arma::vec const &g) { // Calculate the number of lattice constants in each superlattice period - int const n_z=n_atoms/4; + int const n_z=atoms.size()/4; /* The smallest reciprocal lattice vector is therefore pi/(n_z*A0), thus anything less than this must be zero */ @@ -567,8 +556,8 @@ else { // Get midpoint of unit cell - const auto z_first = atoms[0].r(2); // z-position of first atom - const auto z_last = atoms[n_atoms-1].r(2); // z-position of last atom + const auto z_first = atoms.front().r(2); // z-position of first atom + const auto z_last = atoms.back().r(2); // z-position of last atom double const z0=(z_last + z_first)/2; std::complex v1; /* first term in potential */ @@ -609,13 +598,11 @@ * \param F the electric field strength * \param q the carrier charge * \param atoms atomic definitions - * \param n_atoms number of atoms in structure */ static void write_VF(double A0, double F, double q, - atom *atoms, - int n_atoms) + std::vector const &atoms) { FILE *FVFg; /* pointer to output file */ int i; /* index */ @@ -629,7 +616,7 @@ g(1)=0; g(2)=((float)i*4/500)*pi/A0; - fprintf(FVFg,"%le %le\n",g(2)/(pi/A0),abs(VF(A0,F,q,atoms,n_atoms,g))); + fprintf(FVFg,"%le %le\n",g(2)/(pi/A0),abs(VF(A0,F,q,atoms,g))); } fclose(FVFg);