Пример #1
0
void get_fxc(xc_func_type *func, double point[5], double der[5][5])
{
  double v2rho[3], v2rhosigma[6], v2sigma[6];
  int i, j;

  for(i=0; i<5; i++)
    for(j=0; j<5; j++)
      der[i][j] = 0.0;

  for(i=0; i<3; i++) v2rho[i] = 0.0;
  for(i=0; i<6; i++){
    v2rhosigma[i] = 0.0;
    v2sigma[i]    = 0.0;
  }

  switch(func->info->family)
    {
    case XC_FAMILY_LDA:
      xc_lda_fxc(func, 1, &(point[0]), v2rho);
      break;
    case XC_FAMILY_GGA:
    case XC_FAMILY_HYB_GGA:
      xc_gga_fxc(func, 1, &(point[0]), &(point[2]),
		 v2rho, v2rhosigma, v2sigma);
      break;
    }

  der[0][0] = v2rho[0];
  der[0][1] = der[1][0] = v2rho[1];
  der[1][1] = v2rho[2];
  der[0][2] = der[2][0] = v2rhosigma[0];
  der[0][3] = der[3][0] = v2rhosigma[1];
  der[0][4] = der[4][0] = v2rhosigma[2];
  der[1][2] = der[2][1] = v2rhosigma[3];
  der[1][3] = der[3][1] = v2rhosigma[4];
  der[1][4] = der[4][1] = v2rhosigma[5];
  der[2][2] = v2sigma[0];
  der[2][3] = der[3][2] = v2sigma[1];
  der[2][4] = der[4][2] = v2sigma[2];
  der[3][3] = v2sigma[3];
  der[3][4] = der[4][3] = v2sigma[4];
  der[4][4] = v2sigma[5];
}
Пример #2
0
void get_fxc(functionals_type *func, double point[5], double der[5][5])
{
    double v2rho[3], v2rhosigma[6], v2sigma[6];
    int i;

    for(i=0; i<3; i++) v2rho[i] = 0.0;
    for(i=0; i<6; i++) {
        v2rhosigma[i] = 0.0;
        v2sigma[i]    = 0.0;
    }

    switch(func->family)
    {
    case XC_FAMILY_LDA:
        xc_lda_fxc(&(func->lda_func), &(point[0]), v2rho);
        break;
    case XC_FAMILY_GGA:
        xc_gga_fxc(&(func->gga_func), &(point[0]), &(point[2]),
                   v2rho, v2rhosigma, v2sigma);
        break;
        //case XC_FAMILY_HYB_GGA:
        //xc_hyb_gga(&(func->hyb_gga_func), &(point[0]), &(point[2]),
        //    e, &(der[0]), &(der[2]));
        //break;
    }

    der[0][0] = v2rho[0];
    der[0][1] = der[1][0] = v2rho[1];
    der[1][1] = v2rho[2];
    der[0][2] = der[2][0] = v2rhosigma[0];
    der[0][3] = der[3][0] = v2rhosigma[1];
    der[0][4] = der[4][0] = v2rhosigma[2];
    der[1][2] = der[2][1] = v2rhosigma[3];
    der[1][3] = der[3][1] = v2rhosigma[4];
    der[1][4] = der[4][1] = v2rhosigma[5];
    der[2][2] = v2sigma[0];
    der[2][3] = der[3][2] = v2sigma[1];
    der[2][4] = der[4][2] = v2sigma[2];
    der[3][3] = v2sigma[3];
    der[3][4] = der[4][3] = v2sigma[4];
    der[4][4] = v2sigma[5];
}
Пример #3
0
    void evalEXC_VXC_FXC(size_t N, double *rho, double *eps, double *vxc, double *fxc) {

      evalEXC_VXC(N,rho,eps,vxc);
      xc_lda_fxc(&this->functional_,N,rho,fxc);

    }