|
k-dot-p 0.1
|
Classes | |
| class | cartesian_effective_mass |
Functions | |
| ___const unsigned int | get_cartesian_effective_mass_block_index (unsigned int i, unsigned int eigvec, unsigned int L) |
| double | get_average_with_cartesian_effective_mass_block (double *block, unsigned int eigvec, unsigned int L, double *func) |
| GError * | init_density_1d_from_cartesian_effective_mass_block (double *block, unsigned int eigvec, unsigned int L, double dx, struct density_1d *density) |
| double | get_cartesian_effective_mass_block_max_delta (double *block1, unsigned vec1, double *block2, unsigned vec2, unsigned int L) |
| double kdotp::libkdotp::wavefunction::get_average_with_cartesian_effective_mass_block | ( | double * | block, |
| unsigned int | eigvec, | ||
| unsigned int | L, | ||
| double * | func | ||
| ) |
Gets the average of a function with an eigenvector in the block of eigvecs
| block | the block to get the eigenvector |
| eigvec | which eigenvector in the block |
| L | number of grid sites in a wavefunc |
| values | pointer to an array of doubles holding the function across the wavefunction |
Definition at line 41 of file wavefunction_cartesian_effective_mass.c++.
Referenced by calculate_alpha_for_structure(), and main().
{
double avg = 0;
for(unsigned int i=0; i<L; i++) avg += block[L*eigvec + i]*block[L*eigvec + i]*func[i];
return avg;
}
Here is the caller graph for this function:| ___const unsigned int kdotp::libkdotp::wavefunction::get_cartesian_effective_mass_block_index | ( | unsigned int | i, |
| unsigned int | eigvec, | ||
| unsigned int | L | ||
| ) |
Gets the index into a block (returned by e.g. LAPACK) of eigenvecs
| i | grid site of the eigenvector |
| eigvec | which eigenvec in the block |
| L | the number of grid sites |
Definition at line 37 of file wavefunction_cartesian_effective_mass.c++.
{
return L*eigvec + i;
}
| double kdotp::libkdotp::wavefunction::get_cartesian_effective_mass_block_max_delta | ( | double * | block1, |
| unsigned | vec1, | ||
| double * | block2, | ||
| unsigned | vec2, | ||
| unsigned int | L | ||
| ) |
Definition at line 64 of file wavefunction_cartesian_effective_mass.c++.
Referenced by calculate_alpha_for_structure(), and main().
{
//fprintf(stderr, "In get_cartesian_effective_mass_block_max_delta:\n");
if((block1 == NULL) || (block2 == NULL)) return -1;
double max_change = fabs(block1[L*vec1]*block1[L*vec1] - block2[L*vec2]*block2[L*vec2]);
register double change;
for(unsigned int i=1; i<L; i++) {
change = fabs(block1[L*vec1+i]*block1[L*vec1+i] - block2[L*vec2+i]*block2[L*vec2+i]);
//fprintf(stderr, "\t%u: change=%g maxchange=%g (%g-%g)\n", i, change, max_change, block1[L*vec1+i]*block1[L*vec1+i], block2[L*vec2+i]*block2[L*vec2+i]);
if(change > max_change) max_change = change;
}
//fprintf(stderr, "\tmaxchange=%g\n", max_change);
return fabs(max_change);
}
Here is the caller graph for this function:| GError * kdotp::libkdotp::wavefunction::init_density_1d_from_cartesian_effective_mass_block | ( | double * | block, |
| unsigned int | eigvec, | ||
| unsigned int | L, | ||
| double | dx, | ||
| struct density_1d * | density | ||
| ) |
Sets the points to the density from this wavefunction.
| block | the block of eigenvalues |
| eigvec | which eigenvector to use in the block |
| L | the number of points in each wave function in the block |
| dx | inter-node spacing |
| density | pre-allocated structure to store density in. |
Definition at line 56 of file wavefunction_cartesian_effective_mass.c++.
References unlikely, and WAVEFUNCTION_CARTESIAN_EFFECTIVE_MASS_GERROR_DOMAIN.
{
if(unlikely(density->N != L)) return g_error_new(WAVEFUNCTION_CARTESIAN_EFFECTIVE_MASS_GERROR_DOMAIN, 1, "::kdotp::libkdotp::wavefunction::wavefunction_cartesian_effective_mass.c++::init_density_1d_from_carteisan_effective_mass_block: allocated size of the density's storage (%u) and the number of points in the %u-th eigenvector (%u) don't agree!", density->N, eigvec, L);
density->dx = dx;
density->N = L;
for(unsigned int i=0; i<L; i++) density->storage[i] = block[L*eigvec + i]*block[L*eigvec + i];
return NULL;
}
Here is the caller graph for this function: