| 1 |
/* |
| 2 |
* Method of regularization of the source of Poisson equation |
| 3 |
* |
| 4 |
* (see file scalar.h for documentation). |
| 5 |
* |
| 6 |
*/ |
| 7 |
|
| 8 |
/* |
| 9 |
* Copyright (c) 2003 Eric Gourgoulhon & Jerome Novak |
| 10 |
* |
| 11 |
* Copyright (c) 2000-2001 Keisuke Taniguchi (for preceding Cmp version) |
| 12 |
* |
| 13 |
* This file is part of LORENE. |
| 14 |
* |
| 15 |
* LORENE is free software; you can redistribute it and/or modify |
| 16 |
* it under the terms of the GNU General Public License as published by |
| 17 |
* the Free Software Foundation; either version 2 of the License, or |
| 18 |
* (at your option) any later version. |
| 19 |
* |
| 20 |
* LORENE is distributed in the hope that it will be useful, |
| 21 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 22 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 23 |
* GNU General Public License for more details. |
| 24 |
* |
| 25 |
* You should have received a copy of the GNU General Public License |
| 26 |
* along with LORENE; if not, write to the Free Software |
| 27 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 28 |
* |
| 29 |
*/ |
| 30 |
|
| 31 |
|
| 32 |
char scalar_poisson_regu_C[] = "$Header: /cvsroot/Lorene/C++/Source/Tensor/Scalar/scalar_poisson_regu.C,v 1.3 2014/10/13 08:53:47 j_novak Exp $" ; |
| 33 |
|
| 34 |
/* |
| 35 |
* $Id: scalar_poisson_regu.C,v 1.3 2014/10/13 08:53:47 j_novak Exp $ |
| 36 |
* $Log: scalar_poisson_regu.C,v $ |
| 37 |
* Revision 1.3 2014/10/13 08:53:47 j_novak |
| 38 |
* Lorene classes and functions now belong to the namespace Lorene. |
| 39 |
* |
| 40 |
* Revision 1.2 2003/10/11 14:46:00 e_gourgoulhon |
| 41 |
* Line 65-67: changed the name of local variable "triad" to "triad0" |
| 42 |
* in order not to shadow the class member triad. |
| 43 |
* |
| 44 |
* Revision 1.1 2003/09/25 08:56:28 e_gourgoulhon |
| 45 |
* First version (uses Cmp and Tenseur as intermediate quantities). |
| 46 |
* |
| 47 |
* |
| 48 |
* $Header: /cvsroot/Lorene/C++/Source/Tensor/Scalar/scalar_poisson_regu.C,v 1.3 2014/10/13 08:53:47 j_novak Exp $ |
| 49 |
* |
| 50 |
*/ |
| 51 |
|
| 52 |
// Header Lorene |
| 53 |
#include "tensor.h" |
| 54 |
#include "cmp.h" |
| 55 |
#include "tenseur.h" |
| 56 |
#include "param.h" |
| 57 |
|
| 58 |
//****************************************************************** |
| 59 |
|
| 60 |
namespace Lorene { |
| 61 |
|
| 62 |
void Scalar::poisson_regular(int k_div, int nzet, double unsgam1, Param& par, |
| 63 |
Scalar& uu, Scalar& uu_regu, Scalar& uu_div, |
| 64 |
Tensor& duu_div, |
| 65 |
Scalar& source_regu, Scalar& source_div) const { |
| 66 |
|
| 67 |
Cmp csource(*this) ; |
| 68 |
Cmp cuu(uu) ; |
| 69 |
Cmp cuu_regu(uu_regu) ; |
| 70 |
Cmp cuu_div(uu_div) ; |
| 71 |
Cmp csource_regu(source_regu) ; |
| 72 |
Cmp csource_div(source_div) ; |
| 73 |
|
| 74 |
const Base_vect* triad0 = duu_div.get_triad() ; |
| 75 |
|
| 76 |
Tenseur cduu_div(*mp, 1, COV, *triad0) ; |
| 77 |
cduu_div.set_etat_qcq() ; |
| 78 |
Itbl ind(1) ; |
| 79 |
ind.set_etat_qcq() ; |
| 80 |
for (int i=0; i<3; i++) { |
| 81 |
ind.set(0) = i+1 ; |
| 82 |
Cmp tmp( duu_div(ind) ) ; |
| 83 |
cduu_div.set(i) = tmp ; |
| 84 |
} |
| 85 |
|
| 86 |
mp->poisson_regular(csource, k_div, nzet, unsgam1, par, |
| 87 |
cuu, cuu_regu, cuu_div, cduu_div, |
| 88 |
csource_regu, csource_div) ; |
| 89 |
|
| 90 |
uu = cuu ; |
| 91 |
uu_regu = uu ; |
| 92 |
|
| 93 |
for (int i=1; i<=3; i++) { |
| 94 |
ind.set(0) = i ; |
| 95 |
duu_div.set(ind) = cduu_div(i-1) ; |
| 96 |
} |
| 97 |
|
| 98 |
source_regu = csource_regu ; |
| 99 |
source_div = csource_div ; |
| 100 |
|
| 101 |
} |
| 102 |
} |