LORENE
map_af_dalembert.C
1 /*
2  * Copyright (c) 2000-2004 Jerome Novak
3  *
4  * This file is part of LORENE.
5  *
6  * LORENE is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * LORENE is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with LORENE; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  */
21 
22 
23 
24 
25 /*
26  * $Id: map_af_dalembert.C,v 1.19 2016/12/05 16:17:56 j_novak Exp $
27  * $Log: map_af_dalembert.C,v $
28  * Revision 1.19 2016/12/05 16:17:56 j_novak
29  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
30  *
31  * Revision 1.18 2014/10/13 08:53:02 j_novak
32  * Lorene classes and functions now belong to the namespace Lorene.
33  *
34  * Revision 1.17 2014/10/06 15:13:11 j_novak
35  * Modified #include directives to use c++ syntax.
36  *
37  * Revision 1.16 2008/08/27 08:55:31 jl_cornou
38  * Added R_JACO02 case
39  *
40  * Revision 1.15 2007/11/06 14:42:20 j_novak
41  * Copy of field at previous time-steps to local variables to deal with the
42  * dzpuis.
43  *
44  * Revision 1.14 2006/08/31 08:56:37 j_novak
45  * Added the possibility to have a shift in the quantum number l in the operator.
46  *
47  * Revision 1.13 2004/06/08 14:01:27 j_novak
48  * *** empty log message ***
49  *
50  * Revision 1.11 2004/03/04 15:15:48 e_gourgoulhon
51  * Treatment of case fj in state ETATZERO at the end.
52  *
53  * Revision 1.10 2004/03/01 13:30:28 j_novak
54  * Corrected some errors
55  *
56  * Revision 1.9 2004/03/01 09:57:03 j_novak
57  * the wave equation is solved with Scalars. It now accepts a grid with a
58  * compactified external domain, which the solver ignores and where it copies
59  * the values of the field from one time-step to the next.
60  *
61  * Revision 1.8 2003/07/22 13:24:48 j_novak
62  * *** empty log message ***
63  *
64  * Revision 1.7 2003/06/20 10:08:12 j_novak
65  * *** empty log message ***
66  *
67  * Revision 1.6 2003/06/20 09:27:10 j_novak
68  * Modif commentaires.
69  *
70  * Revision 1.5 2003/06/19 16:16:38 j_novak
71  * Parabolic approximation for a non flat dalembert operator
72  *
73  * Revision 1.4 2003/06/18 08:45:27 j_novak
74  * In class Mg3d: added the member get_radial, returning only a radial grid
75  * For dAlembert solver: the way the coefficients of the operator are defined has been changed.
76  *
77  * Revision 1.3 2002/01/03 15:30:28 j_novak
78  * Some comments modified.
79  *
80  * Revision 1.2 2002/01/02 14:07:57 j_novak
81  * Dalembert equation is now solved in the shells. However, the number of
82  * points in theta and phi must be the same in each domain. The solver is not
83  * completely tested (beta version!).
84  *
85  * Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon
86  * LORENE
87  *
88  * Revision 1.7 2001/10/16 10:04:22 novak
89  * cleaning (no more source terms for enhanced BC)
90  *
91  * Revision 1.6 2001/07/19 14:07:15 novak
92  * tentative for new outgoing boundary condition
93  *
94  * Revision 1.5 2000/12/04 15:01:34 novak
95  * *** empty log message ***
96  *
97  * Revision 1.4 2000/12/04 14:20:36 novak
98  * odd case enabled
99  *
100  * Revision 1.3 2000/11/27 14:54:51 novak
101  * 3D boundary conditions operational
102  *
103  * Revision 1.2 2000/10/24 16:18:34 novak
104  * Outgoing wave boundary conditions and addition of the Tbl coeff
105  *
106  * Revision 1.1 2000/10/19 14:17:39 novak
107  * Initial revision
108  *
109  *
110  * $Header: /cvsroot/Lorene/C++/Source/Map/map_af_dalembert.C,v 1.19 2016/12/05 16:17:56 j_novak Exp $
111  *
112  */
113 //Header C++
114 #include <cmath>
115 
116 // Header Lorene:
117 #include "tensor.h"
118 #include "param.h"
119 #include "proto.h"
120 
121 //**************************************************************************
122 
123 namespace Lorene {
124 
125 void Map_af::dalembert(Param& par, Scalar& fjp1, const Scalar& fj, const Scalar& fjm1,
126  const Scalar& source) const {
127 
128 
129  assert(source.get_etat() != ETATNONDEF) ;
130  assert(source.get_mp().get_mg() == mg) ;
131  assert(fj.get_etat() != ETATNONDEF) ;
132  assert(fj.get_mp().get_mg() == mg) ;
133  assert(fjm1.get_etat() != ETATNONDEF) ;
134  assert(fjm1.get_mp().get_mg() == mg) ;
135  assert(fjp1.get_mp().get_mg() == mg) ;
136 
137  assert(par.get_n_double() == 1) ;
138  assert(par.get_n_int() >= 1) ;
139  assert(par.get_n_int_mod() == 1) ;
140  int& nap = par.get_int_mod() ;
141  assert ((nap == 0) || (par.get_n_tbl_mod() > 1)) ;
142 
143  int nz = mg->get_nzone() ;
144  bool ced = (mg->get_type_r(nz-1) == UNSURR) ;
145  int nz0 = (ced ? nz - 1 : nz) ;
146  double dt = par.get_double() ;
147 
148  Scalar fj_local = fj ;
149  Scalar fjm1_local = fjm1 ;
150  if (ced) {
151  fj_local.annule_domain(nz-1) ;
152  fjm1_local.annule_domain(nz-1) ;
153  }
154  Scalar sigma = 2*fj_local - fjm1_local ; // The source (first part)
155 
156  // Coefficients
157  //-------------
158 
159  Tbl* coeff ;
160  if (nap == 0) {
161  coeff = new Tbl(12,nz);
162  coeff->set_etat_qcq() ;
163  par.add_tbl_mod(*coeff) ;
164  }
165  else
166  coeff= &par.get_tbl_mod() ;
167  Tbl a1(nz) ; a1 = 1 ; //Flat dalembertian
168  Tbl a2(nz) ; a2 = 0 ;
169  Tbl a3(nz) ; a3 = 0 ;
170 
171  if (par.get_n_tensor_mod() > 0) { // Metric in front of the dalembertian
172  assert(par.get_n_tensor_mod() == 1) ;
173  Scalar* metri = dynamic_cast<Scalar*>(&par.get_tensor_mod()) ;
174  assert(metri != 0x0) ;
175  assert (metri->get_etat() == ETATQCQ) ;
176 
177  const Map_af* tmap ; //Spherically symmetric grid and mapping
178  if (nap == 0) {
179  double* bornes = new double[nz+1] ;
180  bornes[0] = beta[0] ;
181  for (int i=0; i<nz; i++) bornes[i+1] = alpha[i] + beta[i] ;
182  tmap = new Map_af(*mg->get_radial() , bornes) ;
183  par.add_map(*tmap) ;
184  delete [] bornes ;
185  }
186  else {
187  tmap = dynamic_cast<const Map_af*>(&par.get_map()) ;
188  assert (tmap != 0x0) ;
189  }
190  metri->set_spectral_va().ylm() ;
191 
192  Scalar xmetr(*tmap) ; // l=0 part of the potential in front of the Laplacian
193  xmetr.set_etat_qcq() ;
194  xmetr.std_spectral_base() ;
195  xmetr.set_spectral_va().set_base_t(T_LEG_PP) ; // Only l=0 matters in any case...
196  xmetr.set_spectral_va().set_etat_cf_qcq() ;
197  Mtbl_cf* mt = xmetr.set_spectral_va().c_cf ;
198  mt->annule_hard() ;
199  for (int lz=0; lz<nz0; lz++)
200  for (int ir=0; ir<mg->get_nr(lz); ir++)
201  mt->set(lz,0,0,ir) = (*metri->get_spectral_va().c_cf)(lz, 0, 0, ir) ; //only l=0
202 
203  if (mg->get_nt(0) != 1) xmetr = xmetr / sqrt(double(2)) ;
204  xmetr.set_spectral_va().ylm_i() ;
205  xmetr.set_spectral_va().coef_i() ;
206  const Mtbl& erre = this->r ;
207 
208  a1.set_etat_qcq() ;
209  a2.set_etat_qcq() ;
210  a3.set_etat_qcq() ;
211  Scalar mime(*this) ;
212  mime.annule_hard() ;
213  for (int lz=0; lz<nz0; lz++) {
214  int nr = mg->get_nr(lz);
215  double r1 = erre(lz, 0, 0, nr-1) ;
216  double rm1 = erre(lz, 0, 0, 0) ;
217  double x1 = xmetr.val_grid_point(lz, 0, 0, nr-1) ;
218  double xm1 = xmetr.val_grid_point(lz, 0, 0, 0) ;
219 
220  if (mg->get_type_r(lz) == RARE) { //In the nucleus, no a2*r
221  a1.set(lz) = xm1 ;
222  a2.set(lz) = 0 ;
223  a3.set(lz) = (x1 - a1(lz)) / (r1 * r1);
224  }
225  else { // In the shells, general case
226  int i0 = (nr-1)/2 ;
227  double r0 = erre(lz, 0, 0, i0) ;
228  double x0 = xmetr.val_grid_point(lz, 0, 0, i0) ;
229  double p1 = (r1 - rm1)*(r1 - r0) ;
230  double pm1 = (r0 - rm1)*(r1 - rm1) ;
231  double p0 = (r0 - rm1)*(r1 - r0) ;
232  a1.set(lz) = xm1*r1*r0/pm1 + x1*rm1*r0/p1 - x0*rm1*r1/p0 ;
233  a2.set(lz) = x0*(rm1 + r1)/p0 - xm1*(r1 + r0)/pm1
234  - x1*(rm1 + r0)/p1 ;
235  a3.set(lz) = xm1/pm1+x1/p1-x0/p0 ;
236  }
237 
238  for (int k=0; k<mg->get_np(lz)+2; k++)
239  for (int j=0; j<mg->get_nt(lz); j++)
240  for (int i=0; i<nr; i++)
241  mime.set_grid_point(lz, k, j, i) = a1(lz) + erre(lz, 0, 0, i)*
242  (a2(lz) + erre(lz, 0, 0, i)*a3(lz)) ;
243 
244  Tbl diff = metri->domain(lz) - mime.domain(lz) ;
245  double offset = max(diff) ; // Not sure that this is really
246  a1.set(lz) += offset ; // necessary (supposed to ensure stability).
247  mime.set_domain(lz) += offset ;
248  }
249 
250  Scalar reste = (*metri - mime)*fj_local.laplacian() ;
251  if (ced) reste.annule_domain(nz-1) ;
252  sigma += (dt*dt)*(source + reste) ;
253  if (ced) sigma.annule_domain(nz-1) ;
254  sigma += (0.5*dt*dt)*mime*fjm1_local.laplacian() ; //Source (2nd part)
255  }
256  else {
257  sigma += (dt*dt) * source ;
258  if (ced) sigma.annule_domain(nz-1) ;
259  sigma += (0.5*dt*dt)*fjm1_local.laplacian() ;
260  if (par.get_n_int() > 1) { //there is a shift in the quantum number l
261  int dl = -1 ;
262  int l_min = par.get_int(1) ;
263  sigma.set_spectral_va().ylm() ;
264  Scalar tmp = fjm1_local ;
265  tmp.div_r() ; tmp.div_r() ; // f^(J-1) / r^2
266  tmp.set_spectral_va().ylm() ;
267  const Base_val& base = tmp.get_spectral_base() ;
268  int l_q, m_q, baser ;
269 
270  for (int lz=0; lz<nz-1; lz++) {
271  int nt = mg->get_nt(lz) ;
272  int np = mg->get_np(lz) ;
273  for (int k=0; k<np+2; k++)
274  for (int j=0; j<nt; j++) {
275  base.give_quant_numbers(lz, k, j, m_q, l_q, baser) ;
276  if ((nullite_plm(j, nt, k, np, base) == 1) && (l_q+dl >= l_min) ) {
277  for (int i=0; i<mg->get_nr(lz); i++) {
278  sigma.set_spectral_va().c_cf->set(lz, k, j, i) -=
279  0.5*dt*dt*dl*(2*l_q + dl +1)
280  *(*tmp.get_spectral_va().c_cf)(lz, k, j, i) ;
281  }
282  }
283  }
284  }
285  if (sigma.get_spectral_va().c != 0x0) {
286  delete sigma.set_spectral_va().c ;
287  sigma.set_spectral_va().c = 0x0 ;
288  }
289  }
290  }
291  if (ced) sigma.annule_domain(nz-1) ;
292 
293  //--------------------------------------------
294  // The operator reads
295  // Id - 0.5dt^2*(a1 + a2 r + a3 r^2)Laplacian
296  //--------------------------------------------
297  for (int i=0; i<nz; i++) {
298  coeff->set(1,i) = a1(i) ;
299  coeff->set(2,i) = a2(i) ;
300  coeff->set(3,i) = a3(i) ;
301  coeff->set(4,i) = 0. ;
302  coeff->set(5,i) = 0. ;
303  coeff->set(6,i) = 0. ;
304  coeff->set(7,i) = 0. ;
305  coeff->set(8,i) = 0. ;
306  coeff->set(9,i) = 0. ;
307  coeff->set(10,i) = beta[i] ;
308  coeff->set(11,i) = alpha[i] ;
309  }
310 
311  // Defining the boundary conditions
312  // --------------------------------
313  double R = this->val_r(nz0-1, 1., 0., 0.) ;
314  int nr = mg->get_nr(nz0-1) ;
315  int nt = mg->get_nt(nz0-1) ;
316  int np2 = mg->get_np(nz0-1) + 2;
317 
318  // For each pair of quantic numbers l, m one the result must satisfy
319  // bc1 * f_{l,m} (R) + bc2 * f_{l,m}'(R) = tbc3_{l,m}
320  // Memory is allocated for the parameter (par) at first call
321  double* bc1 ;
322  double* bc2 ;
323  Tbl* tbc3 ;
324  Tbl* phijm1 = 0x0 ;
325  Tbl* phij = 0x0 ;
326  if (nap == 0) {
327  bc1 = new double ;
328  bc2 = new double ;
329  tbc3 = new Tbl(np2,nt) ;
330  par.add_double_mod(*bc1,1) ;
331  par.add_double_mod(*bc2,2) ;
332  par.add_tbl_mod(*tbc3,1) ;
333  // Hereafter the enhanced outgoing-wave condition needs 2 auxiliary
334  // functions phij and phijm1 to define the evolution on the boundary
335  // surface (outer sphere).
336  if (par.get_int(0) == 2) {
337  phijm1 = new Tbl(np2,nt) ;
338  phij = new Tbl(np2,nt) ;
339  par.add_tbl_mod(*phijm1,2) ;
340  par.add_tbl_mod(*phij,3) ;
341  phij->annule_hard() ;
342  phijm1->annule_hard() ;
343  }
344  nap = 1 ;
345  }
346  else {
347  bc1 = &par.get_double_mod(1) ;
348  bc2 = &par.get_double_mod(2) ;
349  tbc3 = &par.get_tbl_mod(1) ;
350  if (par.get_int(0) == 2) {
351  phijm1 = &par.get_tbl_mod(2) ;
352  phij = &par.get_tbl_mod(3) ;
353  }
354  }
355  switch (par.get_int(0)) {
356  case 0: // Homogeneous boundary conditions (f(t,r=R) =0)
357  *bc1 = 1 ;
358  *bc2 = 0 ;
359 
360  *tbc3 = 0 ;
361 
362  break ;
363  case 1: { // Outgoing wave condition (f(t,r) = 1/r S(t-r/c))
364  Valeur bound3(mg) ;
365  bound3 = R*(4*fj_local.get_spectral_va() - fjm1_local.get_spectral_va()) ;
366  if (bound3.get_etat() == ETATZERO) {
367  *bc1 = 3*R + 2*dt ;
368  *bc2 = 2*R*dt ;
369  *tbc3 = 0 ;
370  }
371  else {
372  if (nz0>1) bound3.annule(0,nz0-2) ;
373 
374  bound3.coef() ;
375  bound3.ylm() ;
376 
377  *bc1 = 3*R + 2*dt ;
378  *bc2 = 2*R*dt ;
379 
380  tbc3->set_etat_qcq() ;
381  double val ;
382  for (int k=0; k<np2; k++)
383  for (int j=0; j<nt; j++) {
384  val = 0. ;
385  for (int i=0; i<nr; i++)
386  val += (*bound3.c_cf)(nz0-1,k,j,i) ;
387  tbc3->set(k,j) = val ;
388  }
389  }
390  break ;
391  }
392  /******************************************************************
393  * Enhanced outgoing wave condition.
394  * Time integration of the wave equation on the sphere for the
395  * auxiliary function phij.
396  *****************************************************************/
397  case 2: {
398  Valeur souphi(mg) ;
399  souphi = fj_local.get_spectral_va()/R - fj_local.dsdr().get_spectral_va() ;
400  if (nz0>1) souphi.annule(0,nz0-2) ;
401  souphi.coef() ;
402  souphi.ylm() ;
403 
404  bool zero = (souphi.get_etat() == ETATZERO) ;
405  if (zero) {
406  Base_val base_ref(mg->std_base_scal()) ; //## Maybe not good...
407  base_ref.dsdx() ;
408  base_ref.ylm() ;
409  souphi.set_base(base_ref) ;
410  }
411 
412  int l_s, m_s, base_r ;
413  double val ;
414  int dl = (par.get_n_int() > 1) ? -1 : 0 ;
415  for (int k=0; k<np2; k++) {
416  for (int j=0; j<nt; j++) {
417  donne_lm(nz, nz0-1, j, k, souphi.base, m_s, l_s, base_r) ;
418  l_s += dl ;
419  val = 0. ;
420  if (!zero)
421  val = -4*dt*dt*l_s*(l_s+1)*souphi.c_cf->val_out_bound_jk(nz0-1, j, k) ;
422  double multi = 8*R*R + dt*dt*(6+3*l_s*(l_s+1)) + 12*R*dt ;
423  val = ( 16*R*R*(*phij)(k,j) -
424  (multi-24*R*dt)*(*phijm1)(k,j)
425  + val)/multi ;
426  phijm1->set(k,j) = (*phij)(k,j) ;
427  phij->set(k,j) = val ;
428  }
429  }
430  Valeur bound3(mg) ;
431  *bc1 = 3*R + 2*dt ;
432  *bc2 = 2*R*dt ;
433  bound3 = R*(4*fj_local.get_spectral_va() - fjm1_local.get_spectral_va()) ;
434  if (bound3.get_etat() == ETATZERO) *tbc3 = 0 ;
435  else {
436  if (nz0 > 1) bound3.annule(0,nz0-2) ;
437  bound3.coef() ;
438  bound3.ylm() ;
439  tbc3->set_etat_qcq() ;
440  for (int k=0; k<np2; k++)
441  for (int j=0; j<nt; j++) {
442  val = 0. ;
443  for (int i=0; i<nr; i++)
444  val += (*bound3.c_cf)(nz0-1,k,j,i) ;
445  tbc3->set(k,j) = val + 2*R*dt*(*phij)(k,j);
446  }
447  }
448  break ;
449  }
450  default:
451  cout << "ERROR: Map_af::dalembert" << endl ;
452  cout << "The boundary condition par.get_int(0) = "<< par.get_int(0)
453  << " is unknown!" << endl ;
454  abort() ;
455  }
456 
457  if (sigma.get_etat() == ETATZERO) {
458  fjp1.set_etat_zero() ;
459  return ;
460  }
461 
462  // Spherical harmonic expansion of the source
463  // ------------------------------------------
464  Valeur& sourva = sigma.set_spectral_va() ;
465 
466  // Spectral coefficients of the source
467  assert(sourva.get_etat() == ETATQCQ) ;
468  sourva.ylm() ; // spherical harmonic transforms
469 
470  // Final result returned as a Scalar
471  // ------------------------------
472  fjp1.set_etat_zero() ; // to call Scalar::del_t().
473  fjp1.set_etat_qcq() ;
474 
475  // Call to the Mtbl_cf version
476  // ---------------------------
477  fjp1.set_spectral_va() = sol_dalembert(par, *this, *(sourva.c_cf) ) ;
478  fjp1.set_spectral_va().ylm_i() ; // Back to standard basis.
479 
480  if (ced) {
481  if (fj.get_etat() == ETATZERO) {
482  fjp1.annule_domain(nz-1) ;
483  }
484  else {
485  fjp1.set_domain(nz-1) = fj.domain(nz-1) ;
486  }
487  fjp1.set_dzpuis(fj.get_dzpuis()) ;
488  }
489 }
490 
491 }
const Base_val & get_spectral_base() const
Returns the spectral bases of the Valeur va.
Definition: scalar.h:1328
void add_tbl_mod(Tbl &ti, int position=0)
Adds the address of a new modifiable Tbl to the list.
Definition: param.C:594
void annule_domain(int l)
Sets the Tensor to zero in a given domain.
Definition: tensor.C:675
Mtbl_cf * c_cf
Coefficients of the spectral expansion of the function.
Definition: valeur.h:312
double & get_double_mod(int position=0) const
Returns the reference of a stored modifiable double .
Definition: param.C:501
void ylm_i()
Inverse of ylm()
Definition: valeur_ylm_i.C:134
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
Definition: grilles.h:479
void set_etat_cf_qcq()
Sets the logical state to ETATQCQ (ordinary state) for values in the configuration space (Mtbl_cf c_c...
Definition: valeur.C:715
void coef() const
Computes the coeffcients of *this.
Definition: valeur_coef.C:151
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 give_quant_numbers(int, int, int, int &, int &, int &) const
Computes the various quantum numbers and 1d radial base.
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
double * alpha
Array (size: mg->nzone ) of the values of in each domain.
Definition: map.h:2054
Lorene prototypes.
Definition: app_hor.h:67
Tbl & set(int l)
Read/write of the Tbl containing the coefficients in a given domain.
Definition: mtbl_cf.h:304
void ylm()
Computes the coefficients of *this.
Definition: valeur_ylm.C:141
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
Definition: map.h:783
const Scalar & laplacian(int ced_mult_r=4) const
Returns the Laplacian of *this.
Definition: scalar_deriv.C:436
double & set(int i)
Read/write of a particular element (index i) (1D case)
Definition: tbl.h:301
Tensor field of valence 0 (or component of a tensorial field).
Definition: scalar.h:393
void coef_i() const
Computes the physical value of *this.
virtual double val_r(int l, double xi, double theta, double pphi) const
Returns the value of the radial coordinate r for a given in a given domain.
Definition: map_af_radius.C:99
void dsdx()
The basis is transformed as with a operation.
const Map & get_map(int position=0) const
Returns the reference of a Map stored in the list.
Definition: param.C:1259
const Mg3d * get_radial() const
Returns the pointer on the associated radial grid.
Definition: mg3d.C:649
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
Values and coefficients of a (real-value) function.
Definition: valeur.h:297
int get_etat() const
Returns the logical state ETATNONDEF (undefined), ETATZERO (null) or ETATQCQ (ordinary).
Definition: scalar.h:560
void annule(int l)
Sets the Valeur to zero in a given domain.
Definition: valeur.C:747
virtual void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Definition: scalar.C:359
void set_base(const Base_val &)
Sets the bases for spectral expansions (member base )
Definition: valeur.C:813
Tbl & set_domain(int l)
Read/write of the value in a given domain.
Definition: scalar.h:621
virtual void dalembert(Param &par, Scalar &fJp1, const Scalar &fJ, const Scalar &fJm1, const Scalar &source) const
Performs one time-step integration of the d&#39;Alembert scalar equation.
void set_dzpuis(int)
Modifies the dzpuis flag.
Definition: scalar.C:814
void add_double_mod(double &x, int position=0)
Adds the address of a new modifiable double to the list.
Definition: param.C:456
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
double val_out_bound_jk(int l, int j, int k) const
Computes the angular coefficient of index j,k of the field represented by *this at by means of the s...
void annule_hard()
Sets the Scalar to zero in a hard way.
Definition: scalar.C:386
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Definition: tbl.C:364
int get_etat() const
Returns the logical state.
Definition: valeur.h:760
void div_r()
Division by r everywhere; dzpuis is not changed.
Tensor & get_tensor_mod(int position=0) const
Returns the reference of a modifiable Tensor stored in the list.
Definition: param.C:1603
int get_n_double() const
Returns the number of stored double &#39;s addresses.
Definition: param.C:311
int get_n_int() const
Returns the number of stored int &#39;s addresses.
Definition: param.C:242
const int & get_int(int position=0) const
Returns the reference of a int stored in the list.
Definition: param.C:295
Map_af(const Mg3d &mgrille, const double *r_limits)
Standard Constructor.
Definition: map_af.C:216
void add_map(const Map &mi, int position=0)
Adds the address of a new Map to the list.
Definition: param.C:1214
Base_val base
Bases on which the spectral expansion is performed.
Definition: valeur.h:315
int get_n_tensor_mod() const
Returns the number of modifiable Tensor &#39;s addresses in the list.
Definition: param.C:1551
int get_dzpuis() const
Returns dzpuis.
Definition: scalar.h:563
Mtbl * c
Values of the function at the points of the multi-grid.
Definition: valeur.h:309
Parameter storage.
Definition: param.h:125
Tbl & get_tbl_mod(int position=0) const
Returns the reference of a modifiable Tbl stored in the list.
Definition: param.C:639
double * beta
Array (size: mg->nzone ) of the values of in each domain.
Definition: map.h:2056
int get_nzone() const
Returns the number of domains.
Definition: grilles.h:465
int & get_int_mod(int position=0) const
Returns the reference of a modifiable int stored in the list.
Definition: param.C:433
Tbl max(const Cmp &)
Maximum values of a Cmp in each domain.
Definition: cmp_math.C:438
int get_n_int_mod() const
Returns the number of modifiable int &#39;s addresses in the list.
Definition: param.C:381
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
Definition: grilles.h:469
const Mg3d * mg
Pointer on the multi-grid Mgd3 on which this is defined.
Definition: map.h:694
int get_n_tbl_mod() const
Returns the number of modifiable Tbl &#39;s addresses in the list.
Definition: param.C:587
Bases of the spectral expansions.
Definition: base_val.h:325
Base_val std_base_scal() const
Returns the standard spectral bases for a scalar.
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
void annule_hard()
Sets the Mtbl_cf to zero in a hard way.
Definition: mtbl_cf.C:315
Affine radial mapping.
Definition: map.h:2048
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 set_base_t(int base_t)
Sets the expansion basis for functions in all domains.
Definition: valeur.C:852
const double & get_double(int position=0) const
Returns the reference of a double stored in the list.
Definition: param.C:364
Basic array class.
Definition: tbl.h:164
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
Definition: grilles.h:474
Valeur & set_spectral_va()
Returns va (read/write version)
Definition: scalar.h:610
int get_type_r(int l) const
Returns the type of sampling in the radial direction in domain no.
Definition: grilles.h:491
const Map & get_mp() const
Returns the mapping.
Definition: tensor.h:874
void annule_hard()
Sets the Tbl to zero in a hard way.
Definition: tbl.C:375
const Valeur & get_spectral_va() const
Returns va (read only version)
Definition: scalar.h:607
#define T_LEG_PP
fct. de Legendre associees paires avec m pair
Definition: type_parite.h:218
Coord r
r coordinate centered on the grid
Definition: map.h:736