LORENE
scalar_poisson_regu.C
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 
33 
34 /*
35  * $Id: scalar_poisson_regu.C,v 1.4 2016/12/05 16:18:19 j_novak Exp $
36  * $Log: scalar_poisson_regu.C,v $
37  * Revision 1.4 2016/12/05 16:18:19 j_novak
38  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
39  *
40  * Revision 1.3 2014/10/13 08:53:47 j_novak
41  * Lorene classes and functions now belong to the namespace Lorene.
42  *
43  * Revision 1.2 2003/10/11 14:46:00 e_gourgoulhon
44  * Line 65-67: changed the name of local variable "triad" to "triad0"
45  * in order not to shadow the class member triad.
46  *
47  * Revision 1.1 2003/09/25 08:56:28 e_gourgoulhon
48  * First version (uses Cmp and Tenseur as intermediate quantities).
49  *
50  *
51  * $Header: /cvsroot/Lorene/C++/Source/Tensor/Scalar/scalar_poisson_regu.C,v 1.4 2016/12/05 16:18:19 j_novak Exp $
52  *
53  */
54 
55 // Header Lorene
56 #include "tensor.h"
57 #include "cmp.h"
58 #include "tenseur.h"
59 #include "param.h"
60 
61 //******************************************************************
62 
63 namespace Lorene {
64 
65 void Scalar::poisson_regular(int k_div, int nzet, double unsgam1, Param& par,
66  Scalar& uu, Scalar& uu_regu, Scalar& uu_div,
67  Tensor& duu_div,
68  Scalar& source_regu, Scalar& source_div) const {
69 
70  Cmp csource(*this) ;
71  Cmp cuu(uu) ;
72  Cmp cuu_regu(uu_regu) ;
73  Cmp cuu_div(uu_div) ;
74  Cmp csource_regu(source_regu) ;
75  Cmp csource_div(source_div) ;
76 
77  const Base_vect* triad0 = duu_div.get_triad() ;
78 
79  Tenseur cduu_div(*mp, 1, COV, *triad0) ;
80  cduu_div.set_etat_qcq() ;
81  Itbl ind(1) ;
82  ind.set_etat_qcq() ;
83  for (int i=0; i<3; i++) {
84  ind.set(0) = i+1 ;
85  Cmp tmp( duu_div(ind) ) ;
86  cduu_div.set(i) = tmp ;
87  }
88 
89  mp->poisson_regular(csource, k_div, nzet, unsgam1, par,
90  cuu, cuu_regu, cuu_div, cduu_div,
91  csource_regu, csource_div) ;
92 
93  uu = cuu ;
94  uu_regu = uu ;
95 
96  for (int i=1; i<=3; i++) {
97  ind.set(0) = i ;
98  duu_div.set(ind) = cduu_div(i-1) ;
99  }
100 
101  source_regu = csource_regu ;
102  source_div = csource_div ;
103 
104 }
105 }
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Definition: cmp.h:446
int & set(int i)
Read/write of a particular element (index i ) (1D case)
Definition: itbl.h:247
Lorene prototypes.
Definition: app_hor.h:67
Tensor field of valence 0 (or component of a tensorial field).
Definition: scalar.h:393
Basic integer array class.
Definition: itbl.h:122
void poisson_regular(int k_div, int nzet, double unsgam1, Param &par, Scalar &uu, Scalar &uu_regu, Scalar &uu_div, Tensor &duu_div, Scalar &source_regu, Scalar &source_div) const
Solves the scalar Poisson equation with *this as a source (version with parameters to control the res...
Vectorial bases (triads) with respect to which the tensorial components are defined.
Definition: base_vect.h:105
Cmp & set()
Read/write for a scalar (see also operator=(const Cmp&) ).
Definition: tenseur.C:840
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.
Definition: tensor.h:879
Parameter storage.
Definition: param.h:125
virtual void poisson_regular(const Cmp &source, int k_div, int nzet, double unsgam1, Param &par, Cmp &uu, Cmp &uu_regu, Cmp &uu_div, Tenseur &duu_div, Cmp &source_regu, Cmp &source_div) const =0
Computes the solution of a scalar Poisson equation.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Definition: itbl.C:264
Tensor handling.
Definition: tensor.h:294
Scalar & set(const Itbl &ind)
Returns the value of a component (read/write version).
Definition: tensor.C:663
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Definition: tenseur.C:652
const Map *const mp
Mapping on which the numerical values at the grid points are defined.
Definition: tensor.h:301
Tensor handling *** DEPRECATED : use class Tensor instead ***.
Definition: tenseur.h:304