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.22 2014/10/13 08:52:33 j_novak Exp $
38  * $Log: cmp.h,v $
39  * Revision 1.22 2014/10/13 08:52:33 j_novak
40  * Lorene classes and functions now belong to the namespace Lorene.
41  *
42  * Revision 1.21 2014/10/06 15:09:39 j_novak
43  * Modified #include directives to use c++ syntax.
44  *
45  * Revision 1.20 2012/08/12 17:35:36 p_cerda
46  * Magnetstar: adding new member to class Cmp
47  *
48  * Revision 1.19 2010/02/02 13:34:12 e_gourgoulhon
49  * Marked DEPRECATED (in the documentation).
50  *
51  * Revision 1.18 2005/08/30 08:35:10 p_grandclement
52  * Addition of the Tau version of the vectorial Poisson equation for the Tensors
53  *
54  * Revision 1.17 2005/08/02 06:09:58 m_saijo
55  * Modified comment lines (div_r, multi_r, mult_rsint, div_rsint)
56  *
57  * Revision 1.16 2004/12/29 16:20:20 k_taniguchi
58  * Addition of the function poisson_ylm.
59  *
60  * Revision 1.15 2004/11/30 20:38:10 k_taniguchi
61  * Addition of the function poisson_falloff.
62  *
63  * Revision 1.14 2004/10/11 15:08:59 j_novak
64  * The radial manipulation functions take Scalar as arguments, instead of Cmp.
65  * Added a conversion operator from Scalar to Cmp.
66  * The Cmp radial manipulation function make conversion to Scalar, call to the
67  * Map_radial version with a Scalar argument and back.
68  *
69  * Revision 1.13 2004/03/31 11:21:02 f_limousin
70  * Method Cmp::poisson_neumann_interne has been implemented to solve
71  * the continuity equation for strange stars.
72  *
73  * Revision 1.12 2004/03/22 13:12:40 j_novak
74  * Modification of comments to use doxygen instead of doc++
75  *
76  * Revision 1.11 2004/03/01 09:54:58 j_novak
77  * Suppression of the Cmp version of avance_dalembert (now only with Scalar's)
78  *
79  * Revision 1.10 2003/11/06 14:43:37 e_gourgoulhon
80  * Gave a name to const arguments in certain method prototypes (e.g.
81  * constructors) to correct a bug of DOC++.
82  *
83  * Revision 1.9 2003/09/24 20:52:37 e_gourgoulhon
84  * Added constructor by conversion of a Scalar.
85  *
86  * Revision 1.8 2003/08/26 09:46:10 j_novak
87  * Added the method multipole_spectrum
88  *
89  * Revision 1.7 2003/06/20 14:16:10 f_limousin
90  * Add the function compare().
91  *
92  * Revision 1.6 2003/06/20 09:27:09 j_novak
93  * Modif commentaires.
94  *
95  * Revision 1.5 2002/09/13 09:17:31 j_novak
96  * Modif. commentaires
97  *
98  * Revision 1.4 2002/06/17 14:05:16 j_novak
99  * friend functions are now also declared outside the class definition
100  *
101  * Revision 1.3 2002/05/17 12:08:46 e_gourgoulhon
102  * Corrected error in the comment about dzpuis: multiplied --> divided
103  *
104  * Revision 1.2 2002/01/03 15:30:27 j_novak
105  * Some comments modified.
106  *
107  * Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon
108  * LORENE
109  *
110  * Revision 2.101 2001/10/29 15:36:03 novak
111  * Ajout de Cmp::div_r()
112  *
113  * Revision 2.100 2001/10/16 10:03:57 novak
114  * *** empty log message ***
115  *
116  * Revision 2.99 2001/08/31 14:52:10 novak
117  * Back to 2.97 version 2.98 was useless
118  *
119  * Revision 2.97 2001/07/19 14:01:39 novak
120  * new arguments for Cmp::avance_dalembert
121  *
122  * Revision 2.96 2001/05/29 16:09:40 eric
123  * Modif commentaires (mise en conformite Doc++ 3.4.7).
124  *
125  * Revision 2.95 2001/05/26 15:07:20 eric
126  * Ajout de operator% : multiplication de deux Cmp avec desaliasage
127  *
128  * Revision 2.94 2001/05/25 09:30:07 phil
129  * ajout de filtre_phi
130  *
131  * Revision 2.93 2001/03/30 13:36:22 phil
132  * ajout de raccord_externe
133  *
134  * Revision 2.92 2001/03/26 08:11:50 eric
135  * Modif commentaires.
136  *
137  * Revision 2.91 2001/03/22 10:25:19 phil
138  * modification prototypage de raccord_zec.C
139  *
140  * Revision 2.90 2001/02/12 18:08:10 phil
141  * ajout de Cmp::fixe_decroissance
142  *
143  * Revision 2.89 2000/12/13 14:50:05 phil
144  * changement nom variable dzpuis dans raccord_c1_zec
145  *
146  * Revision 2.88 2000/12/13 14:35:53 phil
147  * *** empty log message ***
148  *
149  * Revision 2.87 2000/12/13 14:26:42 phil
150  * *** empty log message ***
151  *
152  * Revision 2.86 2000/12/13 14:25:26 phil
153  * vire commentaires des raccords (provisioire)
154  *
155  * Revision 2.85 2000/12/13 14:19:49 phil
156  * modif commentaires
157  *
158  * Revision 2.84 2000/12/13 14:08:36 phil
159  * ajout procedure raccord_c1_zec
160  *
161  * Revision 2.83 2000/12/04 16:48:47 novak
162  * *** empty log message ***
163  *
164  * Revision 2.82 2000/12/04 15:06:15 novak
165  * *** empty log message ***
166  *
167  * Revision 2.81 2000/11/15 13:24:28 phil
168  * modification de asymptot
169  *
170  * Revision 2.80 2000/11/15 13:19:13 phil
171  * *** empty log message ***
172  *
173  * Revision 2.79 2000/11/15 13:17:01 phil
174  * *** empty log message ***
175  *
176  * Revision 2.78 2000/11/15 13:15:45 phil
177  * gestion affichage dans asymptot
178  *
179  * Revision 2.77 2000/10/20 09:43:30 phil
180  * changement commentaires
181  *
182  * Revision 2.76 2000/10/19 14:07:06 novak
183  * Ajout de la fonction membre avance_dalembert (experimentale)
184  *
185  * Revision 2.75 2000/10/19 09:20:36 phil
186  * *** empty log message ***
187  *
188  * Revision 2.74 2000/10/19 09:13:45 phil
189  * ajout des fonctions :
190  * filtre(int)
191  * set_val_inf(double)
192  * set_val_hor(double,int)
193  *
194  * Revision 2.73 2000/10/05 14:18:14 eric
195  * La fonction check_poisson est rebaptisee test_poisson.
196  *
197  * Revision 2.72 2000/10/05 13:56:52 eric
198  * *** empty log message ***
199  *
200  * Revision 2.71 2000/10/05 13:52:25 eric
201  * Ajout de la fonction check_poisson.
202  *
203  * Revision 2.70 2000/09/13 12:21:44 eric
204  * Modif commentaires.
205  *
206  * Revision 2.69 2000/09/13 12:11:48 eric
207  * Ajout de la fonction allocate_all().
208  *
209  * Revision 2.68 2000/09/07 15:26:40 keisuke
210  * Add a new argument Cmp& uu in Cmp::poisson_regular.
211  *
212  * Revision 2.67 2000/09/04 09:11:06 keisuke
213  * Suppress Cmp::poisson_regular (version without parameter).
214  *
215  * Revision 2.66 2000/08/31 13:04:30 eric
216  * Ajout des fonctions mult_rsint et div_rsint.
217  *
218  * Revision 2.65 2000/08/29 13:51:36 keisuke
219  * *** empty log message ***
220  *
221  * Revision 2.64 2000/08/29 13:46:14 keisuke
222  * Add the polar and azimuthal derivatives of the diverging potential
223  * in Cmp::poisson_regular.
224  * Modify the argumants of Cmp::poisson_regular.
225  *
226  * Revision 2.63 2000/08/28 15:48:22 keisuke
227  * Modif Cmp::poisson_regular
228  *
229  * Revision 2.62 2000/08/28 15:43:11 keisuke
230  * Modif Cmp::poisson_regular
231  *
232  * Revision 2.61 2000/08/04 12:09:58 eric
233  * Ajout de l'operator()(int l) et de la fonction set(int l) pour
234  * l'acces aux Tbl individuels.
235  *
236  * Revision 2.60 2000/08/04 09:18:05 keisuke
237  * Transformation Cmp::poisson_regular_param en Cmp::poisson_regular
238  *
239  * Revision 2.59 2000/08/03 14:01:29 keisuke
240  * Modif Cmp::poisson_regular et ajout de Cmp::poisson_regular_param
241  *
242  * Revision 2.58 2000/07/29 12:50:01 keisuke
243  * Modif Cmp::poisson_regular
244  *
245  * Revision 2.57 2000/07/20 13:33:50 keisuke
246  * Modif Cmp::poisson_regular
247  *
248  * Revision 2.56 2000/07/20 10:25:09 keisuke
249  * Modif Cmp::poisson_regular
250  *
251  * Revision 2.55 2000/07/19 15:50:23 keisuke
252  * Ajout de Cmp::poisson_regular
253  *
254  * Revision 2.54 2000/05/22 14:38:32 phil
255  * ajout de dec_dzpuis et inc_dzpuis
256  *
257  * Revision 2.53 2000/04/27 15:18:57 phil
258  * *** empty log message ***
259  *
260  * Revision 2.52 2000/03/28 17:44:41 phil
261  * Cmp::raccord() -> Cmp::raccord(int)
262  *
263  * Revision 2.51 2000/03/28 17:31:31 phil
264  * *** empty log message ***
265  *
266  * Revision 2.50 2000/03/28 17:25:35 phil
267  * ajout de Cmp::raccord()
268  *
269  * Revision 2.49 2000/03/25 12:52:45 eric
270  * Ajout de la fonction asymptot(int ).
271  *
272  * Revision 2.48 2000/03/20 13:33:31 phil
273  * commentaires
274  *
275  * Revision 2.47 2000/03/17 17:32:54 phil
276  * *** empty log message ***
277  *
278  * Revision 2.46 2000/03/17 17:07:14 phil
279  * *** empty log message ***
280  *
281  * Revision 2.45 2000/03/17 16:56:00 phil
282  * ajout de poisson_dirichlet et de son amie poisson_neumann
283  *
284  * Revision 2.44 2000/03/06 10:55:44 eric
285  * Ajout des methodes import_symy et import_asymy.
286  *
287  * Revision 2.43 2000/02/28 16:29:48 eric
288  * Ajout des fonctions import_gal, import_align, import_anti.
289  *
290  * Revision 2.42 2000/01/28 16:08:55 eric
291  * Ajout des fonctions dz_nonzero et check_dzpuis.
292  *
293  * Revision 2.41 2000/01/07 16:28:15 eric
294  * Suppression de la fonction membre gradient.
295  *
296  * Revision 2.40 1999/12/21 13:03:22 eric
297  * Changement de prototype de la routine poisson avec Param& : la solution est
298  * desormais passee en argument (et non plus en valeur de retour)
299  * pour permettre l'initialisation de methodes de resolution iteratives.
300  *
301  * Revision 2.39 1999/12/21 10:06:52 eric
302  * Il y a desormais deux versions de poisson: une sans Param et une
303  * avec Param.
304  *
305  * Revision 2.38 1999/12/10 16:19:33 eric
306  * Modif commentaires.
307  *
308  * Revision 2.37 1999/12/10 15:59:01 eric
309  * Modif commentaires fonction set.
310  *
311  * Revision 2.36 1999/12/09 10:45:54 eric
312  * Ajout du calcul d'integrale (membre p_integ et fonctions
313  * integrale et integrale_domains).
314  *
315  * Revision 2.35 1999/12/08 12:38:38 eric
316  * Ajout de la fonction import.
317  *
318  * Revision 2.34 1999/12/07 14:53:13 eric
319  * Changement ordre des arguments (phi,theta,r) --> (r,theta,phi)
320  * dans la routine val_point.
321  *
322  * Revision 2.33 1999/12/06 16:47:00 eric
323  * Ajout de la fonction val_point.
324  *
325  * Revision 2.32 1999/12/02 17:59:11 phil
326  * *** empty log message ***
327  *
328  * Revision 2.31 1999/12/02 14:28:46 eric
329  * Reprototypage de la fonction poisson(): const.
330  * Commentaires.
331  *
332  * Revision 2.30 1999/11/30 14:20:54 eric
333  * Reprototypage des fonctions membres mult_r, mult_r_zec,
334  * dec2_dzpuis et inc2_dzpuis : Cmp --> void.
335  *
336  * Revision 2.29 1999/11/29 13:18:06 eric
337  * Modif commentaires.
338  *
339  * Revision 2.28 1999/11/29 12:56:11 eric
340  * Introduction des membres p_lap, ind_lap.
341  * Changement prototype de la fonction laplacien.
342  *
343  * Revision 2.27 1999/11/26 14:22:54 eric
344  * Ajout du membre dzpuis et des fonctions de manipulation associees.
345  *
346  * Revision 2.26 1999/11/25 16:27:00 eric
347  * Reorganisation complete du calcul et stokage des derivees partielles.
348  *
349  * Revision 2.25 1999/11/23 16:21:32 eric
350  * Suppression du membre statique Cmp_Zero.
351  * Suppression du constructeur par defaut.
352  *
353  * Revision 2.24 1999/11/22 16:48:00 phil
354  * Cmp_Zero est desormais public
355  *
356  * Revision 2.23 1999/11/22 16:34:17 eric
357  * Ajout de l'element global Cmp_Zero.
358  *
359  * Revision 2.22 1999/11/22 15:41:42 eric
360  * Ajout des operateurs set(l,k,j,i) et (l,k,j,i).
361  * Ajout de la fonction annule(int l).
362  *
363  * Revision 2.21 1999/11/15 14:12:28 eric
364  * Ajout des fonctions mathematiques cos, sin, ..., min, max, norme,...
365  *
366  * Revision 2.20 1999/11/12 17:08:10 eric
367  * Ajout de la partie manquante de l'arithmetique.
368  *
369  * Revision 2.19 1999/10/28 09:36:56 eric
370  * Ajout de la fonction affiche_seuil.
371  *
372  * Revision 2.18 1999/10/28 09:01:24 eric
373  * Constructeur par lecture de fichier.
374  * Ajout de la fonction annule(int, int).
375  *
376  * Revision 2.17 1999/10/27 16:46:23 phil
377  * ajout de mult_r_zec
378  *
379  * Revision 2.16 1999/10/27 15:38:40 eric
380  * Suppression du membre c.
381  *
382  * Revision 2.15 1999/10/27 08:42:40 eric
383  * Introduction du membre Valeur va.
384  * Le pointeur Valeur* c est desormais un membre prive constant qui pointe
385  * sur va.
386  * Suppression de la fonction nouveau(), ainsi que du constructeur par
387  * defaut.
388  *
389  * Revision 2.14 1999/10/22 08:14:19 eric
390  * Depoussierage.
391  * Documentation.
392  *
393  * Revision 2.13 1999/10/19 14:40:51 phil
394  * ajout de inc2_dzpuis()
395  *
396  * Revision 2.12 1999/09/16 13:16:47 phil
397  * ajout de Cmp mult_r()
398  *
399  * Revision 2.11 1999/09/15 10:29:44 phil
400  * ajout de dec2_dzpuis()
401  *
402  * Revision 2.10 1999/09/14 17:13:05 phil
403  * ajout de Cmp operator*(double,const Cmp&)
404  *
405  * Revision 2.9 1999/09/14 13:45:27 phil
406  * suppression de la divergence
407  *
408  * Revision 2.8 1999/09/14 12:50:31 phil
409  * ajout de Cmp deriv(int) et de Cmp divergence()
410  *
411  * Revision 2.7 1999/09/07 16:08:04 phil
412  * ajout de la fonction membre gradient
413  *
414  * Revision 2.6 1999/09/06 14:50:27 phil
415  * ajout du laplacien
416  *
417  * Revision 2.5 1999/09/06 14:35:05 phil
418  * ajout de poisson
419  *
420  * Revision 2.4 1999/03/03 11:13:46 hyc
421  * *** empty log message ***
422  *
423  * Revision 2.3 1999/03/03 11:07:27 hyc
424  * *** empty log message ***
425  *
426  *
427  * $Header: /cvsroot/Lorene/C++/Include/cmp.h,v 1.22 2014/10/13 08:52:33 j_novak Exp $
428  *
429  */
430 
431 #include <cstdio>
432 
433 #include "valeur.h"
434 #include "map.h"
435 
436 namespace Lorene {
437 class Param ;
438 
443 class Cmp {
444 
445  // Data :
446  // -----
447  private:
448  const Map* mp ;
449 
451  int etat ;
452 
458  int dzpuis ;
459 
460  public:
462 
463  // Derived data :
464  // ------------
465  private:
467  mutable Cmp* p_dsdr ;
469  mutable Cmp* p_srdsdt ;
471  mutable Cmp* p_srstdsdp ;
472 
476  mutable Cmp* p_dsdx ;
477 
481  mutable Cmp* p_dsdy ;
482 
486  mutable Cmp* p_dsdz ;
487 
490  mutable Cmp* p_lap ;
491 
495  mutable int ind_lap ;
496 
500  mutable Tbl* p_integ ;
501 
502  // Constructors - Destructor
503  // -------------------------
504 
505  public:
506  explicit Cmp(const Map& map) ;
507  explicit Cmp(const Map* p_map) ;
508  Cmp(const Cmp& a) ;
509 
511  Cmp(const Map&, const Mg3d&, FILE* ) ;
512 
513  ~Cmp() ;
514 
515  // Assignment
516  // -----------
517  public:
519  void operator=(const Cmp& a) ;
520 
521  void operator=(const Valeur& a) ;
522  void operator=(const Mtbl& a) ;
523  void operator=(double ) ;
524  void operator=(int ) ;
525 
531  void import(const Cmp& ci) ;
532 
539  void import_symy(const Cmp& ci) ;
540 
548  void import_asymy(const Cmp& ci) ;
549 
561  void import(int nzet, const Cmp& ci) ;
562 
575  void import_symy(int nzet, const Cmp& ci) ;
576 
590  void import_asymy(int nzet, const Cmp& ci) ;
591 
592  private:
606  void import_gal(int nzet, const Cmp& ci) ;
607 
621  void import_align(int nzet, const Cmp& ci) ;
622 
637  void import_anti(int nzet, const Cmp& ci) ;
638 
653  void import_align_symy(int nzet, const Cmp& ci) ;
654 
670  void import_anti_symy(int nzet, const Cmp& ci) ;
671 
687  void import_align_asymy(int nzet, const Cmp& ci) ;
688 
705  void import_anti_asymy(int nzet, const Cmp& ci) ;
706 
707 
708 
709  // Access to individual elements
710  // -----------------------------
711  public:
712 
721  Tbl& set(int l) {
722  assert(etat == ETATQCQ) ;
723  return va.set(l) ;
724  };
725 
730  const Tbl& operator()(int l) const {
731  assert(etat == ETATQCQ) ;
732  return va(l) ;
733  };
734 
735 
746  double& set(int l, int k, int j, int i) {
747  assert(etat == ETATQCQ) ;
748  return va.set(l, k, j, i) ;
749  };
750 
751 
758  double operator()(int l, int k, int j, int i) const {
759  assert(etat != ETATNONDEF) ;
760  if (etat == ETATZERO) {
761  double zero = 0. ;
762  return zero ;
763  }
764  else{
765  return va(l, k, j, i) ;
766  }
767  };
768 
778  double val_point(double r, double theta, double phi) const ;
779 
780 
781  // Memory management
782  // -----------------
783  private:
784  void del_t() ;
785  void del_deriv() ;
786  void set_der_0x0() ;
787 
788  public:
789 
795  void set_etat_nondef() ;
796 
802  void set_etat_zero() ;
803 
810  void set_etat_qcq() ;
811 
820  void allocate_all() ;
821 
830  void annule_hard() ;
831 
837  void annule(int l) ;
838 
849  void annule(int l_min, int l_max) ;
850 
854  void filtre (int n) ;
855 
860  void filtre_phi (int n, int zone) ;
861 
867  void set_val_inf (double val) ;
868 
874  void set_val_hor (double val, int zone) ;
880  void fixe_decroissance (int puis) ;
881 
891 
892  // Extraction of information
893  // -------------------------
894  public:
896  int get_etat() const {return etat;} ;
898  const Map* get_mp() const {return mp;};
900  int get_dzpuis() const {return dzpuis;} ;
901 
905  bool dz_nonzero() const ;
906 
911  bool check_dzpuis(int dzi) const ;
912 
913 
914  // Outputs
915  // -------
916  public:
917  void sauve(FILE *) const ;
918 
928  void affiche_seuil(ostream& ostr, int type = 0, int precision = 4,
929  double threshold = 1.e-7) const ;
930 
932  friend ostream& operator<<(ostream& , const Cmp & ) ;
933 
934 
935  // Member arithmetics
936  // ------------------
937  public:
938  void operator+=(const Cmp &) ;
939  void operator-=(const Cmp &) ;
940  void operator*=(const Cmp &) ;
941 
942  // Manipulation of spectral bases
943  // ------------------------------
947  void std_base_scal() ;
948 
949 
950  // Differential operators and others
951  // ---------------------------------
952  public:
957  const Cmp& dsdr() const ;
958 
963  const Cmp& srdsdt() const ;
964 
969  const Cmp& srstdsdp() const ;
970 
976  const Cmp& dsdx() const ;
977 
983  const Cmp& dsdy() const ;
984 
990  const Cmp& dsdz() const ;
991 
998  const Cmp& deriv(int i) const ;
999 
1008  const Cmp& laplacien(int zec_mult_r = 4) const ;
1009 
1011  void div_r() ;
1012 
1014  void mult_r() ;
1015 
1018  void mult_r_zec() ;
1019 
1021  void mult_rsint() ;
1022 
1024  void mult_cost() ;
1025 
1027  void div_rsint() ;
1028 
1032  void dec_dzpuis() ;
1033 
1037  void inc_dzpuis() ;
1038 
1042  void dec2_dzpuis() ;
1043 
1047  void inc2_dzpuis() ;
1048 
1049  void set_dzpuis(int ) ;
1050 
1058  double integrale() const ;
1059 
1069  const Tbl& integrale_domains() const ;
1070 
1086  Valeur** asymptot(int n, const int flag = 0) const ;
1087 
1089 
1090  void compare(FILE* fich, const char* name_i) ;
1091  void compare(const Cmp& comp, const char* name, int ii = -1
1092  , int jj = -1) ;
1093 
1094 
1095 
1096 
1097  // PDE resolution
1098  // --------------
1099  public:
1109  Cmp poisson() const ;
1110 
1113  Cmp poisson_tau() const ;
1114 
1115  Cmp poisson_falloff(int k_falloff) const ;
1116 
1117  Cmp poisson_ylm(int nylm, double* intvec) const ;
1118 
1130  void poisson(Param& par, Cmp& uu) 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:259
const Cmp & dsdr() const
Returns of *this .
Definition: cmp_deriv.C:84
const Map * get_mp() const
Returns the mapping.
Definition: cmp.h:898
Cmp * p_dsdy
Pointer on of *this , where .
Definition: cmp.h:481
Cmp log(const Cmp &)
Neperian logarithm.
Definition: cmp_math.C:296
Cmp asin(const Cmp &)
Arcsine.
Definition: cmp_math.C:144
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:443
Cmp exp(const Cmp &)
Exponential.
Definition: cmp_math.C:270
void operator=(const Cmp &a)
Assignment to another Cmp defined on the same mapping.
Definition: cmp.C:398
const Cmp & dsdx() const
Returns of *this , where .
Definition: cmp_deriv.C:148
int ind_lap
Power of r by which the last computed Laplacian has been multiplied in the external compactified doma...
Definition: cmp.h:495
Cmp sqrt(const Cmp &)
Square root.
Definition: cmp_math.C:220
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:154
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:527
void annule(int l)
Sets the Cmp to zero in a given domain.
Definition: cmp.C:348
Multi-domain array.
Definition: mtbl.h:118
const Cmp & srstdsdp() const
Returns of *this .
Definition: cmp_deriv.C:127
void set_der_0x0()
Sets the pointers for derivatives to 0x0.
Definition: cmp.C:276
Lorene prototypes.
Definition: app_hor.h:64
int get_etat() const
Returns the logical state.
Definition: cmp.h:896
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:335
Cmp racine_cubique(const Cmp &)
Cube root.
Definition: cmp_math.C:245
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:451
Base class for coordinate mappings.
Definition: map.h:670
const Cmp & srdsdt() const
Returns of *this .
Definition: cmp_deriv.C:105
void mult_r_zec()
Multiplication by r in the external compactified domain (ZEC)
Definition: cmp_r_manip.C:103
void del_deriv()
Logical destructor of the derivatives.
Definition: cmp.C:265
void annule_hard()
Sets the Cmp to zero in a hard way.
Definition: cmp.C:338
Values and coefficients of a (real-value) function.
Definition: valeur.h:287
Tbl * p_integ
Pointer on the space integral of *this (values in each domain)
Definition: cmp.h:500
Cmp operator%(const Cmp &, const Cmp &)
Cmp * Cmp with desaliasing.
Definition: cmp_arithm.C:364
Cmp operator/(const Cmp &, const Cmp &)
Cmp / Cmp.
Definition: cmp_arithm.C:457
Tbl min(const Cmp &)
Minimum values of a Cmp in each domain.
Definition: cmp_math.C:458
void filtre_phi(int n, int zone)
Sets the n lasts coefficients in to 0 in the domain zone .
Definition: cmp_manip.C:101
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:94
Tbl diffrel(const Cmp &a, const Cmp &b)
Relative difference between two Cmp (norme version).
Definition: cmp_math.C:504
void div_r()
Division by r everywhere.
Definition: cmp_r_manip.C:78
Cmp * p_lap
Pointer on the Laplacian of *this.
Definition: cmp.h:490
Cmp tan(const Cmp &)
Tangent.
Definition: cmp_math.C:120
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:166
void mult_r()
Multiplication by r everywhere.
Definition: cmp_r_manip.C:91
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
Definition: cmp.C:289
Cmp poisson_tau() const
Same as Poisson with a Tau method.
Definition: cmp_pde.C:120
Tbl norme(const Cmp &)
Sums of the absolute values of all the values of the Cmp in each domain.
Definition: cmp_math.C:481
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:471
Cmp atan(const Cmp &)
Arctangent.
Definition: cmp_math.C:195
Tbl multipole_spectrum()
Gives the spectrum in terms of multipolar modes l .
Definition: cmp.C:762
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:104
void filtre(int n)
Sets the n lasts coefficients in r to 0 in the external domain.
Definition: cmp_manip.C:74
int dzpuis
Power of r by which the quantity represented by this must be divided in the external compactified zon...
Definition: cmp.h:458
double operator()(int l, int k, int j, int i) const
Read-only of a particular element.
Definition: cmp.h:758
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:136
bool dz_nonzero() const
Returns true if the last domain is compactified and *this is not zero in this domain.
Definition: cmp.C:660
~Cmp()
Destructor.
Definition: cmp.C:250
void operator-=(const Cmp &)
-= Cmp
Definition: cmp_arithm.C:623
Parameter storage.
Definition: param.h:125
void mult_rsint()
Multiplication by .
Definition: cmp_r_manip.C:116
void set_val_inf(double val)
Sets the value of the Cmp to val at infinity.
Definition: cmp_manip.C:126
const Cmp & deriv(int i) const
Returns of *this , where .
Definition: cmp_deriv.C:211
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:55
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:186
Tbl max(const Cmp &)
Maximum values of a Cmp in each domain.
Definition: cmp_math.C:435
friend ostream & operator<<(ostream &, const Cmp &)
Display.
Definition: cmp.C:577
const Tbl & operator()(int l) const
Read-only of the value in a given domain.
Definition: cmp.h:730
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:180
Cmp pow(const Cmp &, int)
Power .
Definition: cmp_math.C:348
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Definition: cmp.C:304
const Cmp & dsdz() const
Returns of *this , where .
Definition: cmp_deriv.C:190
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:192
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:612
void operator*=(const Cmp &)
*= Cmp
Definition: cmp_arithm.C:668
void std_base_scal()
Sets the spectral bases of the Valeur va to the standard ones for a scalar.
Definition: cmp.C:644
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:159
void operator+=(const Cmp &)
+= Cmp
Definition: cmp_arithm.C:575
Cmp poisson() const
Solves the scalar Poisson equation with *this as a source.
Definition: cmp_pde.C:94
void mult_cost()
Multiplication by $.
Definition: cmp_r_manip.C:128
void allocate_all()
Sets the logical state to ETATQCQ (ordinary state) and performs the memory allocation of all the elem...
Definition: cmp.C:323
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:273
const Map * mp
Reference mapping.
Definition: cmp.h:448
int get_dzpuis() const
Returns dzpuis.
Definition: cmp.h:900
Cmp * p_srdsdt
Pointer on of *this.
Definition: cmp.h:469
Cmp log10(const Cmp &)
Basis 10 logarithm.
Definition: cmp_math.C:322
void set_etat_nondef()
Sets the logical state to ETATNONDEF (undefined).
Definition: cmp.C:297
Cmp acos(const Cmp &)
Arccosine.
Definition: cmp_math.C:169
Cmp abs(const Cmp &)
Absolute value.
Definition: cmp_math.C:410
void raccord(int n)
Performs the matching of the nucleus with respect to the first shell.
Definition: cmp_raccord.C:170
Cmp * p_dsdz
Pointer on of *this , where .
Definition: cmp.h:486
Cmp * p_dsdr
Pointer on of *this.
Definition: cmp.h:467
Cmp(const Map &map)
Constructor from mapping.
Definition: cmp.C:208
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:715
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:71
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:108
void set_dzpuis(int)
Set a value to dzpuis.
Definition: cmp.C:654
Cmp sin(const Cmp &)
Sine.
Definition: cmp_math.C:69
const Cmp & dsdy() const
Returns of *this , where .
Definition: cmp_deriv.C:169
Basic array class.
Definition: tbl.h:161
void sauve(FILE *) const
Save in a file.
Definition: cmp.C:561
const Tbl & integrale_domains() const
Computes the integral in each domain of *this .
Definition: cmp_integ.C:73
const Cmp & laplacien(int zec_mult_r=4) const
Returns the Laplacian of *this.
Definition: cmp_deriv.C:242
Cmp * p_dsdx
Pointer on of *this , where .
Definition: cmp.h:476
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:461
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:732
Tensor handling *** DEPRECATED : use class Tensor instead ***.
Definition: tenseur.h:298
Tbl diffrelmax(const Cmp &a, const Cmp &b)
Relative difference between two Cmp (max version).
Definition: cmp_math.C:539
Tbl & set(int l)
Read/write of the value in a given domain (configuration space).
Definition: valeur.h:363
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...