LORENE
scalar_pde_frontiere.C
1 /*
2  * Methods Scalar::poisson_*
3  */
4 
5 /*
6  * Copyright (c) 2003 Eric Gourgoulhon & Jerome Novak
7  *
8  * Copyright (c) 2000-2001 Philippe Grandclement (for preceding Cmp version)
9  *
10  * This file is part of LORENE.
11  *
12  * LORENE is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
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 /*
32  * $Id: scalar_pde_frontiere.C,v 1.7 2016/12/05 16:18:19 j_novak Exp $
33  * $Log: scalar_pde_frontiere.C,v $
34  * Revision 1.7 2016/12/05 16:18:19 j_novak
35  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
36  *
37  * Revision 1.6 2014/10/13 08:53:46 j_novak
38  * Lorene classes and functions now belong to the namespace Lorene.
39  *
40  * Revision 1.5 2007/06/21 20:01:32 k_taniguchi
41  * Modification of the method to convert Scalar to Cmp.
42  *
43  * Revision 1.4 2004/11/23 12:46:57 f_limousin
44  * Intoduce function poisson_dir_neu(...) to solve a scalar poisson
45  * equation with a mixed boundary condition (Dirichlet + Neumann).
46  *
47  * Revision 1.3 2003/10/03 15:58:52 j_novak
48  * Cleaning of some headers
49  *
50  * Revision 1.2 2003/09/25 08:57:27 e_gourgoulhon
51  * modif comments
52  *
53  * Revision 1.1 2003/09/25 08:06:56 e_gourgoulhon
54  * First versions (use Cmp as intermediate quantities).
55  *
56  *
57  * $Header: /cvsroot/Lorene/C++/Source/Tensor/Scalar/scalar_pde_frontiere.C,v 1.7 2016/12/05 16:18:19 j_novak Exp $
58  *
59  */
60 
61 // Header Lorene:
62 #include "tensor.h"
63 #include "cmp.h"
64 
65 
66 namespace Lorene {
67 Scalar Scalar::poisson_dirichlet(const Valeur& limite, int num_front) const {
68 
69  // Cmp csource(*this) ;
70  Cmp csource(mp) ;
71  csource = (*this).va ;
72  csource.set_dzpuis((*this).get_dzpuis()) ;
73  (csource.va).set_base( ((*this).va).get_base() ) ;
74 
75  Cmp cresu(mp) ;
76 
77  mp->poisson_frontiere(csource, limite, 1, num_front, cresu) ;
78 
79  Scalar resu(cresu) ;
80  return resu ;
81 }
82 
83 Scalar Scalar::poisson_dir_neu(const Valeur& limite, int num_front,
84  double fact_dir, double fact_neu) const {
85 
86  // Cmp csource(*this) ;
87  Cmp csource(mp) ;
88  csource = (*this).va ;
89  csource.set_dzpuis((*this).get_dzpuis()) ;
90  (csource.va).set_base( ((*this).va).get_base() ) ;
91 
92  Cmp cresu(mp) ;
93 
94  mp->poisson_frontiere(csource, limite, 3, num_front, cresu, fact_dir,
95  fact_neu) ;
96 
97  Scalar resu(cresu) ;
98  return resu ;
99 }
100 
101 Scalar Scalar::poisson_neumann(const Valeur& limite, int num_front) const {
102 
103  // Cmp csource(*this) ;
104  Cmp csource(mp) ;
105  csource = (*this).va ;
106  csource.set_dzpuis((*this).get_dzpuis()) ;
107  (csource.va).set_base( ((*this).va).get_base() ) ;
108 
109  Cmp cresu(mp) ;
110 
111  mp->poisson_frontiere (csource, limite, 2, num_front, cresu) ;
112 
113  Scalar resu(cresu) ;
114  return resu ;
115 }
116 
117 
119  const Valeur& lim_der, int num_zone) const {
120 
121  Cmp csource(*this) ;
122  Cmp cresu(mp) ;
123 
124  mp->poisson_frontiere_double(csource, lim_func, lim_der, num_zone, cresu) ;
125 
126  Scalar resu(cresu) ;
127  return resu ;
128 }
129 
130 
131 
132 }
Scalar poisson_dir_neu(const Valeur &limite, int num, double fact_dir, double fact_neu) const
Is identicall to Scalar::poisson() .
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Definition: cmp.h:446
Scalar poisson_frontiere_double(const Valeur &, const Valeur &, int) const
Idem as Scalar::poisson_dirichlet , the boundary condition being on both the function and its radial ...
Lorene prototypes.
Definition: app_hor.h:67
Tensor field of valence 0 (or component of a tensorial field).
Definition: scalar.h:393
Values and coefficients of a (real-value) function.
Definition: valeur.h:297
Scalar poisson_neumann(const Valeur &, int) const
Idem as Scalar::poisson_dirichlet , the boundary condition being on the radial derivative of the solu...
virtual void poisson_frontiere(const Cmp &source, const Valeur &limite, int raccord, int num_front, Cmp &pot, double=0., double=0.) const =0
Computes the solution of a Poisson equation from the domain num_front+1 .
void set_dzpuis(int)
Set a value to dzpuis.
Definition: cmp.C:657
Scalar poisson_dirichlet(const Valeur &limite, int num) const
Is identicall to Scalar::poisson() .
const Map *const mp
Mapping on which the numerical values at the grid points are defined.
Definition: tensor.h:301
Valeur va
The numerical value of the Cmp.
Definition: cmp.h:464