Changeset c76393


Ignore:
Timestamp:
Apr 23, 2008, 4:30:20 PM (17 years ago)
Author:
Frederik Heber <heber@…>
Children:
5bef9d
Parents:
51af4a
Message:

lots of changes only with regard to output of sigma, chi and moments

Basically, we just differentiate between ValueOut and ReadOut. This first only prints the interesting values without the rest of the PAS stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified pcp/src/perturbed.c

    r51af4a rc76393  
    29392939 
    29402940  if (P->Call.out[ValueOut]) fprintf(stderr,"(%i) magnetic susceptibility tensor \\Chi_ij = \n",P->Par.me);
     2941  if (P->Call.out[ReadOut]) fprintf(stderr,"\n");
    29412942  for (in=0; in<NDIM; in++) { // index i of integrand vector component
    29422943    for(dex=0;dex<4;dex++)  // initialise cross lookup
     
    29672968      I->I[0].chi[in+dex*NDIM] = Chi[in+dex*NDIM];
    29682969      Chi[in+dex*NDIM] *= Lat->Volume*loschmidt_constant; // factor for _molar_ susceptibility
    2969       if (P->Call.out[ValueOut]) {
     2970      if (P->Call.out[ReadOut]) {
    29702971        fprintf(stderr,"%e\t", Chi[in+dex*NDIM]);
    29712972        if (dex == NDIM-1) fprintf(stderr,"\n");
     
    30123013    A += pow(-1,i)*pow(0.5*(Chi[in+dex*NDIM]-Chi[dex+in*NDIM]),2);
    30133014  }
    3014   if (P->Call.out[ValueOut]) {
     3015  if (P->Call.out[ReadOut]) {
    30153016    fprintf(stderr,"(%i) converted to Principal Axis System\n==================\nDiagonal entries:", P->Par.me);
    30163017    for (i=0;i<NDIM;i++)
    30173018      fprintf(stderr,"\t%lg",gsl_vector_get(eval,i));
    3018     fprintf(stderr,"\nsusceptib. : %e\n", iso);
     3019  }
     3020  if (P->Call.out[ValueOut]) {
     3021    if (P->Call.out[ReadOut])
     3022      fprintf(stderr,"\nsusceptib. : %e\n", iso);
     3023    else
     3024      fprintf(stderr,"%e\n", iso);
     3025  }
     3026  if (P->Call.out[ReadOut]) {
    30193027    fprintf(stderr,"anisotropy : %e\n", delta_chi);
    30203028    fprintf(stderr,"asymmetry  : %e\n", eta);
     
    31193127  for (in=0;in<NDIM*NDIM;in++) {
    31203128    CalculateOneDensityC(Lat, R->LevS, Dens0, CurrentDensity[in], CurrentDensityC[in], factorDC);
    3121     TestReciprocalCurrent(P, CurrentDensityC[in], GArray, in);
     3129    //TestReciprocalCurrent(P, CurrentDensityC[in], GArray, in);
    31223130  }
    31233131
     
    31673175        }
    31683176      }
    3169       // fabs() all sigma values, as we need them as a positive density: OutputVis plots them in logarithmic scale and
    3170       // thus cannot deal with negative values!
    3171       for (i=0; i< Dens0->LocalSizeR; i++)
    3172         sigma_real[in+dex*NDIM][i] = fabs(sigma_real[in+dex*NDIM][i]);
    31733177    }
    31743178  }
     
    31943198  for (it=0; it < I->Max_Types; it++) {  // integration over all types
    31953199    for (ion=0; ion < I->I[it].Max_IonsOfType; ion++) { // and each ion of type
    3196       if (P->Call.out[ValueOut]) fprintf(stderr,"(%i) Shielding Tensor for Ion %i of element %s \\sigma_ij = \n",P->Par.me, ion, I->I[it].Name);
     3200      if (P->Call.out[ValueOut]) fprintf(stderr,"(%i) Shielding Tensor for Ion %i of element %s \\sigma_ij = ",P->Par.me, ion, I->I[it].Name);
     3201      if (P->Call.out[ReadOut]) fprintf(stderr,"\n");
    31973202      for (in=0; in<NDIM; in++) { // index i of vector component in integrand
    31983203        for (dex=0; dex<NDIM; dex++) {// index j of B component derivation in current density tensor
    31993204          gsl_matrix_complex_set(H,in,dex,gsl_complex_rect((I->I[it].sigma_rezi[ion][in+dex*NDIM]+I->I[it].sigma_rezi[ion][dex+in*NDIM])/2.,0));
    3200           if (P->Call.out[ValueOut]) fprintf(stderr,"%e\t", I->I[it].sigma_rezi[ion][in+dex*NDIM]);
     3205          if (P->Call.out[ReadOut]) fprintf(stderr,"%e\t", I->I[it].sigma_rezi[ion][in+dex*NDIM]);
    32013206        }
    3202         if (P->Call.out[ValueOut]) fprintf(stderr,"\n");
     3207        if (P->Call.out[ReadOut]) fprintf(stderr,"\n");
    32033208      }
    32043209      // output tensor to file
     
    32383243        A += pow(-1,i)*pow(0.5*(I->I[it].sigma_rezi[ion][in+dex*NDIM]-I->I[it].sigma_rezi[ion][dex+in*NDIM]),2);
    32393244      }
    3240       if (P->Call.out[ValueOut]) {
     3245      if (P->Call.out[ReadOut]) {
    32413246        fprintf(stderr,"(%i) converted to Principal Axis System\n==================\nDiagonal entries:", P->Par.me);
    32423247        for (i=0;i<NDIM;i++)
    32433248          fprintf(stderr,"\t%lg",gsl_vector_get(eval,i));
    3244         fprintf(stderr,"\nshielding  : %e\n", iso);
     3249      }
     3250      if (P->Call.out[ValueOut]) {
     3251        if (P->Call.out[ReadOut])
     3252          fprintf(stderr,"\nshielding  : %e\n", iso);
     3253        else
     3254          fprintf(stderr,"%e\n", iso);
     3255      }
     3256      if (P->Call.out[ReadOut]) {
    32453257        fprintf(stderr,"anisotropy : %e\n", delta_sigma);
    32463258        fprintf(stderr,"asymmetry  : %e\n", eta);
     
    32843296    }
    32853297  }
    3286    
     3298
     3299  // fabs() all sigma values, as we need them as a positive density: OutputVis plots them in logarithmic scale and
     3300  // thus cannot deal with negative values!
     3301  for (in=0; in<NDIM; in++) {// index i of vector component in integrand
     3302    for (dex=0; dex<NDIM; dex++) { // index j of B component derivation in current density tensor
     3303      for (i=0; i< Dens0->LocalSizeR; i++)
     3304        sigma_real[in+dex*NDIM][i] = fabs(sigma_real[in+dex*NDIM][i]);
     3305    }
     3306  }   
    32873307  if (Lev0->LevelNo == 0) {
    32883308    if (!P->Par.me && P->Call.out[NormalOut]) fprintf(stderr,"(%i)Output of NICS map ...\n", P->Par.me);
     
    33713391  for (it=0; it < I->Max_Types; it++) {  // integration over all types
    33723392    for (ion=0; ion < I->I[it].Max_IonsOfType; ion++) { // and each ion of type
    3373       if (P->Call.out[ValueOut]) fprintf(stderr,"(%i) Magnetic dipole moment Tensor for Ion %i of element %s \\moment_ij = \n",P->Par.me, ion, I->I[it].Name);
     3393      if (P->Call.out[ValueOut]) fprintf(stderr,"(%i) Magnetic dipole moment Tensor for Ion %i of element %s \\moment_ij = ",P->Par.me, ion, I->I[it].Name);
     3394      if (P->Call.out[ReadOut]) fprintf(stderr,"\n");
    33743395      for (in=0; in<NDIM; in++) {// index i of vector component in integrand
    33753396        for (dex=0; dex<NDIM; dex++) { // index j of B component derivation in current density tensor
     
    33943415          MPI_Allreduce ( &moment[in+dex*NDIM], &Moment[in+dex*NDIM], 1, MPI_DOUBLE, MPI_SUM, P->Par.comm_ST_Psi);  // sum "LocalSize to TotalSize"
    33953416          I->I[it].moment[ion][in+dex*NDIM] = Moment[in+dex*NDIM];         
    3396           if (P->Call.out[ValueOut]) fprintf(stderr," %e", Moment[in+dex*NDIM]);
     3417          if (P->Call.out[ReadOut]) fprintf(stderr," %e", Moment[in+dex*NDIM]);
    33973418        }
    3398         if (P->Call.out[ValueOut]) fprintf(stderr,"\n");
     3419        if (P->Call.out[ReadOut]) fprintf(stderr,"\n");
    33993420      }
    34003421      // store symmetrized matrix
     
    34413462        A += pow(-1,i)*pow(0.5*(Moment[in+dex*NDIM]-Moment[dex+in*NDIM]),2);
    34423463      }
    3443       if (P->Call.out[ValueOut]) {
     3464      if (P->Call.out[ReadOut]) {
    34443465        fprintf(stderr,"(%i) converted to Principal Axis System\n==================\nDiagonal entries:", P->Par.me);
    34453466        for (i=0;i<NDIM;i++)
    34463467          fprintf(stderr,"\t%lg",gsl_vector_get(eval,i));
    3447         fprintf(stderr,"\nshielding  : %e\n", iso);
     3468      }
     3469      if (P->Call.out[ValueOut]) {
     3470        if (P->Call.out[ReadOut])
     3471          fprintf(stderr,"moment  : %e\n", iso);
     3472        else
     3473          fprintf(stderr,"%e\n", iso);
     3474      }
     3475      if (P->Call.out[ReadOut]) {
    34483476        fprintf(stderr,"anisotropy : %e\n", delta_moment);
    34493477        fprintf(stderr,"asymmetry  : %e\n", eta);
     
    34513479        fprintf(stderr,"A          : %e\n", A);
    34523480        fprintf(stderr,"==================\n");
    3453        
    3454       }
     3481    }
    34553482      gsl_vector_free(eval);
    34563483    }
Note: See TracChangeset for help on using the changeset viewer.