LORENE
vector_divfree_A_poisson.C
1 /*
2  * Methods to impose the Dirac gauge: divergence-free condition.
3  *
4  * (see file sym_tensor.h for documentation).
5  *
6  */
7 
8 /*
9  * Copyright (c) 2006 Jerome Novak
10  *
11  * This file is part of LORENE.
12  *
13  * LORENE is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License version 2
15  * as published by the Free Software Foundation.
16  *
17  * LORENE is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with LORENE; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25  *
26  */
27 
28 
29 
30 /*
31  * $Id: vector_divfree_A_poisson.C,v 1.5 2016/12/05 16:18:18 j_novak Exp $
32  * $Log: vector_divfree_A_poisson.C,v $
33  * Revision 1.5 2016/12/05 16:18:18 j_novak
34  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
35  *
36  * Revision 1.4 2014/10/13 08:53:45 j_novak
37  * Lorene classes and functions now belong to the namespace Lorene.
38  *
39  * Revision 1.3 2014/10/06 15:13:20 j_novak
40  * Modified #include directives to use c++ syntax.
41  *
42  * Revision 1.2 2009/10/23 13:18:46 j_novak
43  * Minor modifications
44  *
45  * Revision 1.1 2008/08/27 09:01:27 jl_cornou
46  * Methods for solving Dirac systems for divergence free vectors
47  *
48  * $Header: /cvsroot/Lorene/C++/Source/Tensor/vector_divfree_A_poisson.C,v 1.5 2016/12/05 16:18:18 j_novak Exp $
49  *
50  */
51 
52 
53 // C headers
54 #include <cstdlib>
55 #include <cassert>
56 #include <cmath>
57 
58 // Lorene headers
59 #include "metric.h"
60 #include "diff.h"
61 #include "proto.h"
62 #include "param.h"
63 
64 //----------------------------------------------------------------------------------
65 //
66 // sol_Dirac_A
67 //
68 //----------------------------------------------------------------------------------
69 
70 namespace Lorene {
71 void Vector_divfree::sol_Dirac_A_poisson(const Scalar& aaa, Scalar& tilde_vr, Scalar& tilde_eta,
72  const Param* ) const {
73 
74 
75  Scalar source1 = -aaa.lapang();
76  Scalar rvr = source1.poisson_tau();
77  //rvr = rvr - rvr.val_grid_point(0,0,0,0);
78  Scalar source2 = aaa.dsdr();
79  source2.mult_r_dzpuis(2);
80  source2 += 3*aaa;
81  Scalar reta = source2.poisson_tau();
82  //reta = reta - reta.val_grid_point(0,0,0,0);
83  rvr.div_r();
84  tilde_vr = rvr ;
85  reta.div_r();
86  tilde_eta = reta ;
87 
88 
89 }
90 }
const Scalar & lapang() const
Returns the angular Laplacian of *this , where .
Definition: scalar_deriv.C:461
Lorene prototypes.
Definition: app_hor.h:67
Tensor field of valence 0 (or component of a tensorial field).
Definition: scalar.h:393
void div_r()
Division by r everywhere; dzpuis is not changed.
Parameter storage.
Definition: param.h:125
const Scalar & dsdr() const
Returns of *this .
Definition: scalar_deriv.C:113
void mult_r_dzpuis(int ced_mult_r)
Multiplication by r everywhere but with the output flag dzpuis set to ced_mult_r ...
void sol_Dirac_A_poisson(const Scalar &aaa, Scalar &eta, Scalar &vr, const Param *par_bc=0x0) const
Solves via a poisson method a system of two-coupled first-order PDEs obtained from the divergence-fre...
Scalar poisson_tau() const
Solves the scalar Poisson equation with *this as a source using a real Tau method The source of the ...
Definition: scalar_pde.C:172