LORENE
connection.C
1/*
2 * Methods of class Connection.
3 *
4 * (see file connection.h for documentation)
5 *
6 */
7
8/*
9 * Copyright (c) 2003-2004 Eric Gourgoulhon & Jerome Novak
10 *
11 * This file is part of LORENE.
12 *
13 * LORENE is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2
15 * as published by the Free Software Foundation.
16 *
17 * LORENE is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with LORENE; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
26 */
27
28
29
30/*
31 * $Id: connection.C,v 1.20 2016/12/05 16:17:50 j_novak Exp $
32 * $Log: connection.C,v $
33 * Revision 1.20 2016/12/05 16:17:50 j_novak
34 * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
35 *
36 * Revision 1.19 2014/10/13 08:52:49 j_novak
37 * Lorene classes and functions now belong to the namespace Lorene.
38 *
39 * Revision 1.18 2014/10/06 15:13:04 j_novak
40 * Modified #include directives to use c++ syntax.
41 *
42 * Revision 1.17 2004/02/18 18:44:22 e_gourgoulhon
43 * Method Tensor::scontract renammed Tensor::trace.
44 *
45 * Revision 1.16 2004/01/29 15:21:51 e_gourgoulhon
46 * First implementation of method p_divergence.
47 *
48 * Revision 1.15 2004/01/23 07:58:38 e_gourgoulhon
49 * Method p_derive_cov: treatment of dzpuis: entry with dzpuis = 2 is now
50 * allowed (output: dzpuis=3).
51 *
52 * Revision 1.14 2004/01/22 16:15:53 e_gourgoulhon
53 * First operational version of ricci().
54 *
55 * Revision 1.13 2004/01/19 16:57:44 e_gourgoulhon
56 * First implementation of method ricci().
57 * Not tested yet.
58 *
59 * Revision 1.12 2004/01/13 21:33:33 e_gourgoulhon
60 * Corrected a bug in method p_derive_cov: inverted case CON and case COV.
61 *
62 * Revision 1.11 2004/01/04 20:57:51 e_gourgoulhon
63 * -- Data member delta is now of type Tensor_sym (and no longer
64 * Tensor_delta).
65 * -- Better handling of tensor symmetries in method p_derive_cov().
66 *
67 * Revision 1.10 2004/01/01 11:24:04 e_gourgoulhon
68 * Full reorganization of method p_derive_cov: the main loop is now
69 * on the indices of the *output* tensor (to take into account
70 * symmetries in the input and output tensors).
71 *
72 * Revision 1.9 2003/12/30 22:58:27 e_gourgoulhon
73 * -- Replaced member flat_conn (flat connection) by flat_met (flat metric)
74 * -- Added argument flat_met to the constructors of Connection.
75 * -- Suppressed method fait_ricci() (the computation of the Ricci is
76 * now devoted to the virtual method ricci()).
77 * -- Implementation of methods fait_delta() and derive_cov().
78 *
79 * Revision 1.8 2003/12/27 14:59:05 e_gourgoulhon
80 * Method derive_cov() suppressed.
81 *
82 * Revision 1.7 2003/10/16 14:21:36 j_novak
83 * The calculation of the divergence of a Tensor is now possible.
84 *
85 * Revision 1.6 2003/10/11 14:39:49 e_gourgoulhon
86 * Suppressed declaration of unusued arguments in some methods.
87 *
88 * Revision 1.5 2003/10/06 13:58:46 j_novak
89 * The memory management has been improved.
90 * Implementation of the covariant derivative with respect to the exact Tensor
91 * type.
92 *
93 * Revision 1.4 2003/10/03 14:16:04 e_gourgoulhon
94 * Added set_der_0x0 in some constructors.
95 *
96 * Revision 1.3 2003/10/02 21:32:06 e_gourgoulhon
97 * Added constructor from Metric.
98 * Added functions fait_delta and update.
99 *
100 * Revision 1.2 2003/10/01 15:42:49 e_gourgoulhon
101 * still ongoing...
102 *
103 * Revision 1.1 2003/09/29 21:13:08 e_gourgoulhon
104 * First version --- not ready yet.
105 *
106 *
107 *
108 *
109 * $Header: /cvsroot/Lorene/C++/Source/Connection/connection.C,v 1.20 2016/12/05 16:17:50 j_novak Exp $
110 *
111 */
112
113// C++ headers
114#include "headcpp.h"
115
116// C headers
117#include <cstdlib>
118
119// Lorene headers
120#include "connection.h"
121#include "metric.h"
122
123
124 //-----------------------//
125 // Constructors //
126 //-----------------------//
127
128
129// Constructor ab initio
130
131namespace Lorene {
133 const Metric_flat& flat_met_i)
134 : mp(&(delta_i.get_mp())),
135 triad(delta_i.get_triad()),
136 delta(delta_i),
137 assoc_metric(false),
138 flat_met(&flat_met_i) {
139
140 assert( delta_i.get_valence() == 3 ) ;
141 assert( delta_i.sym_index1() == 1 ) ;
142 assert( delta_i.sym_index2() == 2 ) ;
143 assert( delta_i.get_index_type(0) == CON ) ;
144 assert( delta_i.get_index_type(1) == COV ) ;
145 assert( delta_i.get_index_type(2) == COV ) ;
146
147 set_der_0x0() ;
148}
149
150
151// Standard constructor from a metric.
152
154 const Metric_flat& flat_met_i)
155 : mp(&(met.get_mp())),
156 triad(met.cov().get_triad()),
157 delta(*mp, CON, COV, COV, *triad, 1, 2),
158 assoc_metric(true),
159 flat_met(&flat_met_i) {
160
161 fait_delta(met) ; // Computes delta
162
163 set_der_0x0() ;
164}
165
166
167// Copy constructor
168
169Connection::Connection(const Connection& conn_i) : mp(conn_i.mp),
170 triad(conn_i.triad),
171 delta(conn_i.delta),
173 flat_met(conn_i.flat_met) {
174
175 set_der_0x0() ;
176
177}
178
179
180// Constructor for derived classes
181
182Connection::Connection(const Map& mpi, const Base_vect& bi) : mp(&mpi),
183 triad(&bi),
184 delta(mpi, CON, COV, COV, bi, 1, 2),
185 assoc_metric(false),
186 flat_met(0x0){
187
188 set_der_0x0() ;
189
190}
191
192
193
194 //-----------------------//
195 // Destructor //
196 //-----------------------//
197
199
200 del_deriv() ;
201
202}
203
204 //-----------------------------//
205 // Memory management //
206 //-----------------------------//
207
209
210 if (p_ricci != 0x0) delete p_ricci ;
211
212 set_der_0x0() ;
213
214}
215
217
218 p_ricci = 0x0 ;
219
220}
221
222
223 //-----------------------------//
224 // Mutators / assignment //
225 //-----------------------------//
226
227
229
230 assert( triad == ci.triad ) ;
231 delta = ci.delta ;
232 flat_met = ci.flat_met ;
233
234 del_deriv() ;
235
236}
237
238void Connection::update(const Tensor_sym& delta_i) {
239
240 assert(assoc_metric == false) ;
241
242 assert(flat_met != 0x0) ; // to guarantee we are not in a derived class
243
244 assert( delta_i.get_valence() == 3 ) ;
245 assert( delta_i.sym_index1() == 1 ) ;
246 assert( delta_i.sym_index2() == 2 ) ;
247 assert( delta_i.get_index_type(0) == CON ) ;
248 assert( delta_i.get_index_type(1) == COV ) ;
249 assert( delta_i.get_index_type(2) == COV ) ;
250
251 delta = delta_i ;
252
253 del_deriv() ;
254
255}
256
257
258void Connection::update(const Metric& met) {
259
260 assert(assoc_metric == true) ;
261
262 assert(flat_met != 0x0) ; // to guarantee we are not in a derived class
263
264 fait_delta(met) ;
265
266 del_deriv() ;
267
268}
269
270
271
272 //-----------------------------//
273 // Computational methods //
274 //-----------------------------//
275
276
277//--------------------------------------
278// Computation of the Delta coefficients
279//--------------------------------------
280
282
283 assert(flat_met != 0x0) ;
284
285 const Tensor& dgam = gam.cov().derive_cov(*flat_met) ;
286
287 for (int k=1; k<=3; k++) {
288 for (int i=1; i<=3; i++) {
289 for (int j=1; j<=i; j++) {
290 Scalar& cc = delta.set(k,i,j) ;
291 cc = 0 ;
292 for (int l=1; l<=3; l++) {
293 cc += gam.con()(k,l) * (
294 dgam(l,j,i) + dgam(i,l,j) - dgam(i,j,l) ) ;
295
296 }
297 cc = 0.5 * cc ;
298 }
299 }
300 }
301
302
303}
304
305
306//---------------------
307// Covariant derivative
308//---------------------
309
311
312 // Notations: suffix 0 in name <=> input tensor
313 // suffix 1 in name <=> output tensor
314
315 int valence0 = uu.get_valence() ;
316 int valence1 = valence0 + 1 ;
317 int valence1m1 = valence1 - 1 ; // same as valence0, but introduced for
318 // the sake of clarity
319 int ncomp0 = uu.get_n_comp() ;
320
321 // Protections
322 // -----------
323 if (valence0 >= 1) {
324 assert(uu.get_triad() == triad) ;
325 }
326 assert(flat_met != 0x0) ;
327
328 // Creation of the result (pointer)
329 // --------------------------------
330 Tensor* resu ;
331
332 // If uu is a Scalar, the result is a Vector
333 if (valence0 == 0)
334 resu = new Vector(*mp, COV, triad) ;
335 else {
336
337 // Type of indices of the result :
338 Itbl tipe(valence1) ;
339 const Itbl& tipeuu = uu.get_index_type() ;
340 for (int id = 0; id<valence0; id++) {
341 tipe.set(id) = tipeuu(id) ; // First indices = same as uu
342 }
343 tipe.set(valence1m1) = COV ; // last index is the derivation index
344
345 // if uu is a Tensor_sym, the result is also a Tensor_sym:
346 const Tensor* puu = &uu ;
347 const Tensor_sym* puus = dynamic_cast<const Tensor_sym*>(puu) ;
348 if ( puus != 0x0 ) { // the input tensor is symmetric
349 resu = new Tensor_sym(*mp, valence1, tipe, *triad,
350 puus->sym_index1(), puus->sym_index2()) ;
351 }
352 else {
353 resu = new Tensor(*mp, valence1, tipe, *triad) ; // no symmetry
354 }
355 }
356
357 int ncomp1 = resu->get_n_comp() ;
358
359 Itbl ind1(valence1) ; // working Itbl to store the indices of resu
360 Itbl ind0(valence0) ; // working Itbl to store the indices of uu
361 Itbl ind(valence0) ; // working Itbl to store the indices of uu
362
363 Scalar tmp(*mp) ; // working scalar
364
365 // Determination of the dzpuis parameter of the input --> dz_in
366 // ---------------------------------------------------
367 int dz_in = 0 ;
368 for (int ic=0; ic<ncomp0; ic++) {
369 int dzp = uu(uu.indices(ic)).get_dzpuis() ;
370 assert(dzp >= 0) ;
371 if (dzp > dz_in) dz_in = dzp ;
372 }
373
374#ifndef NDEBUG
375 // Check : do all components have the same dzpuis ?
376 for (int ic=0; ic<ncomp0; ic++) {
377 if ( !(uu(uu.indices(ic)).check_dzpuis(dz_in)) ) {
378 cout << "######## WARNING #######\n" ;
379 cout << " Connection::p_derive_cov : the tensor components \n"
380 << " do not have all the same dzpuis ! : \n"
381 << " ic, dzpuis(ic), dz_in : " << ic << " "
382 << uu(uu.indices(ic)).get_dzpuis() << " " << dz_in << endl ;
383 }
384 }
385#endif
386
387
388 // Initialisation to the flat derivative
389 // -------------------------------------
390
391 *resu = uu.derive_cov(*flat_met) ;
392
393 // Addition of the Delta terms
394 // ----------------------------
395 // loop on all the components of the output tensor
396 for (int ic=0; ic<ncomp1; ic++) {
397
398 // indices corresponding to the component no. ic in the output tensor
399 ind1 = resu->indices(ic) ;
400
401 // Indices of the input tensor
402 for (int id = 0; id < valence0; id++) {
403 ind0.set(id) = ind1(id) ;
404 }
405
406 // Value of last index (derivation index)
407 int k = ind1(valence1m1) ;
408
409 tmp = 0 ;
410
411 // Loop on the number of indices of uu
412 for (int id=0; id<valence0; id++) {
413
414 ind = ind0 ;
415
416 switch( uu.get_index_type(id) ) {
417
418 case CON : {
419 for (int l=1; l<=3; l++) {
420 ind.set(id) = l ;
421 tmp += delta(ind0(id), k, l) * uu(ind) ;
422 }
423 break ;
424 }
425
426 case COV : {
427 for (int l=1; l<=3; l++) {
428 ind.set(id) = l ;
429 tmp -= delta(l, k, ind0(id)) * uu(ind) ;
430 }
431 break ;
432 }
433
434 default : {
435 cerr <<
436 "Connection::p_derive_cov : unexpected type of index !\n" ;
437 abort() ;
438 break ;
439 }
440
441 } // end of switch on index type
442
443 } // end of loop on the number of indices of uu
444
445
446 if (dz_in > 0) tmp.dec_dzpuis() ; // to get the same dzpuis as
447 // the flat covariant derivative
448
449 resu->set(ind1) += tmp ; // addition to the flat derivative part
450
451 } // end of loop on all the components of the output tensor
452
453 // C'est fini !
454 // ------------
455
456 return resu ;
457
458}
459
460
461
462//---------------------------------
463// Divergence, returning a pointer.
464//---------------------------------
465
467
468
469 // Notations: suffix 0 in name <=> input tensor
470 // suffix 1 in name <=> output tensor
471
472 int valence0 = uu.get_valence() ;
473 int valence1 = valence0 - 1 ;
474 int valence0m1 = valence0 - 1 ; // same as valence1 but introduced for
475 // the sake of clarity
476 int ncomp0 = uu.get_n_comp() ;
477
478 // Protections
479 // -----------
480 assert (valence0 >= 1) ;
481 assert (uu.get_triad() == triad) ;
482
483 // Last index must be contravariant:
484 assert (uu.get_index_type(valence0m1) == CON) ;
485
486
487 // Creation of the pointer on the result tensor
488 // --------------------------------------------
489 Tensor* resu ;
490
491 if (valence0 == 1) // if u is a Vector, the result is a Scalar
492 resu = new Scalar(*mp) ;
493 else {
494
495 // Type of indices of the result :
496 Itbl tipe(valence1) ;
497 const Itbl& tipeuu = uu.get_index_type() ;
498 for (int id = 0; id<valence1; id++) {
499 tipe.set(id) = tipeuu(id) ; // type of remaining indices =
500 } // same as uu indices
501
502 if (valence0 == 2) { // if u is a rank 2 tensor, the result is a Vector
503 resu = new Vector(*mp, tipe(0), *triad) ;
504 }
505 else {
506 // if uu is a Tensor_sym, the result might be also a Tensor_sym:
507 const Tensor* puu = &uu ;
508 const Tensor_sym* puus = dynamic_cast<const Tensor_sym*>(puu) ;
509 if ( puus != 0x0 ) { // the input tensor is symmetric
510
511 if (puus->sym_index2() != valence0 - 1) {
512
513 // the symmetry is preserved:
514
515 if (valence1 == 2) {
516 resu = new Sym_tensor(*mp, tipe, *triad) ;
517 }
518 else {
519 resu = new Tensor_sym(*mp, valence1, tipe, *triad,
520 puus->sym_index1(), puus->sym_index2()) ;
521 }
522 }
523 else { // the symmetry is lost:
524
525 resu = new Tensor(*mp, valence1, tipe, *triad) ;
526 }
527 }
528 else { // no symmetry in the input tensor:
529 resu = new Tensor(*mp, valence1, tipe, *triad) ;
530 }
531 }
532
533 }
534
535 int ncomp1 = resu->get_n_comp() ;
536
537 Itbl ind0(valence0) ; // working Itbl to store the indices of uu
538 Itbl ind1(valence1) ; // working Itbl to store the indices of resu
539 Itbl ind(valence0) ; // working Itbl to store the indices of uu
540
541 Scalar tmp(*mp) ; // working scalar
542
543
544 // Determination of the dzpuis parameter of the input --> dz_in
545 // ---------------------------------------------------
546 int dz_in = 0 ;
547 for (int ic=0; ic<ncomp0; ic++) {
548 int dzp = uu(uu.indices(ic)).get_dzpuis() ;
549 assert(dzp >= 0) ;
550 if (dzp > dz_in) dz_in = dzp ;
551 }
552
553#ifndef NDEBUG
554 // Check : do all components have the same dzpuis ?
555 for (int ic=0; ic<ncomp0; ic++) {
556 if ( !(uu(uu.indices(ic)).check_dzpuis(dz_in)) ) {
557 cout << "######## WARNING #######\n" ;
558 cout << " Connection::p_divergence : the tensor components \n"
559 << " do not have all the same dzpuis ! : \n"
560 << " ic, dzpuis(ic), dz_in : " << ic << " "
561 << uu(uu.indices(ic)).get_dzpuis() << " " << dz_in << endl ;
562 }
563 }
564#endif
565
566 // The 1-form Delta^k_{lk} is required
567 // -----------------------------------
568
569 Vector delta_trace = delta.trace(0,2) ; // Delta^k_{lk}
570
571 // Initialisation to the flat divergence
572 // -------------------------------------
573
574 *resu = uu.divergence(*flat_met) ;
575
576
577 // Addition of the Delta terms
578 // ----------------------------
579 // loop on all the components of the output tensor
580 for (int ic=0; ic<ncomp1; ic++) {
581
582 // indices corresponding to the component no. ic in the output tensor
583 ind1 = resu->indices(ic) ;
584
585 // Indices of the input tensor (but the last one)
586 for (int id = 0; id < valence1; id++) {
587 ind0.set(id) = ind1(id) ;
588 }
589
590 // Addition of the Delta^k_{lk} term
591 tmp = 0 ;
592
593 for (int l=1; l<=3; l++) {
594 ind0.set(valence0m1) = l ; // summation on the last index of uu
595 tmp += delta_trace(l) * uu(ind0) ;
596 }
597
598 ind0.set(valence0m1) = -1 ; // unvalid value for the last index
599 // because it should no longer be used
600
601
602 // Addition of the other Delta terms
603
604 for (int id=0; id<valence1; id++) { // Loop on the number of indices
605 // the result
606
607 ind = ind0 ;
608
609 switch( uu.get_index_type(id) ) {
610
611 case CON : {
612 for (int l=1; l<=3; l++) {
613 ind.set(id) = l ;
614 for (int k=1; k<=3; k++) {
615 ind.set(valence0m1) = k ;
616 tmp += delta(ind0(id), l, k) * uu(ind) ;
617 }
618 }
619 break ;
620 }
621
622 case COV : {
623 for (int l=1; l<=3; l++) {
624 ind.set(id) = l ;
625 for (int k=1; k<=3; k++) {
626 ind.set(valence0m1) = k ;
627 tmp -= delta(l, ind0(id), k) * uu(ind) ;
628 }
629 }
630 break ;
631 }
632
633 default : {
634 cerr <<
635 "Connection::p_divergence : unexpected type of index !\n" ;
636 abort() ;
637 break ;
638 }
639
640 } // end of switch on index type
641
642 } // end of loop on the number of indices of the result
643
644
645 if (dz_in > 0) tmp.dec_dzpuis() ; // to get the same dzpuis as
646 // the flat divergence
647
648 resu->set(ind1) += tmp ; // addition to the flat divergence part
649
650
651 } // end of loop on all the components of the output tensor
652
653 // C'est fini !
654 // ------------
655
656 return resu ;
657
658}
659
660
661//--------------
662// Ricci tensor
663//--------------
664
665const Tensor& Connection::ricci() const {
666
667 if (p_ricci == 0x0) { // a new computation is necessary
668
669 if (assoc_metric) { // The Ricci tensor is symmetric if the
670 // connection is associated with some metric
671 p_ricci = new Sym_tensor(*mp, COV, *triad) ;
672 }
673 else {
674 p_ricci = new Tensor(*mp, 2, COV, *triad) ;
675 }
676
677 const Tensor& d_delta = delta.derive_cov(*flat_met) ;
678
679 for (int i=1; i<=3; i++) {
680
681 int jmax = assoc_metric ? i : 3 ;
682
683 for (int j=1; j<=jmax; j++) {
684
685 Scalar tmp1(*mp) ;
686 tmp1.set_etat_zero() ;
687 for (int k=1; k<=3; k++) {
688 tmp1 += d_delta(k,i,j,k) ;
689 }
690
691 Scalar tmp2(*mp) ;
692 tmp2.set_etat_zero() ;
693 for (int k=1; k<=3; k++) {
694 tmp2 += d_delta(k,i,k,j) ;
695 }
696
697 Scalar tmp3(*mp) ;
698 tmp3.set_etat_zero() ;
699 for (int k=1; k<=3; k++) {
700 for (int m=1; m<=3; m++) {
701 tmp3 += delta(k,k,m) * delta(m,i,j) ;
702 }
703 }
704 tmp3.dec_dzpuis() ; // dzpuis 4 -> 3
705
706 Scalar tmp4(*mp) ;
707 tmp4.set_etat_zero() ;
708 for (int k=1; k<=3; k++) {
709 for (int m=1; m<=3; m++) {
710 tmp4 += delta(k,j,m) * delta(m,i,k) ;
711 }
712 }
713 tmp4.dec_dzpuis() ; // dzpuis 4 -> 3
714
715 p_ricci->set(i,j) = tmp1 - tmp2 + tmp3 - tmp4 ;
716
717 }
718 }
719
720 }
721
722 return *p_ricci ;
723
724}
725
726
727
728
729
730
731
732
733
734
735
736
737
738}
Vectorial bases (triads) with respect to which the tensorial components are defined.
Definition base_vect.h:105
Tensor * p_ricci
Pointer of the Ricci tensor associated with the connection.
Definition connection.h:164
bool assoc_metric
Indicates whether the connection is associated with a metric (in which case the Ricci tensor is symme...
Definition connection.h:147
const Metric_flat * flat_met
Flat metric with respect to which (member delta ) is defined.
Definition connection.h:156
void operator=(const Connection &)
Assignment to another Connection.
Definition connection.C:228
void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
Definition connection.C:216
virtual ~Connection()
Destructor.
Definition connection.C:198
Connection(const Tensor_sym &delta_i, const Metric_flat &flat_met_i)
Standard constructor ab initio.
Definition connection.C:132
void update(const Tensor_sym &delta_i)
Update the connection when it is defined ab initio.
Definition connection.C:238
const Base_vect *const triad
Triad with respect to which the connection coefficients are defined.
Definition connection.h:124
virtual Tensor * p_derive_cov(const Tensor &tens) const
Computes the covariant derivative of a tensor (with respect to the current connection).
Definition connection.C:310
const Map *const mp
Reference mapping.
Definition connection.h:119
Tensor_sym delta
Tensor which defines the connection with respect to the flat one: is the difference between the con...
Definition connection.h:141
virtual const Tensor & ricci() const
Computes (if not up to date) and returns the Ricci tensor associated with the current connection.
Definition connection.C:665
const Map & get_mp() const
Returns the mapping.
Definition connection.h:253
virtual Tensor * p_divergence(const Tensor &tens) const
Computes the divergence of a tensor (with respect to the current connection).
Definition connection.C:466
void fait_delta(const Metric &)
Computes the difference between the connection coefficients and that a the flat connection in the ca...
Definition connection.C:281
void del_deriv() const
Deletes all the derived quantities.
Definition connection.C:208
Basic integer array class.
Definition itbl.h:122
int & set(int i)
Read/write of a particular element (index i ) (1D case).
Definition itbl.h:247
Flat metric for tensor calculation.
Definition metric.h:261
Metric for tensor calculation.
Definition metric.h:90
virtual const Sym_tensor & con() const
Read-only access to the contravariant representation.
Definition metric.C:293
virtual const Sym_tensor & cov() const
Read-only access to the covariant representation.
Definition metric.C:283
Tensor field of valence 0 (or component of a tensorial field).
Definition scalar.h:393
virtual void set_etat_zero()
Sets the logical state to ETATZERO (zero).
Definition scalar.C:330
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...
Class intended to describe valence-2 symmetric tensors.
Definition sym_tensor.h:226
Symmetric tensors (with respect to two of their arguments).
Definition tensor.h:1050
Tensor handling.
Definition tensor.h:294
Tensor field of valence 1.
Definition vector.h:188
int sym_index1() const
Number of the first symmetric index (0<= id_sym1 < valence ).
Definition tensor.h:1162
const Tensor_sym & derive_cov(const Metric &gam) const
Returns the covariant derivative of this with respect to some metric .
int get_index_type(int i) const
Gives the type (covariant or contravariant) of the index number i .
Definition tensor.h:899
int sym_index2() const
Number of the second symmetric index (id_sym1 < id_sym2 < valence ).
Definition tensor.h:1167
int get_valence() const
Returns the valence.
Definition tensor.h:882
virtual Itbl indices(int pos) const
Returns the indices of a component given by its position in the array cmp .
Definition tensor.C:548
int get_n_comp() const
Returns the number of stored components.
Definition tensor.h:885
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.
Definition tensor.h:879
const Tensor & divergence(const Metric &gam) const
Computes the divergence of this with respect to some metric .
Definition tensor.C:1064
const Tensor & derive_cov(const Metric &gam) const
Returns the covariant derivative of this with respect to some metric .
Definition tensor.C:1011
Scalar & set(const Itbl &ind)
Returns the value of a component (read/write version).
Definition tensor.C:663
Lorene prototypes.
Definition app_hor.h:67
Map(const Mg3d &)
Constructor from a multi-domain 3D grid.
Definition map.C:142