Changeset 183


Ignore:
Timestamp:
09/01/11 19:29:04 (22 months ago)
Author:
micael
Message:
  • Added function to evaluate projectors.
  • Corrected small bug.
Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/pspio_pspdata.c

    r180 r183  
    137137 **********************************************************************/ 
    138138 
    139 int pspio_pspdata_potential_get(const pspio_pspdata_t *data, const int n, 
    140       const int l, const double j, const double r, double *value) { 
    141   ASSERT(data != NULL, PSPIO_ERROR) 
    142   ASSERT(value != NULL, PSPIO_ERROR) 
    143   ASSERT((n >= 0) && (l >=0) && 
    144     ((j == 0) || (abs(j - (double)l) - 0.5 < 10e-9)), PSPIO_ERROR) 
     139int pspio_pspdata_potential_get(const pspio_pspdata_t *data, const int l, 
     140      const double j, const double r, double *value) { 
     141  ASSERT(data != NULL, PSPIO_ERROR); 
     142  ASSERT(value != NULL, PSPIO_ERROR); 
     143  ASSERT((l >=0) && 
     144         ((j == 0) || (abs(j - (double)l) - 0.5 < 10e-9)), PSPIO_ERROR); 
    145145 
    146   HANDLE_FUNC_ERROR(pspio_meshfunc_eval(data->potentials[l+(int)j]->v,r,value)) 
     146  HANDLE_FUNC_ERROR(pspio_meshfunc_eval(data->potentials[l+(int)j]->v,r,value)); 
    147147 
    148148  return PSPIO_SUCCESS; 
    149149} 
     150 
     151 
     152int pspio_pspdata_kbprojector_get(const pspio_pspdata_t *data, const int l, 
     153      const double j, const double r, double *value) { 
     154  ASSERT(data != NULL, PSPIO_ERROR); 
     155  ASSERT(value != NULL, PSPIO_ERROR); 
     156  ASSERT( (l >=0) && 
     157         ((j == 0) || (abs(j - (double)l) - 0.5 < 10e-9)), PSPIO_ERROR); 
     158 
     159  HANDLE_FUNC_ERROR(pspio_meshfunc_eval(data->kb_projectors[l+(int)j]->proj,r,value)); 
     160 
     161  return PSPIO_SUCCESS; 
     162} 
  • trunk/src/pspio_pspdata.h

    r180 r183  
    9797 
    9898  // The states 
    99   int n_states;          /**< number of electronic states */ 
     99  int **qn_to_istate;     /**< table giving the position of the state from the quantum numbers */  
     100  int n_states;           /**< number of electronic states */ 
    100101  pspio_state_t **states; /**< struct with electronic states */ 
    101102 
     
    153154 * radius and angular momenta. 
    154155 * @param[in] psp_data: pointer to psp_data structure to be probed 
    155  * @param[in] n: quantum number 
    156156 * @param[in] l: angular momentum 
    157157 * @param[in] j: total angular momentum 
     
    162162 *       keep performance in mind when tweaking it. 
    163163 */ 
    164 int pspio_pspdata_potential_get(const pspio_pspdata_t *data, const int n, 
    165       const int l, const double j, const double r, double *value); 
     164int pspio_pspdata_potential_get(const pspio_pspdata_t *data, const int l,  
     165     const double j, const double r, double *value); 
     166 
     167/** 
     168 * Gets a KB projector associated with the psp_data structure for given 
     169 * radius and angular momenta. 
     170 * @param[in] psp_data: pointer to psp_data structure to be probed 
     171 * @param[in] l: angular momentum 
     172 * @param[in] j: total angular momentum 
     173 * @param[in] r: radius 
     174 * @param[out] value: value of the specified projector at r 
     175 * @return error code. 
     176 * @note This routine is called many times when using Libpspio. Please 
     177 *       keep performance in mind when tweaking it. 
     178 */ 
     179int pspio_pspdata_kbprojector_get(const pspio_pspdata_t *data, const int l, 
     180      const double j, const double r, double *value); 
    166181 
    167182#endif 
Note: See TracChangeset for help on using the changeset viewer.