param_elliptic.C

00001 /*
00002  *   Copyright (c) 2004 Philippe Grandclement
00003  *
00004  *   This file is part of LORENE.
00005  *
00006  *   LORENE is free software; you can redistribute it and/or modify
00007  *   it under the terms of the GNU General Public License version 2
00008  *   as published by the Free Software Foundation.
00009  *
00010  *   LORENE is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details.
00014  *
00015  *   You should have received a copy of the GNU General Public License
00016  *   along with LORENE; if not, write to the Free Software
00017  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018  *
00019  */
00020 
00021 char param_elliptic_C[] = "$Header: /cvsroot/Lorene/C++/Source/Param_elliptic/param_elliptic.C,v 1.19 2007/05/06 10:48:14 p_grandclement Exp $" ;
00022 
00023 /*
00024  * $Id: param_elliptic.C,v 1.19 2007/05/06 10:48:14 p_grandclement Exp $
00025  * $Log: param_elliptic.C,v $
00026  * Revision 1.19  2007/05/06 10:48:14  p_grandclement
00027  * Modification of a few operators for the vorton project
00028  *
00029  * Revision 1.18  2007/04/24 09:04:13  p_grandclement
00030  * Addition of an operator for the vortons
00031  *
00032  * Revision 1.17  2005/05/12 09:49:44  j_novak
00033  * Temptative treatment of the case where the source is null in the CED (putting
00034  * dzpuis to 4). May be a bad idea...
00035  *
00036  * Revision 1.16  2005/02/15 15:43:17  j_novak
00037  * First version of the block inversion for the vector Poisson equation (method 6).
00038  *
00039  * Revision 1.15  2004/12/23 16:30:16  j_novak
00040  * New files and class for the solution of the rr component of the tensor Poisson
00041  * equation.
00042  *
00043  * Revision 1.14  2004/08/24 09:14:49  p_grandclement
00044  * Addition of some new operators, like Poisson in 2d... It now requieres the
00045  * GSL library to work.
00046  *
00047  * Also, the way a variable change is stored by a Param_elliptic is changed and
00048  * no longer uses Change_var but rather 2 Scalars. The codes using that feature
00049  * will requiere some modification. (It should concern only the ones about monopoles)
00050  *
00051  * Revision 1.13  2004/06/22 13:46:52  j_novak
00052  * Deplacement du conte++ dans set_pois_vect_r
00053  *
00054  * Revision 1.12  2004/06/22 08:49:59  p_grandclement
00055  * Addition of everything needed for using the logarithmic mapping
00056  *
00057  * Revision 1.11  2004/06/14 15:07:12  j_novak
00058  * New methods for the construction of the elliptic operator appearing in
00059  * the vector Poisson equation (acting on eta).
00060  *
00061  * Revision 1.10  2004/05/17 15:50:54  j_novak
00062  * Removed unused nr variables
00063  *
00064  * Revision 1.9  2004/05/17 15:42:22  j_novak
00065  * The method 1 of vector Poisson eq. solves directly for F^r.
00066  * Some bugs were corrected in the operator poisson_vect.
00067  *
00068  * Revision 1.8  2004/05/14 08:51:02  p_grandclement
00069  * *** empty log message ***
00070  *
00071  * Revision 1.7  2004/05/10 15:28:22  j_novak
00072  * First version of functions for the solution of the r-component of the
00073  * vector Poisson equation.
00074  *
00075  * Revision 1.6  2004/03/05 09:18:49  p_grandclement
00076  * Addition of operator sec_order_r2
00077  *
00078  * Revision 1.5  2004/01/15 09:15:39  p_grandclement
00079  * Modification and addition of the Helmholtz operators
00080  *
00081  * Revision 1.4  2004/01/07 14:36:38  p_grandclement
00082  * Modif mineure in Param_elliptic.set_variable
00083  *
00084  * Revision 1.3  2003/12/11 16:11:38  e_gourgoulhon
00085  * Changed #include <iostream.h> to #include "headcpp.h".
00086  *
00087  * Revision 1.2  2003/12/11 15:57:27  p_grandclement
00088  * include stdlib.h encore ...
00089  *
00090  * Revision 1.1  2003/12/11 14:48:51  p_grandclement
00091  * Addition of ALL (and that is a lot !) the files needed for the general elliptic solver ... UNDER DEVELOPEMENT...
00092  *
00093  * 
00094  * $Header: /cvsroot/Lorene/C++/Source/Param_elliptic/param_elliptic.C,v 1.19 2007/05/06 10:48:14 p_grandclement Exp $
00095  *
00096  */
00097 
00098 #include "headcpp.h"
00099 
00100 #include <math.h>
00101 #include <stdlib.h>
00102 
00103 #include "map.h"
00104 #include "ope_elementary.h"
00105 #include "param_elliptic.h"
00106 #include "base_val.h" 
00107 #include "scalar.h"
00108 #include "proto.h"
00109 
00110 
00111 const Map_radial& Param_elliptic::get_mp() const {
00112 
00113   switch (type_map) {
00114   case MAP_AFF:
00115     return *mp_af ;
00116     break ;
00117   case MAP_LOG:
00118     return *mp_log ;
00119     break ;
00120   default:
00121     cout << "Unknown mapping in Param_elliptic" << endl ;
00122     abort() ;
00123     return *mp_af ;
00124   }
00125 }
00126 
00127 double Param_elliptic::get_alpha(int l) const {
00128   
00129  switch (type_map) {
00130   case MAP_AFF:
00131     return mp_af->get_alpha()[l] ;
00132     break ;
00133   case MAP_LOG:
00134     return mp_log->get_alpha(l) ;
00135     break ;
00136   default:
00137     cout << "Unknown mapping in Param_elliptic" << endl ;
00138     abort() ;
00139     return 1 ;
00140   }
00141 }
00142 
00143 double Param_elliptic::get_beta(int l) const {
00144   
00145  switch (type_map) {
00146   case MAP_AFF:
00147     return mp_af->get_beta()[l] ;
00148     break ;
00149   case MAP_LOG:
00150     return mp_log->get_beta(l) ;
00151     break ;
00152   default:
00153     cout << "Unknown mapping in Param_elliptic" << endl ;
00154     abort() ;
00155     return 1 ;
00156   }
00157 }
00158 
00159 int Param_elliptic::get_type(int l) const {
00160   
00161  switch (type_map) {
00162   case MAP_AFF:
00163     return AFFINE ;
00164     break ;
00165   case MAP_LOG:
00166     return mp_log->get_type(l) ;
00167     break ;
00168   default:
00169     cout << "Unknown mapping in Param_elliptic" << endl ;
00170     abort() ;
00171     return 1 ;
00172   }
00173 }
00174 
00175 // Construction (By default it is set to Poisson with appropriate dzpuis...)
00176 Param_elliptic::Param_elliptic(const Scalar& so) : var_F(so.get_mp()), var_G(so.get_mp()), 
00177                            done_F (so.get_mp().get_mg()->get_nzone(), 
00178                                so.get_mp().get_mg()->get_np(0) + 1,  
00179                                so.get_mp().get_mg()->get_nt(0)), 
00180                            done_G (so.get_mp().get_mg()->get_nzone()), 
00181                            val_F_plus (so.get_mp().get_mg()->get_nzone(), 
00182                                so.get_mp().get_mg()->get_np(0) + 1,  
00183                                so.get_mp().get_mg()->get_nt(0)), 
00184                            val_F_minus (so.get_mp().get_mg()->get_nzone(), 
00185                                so.get_mp().get_mg()->get_np(0) + 1,  
00186                                 so.get_mp().get_mg()->get_nt(0)),
00187                            val_dF_plus (so.get_mp().get_mg()->get_nzone(), 
00188                                so.get_mp().get_mg()->get_np(0) + 1,  
00189                                so.get_mp().get_mg()->get_nt(0)), 
00190                            val_dF_minus (so.get_mp().get_mg()->get_nzone(), 
00191                                so.get_mp().get_mg()->get_np(0) + 1,  
00192                                 so.get_mp().get_mg()->get_nt(0)),
00193                            val_G_plus (so.get_mp().get_mg()->get_nzone()), 
00194                            val_G_minus (so.get_mp().get_mg()->get_nzone()),
00195                            val_dG_plus (so.get_mp().get_mg()->get_nzone()), 
00196                            val_dG_minus (so.get_mp().get_mg()->get_nzone())
00197                            
00198                            
00199 {
00200 
00201   // On passe en Ylm
00202   Scalar auxi(so) ;
00203   auxi.set_spectral_va().coef() ;
00204   auxi.set_spectral_va().ylm() ;
00205 
00206   Base_val base (auxi.get_spectral_va().base) ;
00207   int dzpuis = (auxi.dz_nonzero() ? auxi.get_dzpuis() : 4) ; //## to be modified??
00208   
00209   // Right now, only applicable with affine mapping
00210   const Map_af* map_affine = dynamic_cast <const Map_af*> (&so.get_mp()) ;
00211   const Map_log* map_log = dynamic_cast <const Map_log*> (&so.get_mp()) ;
00212 
00213   
00214   if ((map_affine == 0x0) && (map_log == 0x0)) {
00215     cout << "Param_elliptic not yet defined on this type of mapping" << endl ;
00216     abort() ;
00217   }
00218   else  {
00219     
00220     if (map_affine != 0x0) {
00221       type_map = MAP_AFF ;
00222       mp_af = map_affine ;
00223       mp_log = 0x0 ;
00224     }
00225     if (map_log != 0x0) {
00226       type_map = MAP_LOG ;
00227       mp_af = 0x0 ;
00228       mp_log = map_log ;
00229     }
00230     int nz = get_mp().get_mg()->get_nzone() ;
00231     int nbr = 0 ;
00232     for (int l=0 ; l<nz ; l++)
00233       nbr += (get_mp().get_mg()->get_np(l)+1)*
00234     get_mp().get_mg()->get_nt(l) ;
00235     
00236     operateurs = new Ope_elementary* [nbr] ;
00237     
00238     for (int l=0 ; l<nbr ; l++)
00239       operateurs[l] = 0x0 ;
00240 
00241       int nr ;
00242       int base_r, m_quant, l_quant ;
00243       
00244       int conte = 0 ;
00245       for (int l=0 ; l<nz ; l++) {
00246     
00247     nr = get_mp().get_mg()->get_nr(l) ;
00248     
00249     for (int k=0 ; k<get_mp().get_mg()->get_np(l)+1 ; k++)
00250       for (int j=0 ; j<get_mp().get_mg()->get_nt(l) ; j++) {
00251         
00252         so.get_spectral_va().base.give_quant_numbers 
00253           (l, k, j, m_quant, l_quant, base_r) ;
00254  
00255         switch (type_map) {
00256         case MAP_AFF: 
00257           operateurs[conte] = new 
00258         Ope_poisson(nr, base_r, get_alpha(l), 
00259                 get_beta(l), l_quant, dzpuis) ;
00260           break ;
00261         case MAP_LOG:
00262           if (mp_log->get_type(l) == AFFINE)
00263         operateurs[conte] = new 
00264           Ope_poisson(nr, base_r, get_alpha(l), 
00265                   get_beta(l), l_quant, dzpuis) ;
00266           else 
00267         operateurs[conte] = new 
00268           Ope_sec_order (nr, base_r, get_alpha(l), get_beta(l), 
00269                  1., 2. , l_quant) ;
00270           break ;
00271         default :
00272           cout << "Unknown mapping in Param_elliptic::Param_elliptic" 
00273            << endl ; 
00274           
00275         }
00276         conte ++ ;
00277       }
00278       }
00279   }
00280   
00281   // STD VARIABLE CHANGE :
00282   var_F.annule_hard() ;
00283   var_F.set_spectral_va().set_base (so.get_spectral_va().get_base()) ;
00284   
00285   var_G.set_etat_qcq() ;
00286   var_G = 1 ;
00287   var_G.std_spectral_base() ;
00288   
00289   done_F.annule_hard() ;
00290   done_G.annule_hard() ;
00291   
00292   val_F_plus.set_etat_qcq() ;
00293   val_F_minus.set_etat_qcq() ;
00294   val_dF_plus.set_etat_qcq() ;
00295   val_dF_minus.set_etat_qcq() ;
00296   
00297   val_G_plus.set_etat_qcq() ;
00298   val_G_minus.set_etat_qcq() ;
00299   val_dG_plus.set_etat_qcq() ;
00300   val_dG_minus.set_etat_qcq() ;
00301 }
00302 
00303 Param_elliptic::~Param_elliptic () {
00304   
00305   int nbr = 0 ;
00306   for (int l=0 ; l<get_mp().get_mg()->get_nzone() ; l++) 
00307     nbr += (get_mp().get_mg()->get_np(l)+1)*get_mp().get_mg()->get_nt(l) ;
00308 
00309   for (int i=0 ; i<nbr ; i++)
00310     if (operateurs[i] != 0x0)
00311       delete operateurs[i] ;
00312   
00313   delete [] operateurs ;
00314 }
00315 
00316 void Param_elliptic::inc_l_quant (int zone) {
00317   
00318   int np, nt ;
00319 
00320   int conte = 0 ;
00321   for (int l=0 ; l<get_mp().get_mg()->get_nzone() ; l++) {
00322     
00323     np = get_mp().get_mg()->get_np(l) ;
00324     nt = get_mp().get_mg()->get_nt(l) ;
00325 
00326     for (int k=0 ; k<np+1 ; k++)
00327       for (int j=0 ; j<nt ; j++) { 
00328     if ((operateurs[conte] != 0x0) && (l==zone))
00329       operateurs[conte]->inc_l_quant() ;
00330     conte ++ ;
00331       }
00332   }
00333 }
00334 
00335 
00336 void Param_elliptic::set_helmholtz_minus (int zone, double masse, Scalar& source) {
00337   
00338   source.set_spectral_va().coef() ;
00339   source.set_spectral_va().ylm() ;
00340 
00341   int nz = get_mp().get_mg()->get_nzone() ;
00342   int nr ;
00343   int conte = 0 ;
00344   int m_quant, base_r_1d, l_quant ;
00345 
00346   switch (type_map) {
00347 
00348   case MAP_AFF:
00349  
00350     for (int l=0 ; l<nz ; l++) {
00351       
00352       nr = get_mp().get_mg()->get_nr(l) ;
00353       
00354       for (int k=0 ; k<get_mp().get_mg()->get_np(l)+1 ; k++)
00355     for (int j=0 ; j<get_mp().get_mg()->get_nt(l) ; j++) {
00356       if (l==zone) {
00357         if (operateurs[conte] != 0x0) {     
00358           delete operateurs[conte] ;
00359           source.get_spectral_va().base.give_quant_numbers 
00360         (l, k, j, m_quant, l_quant, base_r_1d) ;
00361           operateurs[conte] = new Ope_helmholtz_minus (nr, base_r_1d, l_quant, get_alpha(l), 
00362                                get_beta(l) , masse) ;
00363         }
00364       }
00365       conte ++ ;
00366     }
00367     }
00368     break ;
00369     
00370   case MAP_LOG :
00371     if (mp_log->get_type(zone) != AFFINE) {
00372       cout << "Operator not define with LOG mapping..." << endl ;
00373       abort() ;
00374     }
00375     else {
00376       for (int l=0 ; l<nz ; l++) {
00377     
00378     nr = get_mp().get_mg()->get_nr(l) ;
00379     
00380     for (int k=0 ; k<get_mp().get_mg()->get_np(l)+1 ; k++)
00381       for (int j=0 ; j<get_mp().get_mg()->get_nt(l) ; j++) {
00382         if (l==zone) {
00383           if (operateurs[conte] != 0x0) {       
00384         delete operateurs[conte] ;
00385         source.get_spectral_va().base.give_quant_numbers 
00386           (l, k, j, m_quant, l_quant, base_r_1d) ;
00387         operateurs[conte] = new Ope_helmholtz_minus (nr, base_r_1d, l_quant,
00388                                  get_alpha(l), get_beta(l), masse) ;
00389           }
00390         }
00391         conte ++ ;
00392       }
00393       }
00394     }
00395     break ;
00396     
00397   default :
00398     cout << "Unkown mapping in set_helmhotz_minus" << endl ;
00399     abort() ;
00400     break ;
00401   }
00402 }
00403 
00404 void Param_elliptic::set_helmholtz_plus (int zone, double masse, Scalar& source) {
00405   
00406   source.set_spectral_va().coef() ;
00407   source.set_spectral_va().ylm() ;
00408 
00409   int nz = get_mp().get_mg()->get_nzone() ;
00410   int nr ;
00411   int conte = 0 ;
00412   int m_quant, base_r_1d, l_quant ;
00413 
00414   switch (type_map) {
00415 
00416   case MAP_AFF:
00417  
00418     for (int l=0 ; l<nz ; l++) {
00419       
00420       nr = get_mp().get_mg()->get_nr(l) ;
00421       
00422       for (int k=0 ; k<get_mp().get_mg()->get_np(l)+1 ; k++)
00423     for (int j=0 ; j<get_mp().get_mg()->get_nt(l) ; j++) {
00424       if (l==zone) {
00425         if (operateurs[conte] != 0x0) { 
00426         int old_base = operateurs[conte]->get_base_r() ;
00427         // PROVISOIRE, DANS LE NOYAU SEUL LE CAS SPHERIQUE EST IMPLEMENTE
00428         if ((old_base != R_CHEBI)) {    
00429           delete operateurs[conte] ;
00430           source.get_spectral_va().base.give_quant_numbers 
00431         (l, k, j, m_quant, l_quant, base_r_1d) ;
00432           operateurs[conte] = new Ope_helmholtz_plus (nr, base_r_1d, l_quant, get_alpha(l), 
00433                                get_beta(l) , masse) ;
00434         }
00435         }
00436       }
00437       conte ++ ;
00438     }
00439     }
00440     break ;
00441     
00442   case MAP_LOG :
00443     if (mp_log->get_type(zone) != AFFINE) {
00444       cout << "Operator not define with LOG mapping..." << endl ;
00445       abort() ;
00446     }
00447     else {
00448       for (int l=0 ; l<nz ; l++) {
00449     
00450     nr = get_mp().get_mg()->get_nr(l) ;
00451     
00452     for (int k=0 ; k<get_mp().get_mg()->get_np(l)+1 ; k++)
00453       for (int j=0 ; j<get_mp().get_mg()->get_nt(l) ; j++) {
00454         if (l==zone) {
00455           if (operateurs[conte] != 0x0) {
00456         int old_base = operateurs[conte]->get_base_r() ;
00457         // PROVISOIRE, DANS LE NOYAU SEUL LE CAS SPHERIQUE EST IMPLEMENTE
00458             if ((old_base != R_CHEBI)) {        
00459             delete operateurs[conte] ;
00460             source.get_spectral_va().base.give_quant_numbers 
00461                 (l, k, j, m_quant, l_quant, base_r_1d) ;
00462             operateurs[conte] = new Ope_helmholtz_plus (nr, base_r_1d, l_quant,
00463                                  get_alpha(l), get_beta(l), masse) ;
00464           }
00465         }
00466         }
00467         conte ++ ;
00468       }
00469       }
00470     }
00471     break ;
00472     
00473   default :
00474     cout << "Unkown mapping in set_helmhotz_minus" << endl ;
00475     abort() ;
00476     break ;
00477   }
00478 }
00479 
00480 void Param_elliptic::set_poisson_vect_r(int zone, bool only_l_zero) {
00481  
00482   if (type_map != MAP_AFF) {
00483     cout << "set_poisson_vect_r only defined for an affine mapping..." << endl ;
00484     abort() ;
00485   }
00486   else {
00487 
00488     int nz = get_mp().get_mg()->get_nzone() ;
00489     
00490     int nr ;
00491     
00492     int conte = 0 ;
00493     for (int l=0 ; l<nz ; l++) {
00494       
00495       nr = get_mp().get_mg()->get_nr(l) ;
00496       
00497       for (int k=0 ; k<get_mp().get_mg()->get_np(l)+1 ; k++)
00498     for (int j=0 ; j<get_mp().get_mg()->get_nt(l) ; j++) {
00499       if ((operateurs[conte] != 0x0) && (l==zone)) {
00500         int old_base = operateurs[conte]->get_base_r() ;
00501         Ope_poisson* op_pois = 
00502           dynamic_cast<Ope_poisson*>(operateurs[conte]) ;
00503         assert (op_pois !=0x0) ;
00504         int lq_old = op_pois->get_lquant() ;
00505         int dzp = op_pois->get_dzpuis() ;
00506         
00507         delete operateurs[conte] ;
00508         if (type_map == MAP_AFF) {
00509         if ((!only_l_zero)||(lq_old == 0)) {
00510             operateurs[conte] = new Ope_pois_vect_r(nr, old_base,get_alpha(l), 
00511                                 get_beta(l), lq_old, dzp) ;
00512         }
00513         else {
00514             operateurs[conte] = 0x0 ;
00515         }
00516         }
00517         else
00518           operateurs[conte] = 0x0 ;
00519       }
00520       conte ++ ;
00521     }
00522     }
00523   }
00524 }
00525 
00526 void Param_elliptic::set_poisson_vect_eta(int zone) {
00527  
00528   int nz = get_mp().get_mg()->get_nzone() ;
00529   
00530   int conte = 0 ;
00531   for (int l=0 ; l<nz ; l++) {
00532     
00533     bool ced = (get_mp().get_mg()->get_type_r(l) == UNSURR ) ;
00534     for (int k=0 ; k<get_mp().get_mg()->get_np(l)+1 ; k++)
00535       for (int j=0 ; j<get_mp().get_mg()->get_nt(l) ; j++) {
00536     if ((operateurs[conte] != 0x0) && (l==zone)) {
00537       Ope_poisson* op_pois = 
00538         dynamic_cast<Ope_poisson*>(operateurs[conte]) ;
00539       assert (op_pois !=0x0) ;
00540       int lq_old = op_pois->get_lquant() ;
00541       if (lq_old == 0) {
00542         delete operateurs[conte] ;
00543         operateurs[conte] = 0x0 ;
00544       }
00545       else 
00546         ced ? op_pois->inc_l_quant() : op_pois->dec_l_quant() ;
00547     }
00548     conte ++ ;
00549       }
00550   }
00551 }
00552 
00553 void Param_elliptic::set_poisson_tens_rr(int zone) {
00554  
00555     if (type_map != MAP_AFF) {
00556     cout << "set_poisson_tens_rr only defined for an affine mapping..." 
00557          << endl ;
00558     abort() ;
00559     }
00560     else {
00561     
00562     int nz = get_mp().get_mg()->get_nzone() ;
00563     
00564     int nr ;
00565     
00566     int conte = 0 ;
00567     for (int l=0 ; l<nz ; l++) {
00568         
00569         nr = get_mp().get_mg()->get_nr(l) ;
00570         
00571         for (int k=0 ; k<get_mp().get_mg()->get_np(l)+1 ; k++)
00572         for (int j=0 ; j<get_mp().get_mg()->get_nt(l) ; j++) {
00573             if ((operateurs[conte] != 0x0) && (l==zone)) {
00574             int old_base = operateurs[conte]->get_base_r() ;
00575             Ope_poisson* op_pois = 
00576                 dynamic_cast<Ope_poisson*>(operateurs[conte]) ;
00577             assert (op_pois !=0x0) ;
00578             int lq_old = op_pois->get_lquant() ;
00579             int dzp = op_pois->get_dzpuis() ;
00580             
00581             delete operateurs[conte] ;
00582             if (lq_old >= 2) {
00583                 operateurs[conte] = new Ope_pois_tens_rr
00584                 (nr, old_base,get_alpha(l), get_beta(l), lq_old, dzp) ;
00585             }
00586             else
00587                 operateurs[conte] = 0x0 ;
00588             }
00589             conte ++ ;
00590         }
00591     }
00592     }
00593 }
00594 
00595 void Param_elliptic::set_sec_order_r2 (int zone, double a, double b, double c){
00596  
00597    
00598   int nz = get_mp().get_mg()->get_nzone() ;
00599   int nr ;
00600   int conte = 0 ;
00601 
00602   switch (type_map) {
00603 
00604   case MAP_AFF:
00605  
00606     for (int l=0 ; l<nz ; l++) {
00607       
00608       nr = get_mp().get_mg()->get_nr(l) ;
00609       
00610       for (int k=0 ; k<get_mp().get_mg()->get_np(l)+1 ; k++)
00611     for (int j=0 ; j<get_mp().get_mg()->get_nt(l) ; j++) {
00612       if ((operateurs[conte] != 0x0) && (l==zone)) {
00613         int old_base = operateurs[conte]->get_base_r() ;
00614         // PROVISOIRE, DANS LE NOYAU SEUL LE CAS SPHERIQUE EST IMPLEMENTE
00615         if ((old_base != R_CHEBI)) {
00616           delete operateurs[conte] ;
00617           operateurs[conte] = new Ope_sec_order_r2 (nr, old_base, 
00618                                get_alpha(l), 
00619                                get_beta(l), a, b, c) ;
00620         }
00621       }
00622       conte ++ ;
00623     }
00624     }
00625     break ;
00626     
00627   case MAP_LOG :
00628     if (mp_log->get_type(zone) != AFFINE) {
00629       cout << "Operator not define with LOG mapping..." << endl ;
00630       abort() ;
00631     }
00632     else {
00633       for (int l=0 ; l<nz ; l++) {
00634     
00635     nr = get_mp().get_mg()->get_nr(l) ;
00636     
00637     for (int k=0 ; k<get_mp().get_mg()->get_np(l)+1 ; k++)
00638       for (int j=0 ; j<get_mp().get_mg()->get_nt(l) ; j++) {
00639         if ((operateurs[conte] != 0x0) && (l==zone)) {
00640           int old_base = operateurs[conte]->get_base_r() ;
00641           // PROVISOIRE, DANS LE NOYAU SEUL LE CAS SPHERIQUE EST IMPLEMENTE
00642           if ((old_base != R_CHEBI)) {
00643         delete operateurs[conte] ;
00644         operateurs[conte] = new Ope_sec_order_r2 (nr, old_base, 
00645                                  get_alpha(l), 
00646                                  get_beta(l), a, b, c) ;
00647           }
00648         }
00649         conte ++ ;
00650       }
00651       }
00652     }
00653     break ;
00654     
00655   default :
00656     cout << "Unkown mapping in set_sec_order_r2" << endl ;
00657     abort() ;
00658     break ;
00659   }
00660 }
00661 
00662 void Param_elliptic::set_sec_order (int zone, double a, double b, double c){
00663  
00664   if ((type_map == MAP_AFF) || (mp_log->get_type(zone) == AFFINE)) {
00665     cout << "set_sec_order only defined for a log mapping" << endl ;
00666     abort() ;
00667   }
00668   else {
00669  
00670     int nz = get_mp().get_mg()->get_nzone() ;
00671     
00672     int nr ;
00673     
00674     int conte = 0 ;
00675     for (int l=0 ; l<nz ; l++) {
00676       
00677       nr = get_mp().get_mg()->get_nr(l) ;
00678       
00679       for (int k=0 ; k<get_mp().get_mg()->get_np(l)+1 ; k++)
00680     for (int j=0 ; j<get_mp().get_mg()->get_nt(l) ; j++) {
00681       if ((operateurs[conte] != 0x0) && (l==zone)) {
00682 
00683         int old_base = operateurs[conte]->get_base_r() ;
00684         // PROVISOIRE, DANS LE NOYAU SEUL LE CAS SPHERIQUE EST IMPLEMENTE
00685         if (old_base != R_CHEBI) {
00686           delete operateurs[conte] ;
00687           operateurs[conte] = new Ope_sec_order (nr, old_base, 
00688                              get_alpha(l), 
00689                              get_beta(l), a, b, c) ;
00690         }
00691       }
00692       conte ++ ;
00693     }
00694     }
00695   }
00696 }
00697 
00698 void Param_elliptic::set_ope_vorton (int zone, Scalar& source) {
00699   
00700   source.set_spectral_va().coef() ;
00701   source.set_spectral_va().ylm() ;
00702 
00703   int nz = get_mp().get_mg()->get_nzone() ;
00704   int nr ;
00705   int conte = 0 ;
00706   int m_quant, base_r_1d, l_quant ;
00707   int dzpuis = source.get_dzpuis() ;
00708 
00709   switch (type_map) {
00710 
00711   case MAP_AFF:
00712  
00713     for (int l=0 ; l<nz ; l++) {
00714       int dz = (l==nz-1) ? dzpuis : 0 ;
00715       nr = get_mp().get_mg()->get_nr(l) ;
00716       
00717       for (int k=0 ; k<get_mp().get_mg()->get_np(l)+1 ; k++)
00718     for (int j=0 ; j<get_mp().get_mg()->get_nt(l) ; j++) {
00719       if (l==zone) {
00720         if (operateurs[conte] != 0x0) {     
00721           delete operateurs[conte] ;
00722           source.get_spectral_va().base.give_quant_numbers 
00723         (l, k, j, m_quant, l_quant, base_r_1d) ;
00724           operateurs[conte] = new Ope_vorton (nr, base_r_1d, get_alpha(l), 
00725                                get_beta(l), l_quant, dz) ;
00726         }
00727       }
00728       conte ++ ;
00729     }
00730     }
00731     break ;
00732     
00733   case MAP_LOG :
00734     if (mp_log->get_type(zone) != AFFINE) {
00735       cout << "Operator not define with LOG mapping..." << endl ;
00736       abort() ;
00737     }
00738     else {
00739       for (int l=0 ; l<nz ; l++) {
00740     int dz = (l==nz-1) ? dzpuis : 0 ;
00741     nr = get_mp().get_mg()->get_nr(l) ;
00742     
00743     for (int k=0 ; k<get_mp().get_mg()->get_np(l)+1 ; k++)
00744       for (int j=0 ; j<get_mp().get_mg()->get_nt(l) ; j++) {
00745         if (l==zone) {
00746           if (operateurs[conte] != 0x0) {       
00747         delete operateurs[conte] ;
00748         source.get_spectral_va().base.give_quant_numbers 
00749           (l, k, j, m_quant, l_quant, base_r_1d) ;
00750         operateurs[conte] = new Ope_vorton (nr, base_r_1d,
00751                                  get_alpha(l), get_beta(l), l_quant, dz) ;
00752           }
00753         }
00754         conte ++ ;
00755       }
00756       }
00757     }
00758     break ;
00759     
00760   default :
00761     cout << "Unkown mapping in set_ope_vorton" << endl ;
00762     abort() ;
00763     break ;
00764   }
00765 }
00766 
00767 void Param_elliptic::set_variable_F (const Scalar& so) {
00768 
00769   assert (so.get_etat() != ETATNONDEF) ;
00770   assert (so.get_mp() == get_mp()) ;
00771   
00772   var_F = so ;
00773   done_F.annule_hard() ;
00774 }
00775 
00776 void Param_elliptic::set_variable_G (const Scalar& so) {
00777 
00778   assert (so.get_etat() != ETATNONDEF) ;
00779   assert (so.get_mp() == get_mp()) ;
00780   
00781   var_G = so ;
00782   done_G.annule_hard() ;
00783 }

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