LORENE
tenseur_inv_pois_vect.C
1/*
2 * Copyright (c) 2000-2001 Philippe Grandclement
3 *
4 * This file is part of LORENE.
5 *
6 * LORENE is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * LORENE is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with LORENE; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 */
21
22
23
24
25/*
26 * $Id: tenseur_inv_pois_vect.C,v 1.6 2016/12/05 16:18:16 j_novak Exp $
27 * $Log: tenseur_inv_pois_vect.C,v $
28 * Revision 1.6 2016/12/05 16:18:16 j_novak
29 * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
30 *
31 * Revision 1.5 2014/10/13 08:53:42 j_novak
32 * Lorene classes and functions now belong to the namespace Lorene.
33 *
34 * Revision 1.4 2014/10/06 15:13:18 j_novak
35 * Modified #include directives to use c++ syntax.
36 *
37 * Revision 1.3 2005/08/29 09:41:45 p_grandclement
38 * Minor modif
39 *
40 * Revision 1.2 2002/08/07 16:14:11 j_novak
41 * class Tenseur can now also handle tensor densities, this should be transparent to older codes
42 *
43 * Revision 1.1.1.1 2001/11/20 15:19:30 e_gourgoulhon
44 * LORENE
45 *
46 * Revision 2.0 2000/10/19 09:49:47 phil
47 * *** empty log message ***
48 *
49 *
50 * $Header: /cvsroot/Lorene/C++/Source/Tenseur/tenseur_inv_pois_vect.C,v 1.6 2016/12/05 16:18:16 j_novak Exp $
51 *
52 */
53
54//Standard
55#include <cstdlib>
56
57//Lorene
58#include "tenseur.h"
59
60// Inversion de Poisson vectoriel :
61namespace Lorene {
63
64 assert (valence == 1) ;
65 assert (etat != ETATNONDEF) ;
66 if (etat == ETATZERO)
67 return (*this) ;
68
69 Tenseur inverse (*mp, 1, CON, *get_triad(), metric, poids) ;
70 Tenseur grad (contract(this->gradient(), 0, 1)) ;
71 grad.dec2_dzpuis() ;
72 Tenseur grad_shift (grad.gradient()) ;
73 grad_shift.inc2_dzpuis() ;
74 inverse.set_etat_qcq() ;
75 for (int i=0 ; i<3 ; i++)
76 inverse.set(i) = (*this)(i).laplacien(4)+lambda*grad_shift(i) ;
77
78 return inverse ;
79}
80}
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.
Definition tenseur.h:707
Cmp & set()
Read/write for a scalar (see also operator=(const Cmp&) ).
Definition tenseur.C:830
const Metrique * metric
For tensor densities: the metric defining the conformal factor.
Definition tenseur.h:328
const Map *const mp
Reference mapping.
Definition tenseur.h:309
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Definition tenseur.C:642
Tenseur(const Map &map, const Metrique *met=0x0, double weight=0)
Constructor for a scalar field.
Definition tenseur.C:215
void dec2_dzpuis()
dzpuis -= 2 ;
Definition tenseur.C:1136
const Tenseur & gradient() const
Returns the gradient of *this (Cartesian coordinates).
Definition tenseur.C:1548
friend Tenseur contract(const Tenseur &, int id1, int id2)
Self contraction of two indices of a Tenseur .
int valence
Valence.
Definition tenseur.h:310
void inc2_dzpuis()
dzpuis += 2 ;
Definition tenseur.C:1149
int etat
Logical state ETATZERO , ETATQCQ or ETATNONDEF.
Definition tenseur.h:324
double poids
For tensor densities: the weight.
Definition tenseur.h:326
Tenseur inverse_poisson_vect(double lambda) const
Compute of *this , *this being of valence 1.
Lorene prototypes.
Definition app_hor.h:67
virtual void laplacien(const Scalar &uu, int zec_mult_r, Scalar &lap) const =0
Computes the Laplacian of a scalar field.