LORENE
map_et_integ.C
1 /*
2  * Method of the class Map_et for computing the integral of a Cmp over
3  * all space.
4  */
5 
6 /*
7  * Copyright (c) 2000-2001 Eric Gourgoulhon
8  *
9  * This file is part of LORENE.
10  *
11  * LORENE is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * LORENE is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with LORENE; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24  *
25  */
26 
27 
28 
29 
30 /*
31  * $Id: map_et_integ.C,v 1.6 2016/12/05 16:17:57 j_novak Exp $
32  * $Log: map_et_integ.C,v $
33  * Revision 1.6 2016/12/05 16:17:57 j_novak
34  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
35  *
36  * Revision 1.5 2014/10/13 08:53:05 j_novak
37  * Lorene classes and functions now belong to the namespace Lorene.
38  *
39  * Revision 1.4 2014/10/06 15:13:13 j_novak
40  * Modified #include directives to use c++ syntax.
41  *
42  * Revision 1.3 2004/07/26 16:02:23 j_novak
43  * Added a flag to specify whether the primitive should be zero either at r=0
44  * or at r going to infinity.
45  *
46  * Revision 1.2 2004/06/14 15:27:35 e_gourgoulhon
47  * Added method primr (not ready yet !).
48  *
49  * Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon
50  * LORENE
51  *
52  * Revision 2.2 2000/08/16 12:12:12 eric
53  * Ajout de ciaff.set_dzpuis( ci.get_dzpuis() ) pour tenir compte de
54  * la suppression de Mtbl::dzpuis.
55  *
56  * Revision 2.1 2000/01/17 12:40:32 eric
57  * *** empty log message ***
58  *
59  * Revision 2.0 2000/01/17 11:17:06 eric
60  * *** empty log message ***
61  *
62  *
63  * $Header: /cvsroot/Lorene/C++/Source/Map/map_et_integ.C,v 1.6 2016/12/05 16:17:57 j_novak Exp $
64  *
65  */
66 
67 
68 // Headers C
69 #include <cstdlib>
70 
71 
72 // Headers Lorene
73 #include "map.h"
74 #include "cmp.h"
75 
76 namespace Lorene {
77 Tbl* Map_et::integrale(const Cmp& ci) const {
78 
79  assert(ci.get_etat() != ETATNONDEF) ;
80 
81  int nz = mg->get_nzone() ;
82 
83  if (ci.get_etat() == ETATZERO) {
84  Tbl* resu = new Tbl(nz) ;
85  resu->annule_hard() ;
86  return resu ;
87  }
88 
89  assert( ci.get_etat() == ETATQCQ ) ;
90 
91  // Construction of an affine mapping to call Map_af::integrale
92  Map_af mpaff(*this) ;
93 
94  Cmp ciaff(mpaff) ;
95 
96  // Multiplication by the reducted Jacobian of the mapping
97 
98  Base_val sauve_base = (ci.va).base ;
99 
100  ciaff = (ci.va) * rsx2drdx ;
101 
102  (ciaff.va).set_base(sauve_base) ;
103 
104  ciaff.set_dzpuis( ci.get_dzpuis() ) ;
105 
106  // Call to the Map_af version :
107 
108  return mpaff.integrale(ciaff) ;
109 
110 }
111 
112 
113 void Map_et::primr(const Scalar& , Scalar& , bool) const {
114 
115  cout << "Map_et::primr : not ready yet !" << endl ;
116  abort() ;
117 }
118 }
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Definition: cmp.h:446
virtual void primr(const Scalar &uu, Scalar &resu, bool null_infty) const
Computes the radial primitive which vanishes for .
Definition: map_et_integ.C:113
Lorene prototypes.
Definition: app_hor.h:67
int get_etat() const
Returns the logical state.
Definition: cmp.h:899
Tensor field of valence 0 (or component of a tensorial field).
Definition: scalar.h:393
Coord rsx2drdx
in the nucleus and the shells; \ in the outermost compactified domain.
Definition: map.h:2872
int get_nzone() const
Returns the number of domains.
Definition: grilles.h:465
const Mg3d * mg
Pointer on the multi-grid Mgd3 on which this is defined.
Definition: map.h:694
Bases of the spectral expansions.
Definition: base_val.h:325
Affine radial mapping.
Definition: map.h:2048
int get_dzpuis() const
Returns dzpuis.
Definition: cmp.h:903
virtual Tbl * integrale(const Cmp &) const
Computes the integral over all space of a Cmp.
Definition: map_et_integ.C:77
void set_dzpuis(int)
Set a value to dzpuis.
Definition: cmp.C:657
Basic array class.
Definition: tbl.h:164
void annule_hard()
Sets the Tbl to zero in a hard way.
Definition: tbl.C:375
Valeur va
The numerical value of the Cmp.
Definition: cmp.h:464