funkalicious 0.1

dotcode_wavefunction.h

Go to the documentation of this file.
00001 /**Provides basic routines for getting and using a dotcode wavefunction.
00002  
00003 
00004     Copyright (C) 2011 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 
00021 #include <libpostproc/lp_wavefunction.h>
00022 #include <libdotcode/gcc_hints.h>
00023 
00024 #ifndef ____LIBDOTCODE_DOTCODE_WAVEFUNCTION_H___
00025 #define ____LIBDOTCODE_DOTCODE_WAVEFUNCTION_H___
00026 
00027 /**frees a wavefunction and its resources
00028  *\param wf wavefunction to free
00029  */
00030 void dotcode_wavefunction_free(struct wavefunction *wf);
00031 /**Only frees the resources within the wavefunction struct, not the wavefunction struct itself.
00032  *\param wf wavefunction to free
00033  */
00034 void dotcode_wavefunction_free_resources(struct wavefunction* wf);
00035 
00036 /**Gets the index into the storage member for a wavefunction, or for a density
00037  *\param x x index component
00038  *\param y y index component
00039  *\param z z index component
00040  *\param b band index component
00041  *\param im 1 if imaginary component is wanted; 0 else.
00042  *\param Nx Number of x sites
00043  *\param Ny Number of y sites
00044  *\param Nb Number of bands
00045  *\returns long unsigned int, which is the address in the storage
00046  *array.
00047  *\note there is no error checking, for speed purposes. E.g. if im is
00048  *3, it'll just be blindly used as a 3 and you'll be addressing the
00049  *imaginary component of the next index.
00050  *\note Nz is not needed.
00051  */
00052 ___const long unsigned int get_wavefunction_storage_index_(unsigned int x, unsigned y, unsigned z, unsigned im, unsigned b, unsigned Nx, unsigned Ny, unsigned Nb);
00053 
00054 /**Gets the storage address for a specified index; just de-reference to get or set the value
00055  *\note args are the same as get_wavefunction_storage_index_
00056  *\return pointer to the double at the specified location.
00057  */
00058 double* get_wavefunction_storage_(unsigned int x, unsigned int y, unsigned int z, unsigned int im, unsigned int b, struct wavefunction* wf);
00059 /**Gets the storage address for a specified index (but const); just de-reference to get the value
00060  *\note args are the same as get_wavefunction_storage_index_
00061  *\return pointer (const) to the double at the specified location.
00062  */
00063 const double* get_wavefunction_storage_c_(unsigned int x, unsigned int y, unsigned int z, unsigned int im, unsigned int b, const struct wavefunction* wf);
00064 
00065 /**Gets the probability density within the specified band
00066  *\param wf the wavefunction to get the density out of
00067  *\param band band to use
00068  *\return struct density with the probability density across the distribution
00069  *\note that the density retains the LAPACK-like implicit multiplication by dx^3.
00070  */
00071 struct density* dotcode_wavefunction_get_density_in_band(const struct wavefunction* wf, int band);
00072 
00073 
00074 
00075 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines