LORENE
cmp.h
1 /*
2  * Definition of Lorene class Cmp
3  *
4  */
5 
6 /*
7  * Copyright (c) 1999-2000 Jean-Alain Marck
8  * Copyright (c) 1999-2002 Eric Gourgoulhon
9  * Copyright (c) 1999-2001 Philippe Grandclement
10  * Copyright (c) 2000-2002 Jerome Novak
11  * Copyright (c) 2000-2001 Keisuke Taniguchi
12  *
13  * This file is part of LORENE.
14  *
15  * LORENE is free software; you can redistribute it and/or modify
16  * it under the terms of the GNU General Public License as published by
17  * the Free Software Foundation; either version 2 of the License, or
18  * (at your option) any later version.
19  *
20  * LORENE is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23  * GNU General Public License for more details.
24  *
25  * You should have received a copy of the GNU General Public License
26  * along with LORENE; if not, write to the Free Software
27  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28  *
29  */
30 
31 
32 #ifndef __CMP_H_
33 #define __CMP_H_
34 
35 
36 /*
37  * $Id: cmp.h,v 1.24 2026/03/04 15:47:04 j_novak Exp $
38  * $Log: cmp.h,v $
39  * Revision 1.24 2026/03/04 15:47:04 j_novak
40  * Added 'verbose' flag (true by default) to limit the output of poisson solvers.
41  *
42  * Revision 1.23 2016/09/19 15:26:22 j_novak
43  * Correction of several bugs preventing the shared library compilation.
44  *
45  * Revision 1.22 2014/10/13 08:52:33 j_novak
46  * Lorene classes and functions now belong to the namespace Lorene.
47  *
48  * Revision 1.21 2014/10/06 15:09:39 j_novak
49  * Modified #include directives to use c++ syntax.
50  *
51  * Revision 1.20 2012/08/12 17:35:36 p_cerda
52  * Magnetstar: adding new member to class Cmp
53  *
54  * Revision 1.19 2010/02/02 13:34:12 e_gourgoulhon
55  * Marked DEPRECATED (in the documentation).
56  *
57  * Revision 1.18 2005/08/30 08:35:10 p_grandclement
58  * Addition of the Tau version of the vectorial Poisson equation for the Tensors
59  *
60  * Revision 1.17 2005/08/02 06:09:58 m_saijo
61  * Modified comment lines (div_r, multi_r, mult_rsint, div_rsint)
62  *
63  * Revision 1.16 2004/12/29 16:20:20 k_taniguchi
64  * Addition of the function poisson_ylm.
65  *
66  * Revision 1.15 2004/11/30 20:38:10 k_taniguchi
67  * Addition of the function poisson_falloff.
68  *
69  * Revision 1.14 2004/10/11 15:08:59 j_novak
70  * The radial manipulation functions take Scalar as arguments, instead of Cmp.
71  * Added a conversion operator from Scalar to Cmp.
72  * The Cmp radial manipulation function make conversion to Scalar, call to the
73  * Map_radial version with a Scalar argument and back.
74  *
75  * Revision 1.13 2004/03/31 11:21:02 f_limousin
76  * Method Cmp::poisson_neumann_interne has been implemented to solve
77  * the continuity equation for strange stars.
78  *
79  * Revision 1.12 2004/03/22 13:12:40 j_novak
80  * Modification of comments to use doxygen instead of doc++
81  *
82  * Revision 1.11 2004/03/01 09:54:58 j_novak
83  * Suppression of the Cmp version of avance_dalembert (now only with Scalar's)
84  *
85  * Revision 1.10 2003/11/06 14:43:37 e_gourgoulhon
86  * Gave a name to const arguments in certain method prototypes (e.g.
87  * constructors) to correct a bug of DOC++.
88  *
89  * Revision 1.9 2003/09/24 20:52:37 e_gourgoulhon
90  * Added constructor by conversion of a Scalar.
91  *
92  * Revision 1.8 2003/08/26 09:46:10 j_novak
93  * Added the method multipole_spectrum
94  *
95  * Revision 1.7 2003/06/20 14:16:10 f_limousin
96  * Add the function compare().
97  *
98  * Revision 1.6 2003/06/20 09:27:09 j_novak
99  * Modif commentaires.
100  *
101  * Revision 1.5 2002/09/13 09:17:31 j_novak
102  * Modif. commentaires
103  *
104  * Revision 1.4 2002/06/17 14:05:16 j_novak
105  * friend functions are now also declared outside the class definition
106  *
107  * Revision 1.3 2002/05/17 12:08:46 e_gourgoulhon
108  * Corrected error in the comment about dzpuis: multiplied --> divided
109  *
110  * Revision 1.2 2002/01/03 15:30:27 j_novak
111  * Some comments modified.
112  *
113  * Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon
114  * LORENE
115  *
116  * Revision 2.101 2001/10/29 15:36:03 novak
117  * Ajout de Cmp::div_r()
118  *
119  * Revision 2.100 2001/10/16 10:03:57 novak
120  * *** empty log message ***
121  *
122  * Revision 2.99 2001/08/31 14:52:10 novak
123  * Back to 2.97 version 2.98 was useless
124  *
125  * Revision 2.97 2001/07/19 14:01:39 novak
126  * new arguments for Cmp::avance_dalembert
127  *
128  * Revision 2.96 2001/05/29 16:09:40 eric
129  * Modif commentaires (mise en conformite Doc++ 3.4.7).
130  *
131  * Revision 2.95 2001/05/26 15:07:20 eric
132  * Ajout de operator% : multiplication de deux Cmp avec desaliasage
133  *
134  * Revision 2.94 2001/05/25 09:30:07 phil
135  * ajout de filtre_phi
136  *
137  * Revision 2.93 2001/03/30 13:36:22 phil
138  * ajout de raccord_externe
139  *
140  * Revision 2.92 2001/03/26 08:11:50 eric
141  * Modif commentaires.
142  *
143  * Revision 2.91 2001/03/22 10:25:19 phil
144  * modification prototypage de raccord_zec.C
145  *
146  * Revision 2.90 2001/02/12 18:08:10 phil
147  * ajout de Cmp::fixe_decroissance
148  *
149  * Revision 2.89 2000/12/13 14:50:05 phil
150  * changement nom variable dzpuis dans raccord_c1_zec
151  *
152  * Revision 2.88 2000/12/13 14:35:53 phil
153  * *** empty log message ***
154  *
155  * Revision 2.87 2000/12/13 14:26:42 phil
156  * *** empty log message ***
157  *
158  * Revision 2.86 2000/12/13 14:25:26 phil
159  * vire commentaires des raccords (provisioire)
160  *
161  * Revision 2.85 2000/12/13 14:19:49 phil
162  * modif commentaires
163  *
164  * Revision 2.84 2000/12/13 14:08:36 phil
165  * ajout procedure raccord_c1_zec
166  *
167  * Revision 2.83 2000/12/04 16:48:47 novak
168  * *** empty log message ***
169  *
170  * Revision 2.82 2000/12/04 15:06:15 novak
171  * *** empty log message ***
172  *
173  * Revision 2.81 2000/11/15 13:24:28 phil
174  * modification de asymptot
175  *
176  * Revision 2.80 2000/11/15 13:19:13 phil
177  * *** empty log message ***
178  *
179  * Revision 2.79 2000/11/15 13:17:01 phil
180  * *** empty log message ***
181  *
182  * Revision 2.78 2000/11/15 13:15:45 phil
183  * gestion affichage dans asymptot
184  *
185  * Revision 2.77 2000/10/20 09:43:30 phil
186  * changement commentaires
187  *
188  * Revision 2.76 2000/10/19 14:07:06 novak
189  * Ajout de la fonction membre avance_dalembert (experimentale)
190  *
191  * Revision 2.75 2000/10/19 09:20:36 phil
192  * *** empty log message ***
193  *
194  * Revision 2.74 2000/10/19 09:13:45 phil
195  * ajout des fonctions :
196  * filtre(int)
197  * set_val_inf(double)
198  * set_val_hor(double,int)
199  *
200  * Revision 2.73 2000/10/05 14:18:14 eric
201  * La fonction check_poisson est rebaptisee test_poisson.
202  *
203  * Revision 2.72 2000/10/05 13:56:52 eric
204  * *** empty log message ***
205  *
206  * Revision 2.71 2000/10/05 13:52:25 eric
207  * Ajout de la fonction check_poisson.
208  *
209  * Revision 2.70 2000/09/13 12:21:44 eric
210  * Modif commentaires.
211  *
212  * Revision 2.69 2000/09/13 12:11:48 eric
213  * Ajout de la fonction allocate_all().
214  *
215  * Revision 2.68 2000/09/07 15:26:40 keisuke
216  * Add a new argument Cmp& uu in Cmp::poisson_regular.
217  *
218  * Revision 2.67 2000/09/04 09:11:06 keisuke
219  * Suppress Cmp::poisson_regular (version without parameter).
220  *
221  * Revision 2.66 2000/08/31 13:04:30 eric
222  * Ajout des fonctions mult_rsint et div_rsint.
223  *
224  * Revision 2.65 2000/08/29 13:51:36 keisuke
225  * *** empty log message ***
226  *
227  * Revision 2.64 2000/08/29 13:46:14 keisuke
228  * Add the polar and azimuthal derivatives of the diverging potential
229  * in Cmp::poisson_regular.
230  * Modify the argumants of Cmp::poisson_regular.
231  *
232  * Revision 2.63 2000/08/28 15:48:22 keisuke
233  * Modif Cmp::poisson_regular
234  *
235  * Revision 2.62 2000/08/28 15:43:11 keisuke
236  * Modif Cmp::poisson_regular
237  *
238  * Revision 2.61 2000/08/04 12:09:58 eric
239  * Ajout de l'operator()(int l) et de la fonction set(int l) pour
240  * l'acces aux Tbl individuels.
241  *
242  * Revision 2.60 2000/08/04 09:18:05 keisuke
243  * Transformation Cmp::poisson_regular_param en Cmp::poisson_regular
244  *
245  * Revision 2.59 2000/08/03 14:01:29 keisuke
246  * Modif Cmp::poisson_regular et ajout de Cmp::poisson_regular_param
247  *
248  * Revision 2.58 2000/07/29 12:50:01 keisuke
249  * Modif Cmp::poisson_regular
250  *
251  * Revision 2.57 2000/07/20 13:33:50 keisuke
252  * Modif Cmp::poisson_regular
253  *
254  * Revision 2.56 2000/07/20 10:25:09 keisuke
255  * Modif Cmp::poisson_regular
256  *
257  * Revision 2.55 2000/07/19 15:50:23 keisuke
258  * Ajout de Cmp::poisson_regular
259  *
260  * Revision 2.54 2000/05/22 14:38:32 phil
261  * ajout de dec_dzpuis et inc_dzpuis
262  *
263  * Revision 2.53 2000/04/27 15:18:57 phil
264  * *** empty log message ***
265  *
266  * Revision 2.52 2000/03/28 17:44:41 phil
267  * Cmp::raccord() -> Cmp::raccord(int)
268  *
269  * Revision 2.51 2000/03/28 17:31:31 phil
270  * *** empty log message ***
271  *
272  * Revision 2.50 2000/03/28 17:25:35 phil
273  * ajout de Cmp::raccord()
274  *
275  * Revision 2.49 2000/03/25 12:52:45 eric
276  * Ajout de la fonction asymptot(int ).
277  *
278  * Revision 2.48 2000/03/20 13:33:31 phil
279  * commentaires
280  *
281  * Revision 2.47 2000/03/17 17:32:54 phil
282  * *** empty log message ***
283  *
284  * Revision 2.46 2000/03/17 17:07:14 phil
285  * *** empty log message ***
286  *
287  * Revision 2.45 2000/03/17 16:56:00 phil
288  * ajout de poisson_dirichlet et de son amie poisson_neumann
289  *
290  * Revision 2.44 2000/03/06 10:55:44 eric
291  * Ajout des methodes import_symy et import_asymy.
292  *
293  * Revision 2.43 2000/02/28 16:29:48 eric
294  * Ajout des fonctions import_gal, import_align, import_anti.
295  *
296  * Revision 2.42 2000/01/28 16:08:55 eric
297  * Ajout des fonctions dz_nonzero et check_dzpuis.
298  *
299  * Revision 2.41 2000/01/07 16:28:15 eric
300  * Suppression de la fonction membre gradient.
301  *
302  * Revision 2.40 1999/12/21 13:03:22 eric
303  * Changement de prototype de la routine poisson avec Param& : la solution est
304  * desormais passee en argument (et non plus en valeur de retour)
305  * pour permettre l'initialisation de methodes de resolution iteratives.
306  *
307  * Revision 2.39 1999/12/21 10:06:52 eric
308  * Il y a desormais deux versions de poisson: une sans Param et une
309  * avec Param.
310  *
311  * Revision 2.38 1999/12/10 16:19:33 eric
312  * Modif commentaires.
313  *
314  * Revision 2.37 1999/12/10 15:59:01 eric
315  * Modif commentaires fonction set.
316  *
317  * Revision 2.36 1999/12/09 10:45:54 eric
318  * Ajout du calcul d'integrale (membre p_integ et fonctions
319  * integrale et integrale_domains).
320  *
321  * Revision 2.35 1999/12/08 12:38:38 eric
322  * Ajout de la fonction import.
323  *
324  * Revision 2.34 1999/12/07 14:53:13 eric
325  * Changement ordre des arguments (phi,theta,r) --> (r,theta,phi)
326  * dans la routine val_point.
327  *
328  * Revision 2.33 1999/12/06 16:47:00 eric
329  * Ajout de la fonction val_point.
330  *
331  * Revision 2.32 1999/12/02 17:59:11 phil
332  * *** empty log message ***
333  *
334  * Revision 2.31 1999/12/02 14:28:46 eric
335  * Reprototypage de la fonction poisson(): const.
336  * Commentaires.
337  *
338  * Revision 2.30 1999/11/30 14:20:54 eric
339  * Reprototypage des fonctions membres mult_r, mult_r_zec,
340  * dec2_dzpuis et inc2_dzpuis : Cmp --> void.
341  *
342  * Revision 2.29 1999/11/29 13:18:06 eric
343  * Modif commentaires.
344  *
345  * Revision 2.28 1999/11/29 12:56:11 eric
346  * Introduction des membres p_lap, ind_lap.
347  * Changement prototype de la fonction laplacien.
348  *
349  * Revision 2.27 1999/11/26 14:22:54 eric
350  * Ajout du membre dzpuis et des fonctions de manipulation associees.
351  *
352  * Revision 2.26 1999/11/25 16:27:00 eric
353  * Reorganisation complete du calcul et stokage des derivees partielles.
354  *
355  * Revision 2.25 1999/11/23 16:21:32 eric
356  * Suppression du membre statique Cmp_Zero.
357  * Suppression du constructeur par defaut.
358  *
359  * Revision 2.24 1999/11/22 16:48:00 phil
360  * Cmp_Zero est desormais public
361  *
362  * Revision 2.23 1999/11/22 16:34:17 eric
363  * Ajout de l'element global Cmp_Zero.
364  *
365  * Revision 2.22 1999/11/22 15:41:42 eric
366  * Ajout des operateurs set(l,k,j,i) et (l,k,j,i).
367  * Ajout de la fonction annule(int l).
368  *
369  * Revision 2.21 1999/11/15 14:12:28 eric
370  * Ajout des fonctions mathematiques cos, sin, ..., min, max, norme,...
371  *
372  * Revision 2.20 1999/11/12 17:08:10 eric
373  * Ajout de la partie manquante de l'arithmetique.
374  *
375  * Revision 2.19 1999/10/28 09:36:56 eric
376  * Ajout de la fonction affiche_seuil.
377  *
378  * Revision 2.18 1999/10/28 09:01:24 eric
379  * Constructeur par lecture de fichier.
380  * Ajout de la fonction annule(int, int).
381  *
382  * Revision 2.17 1999/10/27 16:46:23 phil
383  * ajout de mult_r_zec
384  *
385  * Revision 2.16 1999/10/27 15:38:40 eric
386  * Suppression du membre c.
387  *
388  * Revision 2.15 1999/10/27 08:42:40 eric
389  * Introduction du membre Valeur va.
390  * Le pointeur Valeur* c est desormais un membre prive constant qui pointe
391  * sur va.
392  * Suppression de la fonction nouveau(), ainsi que du constructeur par
393  * defaut.
394  *
395  * Revision 2.14 1999/10/22 08:14:19 eric
396  * Depoussierage.
397  * Documentation.
398  *
399  * Revision 2.13 1999/10/19 14:40:51 phil
400  * ajout de inc2_dzpuis()
401  *
402  * Revision 2.12 1999/09/16 13:16:47 phil
403  * ajout de Cmp mult_r()
404  *
405  * Revision 2.11 1999/09/15 10:29:44 phil
406  * ajout de dec2_dzpuis()
407  *
408  * Revision 2.10 1999/09/14 17:13:05 phil
409  * ajout de Cmp operator*(double,const Cmp&)
410  *
411  * Revision 2.9 1999/09/14 13:45:27 phil
412  * suppression de la divergence
413  *
414  * Revision 2.8 1999/09/14 12:50:31 phil
415  * ajout de Cmp deriv(int) et de Cmp divergence()
416  *
417  * Revision 2.7 1999/09/07 16:08:04 phil
418  * ajout de la fonction membre gradient
419  *
420  * Revision 2.6 1999/09/06 14:50:27 phil
421  * ajout du laplacien
422  *
423  * Revision 2.5 1999/09/06 14:35:05 phil
424  * ajout de poisson
425  *
426  * Revision 2.4 1999/03/03 11:13:46 hyc
427  * *** empty log message ***
428  *
429  * Revision 2.3 1999/03/03 11:07:27 hyc
430  * *** empty log message ***
431  *
432  *
433  * $Header: /cvsroot/Lorene/C++/Include/cmp.h,v 1.24 2026/03/04 15:47:04 j_novak Exp $
434  *
435  */
436 
437 #include <cstdio>
438 
439 #include "valeur.h"
440 #include "map.h"
441 
442 namespace Lorene {
443 class Param ;
444 
449 class Cmp {
450 
451  // Data :
452  // -----
453  private:
454  const Map* mp ;
455 
457  int etat ;
458 
464  int dzpuis ;
465 
466  public:
468 
469  // Derived data :
470  // ------------
471  private:
473  mutable Cmp* p_dsdr ;
475  mutable Cmp* p_srdsdt ;
477  mutable Cmp* p_srstdsdp ;
478 
482  mutable Cmp* p_dsdx ;
483 
487  mutable Cmp* p_dsdy ;
488 
492  mutable Cmp* p_dsdz ;
493 
496  mutable Cmp* p_lap ;
497 
501  mutable int ind_lap ;
502 
506  mutable Tbl* p_integ ;
507 
508  // Constructors - Destructor
509  // -------------------------
510 
511  public:
512  explicit Cmp(const Map& map) ;
513  explicit Cmp(const Map* p_map) ;
514  Cmp(const Cmp& a) ;
515 
517  Cmp(const Map&, const Mg3d&, FILE* ) ;
518 
519  ~Cmp() ;
520 
521  // Assignment
522  // -----------
523  public:
525  void operator=(const Cmp& a) ;
526 
527  void operator=(const Valeur& a) ;
528  void operator=(const Mtbl& a) ;
529  void operator=(double ) ;
530  void operator=(int ) ;
531 
537  void import(const Cmp& ci) ;
538 
545  void import_symy(const Cmp& ci) ;
546 
554  void import_asymy(const Cmp& ci) ;
555 
567  void import(int nzet, const Cmp& ci) ;
568 
581  void import_symy(int nzet, const Cmp& ci) ;
582 
596  void import_asymy(int nzet, const Cmp& ci) ;
597 
598  private:
612  void import_gal(int nzet, const Cmp& ci) ;
613 
627  void import_align(int nzet, const Cmp& ci) ;
628 
643  void import_anti(int nzet, const Cmp& ci) ;
644 
659  void import_align_symy(int nzet, const Cmp& ci) ;
660 
676  void import_anti_symy(int nzet, const Cmp& ci) ;
677 
693  void import_align_asymy(int nzet, const Cmp& ci) ;
694 
711  void import_anti_asymy(int nzet, const Cmp& ci) ;
712 
713 
714 
715  // Access to individual elements
716  // -----------------------------
717  public:
718 
727  Tbl& set(int l) {
728  assert(etat == ETATQCQ) ;
729  return va.set(l) ;
730  };
731 
736  const Tbl& operator()(int l) const {
737  assert(etat == ETATQCQ) ;
738  return va(l) ;
739  };
740 
741 
752  double& set(int l, int k, int j, int i) {
753  assert(etat == ETATQCQ) ;
754  return va.set(l, k, j, i) ;
755  };
756 
757 
764  double operator()(int l, int k, int j, int i) const {
765  assert(etat != ETATNONDEF) ;
766  if (etat == ETATZERO) {
767  double zero = 0. ;
768  return zero ;
769  }
770  else{
771  return va(l, k, j, i) ;
772  }
773  };
774 
784  double val_point(double r, double theta, double phi) const ;
785 
786 
787  // Memory management
788  // -----------------
789  private:
790  void del_t() ;
791  void del_deriv() ;
792  void set_der_0x0() ;
793 
794  public:
795 
801  void set_etat_nondef() ;
802 
808  void set_etat_zero() ;
809 
816  void set_etat_qcq() ;
817 
826  void allocate_all() ;
827 
836  void annule_hard() ;
837 
843  void annule(int l) ;
844 
855  void annule(int l_min, int l_max) ;
856 
860  void filtre (int n) ;
861 
866  void filtre_phi (int n, int zone) ;
867 
873  void set_val_inf (double val) ;
874 
880  void set_val_hor (double val, int zone) ;
886  void fixe_decroissance (int puis) ;
887 
897 
898  // Extraction of information
899  // -------------------------
900  public:
902  int get_etat() const {return etat;} ;
904  const Map* get_mp() const {return mp;};
906  int get_dzpuis() const {return dzpuis;} ;
907 
911  bool dz_nonzero() const ;
912 
917  bool check_dzpuis(int dzi) const ;
918 
919 
920  // Outputs
921  // -------
922  public:
923  void sauve(FILE *) const ;
924 
934  void affiche_seuil(ostream& ostr, int type = 0, int precision = 4,
935  double threshold = 1.e-7) const ;
936 
938  friend ostream& operator<<(ostream& , const Cmp & ) ;
939 
940 
941  // Member arithmetics
942  // ------------------
943  public:
944  void operator+=(const Cmp &) ;
945  void operator-=(const Cmp &) ;
946  void operator*=(const Cmp &) ;
947 
948  // Manipulation of spectral bases
949  // ------------------------------
953  void std_base_scal() ;
954 
955 
956  // Differential operators and others
957  // ---------------------------------
958  public:
963  const Cmp& dsdr() const ;
964 
969  const Cmp& srdsdt() const ;
970 
975  const Cmp& srstdsdp() const ;
976 
982  const Cmp& dsdx() const ;
983 
989  const Cmp& dsdy() const ;
990 
996  const Cmp& dsdz() const ;
997 
1004  const Cmp& deriv(int i) const ;
1005 
1014  const Cmp& laplacien(int zec_mult_r = 4) const ;
1015 
1017  void div_r() ;
1018 
1020  void mult_r() ;
1021 
1024  void mult_r_zec() ;
1025 
1027  void mult_rsint() ;
1028 
1030  void mult_cost() ;
1031 
1033  void div_rsint() ;
1034 
1038  void dec_dzpuis() ;
1039 
1043  void inc_dzpuis() ;
1044 
1048  void dec2_dzpuis() ;
1049 
1053  void inc2_dzpuis() ;
1054 
1055  void set_dzpuis(int ) ;
1056 
1064  double integrale() const ;
1065 
1075  const Tbl& integrale_domains() const ;
1076 
1092  Valeur** asymptot(int n, const int flag = 0) const ;
1093 
1094 
1095  // PDE resolution
1096  // --------------
1097  public:
1107  Cmp poisson() const ;
1108 
1111  Cmp poisson_tau() const ;
1112 
1113  Cmp poisson_falloff(int k_falloff) const ;
1114 
1115  Cmp poisson_ylm(int nylm, double* intvec) const ;
1116 
1130  void poisson(Param& par, Cmp& uu, bool verbose=true) const ;
1131 
1134  void poisson_tau(Param& par, Cmp& uu) const ;
1135 
1136  void poisson_falloff(Param& par, Cmp& uu, int k_falloff) const ;
1137 
1138  void poisson_ylm(Param& par, Cmp& uu, int nylm, double* intvec) const ;
1139 
1154  Cmp poisson_dirichlet (const Valeur& limite, int num) const ;
1155 
1160  Cmp poisson_neumann (const Valeur&, int) const ;
1161 
1170  Cmp poisson_neumann_interne (const Valeur&, Param& par, Cmp& resu) const ;
1171  Cmp poisson_frontiere_double (const Valeur&, const Valeur&, int) const ;
1172 
1197  void poisson_regular(int k_div, int nzet, double unsgam1, Param& par,
1198  Cmp& uu, Cmp& uu_regu, Cmp& uu_div,
1199  Tenseur& duu_div,
1200  Cmp& source_regu, Cmp& source_div) const ;
1201 
1236  Tbl test_poisson(const Cmp& uu, ostream& ostr,
1237  bool detail = false) const ;
1242  void raccord(int n) ;
1243 
1250  void raccord_c1_zec (int puis, int nbre, int lmax) ;
1254  void raccord_externe (int puis, int nbre, int lmax) ;
1255 };
1256 ostream& operator<<(ostream& , const Cmp & ) ;
1257 
1264 Cmp operator+(const Cmp& ) ;
1265 Cmp operator-(const Cmp& ) ;
1266 Cmp operator+(const Cmp&, const Cmp &) ;
1267 Cmp operator+(const Cmp&, double ) ;
1268 Cmp operator+(double, const Cmp& ) ;
1269 Cmp operator+(const Cmp&, int ) ;
1270 Cmp operator+(int, const Cmp& ) ;
1271 Cmp operator-(const Cmp &, const Cmp &) ;
1272 Cmp operator-(const Cmp&, double ) ;
1273 Cmp operator-(double, const Cmp& ) ;
1274 Cmp operator-(const Cmp&, int ) ;
1275 Cmp operator-(int, const Cmp& ) ;
1276 Cmp operator*(const Cmp &, const Cmp &) ;
1277 Cmp operator%(const Cmp &, const Cmp &) ;
1278 Cmp operator*(const Cmp&, double ) ;
1279 Cmp operator*(double, const Cmp &) ;
1280 Cmp operator*(const Cmp&, int ) ;
1281 Cmp operator*(int, const Cmp& ) ;
1282 Cmp operator/(const Cmp &, const Cmp &) ;
1283 Cmp operator/(const Cmp&, double ) ;
1284 Cmp operator/(double, const Cmp &) ;
1285 Cmp operator/(const Cmp&, int ) ;
1286 Cmp operator/(int, const Cmp &) ;
1287 
1288 Cmp sin(const Cmp& ) ;
1289 Cmp cos(const Cmp& ) ;
1290 Cmp tan(const Cmp& ) ;
1291 Cmp asin(const Cmp& ) ;
1292 Cmp acos(const Cmp& ) ;
1293 Cmp atan(const Cmp& ) ;
1294 Cmp exp(const Cmp& ) ;
1295 Cmp log(const Cmp& ) ;
1296 Cmp log10(const Cmp& ) ;
1297 Cmp sqrt(const Cmp& ) ;
1298 Cmp racine_cubique (const Cmp& ) ;
1299 Cmp pow(const Cmp& , int ) ;
1300 Cmp pow(const Cmp& , double ) ;
1301 Cmp abs(const Cmp& ) ;
1302 
1308 Tbl max(const Cmp& ) ;
1309 
1315 Tbl min(const Cmp& ) ;
1316 
1323 Tbl norme(const Cmp& ) ;
1324 
1333 Tbl diffrel(const Cmp& a, const Cmp& b) ;
1334 
1343 Tbl diffrelmax(const Cmp& a, const Cmp& b) ;
1344 
1347 }
1348 #endif
void del_t()
Logical destructor.
Definition: cmp.C:262
const Cmp & dsdr() const
Returns of *this .
Definition: cmp_deriv.C:87
const Map * get_mp() const
Returns the mapping.
Definition: cmp.h:904
Cmp * p_dsdy
Pointer on of *this , where .
Definition: cmp.h:487
Cmp log(const Cmp &)
Neperian logarithm.
Definition: cmp_math.C:299
Cmp asin(const Cmp &)
Arcsine.
Definition: cmp_math.C:147
void import_anti_asymy(int nzet, const Cmp &ci)
Assignment to another Cmp defined on a different mapping, when the two mappings have anti-aligned Car...
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Definition: cmp.h:449
Cmp exp(const Cmp &)
Exponential.
Definition: cmp_math.C:273
void operator=(const Cmp &a)
Assignment to another Cmp defined on the same mapping.
Definition: cmp.C:401
const Cmp & dsdx() const
Returns of *this , where .
Definition: cmp_deriv.C:151
int ind_lap
Power of r by which the last computed Laplacian has been multiplied in the external compactified doma...
Definition: cmp.h:501
Cmp sqrt(const Cmp &)
Square root.
Definition: cmp_math.C:223
void dec_dzpuis()
Decreases by 1 the value of dzpuis and changes accordingly the values of the Cmp in the external comp...
Definition: cmp_r_manip.C:157
void import_align(int nzet, const Cmp &ci)
Assignment to another Cmp defined on a different mapping, when the two mappings have aligned Cartesia...
Definition: cmp_import.C:530
void annule(int l)
Sets the Cmp to zero in a given domain.
Definition: cmp.C:351
Multi-domain array.
Definition: mtbl.h:118
const Cmp & srstdsdp() const
Returns of *this .
Definition: cmp_deriv.C:130
void set_der_0x0()
Sets the pointers for derivatives to 0x0.
Definition: cmp.C:279
Lorene prototypes.
Definition: app_hor.h:67
int get_etat() const
Returns the logical state.
Definition: cmp.h:902
void import_anti(int nzet, const Cmp &ci)
Assignment to another Cmp defined on a different mapping, when the two mappings have anti-aligned Car...
Definition: cmp_import.C:338
Cmp racine_cubique(const Cmp &)
Cube root.
Definition: cmp_math.C:248
Base_val operator*(const Base_val &, const Base_val &)
This operator is used when calling multiplication or division of Valeur .
int etat
Logical state (ETATNONDEF , ETATQCQ or ETATZERO ).
Definition: cmp.h:457
Base class for coordinate mappings.
Definition: map.h:696
const Cmp & srdsdt() const
Returns of *this .
Definition: cmp_deriv.C:108
void mult_r_zec()
Multiplication by r in the external compactified domain (ZEC)
Definition: cmp_r_manip.C:106
void del_deriv()
Logical destructor of the derivatives.
Definition: cmp.C:268
void annule_hard()
Sets the Cmp to zero in a hard way.
Definition: cmp.C:341
Values and coefficients of a (real-value) function.
Definition: valeur.h:297
Tbl * p_integ
Pointer on the space integral of *this (values in each domain)
Definition: cmp.h:506
Cmp operator%(const Cmp &, const Cmp &)
Cmp * Cmp with desaliasing.
Definition: cmp_arithm.C:367
Cmp operator/(const Cmp &, const Cmp &)
Cmp / Cmp.
Definition: cmp_arithm.C:460
Tbl min(const Cmp &)
Minimum values of a Cmp in each domain.
Definition: cmp_math.C:461
void filtre_phi(int n, int zone)
Sets the n lasts coefficients in to 0 in the domain zone .
Definition: cmp_manip.C:104
void raccord_externe(int puis, int nbre, int lmax)
Matching of the external domain with the outermost shell.
Cmp cos(const Cmp &)
Cosine.
Definition: cmp_math.C:97
Tbl diffrel(const Cmp &a, const Cmp &b)
Relative difference between two Cmp (norme version).
Definition: cmp_math.C:507
void div_r()
Division by r everywhere.
Definition: cmp_r_manip.C:81
Cmp * p_lap
Pointer on the Laplacian of *this.
Definition: cmp.h:496
Cmp tan(const Cmp &)
Tangent.
Definition: cmp_math.C:123
void inc_dzpuis()
Increases by the value of dzpuis and changes accordingly the values of the Cmp in the external compac...
Definition: cmp_r_manip.C:169
void mult_r()
Multiplication by r everywhere.
Definition: cmp_r_manip.C:94
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
Definition: cmp.C:292
Cmp poisson_tau() const
Same as Poisson with a Tau method.
Definition: cmp_pde.C:126
Tbl norme(const Cmp &)
Sums of the absolute values of all the values of the Cmp in each domain.
Definition: cmp_math.C:484
void raccord_c1_zec(int puis, int nbre, int lmax)
Performs the matching of the external domain with respect to the last shell using function like wit...
Cmp * p_srstdsdp
Pointer on of *this.
Definition: cmp.h:477
Cmp atan(const Cmp &)
Arctangent.
Definition: cmp_math.C:198
Tbl multipole_spectrum()
Gives the spectrum in terms of multipolar modes l .
Definition: cmp.C:765
void import_align_symy(int nzet, const Cmp &ci)
Assignment to another Cmp defined on a different mapping, when the two mappings have aligned Cartesia...
Cmp operator+(const Cmp &)
Definition: cmp_arithm.C:107
void filtre(int n)
Sets the n lasts coefficients in r to 0 in the external domain.
Definition: cmp_manip.C:77
int dzpuis
Power of r by which the quantity represented by this must be divided in the external compactified zo...
Definition: cmp.h:464
double operator()(int l, int k, int j, int i) const
Read-only of a particular element.
Definition: cmp.h:764
void import_gal(int nzet, const Cmp &ci)
Assignment to another Cmp defined on a different mapping, when the two mappings do not have a particu...
Definition: cmp_import.C:139
bool dz_nonzero() const
Returns true if the last domain is compactified and *this is not zero in this domain.
Definition: cmp.C:663
~Cmp()
Destructor.
Definition: cmp.C:253
void operator-=(const Cmp &)
-= Cmp
Definition: cmp_arithm.C:626
Parameter storage.
Definition: param.h:125
void mult_rsint()
Multiplication by .
Definition: cmp_r_manip.C:119
void set_val_inf(double val)
Sets the value of the Cmp to val at infinity.
Definition: cmp_manip.C:129
const Cmp & deriv(int i) const
Returns of *this , where .
Definition: cmp_deriv.C:214
Cmp poisson_dirichlet(const Valeur &limite, int num) const
Is identicall to Cmp::poisson() .
double integrale() const
Computes the integral over all space of *this .
Definition: cmp_integ.C:58
void fixe_decroissance(int puis)
Substracts all the components behaving like in the external domain, with n strictly lower than puis ...
Definition: cmp_manip.C:189
Tbl max(const Cmp &)
Maximum values of a Cmp in each domain.
Definition: cmp_math.C:438
friend ostream & operator<<(ostream &, const Cmp &)
Display.
Definition: cmp.C:580
const Tbl & operator()(int l) const
Read-only of the value in a given domain.
Definition: cmp.h:736
void import_align_asymy(int nzet, const Cmp &ci)
Assignment to another Cmp defined on a different mapping, when the two mappings have aligned Cartesia...
void dec2_dzpuis()
Decreases by 2 the value of dzpuis and changes accordingly the values of the Cmp in the external comp...
Definition: cmp_r_manip.C:183
Cmp pow(const Cmp &, int)
Power .
Definition: cmp_math.C:351
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Definition: cmp.C:307
const Cmp & dsdz() const
Returns of *this , where .
Definition: cmp_deriv.C:193
void import_symy(const Cmp &ci)
Assignment to another Cmp defined on a different mapping.
void inc2_dzpuis()
Increases by 2 the value of dzpuis and changes accordingly the values of the Cmp in the external comp...
Definition: cmp_r_manip.C:195
void affiche_seuil(ostream &ostr, int type=0, int precision=4, double threshold=1.e-7) const
Prints only the values greater than a given threshold.
Definition: cmp.C:615
void operator*=(const Cmp &)
*= Cmp
Definition: cmp_arithm.C:671
void std_base_scal()
Sets the spectral bases of the Valeur va to the standard ones for a scalar.
Definition: cmp.C:647
void set_val_hor(double val, int zone)
Sets the value of the Cmp to val on the inner boudary of the shell number zone .This is usefull for d...
Definition: cmp_manip.C:162
void operator+=(const Cmp &)
+= Cmp
Definition: cmp_arithm.C:578
Cmp poisson() const
Solves the scalar Poisson equation with *this as a source.
Definition: cmp_pde.C:100
void mult_cost()
Multiplication by $.
Definition: cmp_r_manip.C:131
void allocate_all()
Sets the logical state to ETATQCQ (ordinary state) and performs the memory allocation of all the elem...
Definition: cmp.C:326
Tbl test_poisson(const Cmp &uu, ostream &ostr, bool detail=false) const
Checks if a Poisson equation with *this as a source has been correctly solved.
Multi-domain grid.
Definition: grilles.h:276
const Map * mp
Reference mapping.
Definition: cmp.h:454
int get_dzpuis() const
Returns dzpuis.
Definition: cmp.h:906
Cmp * p_srdsdt
Pointer on of *this.
Definition: cmp.h:475
Cmp log10(const Cmp &)
Basis 10 logarithm.
Definition: cmp_math.C:325
void set_etat_nondef()
Sets the logical state to ETATNONDEF (undefined).
Definition: cmp.C:300
Cmp acos(const Cmp &)
Arccosine.
Definition: cmp_math.C:172
Cmp abs(const Cmp &)
Absolute value.
Definition: cmp_math.C:413
void raccord(int n)
Performs the matching of the nucleus with respect to the first shell.
Definition: cmp_raccord.C:173
Cmp * p_dsdz
Pointer on of *this , where .
Definition: cmp.h:492
Cmp * p_dsdr
Pointer on of *this.
Definition: cmp.h:473
Cmp(const Map &map)
Constructor from mapping.
Definition: cmp.C:211
bool check_dzpuis(int dzi) const
Returns false if the last domain is compactified and *this is not zero in this domain and dzpuis is n...
Definition: cmp.C:718
void import_anti_symy(int nzet, const Cmp &ci)
Assignment to another Cmp defined on a different mapping, when the two mappings have anti-aligned Car...
Valeur ** asymptot(int n, const int flag=0) const
Asymptotic expansion at r = infinity.
Definition: cmp_asymptot.C:74
Cmp poisson_neumann(const Valeur &, int) const
Idem as Cmp::poisson_dirichlet , the boundary condition being on the radial derivative of the solutio...
Cmp operator-(const Cmp &)
- Cmp
Definition: cmp_arithm.C:111
void set_dzpuis(int)
Set a value to dzpuis.
Definition: cmp.C:657
Cmp sin(const Cmp &)
Sine.
Definition: cmp_math.C:72
const Cmp & dsdy() const
Returns of *this , where .
Definition: cmp_deriv.C:172
Basic array class.
Definition: tbl.h:164
void sauve(FILE *) const
Save in a file.
Definition: cmp.C:564
const Tbl & integrale_domains() const
Computes the integral in each domain of *this .
Definition: cmp_integ.C:76
const Cmp & laplacien(int zec_mult_r=4) const
Returns the Laplacian of *this.
Definition: cmp_deriv.C:245
Cmp * p_dsdx
Pointer on of *this , where .
Definition: cmp.h:482
void import_asymy(const Cmp &ci)
Assignment to another Cmp defined on a different mapping.
Valeur va
The numerical value of the Cmp.
Definition: cmp.h:467
Cmp poisson_neumann_interne(const Valeur &, Param &par, Cmp &resu) const
Idem as Cmp::poisson_neumann , the boundary condition is on the radial derivative of the solution...
double val_point(double r, double theta, double phi) const
Computes the value of the field represented by *this at an arbitrary point , by means of the spectral...
Definition: cmp.C:735
Tensor handling *** DEPRECATED : use class Tensor instead ***.
Definition: tenseur.h:307
Tbl diffrelmax(const Cmp &a, const Cmp &b)
Relative difference between two Cmp (max version).
Definition: cmp_math.C:542
Tbl & set(int l)
Read/write of the value in a given domain (configuration space).
Definition: valeur.h:373
void poisson_regular(int k_div, int nzet, double unsgam1, Param &par, Cmp &uu, Cmp &uu_regu, Cmp &uu_div, Tenseur &duu_div, Cmp &source_regu, Cmp &source_div) const
Solves the scalar Poisson equation with *this as a source (version with parameters to control the res...