binhor_kij.C

00001 /*
00002  *   Copyright (c) 2004-2005 Francois Limousin
00003  *                           Jose Luis Jaramillo                       
00004  *
00005  *   This file is part of LORENE.
00006  *
00007  *   LORENE is free software; you can redistribute it and/or modify
00008  *   it under the terms of the GNU General Public License as published by
00009  *   the Free Software Foundation; either version 2 of the License, or
00010  *   (at your option) any later version.
00011  *
00012  *   LORENE is distributed in the hope that it will be useful,
00013  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *   GNU General Public License for more details.
00016  *
00017  *   You should have received a copy of the GNU General Public License
00018  *   along with LORENE; if not, write to the Free Software
00019  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020  *
00021  */
00022 
00023 
00024 char binhor_kij_C[] = "$Header: /cvsroot/Lorene/C++/Source/Bin_hor/binhor_kij.C,v 1.9 2007/04/13 15:28:55 f_limousin Exp $" ;
00025 
00026 /*
00027  * $Id: binhor_kij.C,v 1.9 2007/04/13 15:28:55 f_limousin Exp $
00028  * $Log: binhor_kij.C,v $
00029  * Revision 1.9  2007/04/13 15:28:55  f_limousin
00030  * Lots of improvements, generalisation to an arbitrary state of
00031  * rotation, implementation of the spatial metric given by Samaya.
00032  *
00033  * Revision 1.8  2006/05/24 16:56:37  f_limousin
00034  * Many small modifs.
00035  *
00036  * Revision 1.7  2005/09/13 18:33:15  f_limousin
00037  * New function vv_bound_cart_bin(double) for computing binaries with
00038  * berlin condition for the shift vector.
00039  * Suppress all the symy and asymy in the importations.
00040  *
00041  * Revision 1.6  2005/04/29 14:02:44  f_limousin
00042  * Important changes : manage the dependances between quantities (for
00043  * instance psi and psi4). New function write_global(ost).
00044  *
00045  * Revision 1.5  2005/03/10 17:21:52  f_limousin
00046  * Add the Berlin boundary condition for the shift.
00047  * Some changes to avoid warnings.
00048  *
00049  * Revision 1.4  2005/03/03 13:49:35  f_limousin
00050  * Add the spectral bases for both Scalars decouple.
00051  *
00052  * Revision 1.3  2005/02/07 10:48:00  f_limousin
00053  * The extrinsic curvature can now be computed in the case N=0 on the
00054  * horizon.
00055  *
00056  * Revision 1.2  2004/12/31 15:41:54  f_limousin
00057  * Correction of an error
00058  *
00059  * Revision 1.1  2004/12/29 16:12:03  f_limousin
00060  * First version
00061  *
00062  *
00063  * $Header: /cvsroot/Lorene/C++/Source/Bin_hor/binhor_kij.C,v 1.9 2007/04/13 15:28:55 f_limousin Exp $
00064  *
00065  */
00066 
00067 
00068 //standard
00069 #include <stdlib.h>
00070 #include <math.h>
00071 
00072 // Lorene
00073 #include "nbr_spx.h"
00074 #include "tenseur.h"
00075 #include "tensor.h"
00076 #include "isol_hor.h"
00077 #include "proto.h"
00078 #include "utilitaires.h"
00079 //#include "graphique.h"
00080 
00081 void Bin_hor::extrinsic_curvature () {
00082     
00083 
00084     int nnt = hole1.mp.get_mg()->get_nt(1) ;
00085     int nnp = hole1.mp.get_mg()->get_np(1) ;
00086     
00087     int check ;
00088     check = 0 ;
00089     for (int k=0; k<nnp; k++)
00090     for (int j=0; j<nnt; j++){
00091         if ((hole1.n_auto+hole1.n_comp).val_grid_point(1, k, j , 0) < 1e-4){
00092         check = 1 ;
00093         break ;
00094         }
00095     }
00096     
00097     Sym_tensor aa_auto_un (hole1.mp, CON, hole1.mp.get_bvect_spher()) ;
00098     Sym_tensor aa_auto_deux (hole2.mp, CON, hole2.mp.get_bvect_spher()) ;
00099        
00100     if (check == 0){
00101       
00102       // Computation of A^{ij}_auto
00103       
00104       aa_auto_un = ( hole1.beta_auto.ope_killing_conf(hole1.tgam) + 
00105              hole1.gamt_point*hole1.decouple ) / (2.* hole1.nn) ; 
00106       
00107       aa_auto_deux = ( hole2.beta_auto.ope_killing_conf(hole2.tgam) + 
00108                hole2.gamt_point*hole2.decouple ) / (2.* hole2.nn) ;  
00109           
00110       
00111       aa_auto_un.change_triad(hole1.mp.get_bvect_cart()) ;
00112       aa_auto_deux.change_triad(hole2.mp.get_bvect_cart()) ;
00113       
00114       for (int i=1 ; i<=3 ; i++)
00115     for (int j=i ; j<=3 ; j++) {
00116       if (aa_auto_un(i,j).get_etat() != ETATZERO)
00117         aa_auto_un.set(i, j).raccord(3) ;
00118       if (aa_auto_deux(i,j).get_etat() != ETATZERO)
00119         aa_auto_deux.set(i, j).raccord(3) ;
00120     }
00121       
00122       aa_auto_un.change_triad(hole1.mp.get_bvect_spher()) ;
00123       aa_auto_deux.change_triad(hole2.mp.get_bvect_spher()) ;
00124       
00125       hole1.aa_auto = aa_auto_un ;
00126       hole2.aa_auto = aa_auto_deux ;
00127     
00128       
00129       // Computation of A^{ij}_comp
00130       
00131       aa_auto_un.dec_dzpuis(2) ;
00132       aa_auto_deux.dec_dzpuis(2) ;
00133       
00134       Sym_tensor aa_comp_un (hole1.mp, CON, hole1.mp.get_bvect_cart()) ;
00135       aa_comp_un.set_etat_qcq() ;
00136       Sym_tensor aa_comp_deux (hole2.mp, CON, hole2.mp.get_bvect_cart()) ;
00137       aa_comp_deux.set_etat_qcq() ;
00138       
00139       aa_auto_deux.change_triad(hole2.mp.get_bvect_cart()) ;
00140       aa_auto_deux.change_triad(hole1.mp.get_bvect_cart()) ;
00141       assert(*(aa_auto_deux.get_triad()) == *(aa_comp_un.get_triad())) ;
00142       
00143       // importations :
00144       for (int i=1 ; i<=3 ; i++)
00145     for (int j=i ; j<=3 ; j++) {
00146       aa_comp_un.set(i, j).import(aa_auto_deux(i, j)) ;
00147       aa_comp_un.set(i, j).set_spectral_va().set_base(aa_auto_deux(i, j).
00148                               get_spectral_va().get_base()) ;
00149     }
00150       
00151       aa_comp_un.inc_dzpuis(2) ;
00152       aa_comp_un.change_triad(hole1.mp.get_bvect_spher()) ;
00153       
00154       aa_auto_un.change_triad(hole1.mp.get_bvect_cart()) ;
00155        aa_auto_un.change_triad(hole2.mp.get_bvect_cart()) ;
00156        assert(*(aa_auto_un.get_triad()) == *(aa_comp_deux.get_triad())) ;
00157        // importations :
00158        for (int i=1 ; i<=3 ; i++)
00159          for (int j=i ; j<=3 ; j++) {
00160            aa_comp_deux.set(i, j).import(aa_auto_un(i, j)) ;
00161            aa_comp_deux.set(i, j).set_spectral_va().set_base(aa_auto_un(i, j).
00162                    get_spectral_va().get_base()) ;
00163          }
00164 
00165        aa_comp_deux.inc_dzpuis(2) ;
00166        aa_comp_deux.change_triad(hole2.mp.get_bvect_spher()) ;
00167        
00168        /*              
00169        // Computation of A^{ij}_comp in the last domains
00170        // -----------------------------------------------
00171        
00172        int nz = hole1.mp.get_mg()->get_nzone() ;
00173 
00174        Sym_tensor aa_comp_un_zec (hole1.mp, CON, hole1.mp.get_bvect_spher()) ;
00175        aa_comp_un_zec.set_etat_qcq() ;
00176        Sym_tensor aa_comp_deux_zec (hole2.mp, CON, hole2.mp.get_bvect_spher()) ;
00177        aa_comp_deux_zec.set_etat_qcq() ;
00178 
00179        aa_comp_un_zec = ( hole1.beta_comp().ope_killing_conf(hole1.tgam) +
00180           hole1.gamt_point*(1.-hole1.decouple) ) / (2.* hole1.nn()) ;
00181 
00182        aa_comp_deux_zec =( hole2.beta_comp().ope_killing_conf(hole2.tgam) +
00183         hole2.gamt_point*(1.-hole2.decouple) ) / (2.* hole2.nn()) ;
00184 
00185        for (int i=1 ; i<=3 ; i++)
00186          for (int j=i ; j<=3 ; j++)          
00187        for (int l=nz-1 ; l<=nz-1 ; l++) {
00188          if (aa_comp_un.set(i,j).get_etat() == ETATQCQ)
00189            aa_comp_un.set(i,j).set_domain(l) = 
00190                            aa_comp_un_zec(i,j).domain(l) ;
00191          if (aa_comp_deux.set(i,j).get_etat() == ETATQCQ)
00192            aa_comp_deux.set(i,j).set_domain(l)=
00193                                aa_comp_deux_zec(i,j).domain(l) ;
00194        }
00195        */      
00196 
00197        hole1.aa_comp = aa_comp_un ;
00198        hole2.aa_comp = aa_comp_deux ;
00199        
00200        // Computation of A^{ij}_ total
00201        hole1.aa = hole1.aa_auto + hole1.aa_comp ;
00202        hole2.aa = hole2.aa_auto + hole2.aa_comp ;
00203       
00204     }
00205    else {
00206 
00207        // Computation of A^{ij}_auto
00208 
00209        aa_auto_un = ( hole1.beta_auto.ope_killing_conf(hole1.tgam) + 
00210               hole1.gamt_point*hole1.decouple ) ;            
00211        aa_auto_deux = ( hole2.beta_auto.ope_killing_conf(hole2.tgam) + 
00212             hole2.gamt_point*hole2.decouple ) ;          
00213        
00214        aa_auto_un.change_triad(hole1.mp.get_bvect_cart()) ;
00215        aa_auto_deux.change_triad(hole2.mp.get_bvect_cart()) ;
00216 
00217        for (int i=1 ; i<=3 ; i++)
00218        for (int j=1 ; j<=3 ; j++) {
00219            if (aa_auto_un(i,j).get_etat() != ETATZERO)
00220            aa_auto_un.set(i, j).raccord(3) ;
00221            if (aa_auto_deux(i,j).get_etat() != ETATZERO)
00222            aa_auto_deux.set(i, j).raccord(3) ;
00223        }
00224 
00225        // Computation of A^{ij}_comp
00226        
00227        Sym_tensor aa_auto_1 (aa_auto_un) ;
00228        Sym_tensor aa_auto_2 (aa_auto_deux) ;
00229        
00230        aa_auto_1.dec_dzpuis(2) ;
00231        aa_auto_2.dec_dzpuis(2) ;
00232        
00233        Sym_tensor aa_comp_un (hole1.mp, CON, hole1.mp.get_bvect_cart()) ;
00234        aa_comp_un.set_etat_qcq() ;
00235        Sym_tensor aa_comp_deux (hole2.mp, CON, hole2.mp.get_bvect_cart()) ;
00236        aa_comp_deux.set_etat_qcq() ;
00237        
00238        aa_auto_2.change_triad(hole1.mp.get_bvect_cart()) ;
00239        assert(*(aa_auto_2.get_triad()) == *(aa_comp_un.get_triad())) ;
00240        // importations :
00241        aa_comp_un.set(1, 1).import(aa_auto_2(1, 1)) ;
00242        aa_comp_un.set(1, 2).import(aa_auto_2(1, 2)) ;
00243        aa_comp_un.set(1, 3).import(aa_auto_2(1, 3)) ;
00244        aa_comp_un.set(2, 2).import(aa_auto_2(2, 2)) ;
00245        aa_comp_un.set(2, 3).import(aa_auto_2(2, 3)) ;
00246        aa_comp_un.set(3, 3).import(aa_auto_2(3, 3)) ;
00247        
00248        aa_comp_un.std_spectral_base() ;
00249        aa_comp_un.inc_dzpuis(2) ;
00250           
00251        aa_auto_1.change_triad(hole2.mp.get_bvect_cart()) ;
00252        assert(*(aa_auto_1.get_triad()) == *(aa_comp_deux.get_triad())) ;
00253        // importations :
00254        aa_comp_deux.set(1, 1).import(aa_auto_1(1, 1)) ;
00255        aa_comp_deux.set(1, 2).import(aa_auto_1(1, 2)) ;
00256        aa_comp_deux.set(1, 3).import(aa_auto_1(1, 3)) ;
00257        aa_comp_deux.set(2, 2).import(aa_auto_1(2, 2)) ;
00258        aa_comp_deux.set(2, 3).import(aa_auto_1(2, 3)) ;
00259        aa_comp_deux.set(3, 3).import(aa_auto_1(3, 3)) ;
00260        
00261        aa_comp_deux.std_spectral_base() ;
00262        aa_comp_deux.inc_dzpuis(2) ;
00263          
00264        // Computation of A^{ij}_ total
00265        Sym_tensor aa_tot_un (hole1.mp, CON, hole1.mp.get_bvect_cart()) ;
00266        Sym_tensor aa_tot_deux (hole2.mp, CON, hole2.mp.get_bvect_cart()) ;
00267        aa_tot_un = aa_auto_un + aa_comp_un ;
00268        aa_tot_deux = aa_auto_deux + aa_comp_deux ;
00269 
00270        Sym_tensor temp_aa_tot1 (aa_tot_un) ;
00271        Sym_tensor temp_aa_tot2 (aa_tot_deux) ;
00272        
00273        temp_aa_tot1.change_triad(hole1.mp.get_bvect_spher()) ;
00274        temp_aa_tot2.change_triad(hole2.mp.get_bvect_spher()) ;
00275 
00276        // Regularisation
00277        // --------------
00278 
00279        Sym_tensor aa_un (hole1.mp, CON, hole1.mp.get_bvect_cart()) ;
00280        Sym_tensor aa_deux (hole2.mp, CON, hole2.mp.get_bvect_cart()) ;     
00281 
00282       int nz_un = hole1.mp.get_mg()->get_nzone() ;
00283       int nz_deux = hole2.mp.get_mg()->get_nzone() ;
00284       
00285       Scalar ntot_un (hole1.n_auto+hole1.n_comp) ;
00286       ntot_un = division_xpun (ntot_un, 0) ;
00287       ntot_un.raccord(1) ;
00288       
00289       Scalar ntot_deux (hole2.n_auto+hole2.n_comp) ;
00290       ntot_deux = division_xpun (ntot_deux, 0) ;
00291       ntot_deux.raccord(1) ;
00292       
00293       // THE TWO Aij are aligned of not !
00294       double orientation_un = aa_auto_un.get_mp().get_rot_phi() ;
00295       assert ((orientation_un==0) || (orientation_un==M_PI)) ;
00296       double orientation_deux = aa_auto_deux.get_mp().get_rot_phi() ;
00297       assert ((orientation_deux==0) || (orientation_deux==M_PI)) ;
00298       int same_orient = (orientation_un == orientation_deux) ? 1 : -1 ;
00299 
00300 
00301       // Loop on the composants :
00302       for (int lig = 1 ; lig<=3 ; lig++)
00303       for (int col = lig ; col<=3 ; col++) {
00304           
00305           // The orientation
00306           int ind = 1 ;
00307           if (lig !=3)
00308           ind *= -1 ;
00309           if (col != 3)
00310           ind *= -1 ;
00311           if (same_orient == 1)
00312           ind = 1 ;
00313         
00314         // Close to hole one :
00315         Scalar auxi_un (aa_tot_un(lig, col)/2.) ;
00316         auxi_un.dec_dzpuis(2) ;
00317         auxi_un = division_xpun (auxi_un, 0) ;
00318         auxi_un = auxi_un / ntot_un ;
00319         if (auxi_un.get_etat() != ETATZERO)
00320         auxi_un.raccord(1) ;
00321 
00322         // Close to hole two :
00323         Scalar auxi_deux (aa_tot_deux(lig, col)/2.) ;
00324         auxi_deux.dec_dzpuis(2) ;
00325         auxi_deux = division_xpun (auxi_deux, 0) ;
00326         auxi_deux = auxi_deux / ntot_deux ;
00327         if (auxi_deux.get_etat() != ETATZERO)
00328         auxi_deux.raccord(1) ;
00329         
00330         // copy :
00331         Scalar copie_un (aa_tot_un(lig, col)) ;
00332         copie_un.dec_dzpuis(2) ;
00333         
00334         Scalar copie_deux (aa_tot_deux(lig, col)) ;
00335         copie_deux.dec_dzpuis(2) ;
00336         
00337         double lim_un = hole1.mp.get_alpha()[1] + hole1.mp.get_beta()[1] ;
00338         double lim_deux = hole2.mp.get_alpha()[1] + hole2.mp.get_beta()[1] ;
00339         
00340         Mtbl xabs_un (hole1.mp.xa) ;
00341         Mtbl yabs_un (hole1.mp.ya) ;
00342         Mtbl zabs_un (hole1.mp.za) ;
00343         
00344         Mtbl xabs_deux (hole2.mp.xa) ;
00345         Mtbl yabs_deux (hole2.mp.ya) ;
00346         Mtbl zabs_deux (hole2.mp.za) ;
00347         
00348         double xabs, yabs, zabs, air, theta, phi ;
00349 
00350         if (auxi_un.get_etat() != ETATZERO){        
00351         // Loop on the other zones :
00352         for (int l=2 ; l<nz_un ; l++) {
00353 
00354         int nr = hole1.mp.get_mg()->get_nr (l) ;
00355         
00356         if (l==nz_un-1)
00357             nr -- ;
00358         
00359         int np = hole1.mp.get_mg()->get_np (l) ;
00360         int nt = hole1.mp.get_mg()->get_nt (l) ;
00361         
00362         for (int k=0 ; k<np ; k++)
00363             for (int j=0 ; j<nt ; j++)
00364             for (int i=0 ; i<nr ; i++) {
00365                 
00366                 xabs = xabs_un (l, k, j, i) ;
00367                 yabs = yabs_un (l, k, j, i) ;
00368                 zabs = zabs_un (l, k, j, i) ;
00369 
00370                 // coordinates of the point in 2 :
00371                 hole2.mp.convert_absolute 
00372                 (xabs, yabs, zabs, air, theta, phi) ;
00373             
00374                 if (air >= lim_deux)
00375                 // Far from hole two : no pb :
00376                 auxi_un.set_grid_point(l, k, j, i) = 
00377                     copie_un.val_grid_point(l, k, j, i) / 
00378                     ntot_un.val_grid_point(l, k, j, i)/2. ;
00379                 else 
00380                 // close to hole two :
00381                 auxi_un.set_grid_point(l, k, j, i) = 
00382                 ind * auxi_deux.val_point (air, theta, phi) ;
00383                 
00384             }
00385                 
00386         // Case infinity :
00387         if (l==nz_un-1)
00388             for (int k=0 ; k<np ; k++)
00389             for (int j=0 ; j<nt ; j++)
00390                 auxi_un.set_grid_point(nz_un-1, k, j, nr) = 0 ;
00391         }
00392         }
00393 
00394         if (auxi_deux.get_etat() != ETATZERO){      
00395         // The second hole :
00396         for (int l=2 ; l<nz_deux ; l++) {
00397         
00398         int nr = hole2.mp.get_mg()->get_nr (l) ;
00399         
00400         if (l==nz_deux-1)
00401             nr -- ;
00402         
00403         int np = hole2.mp.get_mg()->get_np (l) ;
00404         int nt = hole2.mp.get_mg()->get_nt (l) ;
00405         
00406         for (int k=0 ; k<np ; k++)
00407             for (int j=0 ; j<nt ; j++)
00408             for (int i=0 ; i<nr ; i++) {
00409                 
00410                 xabs = xabs_deux (l, k, j, i) ;
00411                 yabs = yabs_deux (l, k, j, i) ;
00412                 zabs = zabs_deux (l, k, j, i) ;
00413                 
00414                 // coordinates of the point in 2 :
00415                 hole1.mp.convert_absolute 
00416                 (xabs, yabs, zabs, air, theta, phi) ;
00417             
00418                 if (air >= lim_un)
00419                 // Far from hole one : no pb :
00420                 auxi_deux.set_grid_point(l, k, j, i) = 
00421                     copie_deux.val_grid_point(l, k, j, i) / 
00422                     ntot_deux.val_grid_point(l, k, j, i) /2.;
00423                 else 
00424                 // close to hole one :
00425                 auxi_deux.set_grid_point(l, k, j, i) = 
00426                   ind * auxi_un.val_point (air, theta, phi) ;
00427                 }
00428         // Case infinity :
00429         if (l==nz_deux-1)
00430             for (int k=0 ; k<np ; k++)
00431             for (int j=0 ; j<nt ; j++)
00432                 auxi_un.set_grid_point(nz_deux-1, k, j, nr) = 0 ;
00433         }
00434         }
00435 
00436         auxi_un.inc_dzpuis(2) ;
00437         auxi_deux.inc_dzpuis(2) ;
00438         
00439         aa_un.set(lig, col) = auxi_un ;
00440         aa_deux.set(lig, col) = auxi_deux ;
00441       }
00442 
00443       aa_un.change_triad(hole1.mp.get_bvect_spher()) ;
00444       aa_deux.change_triad(hole2.mp.get_bvect_spher()) ;
00445 
00446       hole1.aa = aa_un ;
00447       hole2.aa = aa_deux ;
00448 
00449       aa_auto_un.change_triad(hole1.mp.get_bvect_spher()) ;
00450       aa_auto_deux.change_triad(hole2.mp.get_bvect_spher()) ;
00451 
00452       for (int lig=1 ; lig<=3 ; lig++)
00453       for (int col=lig ; col<=3 ; col++) {
00454           aa_auto_un.set(lig, col) = aa_un(lig, col)*hole1.decouple ;
00455           aa_auto_deux.set(lig, col) = aa_deux(lig, col)*hole2.decouple ;
00456       }
00457 
00458       hole1.aa_auto = aa_auto_un ;
00459       hole2.aa_auto = aa_auto_deux ;
00460 
00461    }
00462 
00463 }   
00464 
00465 
00466 void Bin_hor::decouple () {
00467     
00468     int nz_un = hole1.mp.get_mg()->get_nzone() ;
00469     int nz_deux = hole2.mp.get_mg()->get_nzone() ;
00470     
00471     // We determine R_limite :
00472     double distance = hole1.mp.get_ori_x() - hole2.mp.get_ori_x() ;
00473     double lim_un = distance/2. ;
00474     double lim_deux = distance/2. ;
00475     double int_un = distance/6. ;
00476     double int_deux = distance/6. ;
00477     
00478     // The functions used.
00479     Scalar fonction_f_un (hole1.mp) ;
00480     fonction_f_un = 0.5*pow(
00481     cos((hole1.mp.r-int_un)*M_PI/2./(lim_un-int_un)), 2.)+0.5 ;
00482     fonction_f_un.std_spectral_base();
00483     
00484     Scalar fonction_g_un (hole1.mp) ;
00485     fonction_g_un = 0.5*pow
00486     (sin((hole1.mp.r-int_un)*M_PI/2./(lim_un-int_un)), 2.) ;
00487     fonction_g_un.std_spectral_base();
00488     
00489     Scalar fonction_f_deux (hole2.mp) ;
00490     fonction_f_deux = 0.5*pow(
00491     cos((hole2.mp.r-int_deux)*M_PI/2./(lim_deux-int_deux)), 2.)+0.5 ;
00492     fonction_f_deux.std_spectral_base();
00493     
00494     Scalar fonction_g_deux (hole2.mp) ;
00495     fonction_g_deux = 0.5*pow(
00496     sin((hole2.mp.r-int_deux)*M_PI/2./(lim_un-int_deux)), 2.) ;
00497     fonction_g_deux.std_spectral_base();
00498     
00499     // The functions total :
00500     Scalar decouple_un (hole1.mp) ;
00501     decouple_un.allocate_all() ;
00502     Scalar decouple_deux (hole2.mp) ;
00503     decouple_deux.allocate_all() ;
00504     
00505     Mtbl xabs_un (hole1.mp.xa) ;
00506     Mtbl yabs_un (hole1.mp.ya) ;
00507     Mtbl zabs_un (hole1.mp.za) ;
00508         
00509     Mtbl xabs_deux (hole2.mp.xa) ;
00510     Mtbl yabs_deux (hole2.mp.ya) ;
00511     Mtbl zabs_deux (hole2.mp.za) ;
00512         
00513     double xabs, yabs, zabs, air_un, air_deux, theta, phi ;
00514         
00515     for (int l=0 ; l<nz_un ; l++) {
00516     int nr = hole1.mp.get_mg()->get_nr (l) ;
00517         
00518     if (l==nz_un-1)
00519         nr -- ;
00520         
00521     int np = hole1.mp.get_mg()->get_np (l) ;
00522     int nt = hole1.mp.get_mg()->get_nt (l) ;
00523         
00524     for (int k=0 ; k<np ; k++)
00525         for (int j=0 ; j<nt ; j++)
00526         for (int i=0 ; i<nr ; i++) {
00527                 
00528             xabs = xabs_un (l, k, j, i) ;
00529             yabs = yabs_un (l, k, j, i) ;
00530             zabs = zabs_un (l, k, j, i) ;
00531                 
00532             // Coordinates of the point
00533             hole1.mp.convert_absolute 
00534             (xabs, yabs, zabs, air_un, theta, phi) ;
00535             hole2.mp.convert_absolute 
00536             (xabs, yabs, zabs, air_deux, theta, phi) ;
00537         
00538             if (air_un <= lim_un)
00539             if (air_un < int_un)
00540                 decouple_un.set_grid_point(l, k, j, i) = 1 ;
00541             else
00542             // Close to hole 1 :
00543             decouple_un.set_grid_point(l, k, j, i) = 
00544                 fonction_f_un.val_grid_point(l, k, j, i) ;
00545             else 
00546             if (air_deux <= lim_deux)
00547                 if (air_deux < int_deux)
00548                 decouple_un.set_grid_point(l, k, j, i) = 0 ;
00549                 else
00550             // Close to hole 2 :
00551                 decouple_un.set_grid_point(l, k, j, i) = 
00552         fonction_g_deux.val_point (air_deux, theta, phi) ;
00553         
00554             else
00555                 // Far from each holes :
00556                 decouple_un.set_grid_point(l, k, j, i) = 0.5 ;
00557         }
00558                 
00559         // Case infinity :
00560         if (l==nz_un-1)
00561             for (int k=0 ; k<np ; k++)
00562             for (int j=0 ; j<nt ; j++)
00563                 decouple_un.set_grid_point(nz_un-1, k, j, nr)=0.5 ;
00564         }
00565     
00566     for (int l=0 ; l<nz_deux ; l++) {
00567     int nr = hole2.mp.get_mg()->get_nr (l) ;
00568         
00569     if (l==nz_deux-1)
00570         nr -- ;
00571         
00572     int np = hole2.mp.get_mg()->get_np (l) ;
00573     int nt = hole2.mp.get_mg()->get_nt (l) ;
00574         
00575     for (int k=0 ; k<np ; k++)
00576         for (int j=0 ; j<nt ; j++)
00577         for (int i=0 ; i<nr ; i++) {
00578                 
00579             xabs = xabs_deux (l, k, j, i) ;
00580             yabs = yabs_deux (l, k, j, i) ;
00581             zabs = zabs_deux (l, k, j, i) ;
00582                 
00583             // coordinates of the point  :
00584             hole1.mp.convert_absolute 
00585             (xabs, yabs, zabs, air_un, theta, phi) ;
00586             hole2.mp.convert_absolute 
00587             (xabs, yabs, zabs, air_deux, theta, phi) ;
00588             
00589             if (air_deux <= lim_deux)
00590             if (air_deux < int_deux)
00591                 decouple_deux.set_grid_point(l, k, j, i) = 1 ;
00592             else
00593             // close to hole two :
00594             decouple_deux.set_grid_point(l, k, j, i) = 
00595                 fonction_f_deux.val_grid_point(l, k, j, i) ;
00596             else 
00597             if (air_un <= lim_un)
00598                 if (air_un < int_un)
00599                 decouple_deux.set_grid_point(l, k, j, i) = 0 ;
00600                 else
00601             // close to hole one :
00602                 decouple_deux.set_grid_point(l, k, j, i) = 
00603              fonction_g_un.val_point (air_un, theta, phi) ;
00604         
00605             else
00606                 // Far from each hole :
00607                 decouple_deux.set_grid_point(l, k, j, i) = 0.5 ;
00608         }
00609                 
00610         // Case infinity :
00611         if (l==nz_deux-1)
00612             for (int k=0 ; k<np ; k++)
00613             for (int j=0 ; j<nt ; j++)
00614              decouple_deux.set_grid_point(nz_un-1, k, j, nr)=0.5 ;
00615    }
00616    
00617     decouple_un.std_spectral_base() ;
00618     decouple_deux.std_spectral_base() ;
00619     
00620     hole1.decouple = decouple_un ;
00621     hole2.decouple = decouple_deux ;
00622     
00623 }

Generated on Tue Feb 7 01:35:15 2012 for LORENE by  doxygen 1.4.6