Search vortices in a 2D complex field: Inputs: pTh, pu: mesh and complex P1 field representing the wavefunction Outputs: ppoints: array storing vortex coordinates pucharge: P0 function: =1 in triangles containing a vortex point, =0 otherwise pdmin: minimum distance between the vortices Returns: nbc: number of vortices
| 362 | // Returns: |
| 363 | // nbc: number of vortices |
| 364 | double intdphase(bool bb,Complex const & a,Complex const & b,double const & eps) |
| 365 | { |
| 366 | const double twopi = 2.*Pi; |
| 367 | double zz = bb ? 1. : -1.; |
| 368 | zz=0; // in test !!!! FH. |
| 369 | // zero entra ua et ub => 0 phase ??? |
| 370 | Complex ab(b-a); |
| 371 | if (abs(ab)<eps) return zz*100; |
| 372 | // 0= a + l ab => l = -a/ab |
| 373 | Complex l= -a / ab; |
| 374 | |
| 375 | if( abs(l.imag())<eps) { |
| 376 | // cout << " intdphase "<< l << " " << arg(a/b) << " " << a/b << endl; |
| 377 | // l est real ??? |
| 378 | // verif si l in [0,1] |
| 379 | double lr = l.imag(); |
| 380 | if( lr> -eps && lr < 1+eps ) { |
| 381 | // zero sur a,b |
| 382 | return zz*10; |
| 383 | } else return zz*20; |
| 384 | } |
| 385 | static int count =0; |
| 386 | double dw =arg(b/a)/twopi; |
| 387 | // if(count++<100) cout << dw << endl; |
| 388 | return dw; |
| 389 | |
| 390 | } |
| 391 | |
| 392 | double ChargeF(int i1,int i2,int i3,Complex u[3], double const & eps) |
| 393 | { |