valeur_smooth.C

00001 /*
00002  * Method of the class Valeur to make a function be smooth
00003  *  between the nucleus and the first shell.
00004  *
00005  * (see file valeur.h for the documentation).
00006  */
00007 
00008 /*
00009  *   Copyright (c) 2000-2001 Keisuke Taniguchi
00010  *
00011  *   This file is part of LORENE.
00012  *
00013  *   LORENE is free software; you can redistribute it and/or modify
00014  *   it under the terms of the GNU General Public License as published by
00015  *   the Free Software Foundation; either version 2 of the License, or
00016  *   (at your option) any later version.
00017  *
00018  *   LORENE is distributed in the hope that it will be useful,
00019  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  *   GNU General Public License for more details.
00022  *
00023  *   You should have received a copy of the GNU General Public License
00024  *   along with LORENE; if not, write to the Free Software
00025  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00026  *
00027  */
00028 
00029 
00030 char valeur_smooth_C[] = "$Header: /cvsroot/Lorene/C++/Source/Valeur/valeur_smooth.C,v 1.2 2002/10/16 14:37:16 j_novak Exp $" ;
00031 
00032 /*
00033  * $Id: valeur_smooth.C,v 1.2 2002/10/16 14:37:16 j_novak Exp $
00034  * $Log: valeur_smooth.C,v $
00035  * Revision 1.2  2002/10/16 14:37:16  j_novak
00036  * Reorganization of #include instructions of standard C++, in order to
00037  * use experimental version 3 of gcc.
00038  *
00039  * Revision 1.1.1.1  2001/11/20 15:19:27  e_gourgoulhon
00040  * LORENE
00041  *
00042  * Revision 1.4  2001/10/10  13:56:07  eric
00043  * Modif Joachim: pow(-1,i) --> pow(-1.,i).
00044  *
00045  * Revision 1.3  2001/01/16  16:11:41  keisuke
00046  * Correct the initialization of the summation
00047  *  and insert some explanations.
00048  *
00049  * Revision 1.2  2001/01/16  15:15:12  keisuke
00050  * change the argument and correct some errors.
00051  *
00052  * Revision 1.1  2001/01/16  14:54:54  keisuke
00053  * Initial revision
00054  *
00055  *
00056  * $Header: /cvsroot/Lorene/C++/Source/Valeur/valeur_smooth.C,v 1.2 2002/10/16 14:37:16 j_novak Exp $
00057  *
00058  */
00059 
00060 // Headers C
00061 #include <stdlib.h>
00062 #include <math.h>
00063 
00064 // Headers Lorene
00065 #include "valeur.h"
00066 
00067 //********************************************************************
00068 
00069 void Valeur::smooth(int nzet, Valeur& uuva) const {
00070 
00071     int nucl = nzet - 1 ;
00072     int nr = mg->get_nr(nucl) ;
00073     int nt = mg->get_nt(nucl) ;
00074     int np = mg->get_np(nucl) ;
00075 
00076     // Protections
00077     // -----------
00078     assert(etat == ETATQCQ) ;
00079     assert(nzet > 0) ;
00080     assert(nr == mg->get_nr(nzet)) ;
00081     assert(nt == mg->get_nt(nzet)) ;
00082     assert(np == mg->get_np(nzet)) ;
00083 
00084     Valeur pot(mg) ;
00085     (*this).coef() ;    // the spectral coefficients are required
00086     pot = *((*this).c_cf) ;
00087 
00088     Tbl& ccf_nucl = *((pot.c_cf)->t[nucl]) ;
00089     Tbl& ccf_shell = *((pot.c_cf)->t[nzet]) ;
00090 
00091 
00092     // Get the values at the outer boundary of the nucleus
00093     //-----------------------------------------------------
00094 
00095     Tbl nucl_kj(np, nt) ;
00096     nucl_kj.set_etat_qcq() ;
00097 
00098     for (int k=0 ; k<np ; k++) {
00099       for (int j=0 ; j<nt ; j++) {
00100 
00101     double tmp = 0. ;
00102     for (int i=0 ; i<nr ; i++) {
00103 
00104       tmp += ccf_nucl(k, j, i) ;
00105 
00106     }
00107     nucl_kj.set(k, j) = tmp ;
00108       }
00109     }
00110 
00111 
00112     // Get the values at the inner boundary of the first shell
00113     //  without the last coefficient
00114     //---------------------------------------------------------
00115 
00116     Tbl shell_kj(np, nt) ;
00117     shell_kj.set_etat_qcq() ;
00118 
00119     for (int k=0 ; k<np ; k++) {
00120       for (int j=0 ; j<nt ; j++) {
00121 
00122     double tmp2 = 0. ;
00123     for (int i=0 ; i<nr-1 ; i++) {
00124 
00125       tmp2 += pow(-1., i) * ccf_shell(k, j, i) ;
00126 
00127     }
00128     shell_kj.set(k, j) = tmp2 ;
00129       }
00130     }
00131 
00132 
00133     // Set the last coefficient of the first shell
00134     //---------------------------------------------
00135 
00136     uuva.set_etat_cf_qcq() ;
00137     uuva.c_cf->set_etat_qcq() ;
00138     uuva.c_cf->t[nzet]->set_etat_qcq() ;
00139 
00140     Mtbl_cf& uuva_cf = *(uuva.c_cf) ;
00141 
00142     for (int k=0 ; k<np ; k++) {
00143       for (int j=0 ; j<nt ; j++) {
00144 
00145     uuva_cf.set(nzet, k, j, nr-1) = nucl_kj(k, j) - shell_kj(k, j) ;
00146 
00147       }
00148     }
00149 
00150     uuva.coef_i() ;
00151 
00152 }

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