k-dot-p 0.1

hamiltonians.c++

Go to the documentation of this file.
00001 /*
00002  *
00003 
00004  Copyright (C) 2010 Joseph Pingenot
00005 
00006  This program is free software: you can redistribute it and/or modify
00007  it under the terms of the GNU Affero General Public License as published by
00008  the Free Software Foundation, either version 3 of the License, or
00009  (at your option) any later version.
00010 
00011  This program is distributed in the hope that it will be useful,
00012  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  GNU Affero General Public License for more details.
00015 
00016  You should have received a copy of the GNU Affero General Public License
00017  along with this program.  If not, see <http://www.gnu.org/licenses/>.
00018 
00019 */
00020 #include <libkdotp/hamiltonians.h++>
00021 #include <libmodelxx/grid.h++>
00022 #include <libkdotp/hamiltonian_cartesian_effective_mass.h++>
00023 #include <libkdotp/hamiltonian_cartesian_8band.h++>
00024 
00025 namespace kdotp {
00026   namespace libkdotp {
00027     namespace hamiltonian {
00028 
00029       hamiltonian::hamiltonian(struct libmodelxx::structure::generic_structure *struc, enum model model_, boundary_condition bc, bool second_neighbor) : s(struc), model(model_) {
00030   switch(model) {
00031   case KDOTP_EFFECTIVE_MASS:
00032     switch(struc->g->t) {
00033     case libmodelxx::grid::CARTESIAN:
00034       specific_hamiltonian = new cartesian_effective_mass(struc, bc, second_neighbor);
00035       break;
00036     }
00037     break;
00038   case KDOTP_8BAND:
00039     switch(struc->g->t) {
00040     case libmodelxx::grid::CARTESIAN:
00041       specific_hamiltonian = new cartesian_8band(struc, bc, second_neighbor);
00042       break;
00043     }
00044     break;
00045   }
00046       }
00047 
00048       double* hamiltonian::get_eigenvectors(char VoI, double eVmin, double eVmax, int imin, int imax, double**evals, int *n_eigs, GError **err) const {
00049   switch(model) {
00050   case KDOTP_EFFECTIVE_MASS:
00051     switch(s->g->t) {
00052     case libmodelxx::grid::CARTESIAN:
00053       return ((cartesian_effective_mass*)specific_hamiltonian)->get_eigenvectors(VoI, eVmin, eVmax, imin, imax, evals, n_eigs, err);
00054       break;
00055     }
00056     break;
00057   case KDOTP_8BAND:
00058     switch(s->g->t) {
00059     case libmodelxx::grid::CARTESIAN:
00060       return ((cartesian_8band*)specific_hamiltonian)->get_eigenvectors(VoI, eVmin, eVmax, imin, imax, evals, n_eigs, err);
00061       break;
00062     }
00063     break;
00064   }
00065   return NULL;
00066       }
00067     }
00068   }
00069 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines