Changeset 0f2c43 for pcp


Ignore:
Timestamp:
Apr 22, 2008, 9:07:27 AM (17 years ago)
Author:
Frederik Heber <heber@…>
Children:
6edeca
Parents:
f72dc1
Message:

CalculateIonLocalForce(): local Pseudopotential and Columbpotential summing split up, counter s removed

nothing really changed, only the summands split up into individual lines. Also, the counting variable s was removed, as it was unnecessary (one may drop the initializing statement from the for(..) statement).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pcp/src/pseudo.c

    rf72dc1 r0f2c43  
    10731073void CalculateIonLocalForce(struct Problem *P)
    10741074{
    1075   int is,ia,g2,Index,s,i;
     1075  int is,ia,g2,Index,i;
    10761076  double *G;
    10771077  struct Lattice *L = &P->Lat;
     
    11001100    for (ia=0;ia< I->I[is].Max_IonsOfType; ia++) {
    11011101      dsum = &I->FTemp[ia*NDIM];
    1102       s = 0;
    1103       if (Lev0->GArray[0].GSq == 0.0)
    1104                 s++;
    1105       for (g2=s; g2 < Lev0->MaxG; g2++) {
     1102      g2 = 0;
     1103      if (fabs(Lev0->GArray[g2].GSq) < MYEPSILON)
     1104                g2++;
     1105      for (; g2 < Lev0->MaxG; g2++) {
    11061106                Index = Lev0->GArray[g2].Index;
    11071107                G = Lev0->GArray[g2].G;
    1108                 c_re(cv) = c_re(PP->VCoulombc[g2])*PP->FacGauss[is][g2]+PP->phi_ps_loc[is][g2]*c_re(Dens->DensityCArray[TotalDensity][Index])*R->HGcFactor;
    1109                 c_im(cv) = c_im(PP->VCoulombc[g2])*PP->FacGauss[is][g2]-PP->phi_ps_loc[is][g2]*c_im(Dens->DensityCArray[TotalDensity][Index])*R->HGcFactor;
     1108        //debug(P,"Lokal Pseudopotential");
     1109        c_re(cv) =  PP->phi_ps_loc[is][g2]*c_re(Dens->DensityCArray[TotalDensity][Index])*R->HGcFactor;
     1110        c_im(cv) = -PP->phi_ps_loc[is][g2]*c_im(Dens->DensityCArray[TotalDensity][Index])*R->HGcFactor;
     1111        //debug(P,"Coulombpotential");
     1112        c_re(cv) += c_re(PP->VCoulombc[g2])*PP->FacGauss[is][g2];
     1113                c_im(cv) += c_im(PP->VCoulombc[g2])*PP->FacGauss[is][g2];
    11101114        if (I->I[is].corecorr == CoreCorrected) {
    11111115          // this summand was missing before, is not thoroughly tested
Note: See TracChangeset for help on using the changeset viewer.