LORENE
cmp_pde.C
1 /*
2  * Methods of the class Cmp for various partial differential equations
3  */
4 
5 /*
6  * Copyright (c) 1999-2001 Eric Gourgoulhon
7  * Copyright (c) 1999-2001 Philippe Grandclement
8  * Copyright (c) 2000-2001 Jerome Novak
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: cmp_pde.C,v 1.7 2026/03/04 15:47:04 j_novak Exp $
33  * $Log: cmp_pde.C,v $
34  * Revision 1.7 2026/03/04 15:47:04 j_novak
35  * Added 'verbose' flag (true by default) to limit the output of poisson solvers.
36  *
37  * Revision 1.6 2016/12/05 16:17:49 j_novak
38  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
39  *
40  * Revision 1.5 2014/10/13 08:52:47 j_novak
41  * Lorene classes and functions now belong to the namespace Lorene.
42  *
43  * Revision 1.4 2005/08/30 08:35:12 p_grandclement
44  * Addition of the Tau version of the vectorial Poisson equation for the Tensors
45  *
46  * Revision 1.3 2004/03/01 09:54:59 j_novak
47  * Suppression of the Cmp version of avance_dalembert (now only with Scalar's)
48  *
49  * Revision 1.2 2002/01/03 15:30:27 j_novak
50  * Some comments modified.
51  *
52  * Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon
53  * LORENE
54  *
55  * Revision 1.8 2001/10/16 09:59:00 novak
56  * deletion of source(t=jm1) from the argument list of d'Alembert solvers
57  *
58  * Revision 1.7 2001/07/19 14:04:07 novak
59  * new argument list for Cmp::avance_dalembert
60  *
61  * Revision 1.6 2000/12/04 15:07:55 novak
62  * *** empty log message ***
63  *
64  * Revision 1.5 2000/10/19 14:16:43 novak
65  * Ajout de Cmp::avance_dalembert (etat experimental)
66  *
67  * Revision 1.4 1999/12/21 14:47:30 eric
68  * *** empty log message ***
69  *
70  * Revision 1.3 1999/12/21 13:04:00 eric
71  * Changement de prototype de la routine poisson avec Param& : la solution est
72  * desormais passee en argument (et non plus en valeur de retour)
73  * pour permettre l'initialisation de methodes de resolution iteratives.
74  *
75  * Revision 1.2 1999/12/21 10:07:25 eric
76  * Il y a desormais deux versions de poisson: une sans Param et une
77  * avec Param.
78  *
79  * Revision 1.1 1999/12/02 14:30:13 eric
80  * Initial revision
81  *
82  *
83  * $Header: /cvsroot/Lorene/C++/Source/Cmp/cmp_pde.C,v 1.7 2026/03/04 15:47:04 j_novak Exp $
84  *
85  */
86 
87 // Header Lorene:
88 #include "map.h"
89 #include "cmp.h"
90 #include "param.h"
91 
92  //-----------------------------------//
93  // Scalar Poisson equation //
94  //-----------------------------------//
95 
96 // Version without parameters
97 // --------------------------
98 
99 namespace Lorene {
100 Cmp Cmp::poisson() const {
101 
102  Param bidon ;
103  Cmp resu(*mp) ;
104 
105  mp->poisson(*this, bidon, resu) ;
106 
107  return resu ;
108 }
109 
110 // Version with parameters
111 // -----------------------
112 
113  void Cmp::poisson(Param& par, Cmp& uu, bool verbose) const {
114 
115  mp->poisson(*this, par, uu, verbose) ;
116 
117 }
118 
119  //--------------------------------------------------//
120  // Scalar Poisson equation with a Tau method //
121  //--------------------------------------------------//
122 
123 // Version without parameters
124 // --------------------------
125 
127 
128  Param bidon ;
129  Cmp resu(*mp) ;
130 
131  mp->poisson_tau(*this, bidon, resu) ;
132 
133  return resu ;
134 }
135 
136 // Version with parameters
137 // -----------------------
138 
139 void Cmp::poisson_tau(Param& par, Cmp& uu) const {
140 
141  mp->poisson_tau(*this, par, uu) ;
142 
143 }
144 
145 }
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Definition: cmp.h:449
Lorene prototypes.
Definition: app_hor.h:67
virtual void poisson_tau(const Cmp &source, Param &par, Cmp &uu) const =0
Computes the solution of a scalar Poisson equationwith a Tau method (Cmp version).
Cmp poisson_tau() const
Same as Poisson with a Tau method.
Definition: cmp_pde.C:126
virtual void poisson(const Cmp &source, Param &par, Cmp &uu, bool verbose=true) const =0
Computes the solution of a scalar Poisson equation (Cmp version).
Parameter storage.
Definition: param.h:125
Cmp poisson() const
Solves the scalar Poisson equation with *this as a source.
Definition: cmp_pde.C:100
const Map * mp
Reference mapping.
Definition: cmp.h:454