LORENE
et_rot_mag_mag_plus.C
1/*
2 * Computes magnetic fields and derived quantities for rotating equilibrium
3 *
4 * (see file et_rot_mag.h for documentation)
5 *
6 */
7
8/*
9 * Copyright (c) 2002 Emmanuel Marcq
10 * Copyright (c) 2002 Jerome Novak
11 *
12 * This file is part of LORENE.
13 *
14 * LORENE is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * LORENE is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with LORENE; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 *
28 */
29
30
31
32/*
33 * $Id: et_rot_mag_mag_plus.C,v 1.4 2016/12/05 16:17:54 j_novak Exp $
34 * $Log: et_rot_mag_mag_plus.C,v $
35 * Revision 1.4 2016/12/05 16:17:54 j_novak
36 * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
37 *
38 * Revision 1.3 2014/10/13 08:52:58 j_novak
39 * Lorene classes and functions now belong to the namespace Lorene.
40 *
41 * Revision 1.2 2014/10/06 15:13:09 j_novak
42 * Modified #include directives to use c++ syntax.
43 *
44 * Revision 1.1 2012/08/12 17:48:35 p_cerda
45 * Magnetstar: New classes for magnetstar. Allowing for non-equatorial symmetry in Etoile et al. Adding B_phi in Et_rot_mag.
46 *
47 * Revision 1.14 2005/06/03 15:31:56 j_novak
48 * Better computation when more than one point in phi.
49 *
50 * Revision 1.13 2003/10/03 15:58:47 j_novak
51 * Cleaning of some headers
52 *
53 * Revision 1.12 2002/09/09 13:00:39 e_gourgoulhon
54 * Modification of declaration of Fortran 77 prototypes for
55 * a better portability (in particular on IBM AIX systems):
56 * All Fortran subroutine names are now written F77_* and are
57 * defined in the new file C++/Include/proto_f77.h.
58 *
59 * Revision 1.11 2002/06/05 15:15:59 j_novak
60 * The case of non-adapted mapping is treated.
61 * parmag.d and parrot.d have been merged.
62 *
63 * Revision 1.10 2002/06/03 13:23:16 j_novak
64 * The case when the mapping is not adapted is now treated
65 *
66 * Revision 1.9 2002/06/03 13:00:45 e_marcq
67 *
68 * conduc parameter read in parmag.d
69 *
70 * Revision 1.7 2002/05/20 10:31:59 j_novak
71 * *** empty log message ***
72 *
73 * Revision 1.6 2002/05/17 15:08:01 e_marcq
74 *
75 * Rotation progressive plug-in, units corrected, Q and a_j new member data
76 *
77 * Revision 1.5 2002/05/16 10:02:09 j_novak
78 * Errors in stress energy tensor corrected
79 *
80 * Revision 1.4 2002/05/15 09:54:00 j_novak
81 * First operational version
82 *
83 * Revision 1.3 2002/05/14 13:38:36 e_marcq
84 *
85 *
86 * Unit update, new outputs
87 *
88 * Revision 1.1 2002/05/10 09:26:52 j_novak
89 * Added new class Et_rot_mag for magnetized rotating neutron stars (under development)
90 *
91 *
92 * $Header: /cvsroot/Lorene/C++/Source/Etoile/et_rot_mag_mag_plus.C,v 1.4 2016/12/05 16:17:54 j_novak Exp $
93 *
94 */
95
96// Headers C
97#include <cstdlib>
98#include <cmath>
99
100// Headers Lorene
101#include "et_rot_mag.h"
102#include "utilitaires.h"
103#include "param.h"
104#include "proto_f77.h"
105#include "graphique.h"
106#include "unites.h"
107
108namespace Lorene {
109
110// Algo du papier de 1995
111
112 using namespace Unites ;
113
114void Et_rot_mag::magnet_comput_plus(const int adapt_flag,
115 const int initial_j,
116 const Tbl an_j,
117 Cmp (*f_j)(const Cmp&, const Tbl),
118 const Tbl bn_j,
119 Cmp (*g_j)(const Cmp&, const Tbl),
120 Cmp (*N_j)(const Cmp&, const Tbl),
121 Param& par_poisson_At,
122 Param& par_poisson_Avect){
123 double relax_mag = 1.0 ;
124
125 int Z = mp.get_mg()->get_nzone();
126
127 if(is_conduct()) {
128 bool adapt(adapt_flag) ;
129 /****************************************************************
130 * Assertion that all zones have same number of points in theta
131 ****************************************************************/
132 int nt = mp.get_mg()->get_nt(nzet-1) ;
133 for (int l=0; l<Z; l++) assert(mp.get_mg()->get_nt(l) == nt) ;
134
135 Tbl Rsurf(nt) ;
136 Rsurf.set_etat_qcq() ;
137 mp.r.fait() ;
138 mp.tet.fait() ;
139 Mtbl* theta = mp.tet.c ;
140 const Map_radial* mpr = dynamic_cast<const Map_radial*>(&mp) ;
141 assert (mpr != 0x0) ;
142 for (int j=0; j<nt; j++)
143 Rsurf.set(j) = mpr->val_r_jk(l_surf()(0,j), xi_surf()(0,j), j, 0) ;
144
145
146 // Calcul de A_0t dans l'etoile (conducteur parfait)
147
148 Cmp A_0t(- omega * A_phi) ;
149 A_0t.annule(nzet,Z-1) ;
150
151 Tenseur ATTENS(A_t) ;
152 Tenseur APTENS(A_phi) ;
153 Tenseur BMN(-logn) ;
154 BMN = BMN + log(bbb) ;
155 BMN.set_std_base() ;
156
157
159 nphi.gradient_spher())());
161 nphi.gradient_spher())()) ;
163 BMN.gradient_spher())()
165 BMN.gradient_spher())()) ;
166
167 Cmp ATANT(A_phi.srdsdt()); // Constrction par copie pour mapping
168
169 ATANT.va = ATANT.va.mult_ct().ssint() ;
170
171 Cmp ttnphi(tnphi()) ;
172 ttnphi.mult_rsint() ;
173 Cmp BLAH(- b_car()/(nnn()*nnn())*ttnphi*grad1) ;
174 BLAH -= (1+b_car()/(nnn()*nnn())*tnphi()*tnphi())*grad2 ;
175 Cmp nphisr(nphi()) ;
176 nphisr.div_r() ;
177 Cmp npgrada(2*nphisr*(A_phi.dsdr()+ATANT )) ;
178 npgrada.inc2_dzpuis() ;
179 BLAH -= grad3 + npgrada ;
180 Cmp gtt(-nnn()*nnn()+b_car()*tnphi()*tnphi()) ;
181 Cmp gtphi( - b_car()*ttnphi) ;
182
183 // Calcul de j_t grace a Maxwell-Gauss
184 Cmp tmp(((BLAH - A_0t.laplacien())/a_car() - gtphi*j_phi)
185 / gtt);
186 tmp.annule(nzet, Z-1) ;
187 if (adapt) {
188 j_t = tmp ;
189 }
190 else {
191 j_t.allocate_all() ;
192 for (int j=0; j<nt; j++)
193 for (int l=0; l<nzet; l++)
194 for (int i=0; i<mp.get_mg()->get_nr(l); i++)
195 j_t.set(l,0,j,i) = ( (*mp.r.c)(l,0,j,i) > Rsurf(j) ?
196 0. : tmp(l,0,j,i) ) ;
197 j_t.annule(nzet,Z-1) ;
198 }
199 j_t.std_base_scal() ;
200
201 // Calcul du courant j_phi
202
203 Tbl maxA_phi = max(abs(A_phi));
204
205 if (maxA_phi.set(0) == 0) {
206
207 cout << "Initializing j_phi" << endl;
208
209 double aini = 0.;
210 int nd = an_j.get_dim(0);
211 for (int i=0; i<nd - 4;i++){
212 aini = aini + fabs(an_j(i));
213 }
214 aini = aini + fabs (an_j(3)) + fabs (an_j(5));
215 double bini = 0.;
216 nd = bn_j.get_dim(0);
217 for (int i=0; i<nd;i++){
218 bini = bini + fabs(bn_j(i));
219 }
220
221 switch (initial_j) {
222 case 0 :
223 j_phi = (ener() + press())*aini + bini ;
224 j_phi.std_base_scal() ;
225 j_phi.annule(nzet,Z-1) ;
226 j_phi.std_base_scal() ;
227 break;
228
229 case 1 :
230 j_phi = (ener() + press())*aini + bini;
231 j_phi.std_base_scal() ;
232 j_phi.mult_rsint();
233 j_phi.annule(nzet,Z-1) ;
234 j_phi.std_base_scal() ;
235 break;
236
237 case 2 :
238 j_phi = (ener() + press())*aini + bini ;
239 j_phi.std_base_scal() ;
240 j_phi.mult_cost();
241 j_phi.mult_rsint();
242 j_phi.set_dzpuis(2);
243 j_phi.mult_r();
244 j_phi.annule(nzet,Z-1) ;
245 j_phi.std_base_scal() ;
246 break;
247
248 default :
249 cout << "ERROR" << endl;
250 cout << "initial_j = " << initial_j << endl;
251 abort();
252 }
253
254
255 }else{
256
257
258
259 double maxA_phi_surf = 0.;
260 for (int j = 0; j < nt ; j++ ) {
261 // double maxA_phi_surf_tmp = fabs(A_phi(nzet-1,0,j,mp.get_mg()->get_nr(nzet-1)-1));
262 double maxA_phi_surf_tmp = fabs(A_phi(nzet,0,j,0));
263 maxA_phi_surf= max(maxA_phi_surf, maxA_phi_surf_tmp);
264 }
265
266 Cmp A_phi_scaled = A_phi / maxA_phi.set(0);
267 Cmp A_phi_scaled2 = (A_phi - maxA_phi_surf)/ maxA_phi.set(0);
268
269 A_phi_scaled2.allocate_all() ;
270 for (int j=0; j<nt; j++) {
271 for (int l=0; l<Z; l++) {
272 for (int i=0; i<mp.get_mg()->get_nr(l); i++) {
273 if (A_phi_scaled2(l,0,j,i) < 0.) {
274 A_phi_scaled2.set(l,0,j,i) = 0 ;
275 }
276 }
277 }
278 }
279 A_phi_scaled2.std_base_scal() ;
280
281
282 Cmp j_phi_ff = g_j (A_phi_scaled2, bn_j)/maxA_phi.set(0);
283 //Cmp j_phi_ff = A_phi_scaled ;
284 j_phi_ff.std_base_scal() ;
285 j_phi_ff.div_rsint();
286 j_phi_ff.div_rsint();
287 j_phi_ff = j_phi_ff / b_car() / nnn() / nnn();
288
289 j_phi = omega * j_t
290 + (ener() + press())*f_j(A_phi_scaled, an_j)/maxA_phi.set(0)/g_si
291 + j_phi_ff;
292
293 j_phi.annule(nzet,Z-1) ;
294 j_phi.std_base_scal() ;
295
296
297
298 B_phi = N_j (A_phi_scaled2, bn_j);
299 B_phi.std_base_scal() ;
300 B_phi = B_phi / nnn();
301
302
303
304 }
305 // des_coupe_y(A_phi, 0., nzet, "Magnetic field") ;
306 // des_coupe_y(j_phi, 0., nzet, "Current",0x0,1.2,true,30) ;
307
308 // Resolution de Maxwell Ampere (-> A_phi)
309 // Calcul des termes sources avec A-t du pas precedent.
310
312 BMN.gradient_spher())());
313
314 Tenseur source_tAphi(mp, 1, CON, mp.get_bvect_spher()) ;
315
316 source_tAphi.set_etat_qcq() ;
317 Cmp tjphi(j_phi) ;
318 tjphi.mult_rsint() ;
319 Cmp tgrad1(grad1) ;
320 tgrad1.mult_rsint() ;
321 Cmp d_grad4(grad4) ;
322 d_grad4.div_rsint() ;
323 source_tAphi.set(0)=0 ;
324 source_tAphi.set(1)=0 ;
325 source_tAphi.set(2)= -b_car()*a_car()*(tjphi-tnphi()*j_t)
326 + b_car()/(nnn()*nnn())*(tgrad1+tnphi()*grad2)+d_grad4 ;
327
328 source_tAphi.change_triad(mp.get_bvect_cart());
329
330 Tenseur WORK_VECT(mp, 1, CON, mp.get_bvect_cart()) ;
331 WORK_VECT.set_etat_qcq() ;
332 for (int i=0; i<3; i++) {
333 WORK_VECT.set(i) = 0 ;
334 }
335 Tenseur WORK_SCAL(mp) ;
336 WORK_SCAL.set_etat_qcq() ;
337 WORK_SCAL.set() = 0 ;
338
339 double lambda_mag = 0. ; // No 3D version !
340
341 Tenseur AVECT(source_tAphi) ;
342 if (source_tAphi.get_etat() != ETATZERO) {
343
344 for (int i=0; i<3; i++) {
345 if(source_tAphi(i).dz_nonzero()) {
346 assert( source_tAphi(i).get_dzpuis() == 4 ) ;
347 }
348 else{
349 (source_tAphi.set(i)).set_dzpuis(4) ;
350 }
351 }
352
353 }
354 source_tAphi.poisson_vect(lambda_mag, par_poisson_Avect, AVECT, WORK_VECT,
355 WORK_SCAL) ;
356 AVECT.change_triad(mp.get_bvect_spher());
357 Cmp A_phi_n(AVECT(2));
358 A_phi_n.mult_rsint() ;
359
360 // Resolution de Maxwell-Ampere : A_1
361
362 Cmp source_A_1t(-a_car()*(j_t*gtt + j_phi*gtphi) + BLAH);
363
364 Cmp A_1t(mp);
365 A_1t = 0 ;
366 source_A_1t.poisson(par_poisson_At, A_1t) ;
367
368 int L = mp.get_mg()->get_nt(0);
369
370 Tbl MAT(L,L) ;
371 Tbl MAT_PHI(L,L);
372 Tbl VEC(L) ;
373
374 MAT.set_etat_qcq() ;
375 VEC.set_etat_qcq() ;
376 MAT_PHI.set_etat_qcq() ;
377
378 Tbl leg(L,2*L) ;
379 leg.set_etat_qcq() ;
380
381 Cmp psi(mp);
382 Cmp psi2(mp);
383 psi.allocate_all() ;
384 psi2.allocate_all() ;
385
386 for (int p=0; p<mp.get_mg()->get_np(0); p++) {
387 // leg[k,l] : legendre_l(cos(theta_k))
388 // Construction par recurrence de degre 2
389 for(int k=0;k<L;k++){
390 for(int l=0;l<2*L;l++){
391
392 if(l==0) leg.set(k,l)=1. ;
393 if(l==1) leg.set(k,l)=cos((*theta)(l_surf()(p,k),p,k,0)) ;
394 if(l>=2) leg.set(k,l) = double(2*l-1)/double(l)
395 * cos((*theta)(l_surf()(p,k),p,k,0))
396 * leg(k,l-1)-double(l-1)/double(l)*leg(k,l-2) ;
397 }
398 }
399
400 for(int k=0;k<L;k++){
401
402 // Valeurs a la surface trouvees via va.val_point_jk(l,xisurf,k,p)
403
404 VEC.set(k) = A_0t.va.val_point_jk(l_surf()(p,k), xi_surf()(p,k), k, p)
405 -A_1t.va.val_point_jk(l_surf()(p,k), xi_surf()(p,k), k, p);
406
407 for(int l=0;l<L;l++) MAT.set(l,k) = leg(k,2*l)/pow(Rsurf(k),2*l+1);
408
409 }
410 // appel fortran :
411
412 int* IPIV=new int[L] ;
413 int INFO ;
414
415 Tbl MAT_SAVE(MAT) ;
416 Tbl VEC2(L) ;
417 VEC2.set_etat_qcq() ;
418 int un = 1 ;
419
420 F77_dgesv(&L, &un, MAT.t, &L, IPIV, VEC.t, &L, &INFO) ;
421
422 // coeffs a_l dans VEC
423
424 for(int k=0;k<L;k++) {VEC2.set(k)=1. ; }
425
426 F77_dgesv(&L, &un, MAT_SAVE.t, &L, IPIV, VEC2.t, &L, &INFO) ;
427
428 delete [] IPIV ;
429
430 for(int nz=0;nz < Z; nz++){
431 for(int i=0;i< mp.get_mg()->get_nr(nz);i++){
432 for(int k=0;k<L;k++){
433 psi.set(nz,p,k,i) = 0. ;
434 psi2.set(nz,p,k,i) = 0. ;
435 for(int l=0;l<L;l++){
436 psi.set(nz,p,k,i) += VEC(l)*leg(k,2*l) /
437 pow((*mp.r.c)(nz,p,k,i),2*l+1);
438 psi2.set(nz,p,k,i) += VEC2(l)*leg(k,2*l)/
439 pow((*mp.r.c)(nz, p, k,i),2*l+1);
440 }
441 }
442 }
443 }
444 }
445 psi.std_base_scal() ;
446 psi2.std_base_scal() ;
447
448 assert(psi.get_dzpuis() == 0) ;
449 int dif = A_1t.get_dzpuis() ;
450 if (dif > 0) {
451 for (int d=0; d<dif; d++) A_1t.dec_dzpuis() ;
452 }
453
454 if (adapt) {
455 Cmp A_t_ext(A_1t + psi) ;
456 A_t_ext.annule(0,nzet-1) ;
457 A_0t += A_t_ext ;
458 }
459 else {
460 tmp = A_0t ;
461 A_0t.allocate_all() ;
462 for (int j=0; j<nt; j++)
463 for (int l=0; l<Z; l++)
464 for (int i=0; i<mp.get_mg()->get_nr(l); i++)
465 A_0t.set(l,0,j,i) = ( (*mp.r.c)(l,0,j,i) > Rsurf(j) ?
466 A_1t(l,0,j,i) + psi(l,0,j,i) : tmp(l,0,j,i) ) ;
467 }
468 A_0t.std_base_scal() ;
469
470 Valeur** asymp = A_0t.asymptot(1) ;
471
472 double Q_0 = -4*M_PI*(*asymp[1])(Z-1,0,0,0) ; // utilise A_0t plutot que E
473 delete asymp[0] ;
474 delete asymp[1] ;
475
476 delete [] asymp ;
477
478 asymp = psi2.asymptot(1) ;
479
480 double Q_2 = -4*M_PI*(*asymp[1])(Z-1,0,0,0) ; // A_2t = psi2 a l'infini
481 delete asymp[0] ;
482 delete asymp[1] ;
483
484 delete [] asymp ;
485
486 // solution definitive de A_t:
487
488 double C = (Q-Q_0)/Q_2 ;
489
490 assert(psi2.get_dzpuis() == 0) ;
491 dif = A_0t.get_dzpuis() ;
492 if (dif > 0) {
493 for (int d=0; d<dif; d++) A_0t.dec_dzpuis() ;
494 }
495 Cmp A_t_n(mp) ;
496 if (adapt) {
497 A_t_n = A_0t + C ;
498 Cmp A_t_ext(A_0t + C*psi2) ;
499 A_t_ext.annule(0,nzet-1) ;
500 A_t_n.annule(nzet,Z-1) ;
501 A_t_n += A_t_ext ;
502 }
503 else {
504 A_t_n.allocate_all() ;
505 for (int j=0; j<nt; j++)
506 for (int l=0; l<Z; l++)
507 for (int i=0; i<mp.get_mg()->get_nr(l); i++)
508 A_t_n.set(l,0,j,i) = ( (*mp.r.c)(l,0,j,i) > Rsurf(j) ?
509 A_0t(l,0,j,i) + C*psi2(l,0,j,i) :
510 A_0t(l,0,j,i) + C ) ;
511 }
512 A_t_n.std_base_scal() ;
513
514 asymp = A_t_n.asymptot(1) ;
515
516 delete asymp[0] ;
517 delete asymp[1] ;
518
519 delete [] asymp ;
520 A_t = relax_mag*A_t_n + (1.-relax_mag)*A_t ;
521 A_phi = relax_mag*A_phi_n + (1. - relax_mag)*A_phi ;
522
523
524 }else{
525 cout << "not implemented" << endl;
526 abort();
527
528 }
529
530
531}
532
533
534
535
536
537
538
539
540
541
542
543
544
545}
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Definition cmp.h:446
void mult_rsint()
Multiplication by .
void allocate_all()
Sets the logical state to ETATQCQ (ordinary state) and performs the memory allocation of all the elem...
Definition cmp.C:326
void div_r()
Division by r everywhere.
Definition cmp_r_manip.C:81
void dec_dzpuis()
Decreases by 1 the value of dzpuis and changes accordingly the values of the Cmp in the external comp...
Valeur va
The numerical value of the Cmp.
Definition cmp.h:464
void std_base_scal()
Sets the spectral bases of the Valeur va to the standard ones for a scalar.
Definition cmp.C:647
void annule(int l)
Sets the Cmp to zero in a given domain.
Definition cmp.C:351
const Cmp & laplacien(int zec_mult_r=4) const
Returns the Laplacian of *this.
Definition cmp_deriv.C:245
int get_dzpuis() const
Returns dzpuis.
Definition cmp.h:903
void inc2_dzpuis()
Increases by 2 the value of dzpuis and changes accordingly the values of the Cmp in the external comp...
Tbl & set(int l)
Read/write of the value in a given domain.
Definition cmp.h:724
Valeur ** asymptot(int n, const int flag=0) const
Asymptotic expansion at r = infinity.
void div_rsint()
Division by .
Cmp poisson() const
Solves the scalar Poisson equation with *this as a source.
Definition cmp_pde.C:97
Cmp j_phi
-component of the current 4-vector
Definition et_rot_mag.h:159
Cmp A_phi
-component of the electromagnetic potential 1-form divided by .
Definition et_rot_mag.h:155
Cmp A_t
t-component of the elecctromagnetic potential 1-form, divided by .
Definition et_rot_mag.h:150
bool is_conduct() const
Tells if the star is made of conducting or isolating material.
Definition et_rot_mag.h:241
Cmp j_t
t-component of the current 4-vector
Definition et_rot_mag.h:158
virtual void magnet_comput_plus(const int adapt_flag, const int initial_j, const Tbl an_j, Cmp(*f_j)(const Cmp &x, const Tbl), const Tbl bn_j, Cmp(*g_j)(const Cmp &x, const Tbl), Cmp(*N_j)(const Cmp &x, const Tbl), Param &par_poisson_At, Param &par_poisson_Avect)
Computes the electromagnetic quantities solving the Maxwell equations (6) and (7) of [Bocquet,...
double Q
In the case of a perfect conductor, the requated baryonic charge.
Definition et_rot_mag.h:179
Cmp B_phi
-component of the magnetic field
Definition et_rot_mag.h:157
double omega
Rotation angular velocity ([f_unit] ).
Definition etoile.h:1504
Tenseur & logn
Metric potential = logn_auto.
Definition etoile.h:1524
virtual const Itbl & l_surf() const
Description of the stellar surface: returns a 2-D Itbl containing the values of the domain index l on...
Tenseur nphi
Metric coefficient .
Definition etoile.h:1513
Tenseur bbb
Metric factor B.
Definition etoile.h:1507
Tenseur b_car
Square of the metric factor B.
Definition etoile.h:1510
Tenseur tnphi
Component of the shift vector.
Definition etoile.h:1518
int nzet
Number of domains of *mp occupied by the star.
Definition etoile.h:435
Tenseur nnn
Total lapse function.
Definition etoile.h:512
Map & mp
Mapping associated with the star.
Definition etoile.h:432
Tenseur ener
Total energy density in the fluid frame.
Definition etoile.h:463
Tenseur press
Fluid pressure.
Definition etoile.h:464
const Tbl & xi_surf() const
Description of the stellar surface: returns a 2-D Tbl containing the values of the radial coordinat...
Tenseur a_car
Total conformal factor .
Definition etoile.h:518
Base class for pure radial mappings.
Definition map.h:1551
virtual double val_r_jk(int l, double xi, int j, int k) const =0
Returns the value of the radial coordinate r for a given and a given collocation point in in a give...
Multi-domain array.
Definition mtbl.h:118
Parameter storage.
Definition param.h:125
Basic array class.
Definition tbl.h:161
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Definition tbl.C:364
double & set(int i)
Read/write of a particular element (index i) (1D case).
Definition tbl.h:281
double * t
The array of double.
Definition tbl.h:173
int get_dim(int i) const
Gives the i-th dimension (ie dim.dim[i]).
Definition tbl.h:403
Tensor handling *** DEPRECATED : use class Tensor instead ***.
Definition tenseur.h:304
Cmp & set()
Read/write for a scalar (see also operator=(const Cmp&) ).
Definition tenseur.C:830
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Definition tenseur.C:642
void set_std_base()
Set the standard spectal basis of decomposition for each component.
Definition tenseur.C:1176
const Tenseur & gradient_spher() const
Returns the gradient of *this (Spherical coordinates) (scalar field only).
Definition tenseur.C:1554
void change_triad(const Base_vect &new_triad)
Sets a new vectorial basis (triad) of decomposition and modifies the components accordingly.
Definition tenseur.C:674
void poisson_vect(double lambda, Param &par, Tenseur &shift, Tenseur &vect, Tenseur &scal) const
Solves the vectorial Poisson equation : .
int get_etat() const
Returns the logical state.
Definition tenseur.h:710
Values and coefficients of a (real-value) function.
Definition valeur.h:297
const Valeur & mult_ct() const
Returns applied to *this.
double val_point_jk(int l, double x, int j, int k) const
Computes the value of the field represented by *this at an arbitrary point in , but collocation point...
Definition valeur.C:903
const Valeur & ssint() const
Returns of *this.
Tbl max(const Cmp &)
Maximum values of a Cmp in each domain.
Definition cmp_math.C:438
Cmp pow(const Cmp &, int)
Power .
Definition cmp_math.C:351
Cmp cos(const Cmp &)
Cosine.
Definition cmp_math.C:97
Cmp abs(const Cmp &)
Absolute value.
Definition cmp_math.C:413
Cmp log(const Cmp &)
Neperian logarithm.
Definition cmp_math.C:299
Tenseur flat_scalar_prod_desal(const Tenseur &t1, const Tenseur &t2)
Same as flat_scalar_prod but with desaliasing.
Lorene prototypes.
Definition app_hor.h:67
virtual void adapt(const Cmp &ent, const Param &par, int nbr=0)=0
Adaptation of the mapping to a given scalar field.