Debian Codegraph @

C++/Source/Tensor/Scalar/scalar_pde_frontiere.C

raw
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 char scalar_pde_frontiere_C[] = "$Header: /cvsroot/Lorene/C++/Source/Tensor/Scalar/scalar_pde_frontiere.C,v 1.6 2014/10/13 08:53:46 j_novak Exp $" ;
30
31 /*
32 * $Id: scalar_pde_frontiere.C,v 1.6 2014/10/13 08:53:46 j_novak Exp $
33 * $Log: scalar_pde_frontiere.C,v $
34 * Revision 1.6 2014/10/13 08:53:46 j_novak
35 * Lorene classes and functions now belong to the namespace Lorene.
36 *
37 * Revision 1.5 2007/06/21 20:01:32 k_taniguchi
38 * Modification of the method to convert Scalar to Cmp.
39 *
40 * Revision 1.4 2004/11/23 12:46:57 f_limousin
41 * Intoduce function poisson_dir_neu(...) to solve a scalar poisson
42 * equation with a mixed boundary condition (Dirichlet + Neumann).
43 *
44 * Revision 1.3 2003/10/03 15:58:52 j_novak
45 * Cleaning of some headers
46 *
47 * Revision 1.2 2003/09/25 08:57:27 e_gourgoulhon
48 * modif comments
49 *
50 * Revision 1.1 2003/09/25 08:06:56 e_gourgoulhon
51 * First versions (use Cmp as intermediate quantities).
52 *
53 *
54 * $Header: /cvsroot/Lorene/C++/Source/Tensor/Scalar/scalar_pde_frontiere.C,v 1.6 2014/10/13 08:53:46 j_novak Exp $
55 *
56 */
57
58 // Header Lorene:
59 #include "tensor.h"
60 #include "cmp.h"
61
62
63 namespace Lorene {
64 Scalar Scalar::poisson_dirichlet(const Valeur& limite, int num_front) const {
65
66 // Cmp csource(*this) ;
67 Cmp csource(mp) ;
68 csource = (*this).va ;
69 csource.set_dzpuis((*this).get_dzpuis()) ;
70 (csource.va).set_base( ((*this).va).get_base() ) ;
71
72 Cmp cresu(mp) ;
73
74 mp->poisson_frontiere(csource, limite, 1, num_front, cresu) ;
75
76 Scalar resu(cresu) ;
77 return resu ;
78 }
79
80 Scalar Scalar::poisson_dir_neu(const Valeur& limite, int num_front,
81 double fact_dir, double fact_neu) const {
82
83 // Cmp csource(*this) ;
84 Cmp csource(mp) ;
85 csource = (*this).va ;
86 csource.set_dzpuis((*this).get_dzpuis()) ;
87 (csource.va).set_base( ((*this).va).get_base() ) ;
88
89 Cmp cresu(mp) ;
90
91 mp->poisson_frontiere(csource, limite, 3, num_front, cresu, fact_dir,
92 fact_neu) ;
93
94 Scalar resu(cresu) ;
95 return resu ;
96 }
97
98 Scalar Scalar::poisson_neumann(const Valeur& limite, int num_front) const {
99
100 // Cmp csource(*this) ;
101 Cmp csource(mp) ;
102 csource = (*this).va ;
103 csource.set_dzpuis((*this).get_dzpuis()) ;
104 (csource.va).set_base( ((*this).va).get_base() ) ;
105
106 Cmp cresu(mp) ;
107
108 mp->poisson_frontiere (csource, limite, 2, num_front, cresu) ;
109
110 Scalar resu(cresu) ;
111 return resu ;
112 }
113
114
115 Scalar Scalar::poisson_frontiere_double (const Valeur& lim_func,
116 const Valeur& lim_der, int num_zone) const {
117
118 Cmp csource(*this) ;
119 Cmp cresu(mp) ;
120
121 mp->poisson_frontiere_double(csource, lim_func, lim_der, num_zone, cresu) ;
122
123 Scalar resu(cresu) ;
124 return resu ;
125 }
126
127
128
129 }