scalar_poisson_regu.C

00001 /*
00002  * Method of regularization of the source of Poisson equation
00003  *
00004  * (see file scalar.h for documentation).
00005  *
00006  */
00007 
00008 /*
00009  *   Copyright (c) 2003 Eric Gourgoulhon & Jerome Novak
00010  *
00011  *   Copyright (c) 2000-2001 Keisuke Taniguchi (for preceding Cmp version)
00012  *
00013  *   This file is part of LORENE.
00014  *
00015  *   LORENE is free software; you can redistribute it and/or modify
00016  *   it under the terms of the GNU General Public License as published by
00017  *   the Free Software Foundation; either version 2 of the License, or
00018  *   (at your option) any later version.
00019  *
00020  *   LORENE is distributed in the hope that it will be useful,
00021  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00022  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023  *   GNU General Public License for more details.
00024  *
00025  *   You should have received a copy of the GNU General Public License
00026  *   along with LORENE; if not, write to the Free Software
00027  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00028  *
00029  */
00030 
00031 
00032 char scalar_poisson_regu_C[] = "$Header: /cvsroot/Lorene/C++/Source/Tensor/Scalar/scalar_poisson_regu.C,v 1.2 2003/10/11 14:46:00 e_gourgoulhon Exp $" ;
00033 
00034 /*
00035  * $Id: scalar_poisson_regu.C,v 1.2 2003/10/11 14:46:00 e_gourgoulhon Exp $
00036  * $Log: scalar_poisson_regu.C,v $
00037  * Revision 1.2  2003/10/11 14:46:00  e_gourgoulhon
00038  * Line 65-67: changed the name of local variable "triad" to "triad0"
00039  * in order not to shadow the class member triad.
00040  *
00041  * Revision 1.1  2003/09/25 08:56:28  e_gourgoulhon
00042  * First version (uses Cmp and Tenseur as intermediate quantities).
00043  *
00044  *
00045  * $Header: /cvsroot/Lorene/C++/Source/Tensor/Scalar/scalar_poisson_regu.C,v 1.2 2003/10/11 14:46:00 e_gourgoulhon Exp $
00046  *
00047  */
00048 
00049 // Header Lorene
00050 #include "tensor.h"
00051 #include "cmp.h"
00052 #include "tenseur.h"
00053 #include "param.h"
00054 
00055 //******************************************************************
00056 
00057 void Scalar::poisson_regular(int k_div, int nzet, double unsgam1, Param& par,
00058               Scalar& uu, Scalar& uu_regu, Scalar& uu_div,
00059               Tensor& duu_div,
00060               Scalar& source_regu, Scalar& source_div) const {
00061               
00062     Cmp csource(*this) ; 
00063     Cmp cuu(uu) ;
00064     Cmp cuu_regu(uu_regu) ; 
00065     Cmp cuu_div(uu_div) ; 
00066     Cmp csource_regu(source_regu) ; 
00067     Cmp csource_div(source_div) ; 
00068 
00069     const Base_vect* triad0 = duu_div.get_triad() ; 
00070     
00071     Tenseur cduu_div(*mp, 1, COV, *triad0) ; 
00072     cduu_div.set_etat_qcq() ;
00073     Itbl ind(1) ;
00074     ind.set_etat_qcq() ; 
00075     for (int i=0; i<3; i++) {
00076         ind.set(0) = i+1 ;
00077         Cmp tmp( duu_div(ind) ) ;  
00078         cduu_div.set(i) = tmp ;  
00079     }
00080     
00081     mp->poisson_regular(csource, k_div, nzet, unsgam1, par,
00082             cuu, cuu_regu, cuu_div, cduu_div,
00083             csource_regu, csource_div) ;
00084     
00085     uu = cuu ; 
00086     uu_regu = uu ; 
00087 
00088     for (int i=1; i<=3; i++) {
00089         ind.set(0) = i ;
00090         duu_div.set(ind) = cduu_div(i-1) ;  
00091     }
00092     
00093     source_regu = csource_regu ; 
00094     source_div = csource_div ; 
00095 
00096 }

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