LORENE
scalar.h
1 /*
2  * Definition of Lorene class Scalar
3  *
4  */
5 
6 /*
7  * Copyright (c) 2003-2004 Eric Gourgoulhon & Jerome Novak
8  *
9  * Copyright (c) 1999-2000 Jean-Alain Marck (for previous class Cmp)
10  * Copyright (c) 1999-2002 Eric Gourgoulhon (for previous class Cmp)
11  * Copyright (c) 1999-2001 Philippe Grandclement (for previous class Cmp)
12  * Copyright (c) 2000-2002 Jerome Novak (for previous class Cmp)
13  * Copyright (c) 2000-2001 Keisuke Taniguchi (for previous class Cmp)
14  *
15  * This file is part of LORENE.
16  *
17  * LORENE is free software; you can redistribute it and/or modify
18  * it under the terms of the GNU General Public License as published by
19  * the Free Software Foundation; either version 2 of the License, or
20  * (at your option) any later version.
21  *
22  * LORENE is distributed in the hope that it will be useful,
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25  * GNU General Public License for more details.
26  *
27  * You should have received a copy of the GNU General Public License
28  * along with LORENE; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  *
31  */
32 
33 
34 #ifndef __SCALAR_H_
35 #define __SCALAR_H_
36 
37 
38 /*
39  * $Id: scalar.h,v 1.96 2023/08/31 08:27:26 g_servignat Exp $
40  * $Log: scalar.h,v $
41  * Revision 1.96 2023/08/31 08:27:26 g_servignat
42  * Added the possibility to filter in the r direction within the ylm filter. An order filtering of 0 means no filtering (for all 3 directions).
43  *
44  * Revision 1.95 2023/08/28 09:53:33 g_servignat
45  * Added ylm filter for Tensor and Scalar in theta + phi directions
46  *
47  * Revision 1.94 2015/12/18 15:52:51 j_novak
48  * New method is_nan() for class Scalar.
49  *
50  * Revision 1.93 2015/09/10 13:28:05 j_novak
51  * New methods for the class Hot_Eos
52  *
53  * Revision 1.92 2014/10/13 08:52:36 j_novak
54  * Lorene classes and functions now belong to the namespace Lorene.
55  *
56  * Revision 1.91 2013/06/05 15:06:10 j_novak
57  * Legendre bases are treated as standard bases, when the multi-grid
58  * (Mg3d) is built with BASE_LEG.
59  *
60  * Revision 1.90 2013/01/11 15:44:54 j_novak
61  * Addition of Legendre bases (part 2).
62  *
63  * Revision 1.89 2012/12/19 13:59:56 j_penner
64  * added a few lines to the documentation for scalar_match_tau function
65  *
66  * Revision 1.88 2012/01/17 15:05:46 j_penner
67  * *** empty log message ***
68  *
69  * Revision 1.87 2012/01/17 10:16:27 j_penner
70  * functions added: sarra_filter_r, sarra_filter_r_all_domains, Heaviside
71  *
72  * Revision 1.86 2011/04/08 13:13:09 e_gourgoulhon
73  * Changed the comment of function val_point to indicate specifically the
74  * division by r^dzpuis in the compactified external domain.
75  *
76  * Revision 1.85 2008/09/29 13:23:51 j_novak
77  * Implementation of the angular mapping associated with an affine
78  * mapping. Things must be improved to take into account the domain index.
79  *
80  * Revision 1.84 2008/09/22 19:08:01 j_novak
81  * New methods to deal with boundary conditions
82  *
83  * Revision 1.83 2008/05/24 15:05:22 j_novak
84  * New method Scalar::match_tau to match the output of an explicit time-marching scheme with the tau method.
85  *
86  * Revision 1.82 2007/12/21 16:06:16 j_novak
87  * Methods to filter Tensor, Vector and Sym_tensor objects.
88  *
89  * Revision 1.81 2007/10/31 10:33:11 j_novak
90  * Added exponential filters to smooth Gibbs-type phenomena.
91  *
92  * Revision 1.80 2007/06/21 19:56:36 k_taniguchi
93  * Introduction of another filtre_r.
94  *
95  * Revision 1.79 2007/05/06 10:48:08 p_grandclement
96  * Modification of a few operators for the vorton project
97  *
98  * Revision 1.78 2007/01/16 15:05:59 n_vasset
99  * New constructor (taking a Scalar in mono-domain angular grid for
100  * boundary) for function sol_elliptic_boundary
101  *
102  * Revision 1.77 2006/05/26 09:00:09 j_novak
103  * New members for multiplication or division by cos(theta).
104  *
105  * Revision 1.76 2005/11/30 13:48:06 e_gourgoulhon
106  * Replaced M_PI/2 by 1.57... in argument list of sol_elliptic_sin_zec
107  * (in order not to require the definition of M_PI).
108  *
109  * Revision 1.75 2005/11/30 11:09:03 p_grandclement
110  * Changes for the Bin_ns_bh project
111  *
112  * Revision 1.74 2005/11/17 15:29:46 e_gourgoulhon
113  * Added arithmetics with Mtbl.
114  *
115  * Revision 1.73 2005/10/25 08:56:34 p_grandclement
116  * addition of std_spectral_base in the case of odd functions near the origin
117  *
118  * Revision 1.72 2005/09/07 13:10:47 j_novak
119  * Added a filter setting to zero all mulitpoles in a given range.
120  *
121  * Revision 1.71 2005/08/26 14:02:38 p_grandclement
122  * Modification of the elliptic solver that matches with an oscillatory exterior solution
123  * small correction in Poisson tau also...
124  *
125  * Revision 1.70 2005/08/25 12:14:07 p_grandclement
126  * Addition of a new method to solve the scalar Poisson equation, based on a multi-domain Tau-method
127  *
128  * Revision 1.69 2005/06/09 07:56:25 f_limousin
129  * Implement a new function sol_elliptic_boundary() and
130  * Vector::poisson_boundary(...) which solve the vectorial poisson
131  * equation (method 6) with an inner boundary condition.
132  *
133  * Revision 1.68 2005/06/08 12:35:18 j_novak
134  * New method for solving divergence-like ODEs.
135  *
136  * Revision 1.67 2005/05/20 14:42:30 j_novak
137  * Added the method Scalar::get_spectral_base().
138  *
139  * Revision 1.66 2005/04/04 21:28:57 e_gourgoulhon
140  * Added argument lambda to method poisson_angu
141  * to deal with the generalized angular Poisson equation:
142  * Lap_ang u + lambda u = source.
143  *
144  * Revision 1.65 2004/12/14 09:09:39 f_limousin
145  * Modif. comments.
146  *
147  * Revision 1.64 2004/11/23 12:41:53 f_limousin
148  * Intoduce function poisson_dir_neu(...) to solve a scalar poisson
149  * equation with a mixed boundary condition (Dirichlet + Neumann).
150  *
151  * Revision 1.63 2004/10/11 15:09:00 j_novak
152  * The radial manipulation functions take Scalar as arguments, instead of Cmp.
153  * Added a conversion operator from Scalar to Cmp.
154  * The Cmp radial manipulation function make conversion to Scalar, call to the
155  * Map_radial version with a Scalar argument and back.
156  *
157  * Revision 1.62 2004/08/24 09:14:40 p_grandclement
158  * Addition of some new operators, like Poisson in 2d... It now requieres the
159  * GSL library to work.
160  *
161  * Also, the way a variable change is stored by a Param_elliptic is changed and
162  * no longer uses Change_var but rather 2 Scalars. The codes using that feature
163  * will requiere some modification. (It should concern only the ones about monopoles)
164  *
165  * Revision 1.61 2004/07/27 08:24:26 j_novak
166  * Modif. comments
167  *
168  * Revision 1.60 2004/07/26 16:02:21 j_novak
169  * Added a flag to specify whether the primitive should be zero either at r=0
170  * or at r going to infinity.
171  *
172  * Revision 1.59 2004/07/06 13:36:27 j_novak
173  * Added methods for desaliased product (operator |) only in r direction.
174  *
175  * Revision 1.58 2004/06/22 08:49:57 p_grandclement
176  * Addition of everything needed for using the logarithmic mapping
177  *
178  * Revision 1.57 2004/06/14 15:24:23 e_gourgoulhon
179  * Added method primr (radial primitive).
180  *
181  * Revision 1.56 2004/06/11 14:29:56 j_novak
182  * Scalar::multipole_spectrum() is now a const method.
183  *
184  * Revision 1.55 2004/05/24 14:07:31 e_gourgoulhon
185  * Method set_domain now includes a call to del_deriv() for safety.
186  *
187  * Revision 1.54 2004/05/07 11:26:10 f_limousin
188  * New method filtre_r(int*)
189  *
190  * Revision 1.53 2004/03/22 13:12:43 j_novak
191  * Modification of comments to use doxygen instead of doc++
192  *
193  * Revision 1.52 2004/03/17 15:58:47 p_grandclement
194  * Slight modification of sol_elliptic_no_zec
195  *
196  * Revision 1.51 2004/03/11 12:07:30 e_gourgoulhon
197  * Added method visu_section_anim.
198  *
199  * Revision 1.50 2004/03/08 15:45:38 j_novak
200  * Modif. comment
201  *
202  * Revision 1.49 2004/03/05 15:09:40 e_gourgoulhon
203  * Added method smooth_decay.
204  *
205  * Revision 1.48 2004/03/01 09:57:02 j_novak
206  * the wave equation is solved with Scalars. It now accepts a grid with a
207  * compactified external domain, which the solver ignores and where it copies
208  * the values of the field from one time-step to the next.
209  *
210  * Revision 1.47 2004/02/27 09:43:58 f_limousin
211  * New methods filtre_phi(int) and filtre_theta(int).
212  *
213  * Revision 1.46 2004/02/26 22:46:26 e_gourgoulhon
214  * Added methods derive_cov, derive_con and derive_lie.
215  *
216  * Revision 1.45 2004/02/21 17:03:49 e_gourgoulhon
217  * -- Method "point" renamed "val_grid_point".
218  * -- Method "set_point" renamed "set_grid_point".
219  *
220  * Revision 1.44 2004/02/19 22:07:35 e_gourgoulhon
221  * Added argument "comment" in method spectral_display.
222  *
223  * Revision 1.43 2004/02/11 09:47:44 p_grandclement
224  * Addition of a new elliptic solver, matching with the homogeneous solution
225  * at the outer shell and not solving in the external domain (more details
226  * coming soon ; check your local Lorene dealer...)
227  *
228  * Revision 1.42 2004/01/28 16:46:22 p_grandclement
229  * Addition of the sol_elliptic_fixe_der_zero stuff
230  *
231  * Revision 1.41 2004/01/28 13:25:40 j_novak
232  * The ced_mult_r arguments have been suppressed from the Scalar::*dsd* methods.
233  * In the div/mult _r_dzpuis, there is no more default value.
234  *
235  * Revision 1.40 2004/01/28 10:39:17 j_novak
236  * Comments modified.
237  *
238  * Revision 1.39 2004/01/27 15:10:01 j_novak
239  * New methods Scalar::div_r_dzpuis(int) and Scalar_mult_r_dzpuis(int)
240  * which replace div_r_inc*. Tried to clean the dzpuis handling.
241  * WARNING: no testing at this point!!
242  *
243  * Revision 1.38 2004/01/23 13:25:44 e_gourgoulhon
244  * Added methods set_inner_boundary and set_outer_boundary.
245  * Methods set_val_inf and set_val_hor, which are particular cases of
246  * the above, have been suppressed.
247  *
248  * Revision 1.37 2004/01/22 16:10:09 e_gourgoulhon
249  * Added (provisory) method div_r_inc().
250  *
251  * Revision 1.36 2003/12/16 06:32:20 e_gourgoulhon
252  * Added method visu_box.
253  *
254  * Revision 1.35 2003/12/14 21:46:35 e_gourgoulhon
255  * Added argument start_dx in visu_section.
256  *
257  * Revision 1.34 2003/12/11 16:19:38 e_gourgoulhon
258  * Added method visu_section for visualization with OpenDX.
259  *
260  * Revision 1.33 2003/12/11 14:48:47 p_grandclement
261  * Addition of ALL (and that is a lot !) the files needed for the general elliptic solver ... UNDER DEVELOPEMENT...
262  *
263  * Revision 1.32 2003/11/13 13:43:53 p_grandclement
264  * Addition of things needed for Bhole::update_metric (const Etoile_bin&, double, double)
265  *
266  * Revision 1.31 2003/11/06 14:43:37 e_gourgoulhon
267  * Gave a name to const arguments in certain method prototypes (e.g.
268  * constructors) to correct a bug of DOC++.
269  *
270  * Revision 1.30 2003/11/04 22:55:50 e_gourgoulhon
271  * Added new methods mult_cost(), mult_sint() and div_sint().
272  *
273  * Revision 1.29 2003/10/29 13:09:11 e_gourgoulhon
274  * -- Added integer argument to derivative functions dsdr, etc...
275  * so that one can choose the dzpuis of the result (default=2).
276  * -- Change of method name: laplacien --> laplacian.
277  *
278  * Revision 1.28 2003/10/29 11:00:42 e_gourgoulhon
279  * Virtual functions dec_dzpuis and inc_dzpuis have now an integer argument to
280  * specify by which amount dzpuis is to be increased.
281  * Accordingly virtual methods dec2_dzpuis and inc2_dzpuis have been suppressed.
282  *
283  * Revision 1.27 2003/10/20 14:26:02 j_novak
284  * New assignement operators.
285  *
286  * Revision 1.26 2003/10/19 19:46:33 e_gourgoulhon
287  * -- Method spectral_display now virtual (from Tensor), list of argument
288  * changed.
289  *
290  * Revision 1.25 2003/10/17 13:46:14 j_novak
291  * The argument is now between 1 and 3 (instead of 0->2)
292  *
293  * Revision 1.24 2003/10/16 15:23:41 e_gourgoulhon
294  * Name of method div_r_ced() changed to div_r_inc2().
295  * Name of method div_rsint_ced() changed to div_rsint_inc2().
296  *
297  * Revision 1.23 2003/10/15 21:10:11 e_gourgoulhon
298  * Added method poisson_angu().
299  *
300  * Revision 1.22 2003/10/15 16:03:35 j_novak
301  * Added the angular Laplace operator for Scalar.
302  *
303  * Revision 1.21 2003/10/15 10:29:05 e_gourgoulhon
304  * Added new members p_dsdt and p_stdsdp.
305  * Added new methods dsdt(), stdsdp() and div_tant().
306  *
307  * Revision 1.20 2003/10/13 13:52:39 j_novak
308  * Better managment of derived quantities.
309  *
310  * Revision 1.19 2003/10/10 15:57:27 j_novak
311  * Added the state one (ETATUN) to the class Scalar
312  *
313  * Revision 1.18 2003/10/08 14:24:08 j_novak
314  * replaced mult_r_zec with mult_r_ced
315  *
316  * Revision 1.17 2003/10/06 16:16:02 j_novak
317  * New constructor from a Tensor.
318  *
319  * Revision 1.16 2003/10/06 13:58:45 j_novak
320  * The memory management has been improved.
321  * Implementation of the covariant derivative with respect to the exact Tensor
322  * type.
323  *
324  * Revision 1.15 2003/10/05 21:06:31 e_gourgoulhon
325  * - Added new methods div_r_ced() and div_rsint_ced().
326  * - Added new virtual method std_spectral_base()
327  * - Removed method std_spectral_base_scal()
328  *
329  * Revision 1.14 2003/10/01 13:02:58 e_gourgoulhon
330  * Suppressed the constructor from Map* .
331  *
332  * Revision 1.13 2003/09/29 12:52:56 j_novak
333  * Methods for changing the triad are implemented.
334  *
335  * Revision 1.12 2003/09/25 09:33:36 j_novak
336  * Added methods for integral calculation and various manipulations
337  *
338  * Revision 1.11 2003/09/25 09:11:21 e_gourgoulhon
339  * Added functions for radial operations (divr, etc...)
340  *
341  * Revision 1.10 2003/09/25 08:55:23 e_gourgoulhon
342  * Added members raccord*.
343  *
344  * Revision 1.9 2003/09/25 08:50:11 j_novak
345  * Added the members import
346  *
347  * Revision 1.8 2003/09/25 08:13:51 j_novak
348  * Added method for calculating derivatives
349  *
350  * Revision 1.7 2003/09/25 07:59:26 e_gourgoulhon
351  * Added prototypes for PDE resolutions.
352  *
353  * Revision 1.6 2003/09/25 07:17:58 j_novak
354  * Method asymptot implemented.
355  *
356  * Revision 1.5 2003/09/24 20:53:38 e_gourgoulhon
357  * Added -- constructor by conversion from a Cmp
358  * -- assignment from Cmp
359  *
360  * Revision 1.4 2003/09/24 15:10:54 j_novak
361  * Suppression of the etat flag in class Tensor (still present in Scalar)
362  *
363  * Revision 1.3 2003/09/24 12:01:44 j_novak
364  * Added friend functions for math.
365  *
366  * Revision 1.2 2003/09/24 10:22:01 e_gourgoulhon
367  * still in progress...
368  *
369  * Revision 1.1 2003/09/22 12:50:47 e_gourgoulhon
370  * First version: not ready yet!
371  *
372  *
373  * $Header: /cvsroot/Lorene/C++/Include/scalar.h,v 1.96 2023/08/31 08:27:26 g_servignat Exp $
374  *
375  */
376 
377 // Headers Lorene
378 #include "valeur.h"
379 #include "tensor.h"
380 
381 namespace Lorene {
382 class Param ;
383 class Cmp ;
384 class Param_elliptic ;
385 
393 class Scalar : public Tensor {
394 
395  // Data :
396  // -----
397  protected:
398 
402  int etat ;
403 
409  int dzpuis ;
410 
412 
413  // Derived data :
414  // ------------
415  protected:
417  mutable Scalar* p_dsdr ;
418 
422  mutable Scalar* p_srdsdt ;
423 
427  mutable Scalar* p_srstdsdp ;
428 
430  mutable Scalar* p_dsdt ;
431 
435  mutable Scalar* p_stdsdp ;
436 
440  mutable Scalar* p_dsdx ;
441 
445  mutable Scalar* p_dsdy ;
446 
450  mutable Scalar* p_dsdz ;
451 
454  mutable Scalar* p_lap ;
455 
458  mutable Scalar* p_lapang ;
459 
461  mutable Scalar* p_dsdradial ;
462 
464  mutable Scalar* p_dsdrho ;
465 
469  mutable int ind_lap ;
470 
474  mutable Tbl* p_integ ;
475 
476  // Constructors - Destructor
477  // -------------------------
478 
479  public:
480 
481  explicit Scalar(const Map& mpi) ;
482 
484  Scalar(const Tensor& a) ;
485 
486  Scalar(const Scalar& a) ;
487 
488  Scalar(const Cmp& a) ;
489 
491  Scalar(const Map&, const Mg3d&, FILE* ) ;
492 
493  virtual ~Scalar() ;
494 
495 
496  // Memory management
497  // -----------------
498  protected:
499  void del_t() ;
500  virtual void del_deriv() const;
501  void set_der_0x0() const;
502 
503  public:
504 
510  virtual void set_etat_nondef() ;
511 
517  virtual void set_etat_zero() ;
518 
525  virtual void set_etat_qcq() ;
526 
532  void set_etat_one() ;
533 
542  virtual void allocate_all() ;
543 
552  void annule_hard() ;
553 
554  // Extraction of information
555  // -------------------------
556  public:
560  int get_etat() const {return etat;} ;
561 
563  int get_dzpuis() const {return dzpuis;} ;
564 
568  bool dz_nonzero() const ;
569 
574  bool check_dzpuis(int dzi) const ;
575 
581  bool is_nan(bool verbose=false) const ;
582 
583  // Assignment
584  // -----------
585  public:
587  void operator=(const Scalar& a) ;
588 
590  virtual void operator=(const Tensor& a) ;
591 
592  void operator=(const Cmp& a) ;
593  void operator=(const Valeur& a) ;
594  void operator=(const Mtbl& a) ;
595  void operator=(double ) ;
596  void operator=(int ) ;
597 
598  // Conversion oprators
599  //---------------------
600  operator Cmp() const ;
601 
602  // Access to individual elements
603  // -----------------------------
604  public:
605 
607  const Valeur& get_spectral_va() const {return va;} ;
608 
610  Valeur& set_spectral_va() {return va;} ;
611 
621  Tbl& set_domain(int l) {
622  assert(etat == ETATQCQ) ;
623  del_deriv() ;
624  return va.set(l) ;
625  };
626 
631  const Tbl& domain(int l) const {
632  assert( (etat == ETATQCQ) || (etat == ETATUN) ) ;
633  return va(l) ;
634  };
635 
636 
643  double val_grid_point(int l, int k, int j, int i) const {
644  assert(etat != ETATNONDEF) ;
645  if (etat == ETATZERO) {
646  double zero = 0. ;
647  return zero ;
648  }
649  else {
650  if (etat == ETATUN) {
651  double one = 1. ;
652  return one ;
653  }
654  else{
655  return va(l, k, j, i) ;
656  }
657  }
658  };
659 
674  double val_point(double r, double theta, double phi) const ;
675 
676 
690  double& set_grid_point(int l, int k, int j, int i) {
691  assert(etat == ETATQCQ) ;
692  return va.set(l, k, j, i) ;
693  };
694 
695 
706  virtual void annule(int l_min, int l_max) ;
707 
713  void set_inner_boundary(int l, double x) ;
714 
720  void set_outer_boundary(int l, double x) ;
721 
730  Tbl multipole_spectrum () const ;
731 
738  Tbl tbl_out_bound(int l_dom, bool leave_ylm = false) ;
739 
746  Tbl tbl_in_bound(int n, bool leave_ylm = false) ;
747 
754  Scalar scalar_out_bound(int n, bool leave_ylm = false) ;
755 
756  // Differential operators and others
757  // ---------------------------------
758  public:
763  const Scalar& dsdr() const ;
764 
769  const Scalar& srdsdt() const ;
770 
775  const Scalar& srstdsdp() const ;
776 
779  const Scalar& dsdt() const ;
780 
788  const Scalar& dsdradial() const ;
789 
794  const Scalar& dsdrho() const ;
795 
798  const Scalar& stdsdp() const ;
799 
805  const Scalar& dsdx() const ;
806 
812  const Scalar& dsdy() const ;
813 
819  const Scalar& dsdz() const ;
820 
827  const Scalar& deriv(int i) const ;
828 
833  const Vector& derive_cov(const Metric& gam) const ;
834 
835 
841  const Vector& derive_con(const Metric& gam) const ;
842 
844  Scalar derive_lie(const Vector& v) const ;
845 
846 
855  const Scalar& laplacian(int ced_mult_r = 4) const ;
856 
864  const Scalar& lapang() const ;
865 
867  void div_r() ;
868 
873  void div_r_dzpuis(int ced_mult_r) ;
874 
878  void div_r_ced() ;
879 
881  void mult_r() ;
882 
887  void mult_r_dzpuis(int ced_mult_r) ;
888 
892  void mult_r_ced() ;
893 
895  void mult_rsint() ;
896 
901  void mult_rsint_dzpuis(int ced_mult_r) ;
902 
904  void div_rsint() ;
905 
910  void div_rsint_dzpuis(int ced_mult_r) ;
911 
912  void mult_cost() ;
913 
914  void div_cost() ;
915 
916  void mult_sint() ;
917 
918  void div_sint() ;
919 
920  void div_tant() ;
921 
932  Scalar primr(bool null_infty = true) const ;
933 
941  double integrale() const ;
942 
952  const Tbl& integrale_domains() const ;
953 
958  virtual void dec_dzpuis(int dec = 1) ;
959 
964  virtual void inc_dzpuis(int inc = 1) ;
965 
969  virtual void change_triad(const Base_vect& new_triad) ;
970 
975  void filtre (int n) ;
976 
981  void filtre_r (int* nn) ;
982 
986  void filtre_r (int n, int nzone) ;
987 
998 // virtual void exponential_filter_r(int lzmin, int lzmax, int p,
999 // double alpha= -16.) ;
1000  virtual void exponential_filter_r(int lzmin, int lzmax, int p,
1001  double alpha= -16.) ;
1002 
1013  void sarra_filter_r(int lzmin, int lzmax, double p,
1014  double alpha= -1E-16) ;
1015 
1021  void exp_filter_r_all_domains(Scalar &ss, int p, double alpha=-16.) ;
1022 
1029  void sarra_filter_r_all_domains(double p, double alpha=1E-16) ;
1030 
1038  virtual void exponential_filter_ylm(int lzmin, int lzmax, int p,
1039  double alpha= -16.) ;
1040 
1048  virtual void exponential_filter_ylm_phi(int lzmin, int lzmax, int p_r, int p_tet, int p_phi,
1049  double alpha= -16.) ;
1050 
1058  void annule_l (int l_min, int l_max, bool ylm_output= false ) ;
1059 
1064  void filtre_phi (int n, int zone) ;
1065 
1070  void filtre_tp(int nn, int nz1, int nz2) ;
1071 
1072 
1078  void fixe_decroissance (int puis) ;
1079 
1085  void smooth_decay(int k, int n) ;
1086 
1091  void raccord(int n) ;
1092 
1099  void raccord_c1_zec(int puis, int nbre, int lmax) ;
1100 
1104  void raccord_externe(int puis, int nbre, int lmax) ;
1105 
1122  void match_tau(Param& par_bc, Param* par_mat=0x0) ;
1123 
1140  void match_tau_star(Param& par_bc, Param* par_mat=0x0) ;
1141 
1150  void match_tau_shell(Param& par_bc, Param* par_mat=0x0) ;
1151 
1160  void match_collocation(Param& par_bc, Param* par_mat=0x0) ;
1161 
1162  // Outputs
1163  // -------
1164  public:
1165  virtual void sauve(FILE *) const ;
1166 
1177  virtual void spectral_display(const char* comment = 0x0,
1178  double threshold = 1.e-7, int precision = 4,
1179  ostream& ostr = cout) const ;
1180 
1182  friend ostream& operator<<(ostream& , const Scalar & ) ;
1183 
1207  void visu_section(const char section_type, double aa, double umin, double umax, double vmin,
1208  double vmax, const char* title = 0x0, const char* filename = 0x0,
1209  bool start_dx = true, int nu = 200, int nv = 200) const ;
1210 
1239  void visu_section(const Tbl& plane, double umin, double umax, double vmin,
1240  double vmax, const char* title = 0x0, const char* filename = 0x0,
1241  bool start_dx = true, int nu = 200, int nv = 200) const ;
1242 
1271  void visu_section_anim(const char section_type, double aa, double umin,
1272  double umax, double vmin, double vmax, int jtime, double ttime,
1273  int jgraph = 1, const char* title = 0x0, const char* filename_root = 0x0,
1274  bool start_dx = false, int nu = 200, int nv = 200) const ;
1275 
1297  void visu_box(double xmin, double xmax, double ymin, double ymax,
1298  double zmin, double zmax, const char* title0 = 0x0,
1299  const char* filename0 = 0x0, bool start_dx = true, int nx = 40, int ny = 40,
1300  int nz = 40) const ;
1301 
1302 
1303 
1304  // Member arithmetics
1305  // ------------------
1306  public:
1307  void operator+=(const Scalar &) ;
1308  void operator-=(const Scalar &) ;
1309  void operator*=(const Scalar &) ;
1310 
1311  // Manipulation of spectral bases
1312  // ------------------------------
1316  virtual void std_spectral_base() ;
1317 
1321  virtual void std_spectral_base_odd() ;
1322 
1325  void set_spectral_base(const Base_val& ) ;
1326 
1328  const Base_val& get_spectral_base( ) const {return va.base ;} ;
1329 
1335  void set_dzpuis(int ) ;
1336 
1352  Valeur** asymptot(int n, const int flag = 0) const ;
1353 
1354 
1355  // PDE resolution
1356  // --------------
1357  public:
1367  Scalar poisson() const ;
1368 
1380  void poisson(Param& par, Scalar& uu) const ;
1381 
1391  Scalar poisson_tau() const ;
1392 
1403  void poisson_tau(Param& par, Scalar& uu) const ;
1404 
1419  Scalar poisson_dirichlet (const Valeur& limite, int num) const ;
1420 
1425  Scalar poisson_neumann (const Valeur&, int) const ;
1426 
1427 
1446  Scalar poisson_dir_neu (const Valeur& limite , int num,
1447  double fact_dir, double fact_neu) const ;
1448 
1455  Scalar poisson_frontiere_double (const Valeur&, const Valeur&, int) const ;
1456 
1481  void poisson_regular(int k_div, int nzet, double unsgam1, Param& par,
1482  Scalar& uu, Scalar& uu_regu, Scalar& uu_div,
1483  Tensor& duu_div,
1484  Scalar& source_regu, Scalar& source_div) const ;
1485 
1520  Tbl test_poisson(const Scalar& uu, ostream& ostr,
1521  bool detail = false) const ;
1522 
1536  Scalar poisson_angu(double lambda =0) const ;
1537 
1570  Scalar avance_dalembert(Param& par, const Scalar& fJm1, const Scalar& source)
1571  const ;
1572 
1577  Scalar sol_elliptic(Param_elliptic& params) const ;
1578 
1588  Scalar sol_elliptic_boundary(Param_elliptic& params, const Mtbl_cf& bound,
1589  double fact_dir, double fact_neu) const ;
1590 
1595  Scalar sol_elliptic_boundary(Param_elliptic& params, const Scalar& bound,
1596  double fact_dir, double fact_neu) const ;
1597 
1598 
1606 
1612 
1620  Scalar sol_elliptic_no_zec(Param_elliptic& params, double val = 0) const ;
1621 
1628  Scalar sol_elliptic_only_zec(Param_elliptic& params, double val) const ;
1629 
1639  Scalar sol_elliptic_sin_zec(Param_elliptic& params, double* coefs, double* phases) const ;
1640 
1641 
1649  Scalar sol_elliptic_fixe_der_zero(double val,
1650  Param_elliptic& params) const ;
1651 
1652 
1663  Scalar sol_divergence(int n) const ;
1664 
1665  // Import from other mapping
1666  // -------------------------
1667 
1673  void import(const Scalar& ci) ;
1674 
1681  void import_symy(const Scalar& ci) ;
1682 
1690  void import_asymy(const Scalar& ci) ;
1691 
1703  void import(int nzet, const Scalar& ci) ;
1704 
1717  void import_symy(int nzet, const Scalar& ci) ;
1718 
1732  void import_asymy(int nzet, const Scalar& ci) ;
1733 
1734  protected:
1748  void import_gal(int nzet, const Scalar& ci) ;
1749 
1763  void import_align(int nzet, const Scalar& ci) ;
1764 
1779  void import_anti(int nzet, const Scalar& ci) ;
1780 
1795  void import_align_symy(int nzet, const Scalar& ci) ;
1796 
1812  void import_anti_symy(int nzet, const Scalar& ci) ;
1813 
1829  void import_align_asymy(int nzet, const Scalar& ci) ;
1830 
1847  void import_anti_asymy(int nzet, const Scalar& ci) ;
1848 
1849 
1850  friend Scalar operator-(const Scalar& ) ;
1851  friend Scalar operator+(const Scalar&, const Scalar &) ;
1852  friend Scalar operator+(const Scalar&, const Mtbl&) ;
1853  friend Scalar operator+(const Scalar&, double ) ;
1854  friend Scalar operator-(const Scalar &, const Scalar &) ;
1855  friend Scalar operator-(const Scalar&, const Mtbl&) ;
1856  friend Scalar operator-(const Scalar&, double ) ;
1857  friend Scalar operator*(const Scalar &, const Scalar &) ;
1858  friend Scalar operator%(const Scalar &, const Scalar &) ;
1859  friend Scalar operator|(const Scalar &, const Scalar &) ;
1860  friend Scalar operator*(const Mtbl&, const Scalar &) ;
1861  friend Scalar operator*(double, const Scalar &) ;
1862  friend Scalar operator/(const Scalar &, const Scalar &) ;
1863  friend Scalar operator/(const Scalar &, const Mtbl &) ;
1864  friend Scalar operator/(const Mtbl &, const Scalar &) ;
1865  friend Scalar operator/(const Scalar&, double ) ;
1866  friend Scalar operator/(double, const Scalar &) ;
1867 
1868  friend Scalar sin(const Scalar& ) ;
1869  friend Scalar cos(const Scalar& ) ;
1870  friend Scalar tan(const Scalar& ) ;
1871  friend Scalar asin(const Scalar& ) ;
1872  friend Scalar acos(const Scalar& ) ;
1873  friend Scalar atan(const Scalar& ) ;
1874  friend Scalar exp(const Scalar& ) ;
1875  friend Scalar Heaviside(const Scalar& ) ;
1876  friend Scalar log(const Scalar& ) ;
1877  friend Scalar log10(const Scalar& ) ;
1878  friend Scalar sqrt(const Scalar& ) ;
1879  friend Scalar racine_cubique (const Scalar& ) ;
1880  friend Scalar pow(const Scalar& , int ) ;
1881  friend Scalar pow(const Scalar& , double ) ;
1882  friend Scalar abs(const Scalar& ) ;
1883 
1884  friend double totalmax(const Scalar& ) ;
1885  friend double totalmin(const Scalar& ) ;
1886  friend Tbl max(const Scalar& ) ;
1887  friend Tbl min(const Scalar& ) ;
1888  friend Tbl norme(const Scalar& ) ;
1889  friend Tbl diffrel(const Scalar& a, const Scalar& b) ;
1890  friend Tbl diffrelmax(const Scalar& a, const Scalar& b) ;
1891 
1892 };
1893 
1894 ostream& operator<<(ostream& , const Scalar & ) ;
1895 
1896 // Prototypage de l'arithmetique
1903 Scalar operator+(const Scalar& ) ;
1904 Scalar operator-(const Scalar& ) ;
1905 Scalar operator+(const Scalar&, const Scalar &) ;
1906 Scalar operator+(const Scalar&, const Mtbl&) ;
1907 Scalar operator+(const Mtbl&, const Scalar&) ;
1908 Scalar operator+(const Scalar&, double ) ;
1909 Scalar operator+(double, const Scalar& ) ;
1910 Scalar operator+(const Scalar&, int ) ;
1911 Scalar operator+(int, const Scalar& ) ;
1912 Scalar operator-(const Scalar &, const Scalar &) ;
1913 Scalar operator-(const Scalar&, const Mtbl&) ;
1914 Scalar operator-(const Mtbl&, const Scalar&) ;
1915 Scalar operator-(const Scalar&, double ) ;
1916 Scalar operator-(double, const Scalar& ) ;
1917 Scalar operator-(const Scalar&, int ) ;
1918 Scalar operator-(int, const Scalar& ) ;
1919 Scalar operator*(const Scalar &, const Scalar &) ;
1920 
1922 Scalar operator%(const Scalar &, const Scalar &) ;
1923 
1925 Scalar operator|(const Scalar &, const Scalar &) ;
1926 
1927 Scalar operator*(const Mtbl&, const Scalar&) ;
1928 Scalar operator*(const Scalar&, const Mtbl&) ;
1929 
1930 Scalar operator*(const Scalar&, double ) ;
1931 Scalar operator*(double, const Scalar &) ;
1932 Scalar operator*(const Scalar&, int ) ;
1933 Scalar operator*(int, const Scalar& ) ;
1934 Scalar operator/(const Scalar &, const Scalar &) ;
1935 Scalar operator/(const Scalar&, double ) ;
1936 Scalar operator/(double, const Scalar &) ;
1937 Scalar operator/(const Scalar&, int ) ;
1938 Scalar operator/(int, const Scalar &) ;
1939 Scalar operator/(const Scalar &, const Mtbl&) ;
1940 Scalar operator/(const Mtbl&, const Scalar &) ;
1941 
1942 
1943 Scalar sin(const Scalar& ) ;
1944 Scalar cos(const Scalar& ) ;
1945 Scalar tan(const Scalar& ) ;
1946 Scalar asin(const Scalar& ) ;
1947 Scalar acos(const Scalar& ) ;
1948 Scalar atan(const Scalar& ) ;
1949 Scalar exp(const Scalar& ) ;
1950 Scalar Heaviside(const Scalar& ) ;
1951 Scalar log(const Scalar& ) ;
1952 Scalar log10(const Scalar& ) ;
1953 Scalar sqrt(const Scalar& ) ;
1954 Scalar racine_cubique (const Scalar& ) ;
1955 Scalar pow(const Scalar& , int ) ;
1956 Scalar pow(const Scalar& , double ) ;
1957 Scalar abs(const Scalar& ) ;
1958 
1964 double totalmax(const Scalar& ) ;
1965 
1971 double totalmin(const Scalar& ) ;
1972 
1978 Tbl max(const Scalar& ) ;
1979 
1985 Tbl min(const Scalar& ) ;
1986 
1993 Tbl norme(const Scalar& ) ;
1994 
2003 Tbl diffrel(const Scalar& a, const Scalar& b) ;
2004 
2013 Tbl diffrelmax(const Scalar& a, const Scalar& b) ;
2014 
2019 void exp_filter_ylm_all_domains(Scalar& ss, int p, double alpha=-16.) ;
2020 
2025 void exp_filter_ylm_all_domains(Scalar& ss, int p_tet, int p_phi, double alpha=-16.) ;
2026 
2028 }
2029 #endif
const Base_val & get_spectral_base() const
Returns the spectral bases of the Valeur va.
Definition: scalar.h:1328
Scalar * p_srdsdt
Pointer on of *this (0x0 if not up to date)
Definition: scalar.h:422
void annule_l(int l_min, int l_max, bool ylm_output=false)
Sets all the multipolar components between l_min and l_max to zero.
Definition: scalar_manip.C:117
Metric for tensor calculation.
Definition: metric.h:90
Scalar * p_srstdsdp
Pointer on of *this (0x0 if not up to date)
Definition: scalar.h:427
Cmp log(const Cmp &)
Neperian logarithm.
Definition: cmp_math.C:299
Scalar poisson_dir_neu(const Valeur &limite, int num, double fact_dir, double fact_neu) const
Is identicall to Scalar::poisson() .
Cmp asin(const Cmp &)
Arcsine.
Definition: cmp_math.C:147
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 filtre_r(int *nn)
Sets the n lasts coefficients in r to 0 in all domains.
Definition: scalar_manip.C:186
Scalar poisson_frontiere_double(const Valeur &, const Valeur &, int) const
Idem as Scalar::poisson_dirichlet , the boundary condition being on both the function and its radial ...
const Scalar & dsdradial() const
Returns of *this if the mapping is affine (class Map_af) and of *this if the mapping is logarithmic...
Definition: scalar_deriv.C:491
void mult_r()
Multiplication by r everywhere; dzpuis is not changed.
const Scalar & lapang() const
Returns the angular Laplacian of *this , where .
Definition: scalar_deriv.C:461
Cmp sqrt(const Cmp &)
Square root.
Definition: cmp_math.C:223
virtual void set_etat_zero()
Sets the logical state to ETATZERO (zero).
Definition: scalar.C:330
void set_der_0x0() const
Sets the pointers for derivatives to 0x0.
Definition: scalar.C:312
virtual void annule(int l_min, int l_max)
Sets the Scalar to zero in several domains.
Definition: scalar.C:397
Multi-domain array.
Definition: mtbl.h:118
const Tbl & domain(int l) const
Read-only of the value in a given domain.
Definition: scalar.h:631
friend Scalar exp(const Scalar &)
Exponential.
Definition: scalar_math.C:326
friend double totalmax(const Scalar &)
Maximum values of a Scalar in each domain.
Definition: scalar_math.C:556
Scalar(const Map &mpi)
Constructor from mapping.
Definition: scalar.C:210
Lorene prototypes.
Definition: app_hor.h:67
void div_cost()
Division by .
void visu_section_anim(const char section_type, double aa, double umin, double umax, double vmin, double vmax, int jtime, double ttime, int jgraph=1, const char *title=0x0, const char *filename_root=0x0, bool start_dx=false, int nu=200, int nv=200) const
3D visualization via time evolving plane section (animation).
Definition: scalar_visu.C:538
const Scalar & dsdt() const
Returns of *this .
Definition: scalar_deriv.C:208
const Scalar & laplacian(int ced_mult_r=4) const
Returns the Laplacian of *this.
Definition: scalar_deriv.C:436
Cmp racine_cubique(const Cmp &)
Cube root.
Definition: cmp_math.C:248
void visu_box(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, const char *title0=0x0, const char *filename0=0x0, bool start_dx=true, int nx=40, int ny=40, int nz=40) const
3D visualization (volume rendering) via OpenDX.
Definition: scalar_visu.C:345
Tbl multipole_spectrum() const
Gives the spectrum in terms of multipolar modes l .
Definition: scalar.C:962
const Scalar & dsdz() const
Returns of *this , where .
Definition: scalar_deriv.C:328
Tensor field of valence 0 (or component of a tensorial field).
Definition: scalar.h:393
virtual void change_triad(const Base_vect &new_triad)
Sets a new vectorial basis (triad) of decomposition and modifies the components accordingly.
Definition: scalar.C:1003
Scalar poisson() const
Solves the scalar Poisson equation with *this as a source.
Definition: scalar_pde.C:139
Base_val operator*(const Base_val &, const Base_val &)
This operator is used when calling multiplication or division of Valeur .
Base class for coordinate mappings.
Definition: map.h:688
void import_gal(int nzet, const Scalar &ci)
Assignment to another Scalar defined on a different mapping, when the two mappings do not have a part...
void operator-=(const Scalar &)
-= Scalar
double integrale() const
Computes the integral over all space of *this .
Definition: scalar_integ.C:64
friend Tbl max(const Scalar &)
Maximum values of a Scalar in each domain.
Definition: scalar_math.C:614
friend ostream & operator<<(ostream &, const Scalar &)
Display.
Definition: scalar.C:708
Scalar * p_dsdt
Pointer on of *this (0x0 if not up to date)
Definition: scalar.h:430
Scalar primr(bool null_infty=true) const
Computes the radial primitive which vanishes for .
Definition: scalar_integ.C:104
friend Scalar atan(const Scalar &)
Arctangent.
Definition: scalar_math.C:234
void match_tau(Param &par_bc, Param *par_mat=0x0)
Method for matching accross domains and imposing boundary condition.
void mult_sint()
Multiplication by .
virtual void exponential_filter_ylm_phi(int lzmin, int lzmax, int p_r, int p_tet, int p_phi, double alpha=-16.)
Applies an exponential filter to the spectral coefficients in the angular directions.
void poisson_regular(int k_div, int nzet, double unsgam1, Param &par, Scalar &uu, Scalar &uu_regu, Scalar &uu_div, Tensor &duu_div, Scalar &source_regu, Scalar &source_div) const
Solves the scalar Poisson equation with *this as a source (version with parameters to control the res...
int ind_lap
Power of r by which the last computed Laplacian has been multiplied in the compactified external doma...
Definition: scalar.h:469
const Scalar & dsdx() const
Returns of *this , where .
Definition: scalar_deriv.C:266
virtual void exponential_filter_r(int lzmin, int lzmax, int p, double alpha=-16.)
Applies an exponential filter to the spectral coefficients in the radial direction.
virtual void std_spectral_base()
Sets the spectral bases of the Valeur va to the standard ones for a scalar field. ...
Definition: scalar.C:790
void import_anti_symy(int nzet, const Scalar &ci)
Assignment to another Scalar defined on a different mapping, when the two mappings have anti-aligned ...
friend Tbl min(const Scalar &)
Minimum values of a Scalar in each domain.
Definition: scalar_math.C:642
Values and coefficients of a (real-value) function.
Definition: valeur.h:297
Cmp operator%(const Cmp &, const Cmp &)
Cmp * Cmp with desaliasing.
Definition: cmp_arithm.C:367
Scalar scalar_out_bound(int n, bool leave_ylm=false)
Returns the Scalar containing the values of angular coefficients at the outer boundary.
Definition: scalar_manip.C:473
virtual void allocate_all()
Sets the logical state to ETATQCQ (ordinary state) and performs the memory allocation of all the elem...
Definition: scalar.C:371
virtual void set_etat_nondef()
Sets the logical state to ETATNONDEF (undefined).
Definition: scalar.C:350
int dzpuis
Power of r by which the quantity represented by this must be divided in the compactified external do...
Definition: scalar.h:409
int get_etat() const
Returns the logical state ETATNONDEF (undefined), ETATZERO (null) or ETATQCQ (ordinary).
Definition: scalar.h:560
void operator*=(const Scalar &)
*= Scalar
Scalar sol_elliptic_fixe_der_zero(double val, Param_elliptic &params) const
Resolution of a general elliptic equation fixing the dericative at the origin and relaxing one contin...
Definition: scalar_pde.C:389
Cmp operator/(const Cmp &, const Cmp &)
Cmp / Cmp.
Definition: cmp_arithm.C:460
void operator+=(const Scalar &)
+= Scalar
Tbl min(const Cmp &)
Minimum values of a Cmp in each domain.
Definition: cmp_math.C:461
Scalar sol_divergence(int n) const
Resolution of a divergence-like equation.
virtual void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Definition: scalar.C:359
friend Scalar sqrt(const Scalar &)
Square root.
Definition: scalar_math.C:266
Tbl tbl_in_bound(int n, bool leave_ylm=false)
Returns the Tbl containing the values of angular coefficients at the inner boundary.
Definition: scalar_manip.C:454
Scalar operator|(const Scalar &, const Scalar &)
Scalar * Scalar with desaliasing only in r.
Tbl test_poisson(const Scalar &uu, ostream &ostr, bool detail=false) const
Checks if a Poisson equation with *this as a source has been correctly solved.
const Vector & derive_con(const Metric &gam) const
Returns the "contravariant" derivative of *this with respect to some metric , by raising the index of...
Definition: scalar_deriv.C:402
Tensor field of valence 1.
Definition: vector.h:188
friend Scalar operator*(const Scalar &, const Scalar &)
Scalar * Scalar.
Scalar poisson_angu(double lambda=0) const
Solves the (generalized) angular Poisson equation with *this as source.
Definition: scalar_pde.C:203
Vectorial bases (triads) with respect to which the tensorial components are defined.
Definition: base_vect.h:105
Cmp cos(const Cmp &)
Cosine.
Definition: cmp_math.C:97
Scalar sol_elliptic_only_zec(Param_elliptic &params, double val) const
Resolution of a general elliptic equation solving in the compactified domain and putting a given valu...
Definition: scalar_pde.C:344
Tbl & set_domain(int l)
Read/write of the value in a given domain.
Definition: scalar.h:621
Tbl diffrel(const Cmp &a, const Cmp &b)
Relative difference between two Cmp (norme version).
Definition: cmp_math.C:507
friend Scalar acos(const Scalar &)
Arccosine.
Definition: scalar_math.C:202
void set_dzpuis(int)
Modifies the dzpuis flag.
Definition: scalar.C:814
double val_grid_point(int l, int k, int j, int i) const
Returns the value of the field at a specified grid point.
Definition: scalar.h:643
void annule_hard()
Sets the Scalar to zero in a hard way.
Definition: scalar.C:386
Scalar * p_lap
Pointer on the Laplacian of *this (0x0 if not up to date)
Definition: scalar.h:454
void exp_filter_ylm_all_domains(Scalar &ss, int p, double alpha=-16.)
Applies an exponential filter in angular directions in all domains.
void raccord(int n)
Performs the matching of the nucleus with respect to the first shell.
Cmp tan(const Cmp &)
Tangent.
Definition: cmp_math.C:123
Scalar avance_dalembert(Param &par, const Scalar &fJm1, const Scalar &source) const
Performs one time-step integration (from ) of the scalar d&#39;Alembert equation with *this being the val...
Definition: scalar_pde.C:220
friend Scalar pow(const Scalar &, int)
Power .
Definition: scalar_math.C:454
Tbl * p_integ
Pointer on the space integral of *this (values in each domain) (0x0 if not up to date) ...
Definition: scalar.h:474
void import_anti(int nzet, const Scalar &ci)
Assignment to another Scalar defined on a different mapping, when the two mappings have anti-aligned ...
void smooth_decay(int k, int n)
Performs a matching of the last non-compactified shell with a decaying function where is the spher...
friend Scalar cos(const Scalar &)
Cosine.
Definition: scalar_math.C:107
void div_r()
Division by r everywhere; dzpuis is not changed.
const Scalar & dsdrho() const
Returns of *this .
Definition: scalar_deriv.C:522
virtual void sauve(FILE *) const
Save in a file.
Definition: scalar.C:692
const Tbl & integrale_domains() const
Computes the integral in each domain of *this .
Definition: scalar_integ.C:82
virtual void del_deriv() const
Logical destructor of the derivatives.
Definition: scalar.C:293
Scalar * p_dsdradial
Pointer on of *this.
Definition: scalar.h:461
Tbl norme(const Cmp &)
Sums of the absolute values of all the values of the Cmp in each domain.
Definition: cmp_math.C:484
Cmp atan(const Cmp &)
Arctangent.
Definition: cmp_math.C:198
Scalar sol_elliptic_no_zec(Param_elliptic &params, double val=0) const
Resolution of a general elliptic equation, putting a given value at the outermost shell and not solvi...
Definition: scalar_pde.C:317
virtual void inc_dzpuis(int inc=1)
Increases by inc units the value of dzpuis and changes accordingly the values of the Scalar in the co...
Scalar * p_dsdrho
Pointer on of *this.
Definition: scalar.h:464
const Scalar & dsdy() const
Returns of *this , where .
Definition: scalar_deriv.C:297
Scalar * p_dsdy
Pointer on of *this , where (0x0 if not up to date)
Definition: scalar.h:445
void operator=(const Scalar &a)
Assignment to another Scalar defined on the same mapping.
Definition: scalar.C:452
Cmp operator+(const Cmp &)
Definition: cmp_arithm.C:107
Scalar * p_lapang
Pointer on the Laplacian of *this (0x0 if not up to date)
Definition: scalar.h:458
Scalar poisson_neumann(const Valeur &, int) const
Idem as Scalar::poisson_dirichlet , the boundary condition being on the radial derivative of the solu...
friend Scalar operator+(const Scalar &, const Scalar &)
Scalar + Scalar.
Base_val base
Bases on which the spectral expansion is performed.
Definition: valeur.h:315
int get_dzpuis() const
Returns dzpuis.
Definition: scalar.h:563
Scalar sol_elliptic(Param_elliptic &params) const
Resolution of a general elliptic equation, putting zero at infinity.
Definition: scalar_pde.C:237
virtual void spectral_display(const char *comment=0x0, double threshold=1.e-7, int precision=4, ostream &ostr=cout) const
Displays the spectral coefficients and the associated basis functions.
Definition: scalar.C:747
void set_outer_boundary(int l, double x)
Sets the value of the Scalar at the outer boundary of a given domain.
Definition: scalar_manip.C:321
friend Scalar sin(const Scalar &)
Sine.
Definition: scalar_math.C:75
void mult_r_ced()
Multiplication by r in the compactified external domain (CED), the dzpuis flag is not changed...
Scalar sol_elliptic_boundary(Param_elliptic &params, const Mtbl_cf &bound, double fact_dir, double fact_neu) const
Resolution of a general elliptic equation, putting zero at infinity and with inner boundary condition...
Definition: scalar_pde.C:259
Parameter storage.
Definition: param.h:125
void set_etat_one()
Sets the logical state to ETATUN (one).
Definition: scalar.C:340
friend Tbl diffrelmax(const Scalar &a, const Scalar &b)
Relative difference between two Scalar (max version).
Definition: scalar_math.C:733
Valeur va
The numerical value of the Scalar.
Definition: scalar.h:411
void del_t()
Logical destructor.
Definition: scalar.C:285
Tbl max(const Cmp &)
Maximum values of a Cmp in each domain.
Definition: cmp_math.C:438
virtual void std_spectral_base_odd()
Sets the spectral bases of the Valeur va to the standard odd ones for a scalar field.
Definition: scalar.C:797
const Scalar & deriv(int i) const
Returns of *this , where .
Definition: scalar_deriv.C:359
double totalmax(const Mtbl &)
Maximum value of the Mtbl elements in all domains.
Definition: mtbl_math.C:497
friend Tbl diffrel(const Scalar &a, const Scalar &b)
Relative difference between two Scalar (norme version).
Definition: scalar_math.C:698
friend Scalar operator|(const Scalar &, const Scalar &)
Scalar * Scalar with desaliasing only in r.
const Scalar & stdsdp() const
Returns of *this .
Definition: scalar_deriv.C:238
void mult_cost()
Multiplication by .
void div_rsint_dzpuis(int ced_mult_r)
Division by but with the output flag dzpuis set to ced_mult_r .
friend double totalmin(const Scalar &)
Minimum values of a Scalar in each domain.
Definition: scalar_math.C:585
void visu_section(const char section_type, double aa, double umin, double umax, double vmin, double vmax, const char *title=0x0, const char *filename=0x0, bool start_dx=true, int nu=200, int nv=200) const
3D visualization via a plane section.
Definition: scalar_visu.C:81
void mult_rsint()
Multiplication by everywhere; dzpuis is not changed.
Cmp pow(const Cmp &, int)
Power .
Definition: cmp_math.C:351
Tensor handling.
Definition: tensor.h:294
void sarra_filter_r_all_domains(double p, double alpha=1E-16)
Applies an exponential filter in radial direction in all domains for the case where p is a double (se...
void filtre(int n)
Sets the n lasts coefficients in r to 0 in the external domain.
Definition: scalar_manip.C:157
This class contains the parameters needed to call the general elliptic solver.
friend Scalar operator-(const Scalar &)
- Scalar
Definition: scalar_arithm.C:93
friend Scalar log(const Scalar &)
Neperian logarithm.
Definition: scalar_math.C:388
double totalmin(const Mtbl &)
Minimum value of the Mtbl elements in all domain.
Definition: mtbl_math.C:525
friend Scalar racine_cubique(const Scalar &)
Cube root.
Definition: scalar_math.C:296
Scalar derive_lie(const Vector &v) const
Computes the derivative of this along a vector field v.
Definition: scalar_deriv.C:419
void import_align_symy(int nzet, const Scalar &ci)
Assignment to another Scalar defined on a different mapping, when the two mappings have aligned Carte...
double val_point(double r, double theta, double phi) const
Computes the value of the field at an arbitrary point , by means of the spectral expansion.
Definition: scalar.C:896
void import_align(int nzet, const Scalar &ci)
Assignment to another Scalar defined on a different mapping, when the two mappings have aligned Carte...
void set_inner_boundary(int l, double x)
Sets the value of the Scalar at the inner boundary of a given domain.
Definition: scalar_manip.C:289
void filtre_tp(int nn, int nz1, int nz2)
Sets the n lasts coefficients in to 0 in the domain nz1 to nz2 when expressed in spherical harmonics...
Definition: scalar_manip.C:276
void fixe_decroissance(int puis)
Substracts all the components behaving like in the external domain, with n strictly lower than puis ...
Definition: scalar_manip.C:352
void set_spectral_base(const Base_val &)
Sets the spectral bases of the Valeur va
Definition: scalar.C:803
Multi-domain grid.
Definition: grilles.h:279
Bases of the spectral expansions.
Definition: base_val.h:325
void import_anti_asymy(int nzet, const Scalar &ci)
Assignment to another Scalar defined on a different mapping, when the two mappings have anti-aligned ...
Scalar * p_dsdz
Pointer on of *this , where (0x0 if not up to date)
Definition: scalar.h:450
double & set_grid_point(int l, int k, int j, int i)
Setting the value of the field at a given grid point.
Definition: scalar.h:690
friend Scalar operator/(const Scalar &, const Scalar &)
Scalar / Scalar.
void filtre_phi(int n, int zone)
Sets the n lasts coefficients in to 0 in the domain zone .
Definition: scalar_manip.C:255
bool dz_nonzero() const
Returns true if the last domain is compactified and *this is not zero in this domain.
Definition: scalar.C:820
void sarra_filter_r(int lzmin, int lzmax, double p, double alpha=-1E-16)
Applies an exponential filter to the spectral coefficients in the radial direction.
const Scalar & srdsdt() const
Returns of *this .
Definition: scalar_deriv.C:145
virtual ~Scalar()
Destructor.
Definition: scalar.C:273
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 log10(const Cmp &)
Basis 10 logarithm.
Definition: cmp_math.C:325
void exp_filter_r_all_domains(Scalar &ss, int p, double alpha=-16.)
Applies an exponential filter in radial direction in all domains.
Scalar sol_elliptic_pseudo_1d(Param_elliptic &) const
Solves a pseudo-1d elliptic equation with *this as a source.
Definition: scalar_pde.C:433
Cmp acos(const Cmp &)
Arccosine.
Definition: cmp_math.C:172
Cmp abs(const Cmp &)
Absolute value.
Definition: cmp_math.C:413
friend Scalar log10(const Scalar &)
Basis 10 logarithm.
Definition: scalar_math.C:421
int etat
The logical state ETATNONDEF (undefined), ETATZERO (null), ETATUN (one), or ETATQCQ (ordinary)...
Definition: scalar.h:402
Scalar * p_stdsdp
Pointer on of *this (0x0 if not up to date)
Definition: scalar.h:435
Coefficients storage for the multi-domain spectral method.
Definition: mtbl_cf.h:196
const Scalar & dsdr() const
Returns of *this .
Definition: scalar_deriv.C:113
void import_symy(const Scalar &ci)
Assignment to another Scalar defined on a different mapping.
friend Tbl norme(const Scalar &)
Sums of the absolute values of all the values of the Scalar in each domain.
Definition: scalar_math.C:670
Scalar * p_dsdr
Pointer on of *this (0x0 if not up to date)
Definition: scalar.h:417
void div_sint()
Division by .
void div_rsint()
Division by everywhere; dzpuis is not changed.
Valeur ** asymptot(int n, const int flag=0) const
Asymptotic expansion at r = infinity.
Tbl tbl_out_bound(int l_dom, bool leave_ylm=false)
Returns the Tbl containing the values of angular coefficients at the outer boundary.
Definition: scalar_manip.C:436
Cmp operator-(const Cmp &)
- Cmp
Definition: cmp_arithm.C:111
void mult_rsint_dzpuis(int ced_mult_r)
Multiplication by but with the output flag dzpuis set to ced_mult_r .
Cmp sin(const Cmp &)
Sine.
Definition: cmp_math.C:72
Mtbl Heaviside(const Mtbl &)
Heaviside function.
Definition: mtbl_math.C:320
Basic array class.
Definition: tbl.h:164
Valeur & set_spectral_va()
Returns va (read/write version)
Definition: scalar.h:610
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: scalar.C:879
bool is_nan(bool verbose=false) const
Looks for NaNs (not a number) in the scalar field.
Definition: scalar.C:1014
void match_tau_star(Param &par_bc, Param *par_mat=0x0)
Method for matching accross domains and imposing boundary condition.
void match_collocation(Param &par_bc, Param *par_mat=0x0)
Method for matching accross domains and imposing boundary condition.
friend Scalar tan(const Scalar &)
Tangent.
Definition: scalar_math.C:139
friend Scalar abs(const Scalar &)
Absolute value.
Definition: scalar_math.C:526
Scalar poisson_dirichlet(const Valeur &limite, int num) const
Is identicall to Scalar::poisson() .
virtual void exponential_filter_ylm(int lzmin, int lzmax, int p, double alpha=-16.)
Applies an exponential filter to the spectral coefficients in the angular directions.
void match_tau_shell(Param &par_bc, Param *par_mat=0x0)
Method for matching accross domains and imposing boundary condition.
Scalar sol_elliptic_sin_zec(Param_elliptic &params, double *coefs, double *phases) const
General elliptic solver.
Definition: scalar_pde.C:366
void import_align_asymy(int nzet, const Scalar &ci)
Assignment to another Scalar defined on a different mapping, when the two mappings have aligned Carte...
void div_r_dzpuis(int ced_mult_r)
Division by r everywhere but with the output flag dzpuis set to ced_mult_r .
const Vector & derive_cov(const Metric &gam) const
Returns the gradient (1-form = covariant vector) of *this
Definition: scalar_deriv.C:390
void div_tant()
Division by .
void raccord_externe(int puis, int nbre, int lmax)
Matching of the external domain with the outermost shell.
void div_r_ced()
Division by r in the compactified external domain (CED), the dzpuis flag is not changed.
friend Scalar operator%(const Scalar &, const Scalar &)
Scalar * Scalar with desaliasing.
virtual void dec_dzpuis(int dec=1)
Decreases by dec units the value of dzpuis and changes accordingly the values of the Scalar in the co...
Scalar sol_elliptic_2d(Param_elliptic &) const
Solves the scalar 2-dimensional elliptic equation with *this as a source.
Definition: scalar_pde.C:412
void import_asymy(const Scalar &ci)
Assignment to another Scalar defined on a different mapping.
friend Scalar asin(const Scalar &)
Arcsine.
Definition: scalar_math.C:170
friend Scalar Heaviside(const Scalar &)
Heaviside function.
Definition: scalar_math.C:358
void mult_r_dzpuis(int ced_mult_r)
Multiplication by r everywhere but with the output flag dzpuis set to ced_mult_r ...
Tbl diffrelmax(const Cmp &a, const Cmp &b)
Relative difference between two Cmp (max version).
Definition: cmp_math.C:542
const Valeur & get_spectral_va() const
Returns va (read only version)
Definition: scalar.h:607
const Scalar & srstdsdp() const
Returns of *this .
Definition: scalar_deriv.C:177
Tbl & set(int l)
Read/write of the value in a given domain (configuration space).
Definition: valeur.h:373
Scalar poisson_tau() const
Solves the scalar Poisson equation with *this as a source using a real Tau method The source of the ...
Definition: scalar_pde.C:172
Scalar * p_dsdx
Pointer on of *this , where (0x0 if not up to date)
Definition: scalar.h:440