KADATH
metric_cfc.cpp
1 /*
2  Copyright 2018 Philippe Grandclement
3 
4  This file is part of Kadath.
5 
6  Kadath 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 3 of the License, or
9  (at your option) any later version.
10 
11  Kadath 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 Kadath. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #include "space.hpp"
21 #include "tensor.hpp"
22 #include "metric.hpp"
23 #include "term_eq.hpp"
24 #include "scalar.hpp"
25 #include "tensor_impl.hpp"
26 #include "system_of_eqs.hpp"
27 #include "metric_tensor.hpp"
28 #include "name_tools.hpp"
29 namespace Kadath {
30 
32  Metric(conf.get_space()), p_conf(&conf), basis(bb), fmet(conf.get_space(), basis) {
33  type_tensor = COV ;
34 }
35 
37  Metric (so), p_conf(so.p_conf), basis(so.basis), fmet(so.fmet), place_syst(so.place_syst) {
38 }
39 
40 Metric_cfc::~Metric_cfc() {
41 }
42 
43 
44 int Metric_cfc::give_type(int dd) const {
45  return basis.get_basis(dd) ;
46 }
47 
48 
49 void Metric_cfc::compute_cov (int dd) const {
50 
51  int dim = espace.get_ndim() ;
52  if (dim!=3) {
53  cerr << "Function only implemented for dimension 3" << endl ;
54  abort() ;
55  }
56 
57  int place = place_syst + (dd-syst->dom_min) ;
58  //Need to work component by components...
59  bool doder = (syst->term[place]->der_t==0x0) ? false : true ;
60 
61  Scalar val (espace) ;
62  Scalar der (espace) ;
63 
64  // CFC
65  val.set_domain(dd) = pow((*syst->term[place]->val_t)()(dd), 4) ;
66  val.std_base() ;
67  if (doder) {
68  der.set_domain(dd) = 4*pow((*syst->term[place]->val_t)()(dd), 3)* (*syst->term[place]->der_t)()(dd);
69  der.std_base() ;
70  }
71 
72 
73  // Value field :
74  Metric_tensor resval (espace, COV, basis) ;
75  resval.set(1,1) = val ;
76  resval.set(1,2) = 0 ;
77  resval.set(1,3) = 0 ;
78  resval.set(2,2) = val ;
79  resval.set(2,3) = 0 ;
80  resval.set(3,3) = val ;
81 
82  if (!doder) {
83  if (p_met_cov[dd]==0x0)
84  p_met_cov[dd] = new Term_eq(dd, resval) ;
85  else
86  *p_met_cov[dd] = Term_eq(dd, resval) ;
87  }
88  else {
89  // Der field :
90  Metric_tensor resder (espace, COV, basis) ;
91  resder.set(1,1) = der ;
92  resder.set(1,2) = 0 ;
93  resder.set(1,3) = 0 ;
94  resder.set(2,2) = der ;
95  resder.set(2,3) = 0 ;
96  resder.set(3,3) = der ;
97 
98  if (p_met_cov[dd]==0x0)
99  p_met_cov[dd] = new Term_eq(dd, resval, resder) ;
100  else
101  *p_met_cov[dd] = Term_eq(dd, resval, resder) ;
102  }
103 }
104 
105 void Metric_cfc::compute_con (int dd) const {
106 
107  int dim = espace.get_ndim() ;
108  if (dim!=3) {
109  cerr << "Function only implemented for dimension 3" << endl ;
110  abort() ;
111  }
112 
113  int place = place_syst + (dd-syst->dom_min) ;
114  //Need to work component by components...
115  bool doder = (syst->term[place]->der_t==0x0) ? false : true ;
116 
117  Scalar val (espace) ;
118  Scalar der (espace) ;
119 
120  // CFC
121  val.set_domain(dd) = pow((*syst->term[place]->val_t)()(dd), -4) ;
122  val.std_base() ;
123  if (doder) {
124  der.set_domain(dd) = -4*pow((*syst->term[place]->val_t)()(dd), -5)* (*syst->term[place]->der_t)()(dd);
125  der.std_base() ;
126  }
127 
128 
129  // Value field :
130  Metric_tensor resval (espace, COV, basis) ;
131  resval.set(1,1) = val ;
132  resval.set(1,2) = 0 ;
133  resval.set(1,3) = 0 ;
134  resval.set(2,2) = val ;
135  resval.set(2,3) = 0 ;
136  resval.set(3,3) = val ;
137 
138  if (!doder) {
139  if (p_met_con[dd]==0x0)
140  p_met_con[dd] = new Term_eq(dd, resval) ;
141  else
142  *p_met_con[dd] = Term_eq(dd, resval) ;
143  }
144  else {
145  // Der field :
146  Metric_tensor resder (espace, COV, basis) ;
147  resder.set(1,1) = der ;
148  resder.set(1,2) = 0 ;
149  resder.set(1,3) = 0 ;
150  resder.set(2,2) = der ;
151  resder.set(2,3) = 0 ;
152  resder.set(3,3) = der ;
153 
154 
155  if (p_met_con[dd]==0x0)
156  p_met_con[dd] = new Term_eq(dd, resval, resder) ;
157  else
158  *p_met_con[dd] = Term_eq(dd, resval, resder) ;
159  }
160 
161 }
162 
163 void Metric_cfc::compute_christo (int dd) const {
164  // Need both representation of the metric)
165  if (type_tensor == CON) {
166  if (p_met_con[dd]==0x0)
167  compute_con(dd) ;
168  if (p_met_cov[dd]==0x0)
169  compute_cov(dd) ;
170  }
171  else {
172  if (p_met_cov[dd]==0x0)
173  compute_cov(dd) ;
174  if (p_met_con[dd]==0x0)
175  compute_con(dd) ;
176  }
177 
178  Array<int> type_ind (3) ;
179  type_ind.set(0) = COV ; type_ind.set(1) = COV ; type_ind.set(2) = CON ;
180  Tensor res_val (espace, 3, type_ind, basis) ;
181  Tensor res_der (espace, 3, type_ind, basis) ;
182 
183  Term_eq flat_der (fmet.derive(COV, ' ', (*p_met_cov[dd]))) ;
184  bool doder = (flat_der.der_t==0x0) ? false : true ;
185 
186  Index pos (res_val) ;
187  do {
188 
189  Val_domain cmpval (espace.get_domain(dd)) ;
190  cmpval = 0 ;
191  for (int l=1 ; l<=espace.get_ndim() ; l++)
192  cmpval += 0.5*(*p_met_con[dd]->val_t)(pos(2)+1,l)(dd)*((*flat_der.val_t)(pos(0)+1, pos(1)+1, l)(dd) +
193  (*flat_der.val_t)(pos(1)+1, pos(0)+1, l)(dd) - (*flat_der.val_t)(l, pos(0)+1, pos(1)+1)(dd)) ;
194 
195  res_val.set(pos).set_domain(dd) = cmpval ;
196 
197  if (doder) {
198  Val_domain cmpder (espace.get_domain(dd)) ;
199  cmpder = 0 ;
200  for (int l=1 ; l<=espace.get_ndim() ; l++)
201  cmpder += 0.5*(*p_met_con[dd]->der_t)(pos(2)+1,l)(dd)*((*flat_der.val_t)(pos(0)+1, pos(1)+1, l)(dd) +
202  (*flat_der.val_t)(pos(1)+1, pos(0)+1, l)(dd) - (*flat_der.val_t)(l, pos(0)+1, pos(1)+1)(dd))
203  + 0.5*(*p_met_con[dd]->val_t)(pos(2)+1,l)(dd)*((*flat_der.der_t)(pos(0)+1, pos(1)+1, l)(dd) +
204  (*flat_der.der_t)(pos(1)+1, pos(0)+1, l)(dd) - (*flat_der.der_t)(l, pos(0)+1, pos(1)+1)(dd)) ;
205 
206  res_der.set(pos).set_domain(dd) = cmpder ;
207  }
208  }
209  while (pos.inc()) ;
210 
211  if (!doder) {
212  if (p_christo[dd]==0x0)
213  p_christo[dd] = new Term_eq(dd, res_val) ;
214  else
215  *p_christo[dd] = Term_eq (dd, res_val) ;
216  }
217  else {
218  if (p_christo[dd]==0x0)
219  p_christo[dd] = new Term_eq(dd, res_val, res_der) ;
220  else
221  *p_christo[dd] = Term_eq(dd, res_val, res_der) ;
222  }
223 
224 }
225 
226 
227 
228 void Metric_cfc::compute_riemann (int dd) const {
229 
230  // Need christoffels
231  if (p_christo[dd]==0x0)
232  compute_christo(dd) ;
233 
234 
235  Array<int> indices (4) ;
236  indices.set(0) = CON ; indices.set(1) = COV ; indices.set(2) = COV ; indices.set(3) = COV ;
237  Tensor res_val (espace, 4, indices, basis) ;
238  Tensor res_der (espace, 4, indices, basis) ;
239 
240  Term_eq flat_der (fmet.derive(COV, ' ', (*p_christo[dd]))) ;
241  bool doder = (flat_der.der_t==0x0) ? false : true ;
242 
243  Index pos (res_val) ;
244  do {
245 
246  Val_domain cmpval ((*flat_der.val_t)(pos(2)+1, pos(1)+1,pos(3)+1,pos(0)+1)(dd)
247  - (*flat_der.val_t)(pos(3)+1, pos(1)+1, pos(2)+1, pos(0)+1)(dd)) ;
248  for (int m=1 ; m<=espace.get_ndim() ; m++) {
249  cmpval += (*p_christo[dd]->val_t)(pos(2)+1,m, pos(0)+1)(dd)*(*p_christo[dd]->val_t)(pos(1)+1,pos(3)+1,m)(dd)
250  - (*p_christo[dd]->val_t)(pos(3)+1,m,pos(0)+1)(dd)*(*p_christo[dd]->val_t)(pos(1)+1,pos(2)+1,m)(dd) ;
251  }
252  res_val.set(pos).set_domain(dd) = cmpval;
253  if (doder) {
254  Val_domain cmpder ((*flat_der.der_t)(pos(2)+1, pos(1)+1,pos(3)+1,pos(0)+1)(dd)
255  - (*flat_der.der_t)(pos(3)+1, pos(1)+1, pos(2)+1, pos(0)+1)(dd)) ;
256  for (int m=1 ; m<=espace.get_ndim() ; m++) {
257  cmpder += (*p_christo[dd]->der_t)(pos(2)+1,m, pos(0)+1)(dd)*(*p_christo[dd]->val_t)(pos(1)+1,pos(3)+1,m)(dd)
258  + (*p_christo[dd]->val_t)(pos(2)+1,m, pos(0)+1)(dd)*(*p_christo[dd]->der_t)(pos(1)+1,pos(3)+1,m)(dd)
259  - (*p_christo[dd]->der_t)(pos(3)+1,m,pos(0)+1)(dd)*(*p_christo[dd]->val_t)(pos(1)+1,pos(2)+1,m)(dd)
260  - (*p_christo[dd]->val_t)(pos(3)+1,m,pos(0)+1)(dd)*(*p_christo[dd]->der_t)(pos(1)+1,pos(2)+1,m)(dd);
261  }
262  res_der.set(pos).set_domain(dd) = cmpder ;
263  }
264  }
265  while (pos.inc()) ;
266 
267  if (!doder) {
268  if (p_riemann[dd]==0x0)
269  p_riemann[dd] = new Term_eq(dd, res_val) ;
270  else
271  *p_riemann[dd] = Term_eq (dd, res_val) ;
272  }
273  else {
274  if (p_riemann[dd]==0x0)
275  p_riemann[dd] = new Term_eq(dd, res_val, res_der) ;
276  else
277  *p_riemann[dd] = Term_eq(dd, res_val, res_der) ;
278  }
279 
280 }
281 
282 
283 
284 void Metric_cfc::compute_ricci_tensor (int dd) const {
285  // Need christoffels
286  if (p_christo[dd]==0x0)
287  compute_christo(dd) ;
288 
289 
290  Array<int> indices (2) ;
291  indices.set(0) = COV ; indices.set(1) = COV ;
292  Tensor res_val (espace, 2, indices, basis) ;
293  Tensor res_der (espace, 2, indices, basis) ;
294 
295  Term_eq flat_der (fmet.derive(COV, ' ', (*p_christo[dd]))) ;
296  bool doder = (flat_der.der_t==0x0) ? false : true ;
297 
298  Index pos (res_val) ;
299  do {
300 
301  Val_domain cmpval (espace.get_domain(dd)) ;
302  cmpval = 0 ;
303 
304  for (int l=1 ; l<=espace.get_ndim() ; l++) {
305  cmpval += (*flat_der.val_t)(l, pos(1)+1,pos(0)+1,l)(dd)
306  - (*flat_der.val_t)(pos(1)+1, pos(0)+1,l ,l)(dd) ;
307  for (int m=1 ; m<=espace.get_ndim() ; m++) {
308  cmpval += (*p_christo[dd]->val_t)(l,m, l)(dd)*(*p_christo[dd]->val_t)(pos(0)+1,pos(1)+1,m)(dd)
309  - (*p_christo[dd]->val_t)(pos(0)+1,l, m)(dd)*(*p_christo[dd]->val_t)(pos(1)+1,m,l)(dd) ;
310  }
311  }
312 
313  res_val.set(pos).set_domain(dd) = cmpval;
314  if (doder) {
315  Val_domain cmpder(espace.get_domain(dd)) ;
316  cmpder = 0 ;
317 
318  for (int l=1 ; l<=espace.get_ndim() ; l++) {
319  cmpder += (*flat_der.der_t)(l, pos(1)+1,pos(0)+1,l)(dd)
320  - (*flat_der.der_t)(pos(1)+1, pos(0)+1,l ,l)(dd) ;
321  for (int m=1 ; m<=espace.get_ndim() ; m++) {
322  cmpder += (*p_christo[dd]->der_t)(l,m, l)(dd)*(*p_christo[dd]->val_t)(pos(0)+1,pos(1)+1,m)(dd)
323  + (*p_christo[dd]->val_t)(l,m, l)(dd)*(*p_christo[dd]->der_t)(pos(0)+1,pos(1)+1,m)(dd)
324  - (*p_christo[dd]->der_t)(pos(0)+1,l, m)(dd)*(*p_christo[dd]->val_t)(pos(1)+1,m,l)(dd)
325  - (*p_christo[dd]->val_t)(pos(0)+1,l, m)(dd)*(*p_christo[dd]->der_t)(pos(1)+1,m,l)(dd);
326  }
327  }
328  res_der.set(pos).set_domain(dd) = cmpder ;
329  }
330  }
331  while (pos.inc()) ;
332 
333  if (!doder) {
334  if (p_ricci_tensor[dd]==0x0)
335  p_ricci_tensor[dd] = new Term_eq(dd, res_val) ;
336  else
337  *p_ricci_tensor[dd] = Term_eq (dd, res_val) ;
338  }
339  else {
340  if (p_ricci_tensor[dd]==0x0)
341  p_ricci_tensor[dd] = new Term_eq(dd, res_val, res_der) ;
342  else
343  *p_ricci_tensor[dd] = Term_eq(dd, res_val, res_der) ;
344  }
345 
346 
347 }
348 
349 
350 
351 
352 Term_eq Metric_cfc::derive_flat (int type_der, char ind_der, const Term_eq& so) const {
353 
354  int dd = so.get_dom() ;
355 
356  if (p_met_con[dd]==0x0)
357  compute_con(dd) ;
358  if (p_met_cov[dd]==0x0)
359  compute_cov(dd) ;
360 
361 
362  // The partial derivative part
363  Term_eq res (fmet.derive_with_other (type_der, ind_der, so, this)) ;
364  return res ;
365 }
366 
367 Term_eq Metric_cfc::derive (int type_der, char ind_der, const Term_eq& so) const {
368 
369  int dd = so.get_dom() ;
370 
371  if (p_christo[dd]==0x0)
372  compute_christo(dd) ;
373  // The partial derivative part
374  Term_eq res (fmet.derive_with_other (type_der, ind_der, so, this)) ;
375 
376  // Add the part containing the Christoffel :
377  //Must find a name for summation on Christofel :
378  bool found = false ;
379  int start = 97 ;
380  do {
381  bool same = false ;
382  if (ind_der==char(start))
383  same = true ;
384  for (int i=0 ; i<so.val_t->get_valence() ; i++)
385  if (so.val_t->get_name_ind()[i]==char(start))
386  same = true ;
387  if (!same)
388  found = true ;
389  else
390  start ++ ;
391  }
392  while ((!found) && (start<123)) ;
393  if (!found) {
394  cerr << "Trouble with indices in derive (you are not using tensors of order > 24, are you ?)" << endl ;
395  abort() ;
396  }
397  char name_sum = char(start) ;
398 
399  bool doder = ((so.der_t==0x0) || (p_christo[dd]->der_t==0x0)) ? false : true ;
400 
401  //loop on the components of so :
402  for (int cmp=0 ; cmp<so.val_t->get_valence() ; cmp ++) {
403 
404  int genre_indice = so.val_t->get_index_type(cmp) ;
405 
406  //Affecte names on the Christoffels :
407  p_christo[dd]->val_t->set_name_affected() ;
408  p_christo[dd]->val_t->set_name_ind(0, ind_der) ;
409  if (genre_indice==COV) {
410  p_christo[dd]->val_t->set_name_ind(1, so.val_t->get_name_ind()[cmp]) ;
411  p_christo[dd]->val_t->set_name_ind(2, name_sum) ;
412  }
413  else {
414  p_christo[dd]->val_t->set_name_ind(2, so.val_t->get_name_ind()[cmp]) ;
415  p_christo[dd]->val_t->set_name_ind(1, name_sum) ;
416  }
417 
418  if (doder) {
419  p_christo[dd]->der_t->set_name_affected() ;
420  p_christo[dd]->der_t->set_name_ind(0, ind_der) ;
421  if (genre_indice==COV) {
422  p_christo[dd]->der_t->set_name_ind(1, so.der_t->get_name_ind()[cmp]) ;
423  p_christo[dd]->der_t->set_name_ind(2, name_sum) ;
424  }
425  else {
426  p_christo[dd]->der_t->set_name_ind(2, so.der_t->get_name_ind()[cmp]) ;
427  p_christo[dd]->der_t->set_name_ind(1, name_sum) ;
428  }
429  }
430 
431  Term_eq auxi_christ (*p_christo[dd]) ;
432 
433  if (type_der==CON)
434  manipulate_ind(auxi_christ, 0) ;
435 
436  // Check if one inner summation is needed :
437  bool need_sum = false ;
438  char const * ind = p_christo[dd]->val_t->get_name_ind() ;
439  if ((ind[0]==ind[2]) || (ind[1]==ind[2]) || (ind[0]==ind[1]))
440  need_sum = true ;
441 
442  Term_eq* christ ;
443  if (need_sum)
444  if (!doder)
445  christ = new Term_eq (dd, auxi_christ.val_t->do_summation_one_dom(dd)) ;
446  else
447  christ = new Term_eq (dd, auxi_christ.val_t->do_summation_one_dom(dd),
448  auxi_christ.der_t->do_summation_one_dom(dd)) ;
449  else
450  christ = new Term_eq (auxi_christ) ;
451 
452  // Affecte names on the field :
453  Term_eq copie (so) ;
454  copie.val_t->set_name_affected() ;
455  for (int i=0 ; i<so.val_t->get_valence() ; i++)
456  if (i!=cmp)
457  copie.val_t->set_name_ind(i, so.val_t->get_name_ind()[i]) ;
458  else
459  copie.val_t->set_name_ind(i, name_sum) ;
460  if (doder) {
461  copie.der_t->set_name_affected() ;
462  for (int i=0 ; i<so.der_t->get_valence() ; i++)
463  if (i!=cmp)
464  copie.der_t->set_name_ind(i, so.der_t->get_name_ind()[i]) ;
465  else
466  copie.der_t->set_name_ind(i, name_sum) ;
467  }
468 
469  Term_eq part_christo ((*christ)*copie) ;
470  delete christ ;
471 
472  if (genre_indice==CON)
473  res = res + part_christo ;
474  else
475  res = res - part_christo ;
476  }
477  return res ;
478 }
479 
480 
481 
482 void Metric_cfc::set_system (System_of_eqs& ss, const char* name_met) {
483 
484  syst = &ss ;
485 
486  // Position in the system :
487  place_syst = ss.ndom*ss.nvar ;
488 
489  // unknown for the system (no name, the name is in the metric already)
490  ss.add_var (0x0, *p_conf) ;
491 
492  if (ss.met!=0x0) {
493  cerr << "Metric already set for the system" << endl ;
494  abort() ;
495  }
496 
497  ss.met = this ;
498  ss.name_met = new char[LMAX] ;
499  trim_spaces (ss.name_met, name_met) ;
500 }}
reference set(const Index &pos)
Read/write of an element.
Definition: array.hpp:186
Describes the tensorial basis used by the various tensors.
Definition: base_tensor.hpp:49
int get_basis(int nd) const
Read only the basis in a given domain.
Definition: base_tensor.hpp:93
Class that gives the position inside a multi-dimensional Array.
Definition: index.hpp:38
bool inc(int increm, int var=0)
Increments the position of the Index.
Definition: index.hpp:99
Class to deal with a metric with a conformaly flat metric.
Definition: metric.hpp:632
int place_syst
Gives the location of the metric amongst the various unknowns of the associated System_of_eqs.
Definition: metric.hpp:638
virtual void compute_christo(int) const
Computes the Christoffel symbols, in a given Domain.
Definition: metric_cfc.cpp:163
virtual void set_system(System_of_eqs &syst, const char *name)
Associate the metric to a given system of equations.
Definition: metric_cfc.cpp:482
const Base_tensor & basis
The tensorial basis used.
Definition: metric.hpp:636
virtual void compute_ricci_tensor(int) const
Computes the Ricci tensor, in a given Domain.
Definition: metric_cfc.cpp:284
Scalar * p_conf
Pointer on the Scalar being the conformal factor.
Definition: metric.hpp:635
Metric_flat fmet
Associated flat metric.
Definition: metric.hpp:637
virtual void compute_riemann(int) const
Computes the Riemann tensor, in a given Domain.
Definition: metric_cfc.cpp:228
virtual void compute_cov(int) const
Computes the covariant representation, in a given Domain.
Definition: metric_cfc.cpp:49
virtual int give_type(int) const
Returns the type of tensorial basis of the covariant representation, in a given Domain.
Definition: metric_cfc.cpp:44
virtual void compute_con(int) const
Computes the contravariant representation, in a given Domain.
Definition: metric_cfc.cpp:105
Metric_cfc(Scalar &, const Base_tensor &)
Constructor from a Metric_tensor.
Definition: metric_cfc.cpp:31
virtual Term_eq derive(int, char, const Term_eq &) const
Computes the covariant derivative of a Term_eq (assumes Cartesian basis of decomposition).
Definition: metric_cfc.cpp:367
virtual Term_eq derive_flat(int, char, const Term_eq &) const
Computes the covariant flat derivative of a Term_eq.
Definition: metric_cfc.cpp:352
Term_eq derive_with_other(int tder, char indder, const Term_eq &so, const Metric *othermet) const
Computes the flat covariant derivative.
virtual Term_eq derive(int, char, const Term_eq &) const
Computes the covariant derivative of a Term_eq (assumes Cartesian basis of decomposition).
Particular type of Tensor, dedicated to the desription of metrics.
Purely abstract class for metric handling.
Definition: metric.hpp:39
int type_tensor
States if one works in the CON or COV representation.
Definition: metric.hpp:86
MMPtr_array< Term_eq > p_ricci_tensor
Array of pointers on various Term_eq.
Definition: metric.hpp:70
const Space & espace
The associated Space.
Definition: metric.hpp:42
MMPtr_array< Term_eq > p_met_cov
Array of pointers on various Term_eq.
Definition: metric.hpp:50
MMPtr_array< Term_eq > p_met_con
Array of pointers on various Term_eq.
Definition: metric.hpp:55
virtual void manipulate_ind(Term_eq &so, int ind) const
Uses the Metric to manipulate one of the index of a Term_eq (i.e.
Definition: metric.cpp:645
MMPtr_array< Term_eq > p_riemann
Array of pointers on various Term_eq.
Definition: metric.hpp:65
MMPtr_array< Term_eq > p_christo
Array of pointers on various Term_eq.
Definition: metric.hpp:60
const System_of_eqs * syst
Pointer of the system of equations where the metric is used (only one for now).
Definition: metric.hpp:44
The class Scalar does not really implements scalars in the mathematical sense but rather tensorial co...
Definition: scalar.hpp:67
Val_domain & set_domain(int)
Read/write of a particular Val_domain.
Definition: scalar.hpp:555
void std_base()
Sets the standard basis of decomposition.
Definition: scalar.hpp:399
const Domain * get_domain(int i) const
returns a pointer on the domain.
Definition: space.hpp:1385
int get_ndim() const
Returns the number of dimensions.
Definition: space.hpp:1373
Class used to describe and solve a system of equations.
virtual void add_var(const char *name, double &var)
Addition of a variable (number case)
int ndom
Number of domains used.
char * name_met
Name by which the metric is recognized.
MMPtr_array< Term_eq > term
Pointers on the Term_eq corresponding to the unknown fields.
int dom_min
Smallest domain number.
Metric * met
Pointer on the associated Metric, if defined.
int nvar
Number of unknown fields.
Tensor handling.
Definition: tensor.hpp:149
void set_name_ind(int dd, char name)
Sets the name of one index ; the names must have been affected first.
void set_name_affected()
Affects the name of the indices.
Definition: tensor.hpp:435
Scalar & set(const Array< int > &ind)
Returns the value of a component (read/write version).
Definition: tensor_impl.hpp:91
char const * get_name_ind() const
Definition: tensor.hpp:424
int get_index_type(int i) const
Gives the type (covariant or contravariant) of a given index.
Definition: tensor.hpp:526
int get_valence() const
Returns the valence.
Definition: tensor.hpp:509
Tensor do_summation_one_dom(int dd) const
Does the inner contraction of the Tensor in a given domain.
This class is intended to describe the manage objects appearing in the equations.
Definition: term_eq.hpp:62
Tensor * der_t
Pointer on the variation, if the Term_eq is a Tensor.
Definition: term_eq.hpp:69
int get_dom() const
Definition: term_eq.hpp:135
Tensor * val_t
Pointer on the value, if the Term_eq is a Tensor.
Definition: term_eq.hpp:68
Class for storing the basis of decompositions of a field and its values on both the configuration and...
Definition: val_domain.hpp:69