- Timestamp:
- Apr 22, 2008, 11:18:34 AM (17 years ago)
- Children:
- 1d77026
- Parents:
- d2f1b1
- Location:
- pcp/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified pcp/src/perturbed.c ¶
rd2f1b1 r8786c3 3062 3062 CurrentDensity[8] = (fftw_real *) Dens0->DensityArray[CurrentDensity8]; 3063 3063 3064 if (P->Call.out[StepLeaderOut]) fprintf(stderr,"(%i) Checking J_{ij} (G=0) = 0 for each i,j ... \n",P->Par.me); 3064 // inverse Fourier transform current densities 3065 if (P->Call.out[LeaderOut]) fprintf(stderr,"(%i) Transforming and checking J_{ij} (G=0) = 0 for each i,j ... \n",P->Par.me); 3065 3066 for (in=0;in<NDIM*NDIM;in++) { 3066 3067 CalculateOneDensityC(Lat, R->LevS, Dens0, CurrentDensity[in], CurrentDensityC[in], factorDC); 3067 tmp = sqrt(CurrentDensityC[in][0].re*CurrentDensityC[in][0].re+CurrentDensityC[in][0].im*CurrentDensityC[in][0].im); 3068 if (GArray[0].GSq < MYEPSILON) { 3069 if (in % NDIM == 0) fprintf(stderr,"(%i) ",P->Par.me); 3070 if (tmp > MYEPSILON) { 3071 fprintf(stderr,"J_{%i,%i} = |%e + i%e| < %e ? (%e)\t", in / NDIM, in%NDIM, CurrentDensityC[in][0].re, CurrentDensityC[in][0].im, MYEPSILON, tmp - MYEPSILON); 3072 } else { 3073 fprintf(stderr,"J_{%i,%i} ok\t", in / NDIM, in%NDIM); 3074 } 3075 if (in % NDIM == (NDIM-1)) fprintf(stderr,"\n"); 3076 } 3077 } 3078 3068 TestReciprocalCurrent(P, CurrentDensityC[in], GArray, in); 3069 } 3070 3071 // linking pointers to the arrays 3079 3072 for (in=0;in<NDIM*NDIM;in++) { 3080 3073 LockDensityArray(Dens0,in,real); // Psi1R … … 3397 3390 3398 3391 gsl_matrix_complex_free(H); 3392 } 3393 3394 /** Test if G=0-component of reciprocal current is 0. 3395 * In most cases we do not reach a numerical sensible zero as in MYEPSILON and remain satisfied as long 3396 * as the integrated current density is very small (e.g. compared to single entries in the current density array) 3397 * \param *P Problem at hand 3398 * \param *CurrentC pointer to reciprocal current density 3399 * \param *GArray pointer to array with G vectors 3400 * \param in index of current component 3401 * \sa TestCurrent() these two tests are equivalent and follow by fourier transformation 3402 */ 3403 void TestReciprocalCurrent(struct Problem *P, const fftw_complex *CurrentC, struct OneGData *GArray, int in) 3404 { 3405 double tmp; 3406 tmp = sqrt(CurrentC[0].re*CurrentC[0].re+CurrentC[0].im*CurrentC[0].im); 3407 if ((P->Call.out[LeaderOut]) && (GArray[0].GSq < MYEPSILON)) { 3408 if (in % NDIM == 0) fprintf(stderr,"(%i) ",P->Par.me); 3409 if (tmp > MYEPSILON) { 3410 fprintf(stderr,"J_{%i,%i} = |%e + i%e| < %e ? (%e)\t", in / NDIM, in%NDIM, CurrentC[0].re, CurrentC[0].im, MYEPSILON, tmp - MYEPSILON); 3411 } else { 3412 fprintf(stderr,"J_{%i,%i} ok\t", in / NDIM, in%NDIM); 3413 } 3414 if (in % NDIM == (NDIM-1)) fprintf(stderr,"\n"); 3415 } 3399 3416 } 3400 3417 -
TabularUnified pcp/src/perturbed.h ¶
rd2f1b1 r8786c3 49 49 void TestSawtooth(struct Problem *P, const int index); 50 50 void TestCurrent(struct Problem *P, const int index); 51 void TestReciprocalCurrent(struct Problem *P, const fftw_complex *currentC, struct OneGData *GArray, int in); 51 52 52 53 #endif /*PERTURBED_H_*/
Note:
See TracChangeset
for help on using the changeset viewer.