param_elliptic_val_lim.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_val_lim_C[] = "$Header: /cvsroot/Lorene/C++/Source/Param_elliptic/param_elliptic_val_lim.C,v 1.1 2004/08/24 09:14:49 p_grandclement Exp $" ;
00022 
00023 /*
00024  * $Id: param_elliptic_val_lim.C,v 1.1 2004/08/24 09:14:49 p_grandclement Exp $
00025  * $Log: param_elliptic_val_lim.C,v $
00026  * Revision 1.1  2004/08/24 09:14:49  p_grandclement
00027  * Addition of some new operators, like Poisson in 2d... It now requieres the
00028  * GSL library to work.
00029  *
00030  * Also, the way a variable change is stored by a Param_elliptic is changed and
00031  * no longer uses Change_var but rather 2 Scalars. The codes using that feature
00032  * will requiere some modification. (It should concern only the ones about monopoles)
00033  *
00034  
00035  * $Header: /cvsroot/Lorene/C++/Source/Param_elliptic/param_elliptic_val_lim.C,v 1.1 2004/08/24 09:14:49 p_grandclement Exp $
00036  *
00037  */
00038 
00039 #include "headcpp.h"
00040 
00041 #include <math.h>
00042 #include <stdlib.h>
00043 
00044 #include "base_val.h"
00045 #include "param_elliptic.h"
00046 #include "proto.h"
00047 
00048 double Param_elliptic::F_plus (int zone, int k, int j) const {
00049 
00050   if (done_F(zone, k, j) == 0)
00051     compute_val_F(zone, k, j) ;
00052 
00053   return val_F_plus (zone, k, j) ;
00054 }
00055 
00056 double Param_elliptic::F_minus (int zone, int k, int j) const {
00057 
00058   if (done_F(zone, k, j) == 0)
00059     compute_val_F(zone, k, j) ;
00060 
00061   return val_F_minus (zone, k, j) ;
00062 }
00063 
00064 double Param_elliptic::dF_plus (int zone, int k, int j) const {
00065 
00066   if (done_F(zone, k, j) == 0)
00067     compute_val_F(zone, k, j) ;
00068 
00069   return val_dF_plus (zone, k, j) ;
00070 }
00071 
00072 double Param_elliptic::dF_minus (int zone, int k, int j) const {
00073 
00074   if (done_F(zone, k, j) == 0)
00075     compute_val_F(zone, k, j) ;
00076 
00077   return val_dF_minus (zone, k, j) ;
00078 }
00079 
00080 
00081 double Param_elliptic::G_plus (int zone) const {
00082 
00083   if (done_G(zone) == 0)
00084     compute_val_G(zone) ;
00085 
00086   return val_G_plus (zone) ;
00087 }
00088 
00089 double Param_elliptic::G_minus (int zone) const {
00090 
00091   if (done_G(zone) == 0)
00092     compute_val_G(zone) ;
00093 
00094   return val_G_minus (zone) ;
00095 }
00096 
00097 double Param_elliptic::dG_plus (int zone) const {
00098 
00099   if (done_G(zone) == 0)
00100     compute_val_G(zone) ;
00101 
00102   return val_dG_plus (zone) ;
00103 }
00104 
00105 double Param_elliptic::dG_minus (int zone) const {
00106 
00107   if (done_G(zone) == 0)
00108     compute_val_G(zone) ;
00109 
00110   return val_dG_minus (zone) ;
00111 }
00112 
00113 
00114 void Param_elliptic::compute_val_F (int zone, int k, int j) const {
00115   
00116   int nr = get_mp().get_mg()->get_nr(zone) ;
00117   Tbl coefs (nr) ;
00118   coefs.set_etat_qcq() ;
00119 
00120   bool zero ;
00121 
00122   if (var_F.get_spectral_va().c_cf->get_etat() == ETATZERO)
00123     zero = true ;
00124   else
00125     if ((*var_F.get_spectral_va().c_cf)(zone).get_etat() == ETATZERO)
00126       zero = true ;
00127     else 
00128       zero = false ;
00129 
00130   if (zero)
00131     coefs.annule_hard() ;
00132   else
00133     for (int i=0 ; i<nr ; i++)
00134       coefs.set(i) = (*var_F.get_spectral_va().c_cf)(zone, k, j, i) ;
00135 
00136   int lq, mq ;
00137   int base_r ;
00138   var_F.get_spectral_va().base.give_quant_numbers (zone, k,j, lq, mq, base_r) ;
00139 
00140   double alpha = get_alpha(zone) ;
00141 
00142   Tbl output (val_solp(coefs, alpha, base_r)) ;
00143 
00144   // On range :
00145   val_F_plus.set(zone, k, j) = output(0) ;
00146   val_F_minus.set(zone, k, j) = output(1) ;
00147   val_dF_plus.set(zone, k, j) = output(2) ;
00148   val_dF_minus.set(zone, k, j) = output(3) ;
00149   done_F.set(zone, k, j) = 1 ;
00150 
00151 }
00152 
00153 void Param_elliptic::compute_val_G (int zone) const {
00154   
00155   int nr = get_mp().get_mg()->get_nr(zone) ;
00156   Tbl coefs (nr) ;
00157   coefs.set_etat_qcq() ;
00158  
00159 
00160   bool zero ;
00161   if (var_G.get_spectral_va().c_cf->get_etat() == ETATZERO)
00162     zero = true ;
00163   else
00164     if ((*var_G.get_spectral_va().c_cf)(zone).get_etat() == ETATZERO)
00165       zero = true ;
00166     else 
00167       zero = false ;
00168   if (zero)
00169     coefs.annule_hard() ;
00170   else
00171     for (int i=0 ; i<nr ; i++)
00172       coefs.set(i) = (*var_G.get_spectral_va().c_cf)(zone, 0, 0, i) ;
00173   
00174   int lq, mq ;
00175   int base_r ;
00176   var_G.get_spectral_va().base.give_quant_numbers (zone, 0, 0, lq, mq, base_r) ;
00177 
00178 
00179   double alpha = get_alpha(zone) ;
00180 
00181   Tbl output (val_solp(coefs, alpha, base_r)) ;
00182 
00183   // On range :
00184   val_G_plus.set(zone) = output(0) ;
00185   val_G_minus.set(zone) = output(1) ;
00186   val_dG_plus.set(zone) = output(2) ;
00187   val_dG_minus.set(zone) = output(3) ;
00188   done_G.set(zone) = 1 ;
00189 }

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