Changeset 3281 in Sophya for trunk/Cosmo/SimLSS/genefluct3d.cc
- Timestamp:
- Jul 10, 2007, 7:23:38 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/SimLSS/genefluct3d.cc
r3271 r3281 25 25 #include "genefluct3d.h" 26 26 27 //#define FFTW_THREAD27 #define FFTW_THREAD 28 28 29 29 #define MODULE2(_x_) ((double)((_x_).real()*(_x_).real() + (_x_).imag()*(_x_).imag())) … … 437 437 init_fftw(); 438 438 SetObservator(zref,kzref); 439 } catch (PThrowable & exc) { 440 cout<<"Exception : "<<(string)typeid(exc).name() 441 <<" - Msg= "<<exc.Msg()<<endl; 442 return; 443 } catch (...) { 444 cout<<" some other exception was caught !"<<endl; 445 return; 446 } 447 } 448 449 void GeneFluct3D::WriteSlicePPF(string cfname) 450 // On ecrit 3 tranches du cube selon chaque axe 451 { 452 cout<<"--- GeneFluct3D::WriteSlicePPF: Writing Cube Slices"<<cfname<<endl; 453 try { 454 455 POutPersist pos(cfname.c_str()); 456 TMatrix<r_4> S; 457 char str[16]; 458 long i,j,l; 459 460 // Tranches en Z 461 for(int s=0;s<3;s++) { 462 S.ReSize(Nx_,Ny_); 463 if(s==0) l=0; else if(s==1) l=(Nz_+1)/2; else l=Nz_-1; 464 sprintf(str,"z%d",l); 465 for(i=0;i<Nx_;i++) for(j=0;j<Ny_;j++) S(i,j)=data_[IndexR(i,j,l)]; 466 pos<<PPFNameTag(str)<<S; S.RenewObjId(); 467 } 468 469 // Tranches en Y 470 for(int s=0;s<3;s++) { 471 S.ReSize(Nz_,Nx_); 472 if(s==0) j=0; else if(s==1) j=(Ny_+1)/2; else j=Ny_-1; 473 sprintf(str,"y%d",j); 474 for(i=0;i<Nx_;i++) for(l=0;l<Nz_;l++) S(l,i)=data_[IndexR(i,j,l)]; 475 pos<<PPFNameTag(str)<<S; S.RenewObjId(); 476 } 477 478 // Tranches en X 479 for(int s=0;s<3;s++) { 480 S.ReSize(Nz_,Ny_); 481 if(s==0) i=0; else if(s==1) i=(Nx_+1)/2; else i=Nx_-1; 482 sprintf(str,"x%d",i); 483 for(j=0;j<Ny_;j++) for(l=0;l<Nz_;l++) S(l,j)=data_[IndexR(i,j,l)]; 484 pos<<PPFNameTag(str)<<S; S.RenewObjId(); 485 } 486 439 487 } catch (PThrowable & exc) { 440 488 cout<<"Exception : "<<(string)typeid(exc).name()
Note:
See TracChangeset
for help on using the changeset viewer.