- Timestamp:
- Apr 22, 2008, 12:19:38 PM (17 years ago)
- Children:
- cc9c36
- Parents:
- 34b70c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pcp/src/perturbed.c
r34b70c r87b8ed 3248 3248 } 3249 3249 3250 // Output of magnetic field densities for each direction 3251 for (i=0;i<NDIM*NDIM;i++) 3252 OutputVis(P, sigma_real[i]); 3253 // Diagonalizing the tensor "field" B_ij [r] 3254 fprintf(stderr,"(%i) Diagonalizing B_ij [r] ... \n", P->Par.me); 3255 for (i=0; i< Dens0->LocalSizeR; i++) { 3256 for (in=0; in<NDIM; in++) // index i of vector component in integrand 3257 for (dex=0; dex<NDIM; dex++) { // index j of B component derivation in current density tensor 3258 //fprintf(stderr,"(%i) Setting B_(%i,%i)[%i] ... \n", P->Par.me, in,dex,i); 3259 gsl_matrix_complex_set(H,in,dex,gsl_complex_rect((sigma_real[in+dex*NDIM][i]+sigma_real[dex+in*NDIM][i])/2.,0)); 3250 if (R->MaxOuterStep > 0) { // if we do MD, calculate magnetic force with undiagonalised B fields 3251 for (it=0; it < I->Max_Types; it++) { // integration over all types 3252 for (ion=0; ion < I->I[it].Max_IonsOfType; ion++) { // and each ion of type 3253 // Finally use the magnetic moment in order to calculate the magnetic force 3254 RMat33Vec3(x, Lat->ReciBasis, &(I->I[it].R[NDIM*ion])); 3255 for (d=0;d<NDIM;d++) 3256 n[d] = (int)(x[d]/(2.*PI)*(double)N[d]); // round to next nearest mesh point 3257 // n[d] = (int)(I->I[it].R[NDIM*ion+d]/Lat->RealBasisQ[d]*(double)N[d]); 3258 for (d=0;d<NDIM;d++) { // index of induced magnetic field 3259 I->I[it].FMagnetic[d+ion*NDIM] = 0.; 3260 for (j=0;j<NDIM;j++) {// we to sum over all external field components 3261 //fprintf(stderr,"(%i) Calculating magnetic force component %i over field component %i of ion (type %i, nr %i)\n", P->Par.me, d, j, it, ion); 3262 I->I[it].FMagnetic[d+ion*NDIM] += - I->I[it].moment[ion][d] * FirstDiscreteDerivative(P, Lev0, sigma_real[d+NDIM*j], n, d, P->Par.me_comm_ST_Psi)*P->R.BField[j]; 3263 } 3264 } 3260 3265 } 3261 gsl_eigen_herm(H, eval, w); 3262 gsl_sort_vector(eval); // sort eigenvalues 3263 for (in=0;in<NDIM;in++) 3264 sigma_real[in][i] = gsl_vector_get(eval,in); 3266 } 3265 3267 } 3266 3268
Note:
See TracChangeset
for help on using the changeset viewer.