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.23 2016/09/19 15:26:22 j_novak Exp $
38  * $Log: cmp.h,v $
39  * Revision 1.23 2016/09/19 15:26:22 j_novak
40  * Correction of several bugs preventing the shared library compilation.
41  *
42  * Revision 1.22 2014/10/13 08:52:33 j_novak
43  * Lorene classes and functions now belong to the namespace Lorene.
44  *
45  * Revision 1.21 2014/10/06 15:09:39 j_novak
46  * Modified #include directives to use c++ syntax.
47  *
48  * Revision 1.20 2012/08/12 17:35:36 p_cerda
49  * Magnetstar: adding new member to class Cmp
50  *
51  * Revision 1.19 2010/02/02 13:34:12 e_gourgoulhon
52  * Marked DEPRECATED (in the documentation).
53  *
54  * Revision 1.18 2005/08/30 08:35:10 p_grandclement
55  * Addition of the Tau version of the vectorial Poisson equation for the Tensors
56  *
57  * Revision 1.17 2005/08/02 06:09:58 m_saijo
58  * Modified comment lines (div_r, multi_r, mult_rsint, div_rsint)
59  *
60  * Revision 1.16 2004/12/29 16:20:20 k_taniguchi
61  * Addition of the function poisson_ylm.
62  *
63  * Revision 1.15 2004/11/30 20:38:10 k_taniguchi
64  * Addition of the function poisson_falloff.
65  *
66  * Revision 1.14 2004/10/11 15:08:59 j_novak
67  * The radial manipulation functions take Scalar as arguments, instead of Cmp.
68  * Added a conversion operator from Scalar to Cmp.
69  * The Cmp radial manipulation function make conversion to Scalar, call to the
70  * Map_radial version with a Scalar argument and back.
71  *
72  * Revision 1.13 2004/03/31 11:21:02 f_limousin
73  * Method Cmp::poisson_neumann_interne has been implemented to solve
74  * the continuity equation for strange stars.
75  *
76  * Revision 1.12 2004/03/22 13:12:40 j_novak
77  * Modification of comments to use doxygen instead of doc++
78  *
79  * Revision 1.11 2004/03/01 09:54:58 j_novak
80  * Suppression of the Cmp version of avance_dalembert (now only with Scalar's)
81  *
82  * Revision 1.10 2003/11/06 14:43:37 e_gourgoulhon
83  * Gave a name to const arguments in certain method prototypes (e.g.
84  * constructors) to correct a bug of DOC++.
85  *
86  * Revision 1.9 2003/09/24 20:52:37 e_gourgoulhon
87  * Added constructor by conversion of a Scalar.
88  *
89  * Revision 1.8 2003/08/26 09:46:10 j_novak
90  * Added the method multipole_spectrum
91  *
92  * Revision 1.7 2003/06/20 14:16:10 f_limousin
93  * Add the function compare().
94  *
95  * Revision 1.6 2003/06/20 09:27:09 j_novak
96  * Modif commentaires.
97  *
98  * Revision 1.5 2002/09/13 09:17:31 j_novak
99  * Modif. commentaires
100  *
101  * Revision 1.4 2002/06/17 14:05:16 j_novak
102  * friend functions are now also declared outside the class definition
103  *
104  * Revision 1.3 2002/05/17 12:08:46 e_gourgoulhon
105  * Corrected error in the comment about dzpuis: multiplied --> divided
106  *
107  * Revision 1.2 2002/01/03 15:30:27 j_novak
108  * Some comments modified.
109  *
110  * Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon
111  * LORENE
112  *
113  * Revision 2.101 2001/10/29 15:36:03 novak
114  * Ajout de Cmp::div_r()
115  *
116  * Revision 2.100 2001/10/16 10:03:57 novak
117  * *** empty log message ***
118  *
119  * Revision 2.99 2001/08/31 14:52:10 novak
120  * Back to 2.97 version 2.98 was useless
121  *
122  * Revision 2.97 2001/07/19 14:01:39 novak
123  * new arguments for Cmp::avance_dalembert
124  *
125  * Revision 2.96 2001/05/29 16:09:40 eric
126  * Modif commentaires (mise en conformite Doc++ 3.4.7).
127  *
128  * Revision 2.95 2001/05/26 15:07:20 eric
129  * Ajout de operator% : multiplication de deux Cmp avec desaliasage
130  *
131  * Revision 2.94 2001/05/25 09:30:07 phil
132  * ajout de filtre_phi
133  *
134  * Revision 2.93 2001/03/30 13:36:22 phil
135  * ajout de raccord_externe
136  *
137  * Revision 2.92 2001/03/26 08:11:50 eric
138  * Modif commentaires.
139  *
140  * Revision 2.91 2001/03/22 10:25:19 phil
141  * modification prototypage de raccord_zec.C
142  *
143  * Revision 2.90 2001/02/12 18:08:10 phil
144  * ajout de Cmp::fixe_decroissance
145  *
146  * Revision 2.89 2000/12/13 14:50:05 phil
147  * changement nom variable dzpuis dans raccord_c1_zec
148  *
149  * Revision 2.88 2000/12/13 14:35:53 phil
150  * *** empty log message ***
151  *
152  * Revision 2.87 2000/12/13 14:26:42 phil
153  * *** empty log message ***
154  *
155  * Revision 2.86 2000/12/13 14:25:26 phil
156  * vire commentaires des raccords (provisioire)
157  *
158  * Revision 2.85 2000/12/13 14:19:49 phil
159  * modif commentaires
160  *
161  * Revision 2.84 2000/12/13 14:08:36 phil
162  * ajout procedure raccord_c1_zec
163  *
164  * Revision 2.83 2000/12/04 16:48:47 novak
165  * *** empty log message ***
166  *
167  * Revision 2.82 2000/12/04 15:06:15 novak
168  * *** empty log message ***
169  *
170  * Revision 2.81 2000/11/15 13:24:28 phil
171  * modification de asymptot
172  *
173  * Revision 2.80 2000/11/15 13:19:13 phil
174  * *** empty log message ***
175  *
176  * Revision 2.79 2000/11/15 13:17:01 phil
177  * *** empty log message ***
178  *
179  * Revision 2.78 2000/11/15 13:15:45 phil
180  * gestion affichage dans asymptot
181  *
182  * Revision 2.77 2000/10/20 09:43:30 phil
183  * changement commentaires
184  *
185  * Revision 2.76 2000/10/19 14:07:06 novak
186  * Ajout de la fonction membre avance_dalembert (experimentale)
187  *
188  * Revision 2.75 2000/10/19 09:20:36 phil
189  * *** empty log message ***
190  *
191  * Revision 2.74 2000/10/19 09:13:45 phil
192  * ajout des fonctions :
193  * filtre(int)
194  * set_val_inf(double)
195  * set_val_hor(double,int)
196  *
197  * Revision 2.73 2000/10/05 14:18:14 eric
198  * La fonction check_poisson est rebaptisee test_poisson.
199  *
200  * Revision 2.72 2000/10/05 13:56:52 eric
201  * *** empty log message ***
202  *
203  * Revision 2.71 2000/10/05 13:52:25 eric
204  * Ajout de la fonction check_poisson.
205  *
206  * Revision 2.70 2000/09/13 12:21:44 eric
207  * Modif commentaires.
208  *
209  * Revision 2.69 2000/09/13 12:11:48 eric
210  * Ajout de la fonction allocate_all().
211  *
212  * Revision 2.68 2000/09/07 15:26:40 keisuke
213  * Add a new argument Cmp& uu in Cmp::poisson_regular.
214  *
215  * Revision 2.67 2000/09/04 09:11:06 keisuke
216  * Suppress Cmp::poisson_regular (version without parameter).
217  *
218  * Revision 2.66 2000/08/31 13:04:30 eric
219  * Ajout des fonctions mult_rsint et div_rsint.
220  *
221  * Revision 2.65 2000/08/29 13:51:36 keisuke
222  * *** empty log message ***
223  *
224  * Revision 2.64 2000/08/29 13:46:14 keisuke
225  * Add the polar and azimuthal derivatives of the diverging potential
226  * in Cmp::poisson_regular.
227  * Modify the argumants of Cmp::poisson_regular.
228  *
229  * Revision 2.63 2000/08/28 15:48:22 keisuke
230  * Modif Cmp::poisson_regular
231  *
232  * Revision 2.62 2000/08/28 15:43:11 keisuke
233  * Modif Cmp::poisson_regular
234  *
235  * Revision 2.61 2000/08/04 12:09:58 eric
236  * Ajout de l'operator()(int l) et de la fonction set(int l) pour
237  * l'acces aux Tbl individuels.
238  *
239  * Revision 2.60 2000/08/04 09:18:05 keisuke
240  * Transformation Cmp::poisson_regular_param en Cmp::poisson_regular
241  *
242  * Revision 2.59 2000/08/03 14:01:29 keisuke
243  * Modif Cmp::poisson_regular et ajout de Cmp::poisson_regular_param
244  *
245  * Revision 2.58 2000/07/29 12:50:01 keisuke
246  * Modif Cmp::poisson_regular
247  *
248  * Revision 2.57 2000/07/20 13:33:50 keisuke
249  * Modif Cmp::poisson_regular
250  *
251  * Revision 2.56 2000/07/20 10:25:09 keisuke
252  * Modif Cmp::poisson_regular
253  *
254  * Revision 2.55 2000/07/19 15:50:23 keisuke
255  * Ajout de Cmp::poisson_regular
256  *
257  * Revision 2.54 2000/05/22 14:38:32 phil
258  * ajout de dec_dzpuis et inc_dzpuis
259  *
260  * Revision 2.53 2000/04/27 15:18:57 phil
261  * *** empty log message ***
262  *
263  * Revision 2.52 2000/03/28 17:44:41 phil
264  * Cmp::raccord() -> Cmp::raccord(int)
265  *
266  * Revision 2.51 2000/03/28 17:31:31 phil
267  * *** empty log message ***
268  *
269  * Revision 2.50 2000/03/28 17:25:35 phil
270  * ajout de Cmp::raccord()
271  *
272  * Revision 2.49 2000/03/25 12:52:45 eric
273  * Ajout de la fonction asymptot(int ).
274  *
275  * Revision 2.48 2000/03/20 13:33:31 phil
276  * commentaires
277  *
278  * Revision 2.47 2000/03/17 17:32:54 phil
279  * *** empty log message ***
280  *
281  * Revision 2.46 2000/03/17 17:07:14 phil
282  * *** empty log message ***
283  *
284  * Revision 2.45 2000/03/17 16:56:00 phil
285  * ajout de poisson_dirichlet et de son amie poisson_neumann
286  *
287  * Revision 2.44 2000/03/06 10:55:44 eric
288  * Ajout des methodes import_symy et import_asymy.
289  *
290  * Revision 2.43 2000/02/28 16:29:48 eric
291  * Ajout des fonctions import_gal, import_align, import_anti.
292  *
293  * Revision 2.42 2000/01/28 16:08:55 eric
294  * Ajout des fonctions dz_nonzero et check_dzpuis.
295  *
296  * Revision 2.41 2000/01/07 16:28:15 eric
297  * Suppression de la fonction membre gradient.
298  *
299  * Revision 2.40 1999/12/21 13:03:22 eric
300  * Changement de prototype de la routine poisson avec Param& : la solution est
301  * desormais passee en argument (et non plus en valeur de retour)
302  * pour permettre l'initialisation de methodes de resolution iteratives.
303  *
304  * Revision 2.39 1999/12/21 10:06:52 eric
305  * Il y a desormais deux versions de poisson: une sans Param et une
306  * avec Param.
307  *
308  * Revision 2.38 1999/12/10 16:19:33 eric
309  * Modif commentaires.
310  *
311  * Revision 2.37 1999/12/10 15:59:01 eric
312  * Modif commentaires fonction set.
313  *
314  * Revision 2.36 1999/12/09 10:45:54 eric
315  * Ajout du calcul d'integrale (membre p_integ et fonctions
316  * integrale et integrale_domains).
317  *
318  * Revision 2.35 1999/12/08 12:38:38 eric
319  * Ajout de la fonction import.
320  *
321  * Revision 2.34 1999/12/07 14:53:13 eric
322  * Changement ordre des arguments (phi,theta,r) --> (r,theta,phi)
323  * dans la routine val_point.
324  *
325  * Revision 2.33 1999/12/06 16:47:00 eric
326  * Ajout de la fonction val_point.
327  *
328  * Revision 2.32 1999/12/02 17:59:11 phil
329  * *** empty log message ***
330  *
331  * Revision 2.31 1999/12/02 14:28:46 eric
332  * Reprototypage de la fonction poisson(): const.
333  * Commentaires.
334  *
335  * Revision 2.30 1999/11/30 14:20:54 eric
336  * Reprototypage des fonctions membres mult_r, mult_r_zec,
337  * dec2_dzpuis et inc2_dzpuis : Cmp --> void.
338  *
339  * Revision 2.29 1999/11/29 13:18:06 eric
340  * Modif commentaires.
341  *
342  * Revision 2.28 1999/11/29 12:56:11 eric
343  * Introduction des membres p_lap, ind_lap.
344  * Changement prototype de la fonction laplacien.
345  *
346  * Revision 2.27 1999/11/26 14:22:54 eric
347  * Ajout du membre dzpuis et des fonctions de manipulation associees.
348  *
349  * Revision 2.26 1999/11/25 16:27:00 eric
350  * Reorganisation complete du calcul et stokage des derivees partielles.
351  *
352  * Revision 2.25 1999/11/23 16:21:32 eric
353  * Suppression du membre statique Cmp_Zero.
354  * Suppression du constructeur par defaut.
355  *
356  * Revision 2.24 1999/11/22 16:48:00 phil
357  * Cmp_Zero est desormais public
358  *
359  * Revision 2.23 1999/11/22 16:34:17 eric
360  * Ajout de l'element global Cmp_Zero.
361  *
362  * Revision 2.22 1999/11/22 15:41:42 eric
363  * Ajout des operateurs set(l,k,j,i) et (l,k,j,i).
364  * Ajout de la fonction annule(int l).
365  *
366  * Revision 2.21 1999/11/15 14:12:28 eric
367  * Ajout des fonctions mathematiques cos, sin, ..., min, max, norme,...
368  *
369  * Revision 2.20 1999/11/12 17:08:10 eric
370  * Ajout de la partie manquante de l'arithmetique.
371  *
372  * Revision 2.19 1999/10/28 09:36:56 eric
373  * Ajout de la fonction affiche_seuil.
374  *
375  * Revision 2.18 1999/10/28 09:01:24 eric
376  * Constructeur par lecture de fichier.
377  * Ajout de la fonction annule(int, int).
378  *
379  * Revision 2.17 1999/10/27 16:46:23 phil
380  * ajout de mult_r_zec
381  *
382  * Revision 2.16 1999/10/27 15:38:40 eric
383  * Suppression du membre c.
384  *
385  * Revision 2.15 1999/10/27 08:42:40 eric
386  * Introduction du membre Valeur va.
387  * Le pointeur Valeur* c est desormais un membre prive constant qui pointe
388  * sur va.
389  * Suppression de la fonction nouveau(), ainsi que du constructeur par
390  * defaut.
391  *
392  * Revision 2.14 1999/10/22 08:14:19 eric
393  * Depoussierage.
394  * Documentation.
395  *
396  * Revision 2.13 1999/10/19 14:40:51 phil
397  * ajout de inc2_dzpuis()
398  *
399  * Revision 2.12 1999/09/16 13:16:47 phil
400  * ajout de Cmp mult_r()
401  *
402  * Revision 2.11 1999/09/15 10:29:44 phil
403  * ajout de dec2_dzpuis()
404  *
405  * Revision 2.10 1999/09/14 17:13:05 phil
406  * ajout de Cmp operator*(double,const Cmp&)
407  *
408  * Revision 2.9 1999/09/14 13:45:27 phil
409  * suppression de la divergence
410  *
411  * Revision 2.8 1999/09/14 12:50:31 phil
412  * ajout de Cmp deriv(int) et de Cmp divergence()
413  *
414  * Revision 2.7 1999/09/07 16:08:04 phil
415  * ajout de la fonction membre gradient
416  *
417  * Revision 2.6 1999/09/06 14:50:27 phil
418  * ajout du laplacien
419  *
420  * Revision 2.5 1999/09/06 14:35:05 phil
421  * ajout de poisson
422  *
423  * Revision 2.4 1999/03/03 11:13:46 hyc
424  * *** empty log message ***
425  *
426  * Revision 2.3 1999/03/03 11:07:27 hyc
427  * *** empty log message ***
428  *
429  *
430  * $Header: /cvsroot/Lorene/C++/Include/cmp.h,v 1.23 2016/09/19 15:26:22 j_novak Exp $
431  *
432  */
433 
434 #include <cstdio>
435 
436 #include "valeur.h"
437 #include "map.h"
438 
439 namespace Lorene {
440 class Param ;
441 
446 class Cmp {
447 
448  // Data :
449  // -----
450  private:
451  const Map* mp ;
452 
454  int etat ;
455 
461  int dzpuis ;
462 
463  public:
465 
466  // Derived data :
467  // ------------
468  private:
470  mutable Cmp* p_dsdr ;
472  mutable Cmp* p_srdsdt ;
474  mutable Cmp* p_srstdsdp ;
475 
479  mutable Cmp* p_dsdx ;
480 
484  mutable Cmp* p_dsdy ;
485 
489  mutable Cmp* p_dsdz ;
490 
493  mutable Cmp* p_lap ;
494 
498  mutable int ind_lap ;
499 
503  mutable Tbl* p_integ ;
504 
505  // Constructors - Destructor
506  // -------------------------
507 
508  public:
509  explicit Cmp(const Map& map) ;
510  explicit Cmp(const Map* p_map) ;
511  Cmp(const Cmp& a) ;
512 
514  Cmp(const Map&, const Mg3d&, FILE* ) ;
515 
516  ~Cmp() ;
517 
518  // Assignment
519  // -----------
520  public:
522  void operator=(const Cmp& a) ;
523 
524  void operator=(const Valeur& a) ;
525  void operator=(const Mtbl& a) ;
526  void operator=(double ) ;
527  void operator=(int ) ;
528 
534  void import(const Cmp& ci) ;
535 
542  void import_symy(const Cmp& ci) ;
543 
551  void import_asymy(const Cmp& ci) ;
552 
564  void import(int nzet, const Cmp& ci) ;
565 
578  void import_symy(int nzet, const Cmp& ci) ;
579 
593  void import_asymy(int nzet, const Cmp& ci) ;
594 
595  private:
609  void import_gal(int nzet, const Cmp& ci) ;
610 
624  void import_align(int nzet, const Cmp& ci) ;
625 
640  void import_anti(int nzet, const Cmp& ci) ;
641 
656  void import_align_symy(int nzet, const Cmp& ci) ;
657 
673  void import_anti_symy(int nzet, const Cmp& ci) ;
674 
690  void import_align_asymy(int nzet, const Cmp& ci) ;
691 
708  void import_anti_asymy(int nzet, const Cmp& ci) ;
709 
710 
711 
712  // Access to individual elements
713  // -----------------------------
714  public:
715 
724  Tbl& set(int l) {
725  assert(etat == ETATQCQ) ;
726  return va.set(l) ;
727  };
728 
733  const Tbl& operator()(int l) const {
734  assert(etat == ETATQCQ) ;
735  return va(l) ;
736  };
737 
738 
749  double& set(int l, int k, int j, int i) {
750  assert(etat == ETATQCQ) ;
751  return va.set(l, k, j, i) ;
752  };
753 
754 
761  double operator()(int l, int k, int j, int i) const {
762  assert(etat != ETATNONDEF) ;
763  if (etat == ETATZERO) {
764  double zero = 0. ;
765  return zero ;
766  }
767  else{
768  return va(l, k, j, i) ;
769  }
770  };
771 
781  double val_point(double r, double theta, double phi) const ;
782 
783 
784  // Memory management
785  // -----------------
786  private:
787  void del_t() ;
788  void del_deriv() ;
789  void set_der_0x0() ;
790 
791  public:
792 
798  void set_etat_nondef() ;
799 
805  void set_etat_zero() ;
806 
813  void set_etat_qcq() ;
814 
823  void allocate_all() ;
824 
833  void annule_hard() ;
834 
840  void annule(int l) ;
841 
852  void annule(int l_min, int l_max) ;
853 
857  void filtre (int n) ;
858 
863  void filtre_phi (int n, int zone) ;
864 
870  void set_val_inf (double val) ;
871 
877  void set_val_hor (double val, int zone) ;
883  void fixe_decroissance (int puis) ;
884 
894 
895  // Extraction of information
896  // -------------------------
897  public:
899  int get_etat() const {return etat;} ;
901  const Map* get_mp() const {return mp;};
903  int get_dzpuis() const {return dzpuis;} ;
904 
908  bool dz_nonzero() const ;
909 
914  bool check_dzpuis(int dzi) const ;
915 
916 
917  // Outputs
918  // -------
919  public:
920  void sauve(FILE *) const ;
921 
931  void affiche_seuil(ostream& ostr, int type = 0, int precision = 4,
932  double threshold = 1.e-7) const ;
933 
935  friend ostream& operator<<(ostream& , const Cmp & ) ;
936 
937 
938  // Member arithmetics
939  // ------------------
940  public:
941  void operator+=(const Cmp &) ;
942  void operator-=(const Cmp &) ;
943  void operator*=(const Cmp &) ;
944 
945  // Manipulation of spectral bases
946  // ------------------------------
950  void std_base_scal() ;
951 
952 
953  // Differential operators and others
954  // ---------------------------------
955  public:
960  const Cmp& dsdr() const ;
961 
966  const Cmp& srdsdt() const ;
967 
972  const Cmp& srstdsdp() const ;
973 
979  const Cmp& dsdx() const ;
980 
986  const Cmp& dsdy() const ;
987 
993  const Cmp& dsdz() const ;
994 
1001  const Cmp& deriv(int i) const ;
1002 
1011  const Cmp& laplacien(int zec_mult_r = 4) const ;
1012 
1014  void div_r() ;
1015 
1017  void mult_r() ;
1018 
1021  void mult_r_zec() ;
1022 
1024  void mult_rsint() ;
1025 
1027  void mult_cost() ;
1028 
1030  void div_rsint() ;
1031 
1035  void dec_dzpuis() ;
1036 
1040  void inc_dzpuis() ;
1041 
1045  void dec2_dzpuis() ;
1046 
1050  void inc2_dzpuis() ;
1051 
1052  void set_dzpuis(int ) ;
1053 
1061  double integrale() const ;
1062 
1072  const Tbl& integrale_domains() const ;
1073 
1089  Valeur** asymptot(int n, const int flag = 0) const ;
1090 
1091 
1092  // PDE resolution
1093  // --------------
1094  public:
1104  Cmp poisson() const ;
1105 
1108  Cmp poisson_tau() const ;
1109 
1110  Cmp poisson_falloff(int k_falloff) const ;
1111 
1112  Cmp poisson_ylm(int nylm, double* intvec) const ;
1113 
1125  void poisson(Param& par, Cmp& uu) const ;
1126 
1129  void poisson_tau(Param& par, Cmp& uu) const ;
1130 
1131  void poisson_falloff(Param& par, Cmp& uu, int k_falloff) const ;
1132 
1133  void poisson_ylm(Param& par, Cmp& uu, int nylm, double* intvec) const ;
1134 
1149  Cmp poisson_dirichlet (const Valeur& limite, int num) const ;
1150 
1155  Cmp poisson_neumann (const Valeur&, int) const ;
1156 
1165  Cmp poisson_neumann_interne (const Valeur&, Param& par, Cmp& resu) const ;
1166  Cmp poisson_frontiere_double (const Valeur&, const Valeur&, int) const ;
1167 
1192  void poisson_regular(int k_div, int nzet, double unsgam1, Param& par,
1193  Cmp& uu, Cmp& uu_regu, Cmp& uu_div,
1194  Tenseur& duu_div,
1195  Cmp& source_regu, Cmp& source_div) const ;
1196 
1231  Tbl test_poisson(const Cmp& uu, ostream& ostr,
1232  bool detail = false) const ;
1237  void raccord(int n) ;
1238 
1245  void raccord_c1_zec (int puis, int nbre, int lmax) ;
1249  void raccord_externe (int puis, int nbre, int lmax) ;
1250 };
1251 ostream& operator<<(ostream& , const Cmp & ) ;
1252 
1259 Cmp operator+(const Cmp& ) ;
1260 Cmp operator-(const Cmp& ) ;
1261 Cmp operator+(const Cmp&, const Cmp &) ;
1262 Cmp operator+(const Cmp&, double ) ;
1263 Cmp operator+(double, const Cmp& ) ;
1264 Cmp operator+(const Cmp&, int ) ;
1265 Cmp operator+(int, 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 &, const Cmp &) ;
1273 Cmp operator*(const Cmp&, double ) ;
1274 Cmp operator*(double, const Cmp &) ;
1275 Cmp operator*(const Cmp&, int ) ;
1276 Cmp operator*(int, 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 
1283 Cmp sin(const Cmp& ) ;
1284 Cmp cos(const Cmp& ) ;
1285 Cmp tan(const Cmp& ) ;
1286 Cmp asin(const Cmp& ) ;
1287 Cmp acos(const Cmp& ) ;
1288 Cmp atan(const Cmp& ) ;
1289 Cmp exp(const Cmp& ) ;
1290 Cmp log(const Cmp& ) ;
1291 Cmp log10(const Cmp& ) ;
1292 Cmp sqrt(const Cmp& ) ;
1293 Cmp racine_cubique (const Cmp& ) ;
1294 Cmp pow(const Cmp& , int ) ;
1295 Cmp pow(const Cmp& , double ) ;
1296 Cmp abs(const Cmp& ) ;
1297 
1303 Tbl max(const Cmp& ) ;
1304 
1310 Tbl min(const Cmp& ) ;
1311 
1318 Tbl norme(const Cmp& ) ;
1319 
1328 Tbl diffrel(const Cmp& a, const Cmp& b) ;
1329 
1338 Tbl diffrelmax(const Cmp& a, const Cmp& b) ;
1339 
1342 }
1343 #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:901
Cmp * p_dsdy
Pointer on of *this , where .
Definition: cmp.h:484
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:446
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:498
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:899
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:454
Base class for coordinate mappings.
Definition: map.h:688
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:503
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:493
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:123
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:474
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:461
double operator()(int l, int k, int j, int i) const
Read-only of a particular element.
Definition: cmp.h:761
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:733
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:97
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:279
const Map * mp
Reference mapping.
Definition: cmp.h:451
int get_dzpuis() const
Returns dzpuis.
Definition: cmp.h:903
Cmp * p_srdsdt
Pointer on of *this.
Definition: cmp.h:472
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:489
Cmp * p_dsdr
Pointer on of *this.
Definition: cmp.h:470
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:479
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:464
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:304
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...