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 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 }
Lorene::Tenseur
Tensor handling *** DEPRECATED : use class Tensor instead ***.
Definition: tenseur.h:301
Lorene::Tensor
Tensor handling.
Definition: tensor.h:288
Lorene::Itbl::set
int & set(int i)
Read/write of a particular element (index i ) (1D case)
Definition: itbl.h:247
Lorene::Tenseur::set
Cmp & set()
Read/write for a scalar (see also operator=(const Cmp&) ).
Definition: tenseur.C:824
Lorene
Lorene prototypes.
Definition: app_hor.h:64
Lorene::Itbl::set_etat_qcq
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Definition: itbl.C:261
Lorene::Itbl
Basic integer array class.
Definition: itbl.h:122
Lorene::Scalar
Tensor field of valence 0 (or component of a tensorial field).
Definition: scalar.h:387
Lorene::Map::poisson_regular
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.
Lorene::Tensor::set
Scalar & set(const Itbl &ind)
Returns the value of a component (read/write version).
Definition: tensor.C:654
Lorene::Tensor::mp
const Map *const mp
Mapping on which the numerical values at the grid points are defined.
Definition: tensor.h:295
Lorene::Cmp
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Definition: cmp.h:446
Lorene::Scalar::poisson_regular
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...
Definition: scalar_poisson_regu.C:62
Lorene::Tenseur::set_etat_qcq
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Definition: tenseur.C:636
Lorene::Tensor::get_triad
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.
Definition: tensor.h:866
Lorene::Param
Parameter storage.
Definition: param.h:125
Lorene::Base_vect
Vectorial bases (triads) with respect to which the tensorial components are defined.
Definition: base_vect.h:105