*** /home/muntwiler_m/mnt/pearl_data/software/edac/edac_all.cpp 2011-04-14 23:38:44.000000000 +0200 --- edac_all.cpp 2018-02-05 17:30:17.347373088 +0100 *************** *** 3085,3090 **** --- 3085,3091 ---- numero Vxc_Barth_Hedin(numero den, numero denup) { if(den<1e-10) return 0; + if(denup<0) denup=0; numero rs=1/pow(4*pi/3*den, 1/3.0); numero x=denup/den; numero alpha0=pow(4/(9*pi), 1/3.0); *************** *** 10117,10122 **** --- 10118,10124 ---- void scan_imfp(char *name); void scan_imfp(FILE *fout); numero iimfp_TPP(numero kr); + numero iimfp_SD(numero kr); numero TPP_rho, TPP_Nv, TPP_Ep, TPP_Eg; numero screening_length; int scattering_so; *************** *** 10230,10235 **** --- 10232,10238 ---- int n_th; int n_fi; + int n_ang; numero *th, *fi; numero *th_out, *************** *** 10239,10244 **** --- 10242,10248 ---- void free(void); void init_th(numero thi, numero thf, int nth); void init_phi(numero fii, numero fif, int nfi); + void read_angles(FILE *fin, char *my_file); void init_refraction( numero refraction); void init_transmission( *************** *** 10905,10942 **** } numero calculation::IIIthfi(int no, numero th, numero fi) { ! numero ii,ii0, xth,xfi; ! numero th0=final.th[0], th1=final.th[final.n_th-1]; numero fi0=final.fi[0], fi1=final.fi[final.n_fi-1]; int ith,ifi,ij; while(fi<0) fi+=2*pi; while(fi>2*pi) fi-=2*pi; ! xth=(final.n_th-1)*(th-th0)/(th1-th0); ith=int(floor(xth-0.001)); ! xfi=(final.n_fi-1)*(fi-fi0)/(fi1-fi0); ifi=int(floor(xfi-0.001)); if(ifi==-1) ifi=0; if(0<=ith && ith2*pi) fi-=2*pi; ! xth=(final.n_th-1)*(th-th0)/(th1-th0); ith=int(floor(xth-0.0001)); ! xfi=(final.n_fi-1)*(fi-fi0)/(fi1-fi0); ifi=int(floor(xfi-0.0001)); if(ifi==-1) ifi=0; + if(ith==-1) ith=0; if(0<=ith && ith0.1?i:0.1); //gauss weight * radial weight ! nw += cf; //sum of weights ! val+=IIIthfi(no,th2,ph2)*cf; } ! return val/nw; } + void calculation::write_ang(FILE *fout_, int ik) { int no,nno,i,j; *************** *** 10961,10967 **** for(no=0; no1) { + delete [] th; delete [] th_out; delete [] transmission; delete [] fi; + n_th=nang; + th=new numero [n_th]; + th_out=new numero [n_th]; + transmission=new numero [n_th]; + n_fi=nang; + fi=new numero [n_fi]; + for(i=0; i