KADATH
metric_flat.cpp
1 /*
2  Copyright 2017 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 "system_of_eqs.hpp"
22 #include "tensor.hpp"
23 #include "metric.hpp"
24 #include "term_eq.hpp"
25 #include "scalar.hpp"
26 #include "tensor_impl.hpp"
27 #include "name_tools.hpp"
28 #include "metric_tensor.hpp"
29 namespace Kadath {
30 Metric_flat::Metric_flat (const Space& sp, const Base_tensor& bb) : Metric(sp), basis(bb) {
31 }
32 
33 Metric_flat::Metric_flat (const Metric_flat& so) : Metric (so), basis(so.basis) {
34 }
35 
37  // Nothing to do everything is constant
38 }
39 
41  // Nothing to do everything is constant
42 }
43 
44 void Metric_flat::compute_cov (int dd) const {
45  Metric_tensor res (espace, COV, basis) ;
46 
47  for (int i=1 ; i<=espace.get_ndim() ; i++)
48  for (int j=i ; j<=espace.get_ndim() ; j++)
49  res.set(i,j).set_domain(dd) = (i==j) ? 1. : 0 ;
50  res.std_base() ;
51 
52  if (p_met_cov[dd]==0x0)
53  p_met_cov[dd] = new Term_eq(dd, res) ;
54  else
55  *p_met_cov[dd] = Term_eq (dd, res) ;
56  p_met_cov[dd]->set_der_zero() ;
57 }
58 
59 int Metric_flat::give_type(int dd) const {
60  return basis.get_basis(dd) ;
61 }
62 
63 void Metric_flat::compute_con (int dd) const {
64 
65  Metric_tensor res (espace, CON, basis) ;
66  for (int i=1 ; i<=espace.get_ndim() ; i++)
67  for (int j=i ; j<=espace.get_ndim() ; j++)
68  res.set(i,j).set_domain(dd) = (i==j) ? 1. : 0 ;
69  res.std_base() ;
70  if (p_met_con[dd]==0x0)
71  p_met_con[dd] = new Term_eq(dd, res) ;
72  else
73  *p_met_con[dd] = Term_eq(dd, res) ;
74  p_met_con[dd]->set_der_zero() ;
75 }
76 
77 void Metric_flat::compute_christo (int) const {
78  cerr << "Computation of Christo not explicit for Metric_flat" << endl ;
79  abort() ;
80 }
81 
82 void Metric_flat::compute_ricci_tensor (int dd) const {
83 
84  Metric_tensor res (espace, COV, basis) ;
85  switch (basis.get_basis(dd)) {
86  case CARTESIAN_BASIS :
87  res = 0 ;
88  break ;
89  case SPHERICAL_BASIS :
90  res = 0 ;
91  break ;
92  case MTZ_BASIS :
93  for (int i=1 ; i<=3 ; i++)
94  for (int j=i ; j<=3 ; j++)
95  res.set(i,j).annule_hard() ;
96  res.set(2,2).set_domain(dd) = -2/pow(espace.get_domain(dd)->get_radius(), 2) ;
97  res.set(3,3).set_domain(dd) = res(2,2)(dd) ;
98  break ;
99  default:
100  cerr << "Unknown tensorial basis in Metric_flat::compute_ricci_tensor" << endl ;
101  abort() ;
102  }
103 
104  res.std_base() ;
105  if (p_ricci_tensor[dd]==0x0)
106  p_ricci_tensor[dd] = new Term_eq(dd, res) ;
107  else
108  *p_ricci_tensor[dd] = Term_eq(dd, res) ;
109 
110  p_ricci_tensor[dd]->set_der_zero() ;
111 }
112 
114 
115  Scalar res (espace) ;
116  switch (basis.get_basis(dd)) {
117  case CARTESIAN_BASIS :
118  res = 0 ;
119  break ;
120  case SPHERICAL_BASIS :
121  res = 0 ;
122  break ;
123  case MTZ_BASIS :
124  res.set_domain(dd)= -4/pow(espace.get_domain(dd)->get_radius(), 2) ;
125  break ;
126  default:
127  cerr << "Unknown tensorial basis in Metric_flat::compute_ricci_tensor" << endl ;
128  abort() ;
129  }
130 
131  res.std_base() ;
132  if (p_ricci_scalar[dd]==0x0)
133  p_ricci_scalar[dd] = new Term_eq(dd, res) ;
134  else
135  *p_ricci_scalar[dd] = Term_eq(dd, res) ;
136 
137  p_ricci_scalar[dd]->set_der_zero() ;
138 }
139 
140 void Metric_flat::manipulate_ind (Term_eq& so, int ind) const {
141  // Just change the type of the indice !
142  so.set_val_t()->set_index_type (ind) *= -1 ;
143  if (so.set_der_t() !=0x0)
144  so.set_der_t()->set_index_type (ind) *= -1 ;
145 }
146 
147 
148 Term_eq Metric_flat::derive_partial_cart (int type_der, char ind_der, const Term_eq& so) const {
149 
150  int dom = so.get_dom() ;
151 
152  // Affecte names or not ?
153  bool donames = ((so.val_t->is_name_affected()) || (so.val_t->get_valence()==0)) ? true : false ;
154 
155  // Computation of flat gradient :
156  Term_eq auxi (espace.get_domain(dom)->partial_cart (so)) ;
157 
158  int val_res = auxi.val_t->get_valence() ;
159 
160  if (donames) {
161  // Set the names of the indices :
162  auxi.val_t->set_name_affected() ;
163  auxi.val_t->set_name_ind(0, ind_der) ;
164  for (int i=1 ; i<val_res ; i++)
165  auxi.val_t->set_name_ind(i, so.val_t->get_name_ind()[i-1]) ;
166 
167  if (auxi.der_t!=0x0) {
168  auxi.der_t->set_name_affected() ;
169  auxi.der_t->set_name_ind(0, ind_der) ;
170  for (int i=1 ; i<val_res ; i++)
171  auxi.der_t->set_name_ind(i, so.val_t->get_name_ind()[i-1]) ;
172  }
173  }
174 
175  // Manipulate if Contravariant version
176  if (type_der==CON)
177  manipulate_ind (auxi, 0) ;
178 
179  bool need_sum = false ;
180  if (donames)
181  for (int i=1 ; i<val_res ; i++)
182  if (ind_der== so.val_t->get_name_ind()[i-1])
183  need_sum = true ;
184 
185  if (!need_sum)
186  return auxi ;
187  else {
188  if (auxi.der_t==0x0)
189  return Term_eq (dom, auxi.val_t->do_summation_one_dom(dom)) ;
190  else
191  return Term_eq (dom, auxi.val_t->do_summation_one_dom(dom), auxi.der_t->do_summation_one_dom(dom)) ;
192  }
193 }
194 
195 Term_eq Metric_flat::derive_partial_spher (int type_der, char ind_der, const Term_eq& so) const {
196 
197  int dom = so.get_dom() ;
198  bool donames = ((so.val_t->is_name_affected()) || (so.val_t->get_valence()==0)) ? true : false ;
199 
200  // Computation of flat gradient :
201  Term_eq auxi (espace.get_domain(dom)->partial_spher (so)) ;
202 
203  int val_res = auxi.val_t->get_valence() ;
204 
205  if (donames) {
206  // Set the names of the indices :
207  auxi.val_t->set_name_affected() ;
208  auxi.val_t->set_name_ind(0, ind_der) ;
209  for (int i=1 ; i<val_res ; i++)
210  auxi.val_t->set_name_ind(i, so.val_t->get_name_ind()[i-1]) ;
211 
212  if (auxi.der_t!=0x0) {
213  auxi.der_t->set_name_affected() ;
214  auxi.der_t->set_name_ind(0, ind_der) ;
215  for (int i=1 ; i<val_res ; i++)
216  auxi.der_t->set_name_ind(i, so.val_t->get_name_ind()[i-1]) ;
217  }
218  }
219 
220  // Manipulate if Contravariant version
221  if (type_der==CON)
222  manipulate_ind (auxi, 0) ;
223 
224  bool need_sum = false ;
225  if (donames)
226  for (int i=1 ; i<val_res ; i++)
227  if (ind_der== so.val_t->get_name_ind()[i-1])
228  need_sum = true ;
229 
230  if (!need_sum)
231  return auxi ;
232  else {
233  if (auxi.der_t==0x0)
234  return Term_eq (dom, auxi.val_t->do_summation_one_dom(dom)) ;
235  else
236  return Term_eq (dom, auxi.val_t->do_summation_one_dom(dom), auxi.der_t->do_summation_one_dom(dom)) ;
237  }
238 }
239 
240 Term_eq Metric_flat::derive_partial_mtz (int type_der, char ind_der, const Term_eq& so) const {
241 
242  int dom = so.get_dom() ;
243  bool donames = ((so.val_t->is_name_affected()) || (so.val_t->get_valence()==0)) ? true : false ;
244 
245  // Computation of flat gradient :
246  Term_eq auxi (espace.get_domain(dom)->partial_mtz (so)) ;
247 
248  int val_res = auxi.val_t->get_valence() ;
249 
250  if (donames) {
251  // Set the names of the indices :
252  auxi.val_t->set_name_affected() ;
253  auxi.val_t->set_name_ind(0, ind_der) ;
254  for (int i=1 ; i<val_res ; i++)
255  auxi.val_t->set_name_ind(i, so.val_t->get_name_ind()[i-1]) ;
256 
257  if (auxi.der_t!=0x0) {
258  auxi.der_t->set_name_affected() ;
259  auxi.der_t->set_name_ind(0, ind_der) ;
260  for (int i=1 ; i<val_res ; i++)
261  auxi.der_t->set_name_ind(i, so.val_t->get_name_ind()[i-1]) ;
262  }
263  }
264 
265  // Manipulate if Contravariant version
266  if (type_der==CON)
267  manipulate_ind (auxi, 0) ;
268 
269  bool need_sum = false ;
270  if (donames)
271  for (int i=1 ; i<val_res ; i++)
272  if (ind_der== so.val_t->get_name_ind()[i-1])
273  need_sum = true ;
274 
275  if (!need_sum)
276  return auxi ;
277  else {
278  if (auxi.der_t==0x0)
279  return Term_eq (dom, auxi.val_t->do_summation_one_dom(dom)) ;
280  else
281  return Term_eq (dom, auxi.val_t->do_summation_one_dom(dom), auxi.der_t->do_summation_one_dom(dom)) ;
282  }
283 }
284 
285 
286 
287 Term_eq Metric_flat::derive_partial (int type_der, char ind_der, const Term_eq& so) const {
288 
289  int dom = so.get_dom() ;
290 
291  if (p_met_con[dom]==0x0)
292  compute_con(dom) ;
293  if (p_met_cov[dom]==0x0)
294  compute_cov(dom) ;
295 
296  // so must be tensor :
297  if (so.get_type_data()!=TERM_T) {
298  cerr << "Metric_flat::derive partial only defined for tensor data" << endl ;
299  abort() ;
300  }
301 
302  switch (basis.get_basis(dom)) {
303  case CARTESIAN_BASIS :
304  return derive_partial_cart (type_der, ind_der, so) ;
305  case SPHERICAL_BASIS :
306  return derive_partial_spher (type_der, ind_der, so) ;
307  case MTZ_BASIS :
308  return derive_partial_mtz (type_der, ind_der, so) ;
309  default:
310  cerr << "Unknown tensorial basis in Metric_flat::derive_partial" << endl ;
311  abort() ;
312  }
313 }
314 
315 Term_eq Metric_flat::derive_cart (int type_der, char ind_der, const Term_eq& so) const {
316  return derive_partial (type_der, ind_der, so) ;
317 }
318 
319 Term_eq Metric_flat::derive_spher (int type_der, char ind_der, const Term_eq& so) const {
320 
321  // Computation of flat gradient :
322  Term_eq part_der (derive_partial(type_der, ind_der, so)) ;
323 
324  int dom = so.get_dom() ;
325  bool donames = ((so.val_t->is_name_affected()) || (so.val_t->get_valence()==0)) ? true : false ;
326 
327  Term_eq auxi (espace.get_domain(dom)->connection_spher (so)) ;
328  int val_res = auxi.val_t->get_valence() ;
329 
330  if (donames) {
331  // Set the names of the indices :
332  auxi.val_t->set_name_affected() ;
333  auxi.val_t->set_name_ind(0, ind_der) ;
334  for (int i=1 ; i<val_res ; i++)
335  auxi.val_t->set_name_ind(i, so.val_t->get_name_ind()[i-1]) ;
336 
337  if (auxi.der_t!=0x0) {
338  auxi.der_t->set_name_affected() ;
339  auxi.der_t->set_name_ind(0, ind_der) ;
340  for (int i=1 ; i<val_res ; i++)
341  auxi.der_t->set_name_ind(i, so.val_t->get_name_ind()[i-1]) ;
342  }
343  }
344 
345  // Manipulate if Contravariant version
346  if (type_der==CON)
347  manipulate_ind (auxi, 0) ;
348 
349 
350  bool need_sum = false ;
351  if (donames)
352  for (int i=1 ; i<val_res ; i++)
353  if (ind_der== so.val_t->get_name_ind()[i-1])
354  need_sum = true ;
355 
356  if (!need_sum) {
357  return (part_der + auxi) ;
358  }
359  else {
360  if (auxi.der_t==0x0) {
361 
362 
363  return (part_der + Term_eq (dom, auxi.val_t->do_summation_one_dom(dom))) ;
364  }
365  else
366  return (part_der + Term_eq (dom, auxi.val_t->do_summation_one_dom(dom), auxi.der_t->do_summation_one_dom(dom))) ;
367  }
368 }
369 
370 Term_eq Metric_flat::derive_mtz (int type_der, char ind_der, const Term_eq& so) const {
371 
372 
373  // Computation of flat gradient :
374  Term_eq part_der (derive_partial(type_der, ind_der, so)) ;
375 
376  int dom = so.get_dom() ;
377  bool donames = ((so.val_t->is_name_affected()) || (so.val_t->get_valence()==0)) ? true : false ;
378 
379  Term_eq auxi (espace.get_domain(dom)->connection_mtz (so)) ;
380  int val_res = auxi.val_t->get_valence() ;
381 
382  if (donames) {
383  // Set the names of the indices :
384  auxi.val_t->set_name_affected() ;
385  auxi.val_t->set_name_ind(0, ind_der) ;
386  for (int i=1 ; i<val_res ; i++)
387  auxi.val_t->set_name_ind(i, so.val_t->get_name_ind()[i-1]) ;
388 
389  if (auxi.der_t!=0x0) {
390  auxi.der_t->set_name_affected() ;
391  auxi.der_t->set_name_ind(0, ind_der) ;
392  for (int i=1 ; i<val_res ; i++)
393  auxi.der_t->set_name_ind(i, so.val_t->get_name_ind()[i-1]) ;
394  }
395  }
396 
397  // Manipulate if Contravariant version
398  if (type_der==CON)
399  manipulate_ind (auxi, 0) ;
400 
401 
402  bool need_sum = false ;
403  if (donames)
404  for (int i=1 ; i<val_res ; i++)
405  if (ind_der== so.val_t->get_name_ind()[i-1])
406  need_sum = true ;
407 
408  if (!need_sum) {
409  return (part_der + auxi) ;
410  }
411  else {
412  if (auxi.der_t==0x0) {
413 
414 
415  return (part_der + Term_eq (dom, auxi.val_t->do_summation_one_dom(dom))) ;
416  }
417  else
418  return (part_der + Term_eq (dom, auxi.val_t->do_summation_one_dom(dom), auxi.der_t->do_summation_one_dom(dom))) ;
419  }
420 }
421 
422 Term_eq Metric_flat::derive (int type_der, char ind_der, const Term_eq& so) const {
423 
424  int dom = so.get_dom() ;
425 
426  if (p_met_con[dom]==0x0)
427  compute_con(dom) ;
428  if (p_met_cov[dom]==0x0)
429  compute_cov(dom) ;
430 
431  // so must be tensor :
432  if (so.get_type_data()!=TERM_T) {
433  cerr << "Metric_flat::derive only defined for tensor data" << endl ;
434  abort() ;
435  }
436 
437  switch (basis.get_basis(dom)) {
438  case CARTESIAN_BASIS :
439  return derive_cart (type_der, ind_der, so) ;
440  case SPHERICAL_BASIS :
441  return derive_spher (type_der, ind_der, so) ;
442  case MTZ_BASIS :
443  return derive_mtz (type_der, ind_der, so) ;
444  default:
445  cerr << "Unknown tensorial basis in Metric_flat::derive" << endl ;
446  abort() ;
447  }
448 
449 }
450 Term_eq Metric_flat::derive_with_other_cart (int type_der, char ind_der, const Term_eq& so, const Metric* manipulator) const {
451  int dom = so.get_dom() ;
452  // Call the domain version
453  return so.val_t->get_space().get_domain(dom)->derive_flat_cart (type_der, ind_der, so, manipulator) ;
454 }
455 
456 Term_eq Metric_flat::derive_with_other_spher (int type_der, char ind_der, const Term_eq& so, const Metric* manipulator) const {
457  int dom = so.get_dom() ;
458 
459  // Call the domain version
460  return so.val_t->get_space().get_domain(dom)->derive_flat_spher (type_der, ind_der, so, manipulator) ;
461 }
462 
463 Term_eq Metric_flat::derive_with_other_mtz (int type_der, char ind_der, const Term_eq& so, const Metric* manipulator) const {
464  int dom = so.get_dom() ;
465 
466  // Call the domain version
467  return so.val_t->get_space().get_domain(dom)->derive_flat_mtz (type_der, ind_der, so, manipulator) ;
468 }
469 
470 Term_eq Metric_flat::derive_with_other (int type_der, char ind_der, const Term_eq& so, const Metric* manipulator) const {
471 
472  int dom = so.get_dom() ;
473 
474  if (p_met_con[dom]==0x0)
475  compute_con(dom) ;
476  if (p_met_cov[dom]==0x0)
477  compute_cov(dom) ;
478 
479  // so must be tensor :
480  if (so.get_type_data()!=TERM_T) {
481  cerr << "Metric_flat::derive_with_other only defined for tensor data" << endl ;
482  abort() ;
483  }
484 
485  switch (basis.get_basis(dom)) {
486  case CARTESIAN_BASIS :
487  return derive_with_other_cart (type_der, ind_der, so, manipulator) ;
488  case SPHERICAL_BASIS :
489  return derive_with_other_spher (type_der, ind_der, so, manipulator) ;
490  case MTZ_BASIS :
491  return derive_with_other_mtz (type_der, ind_der, so, manipulator) ;
492  default:
493  cerr << "Unknown tensorial basis in Metric_flat::derive_with_other" << endl ;
494  abort() ;
495  }
496 
497 }
498 
499 void Metric_flat::set_system (System_of_eqs& ss, const char* name) {
500 
501  syst = &ss ;
502  if (syst->met!=0x0) {
503  cerr << "Metric already set for the system" << endl ;
504  abort() ;
505  }
506 
507  ss.met = this ;
508  ss.name_met = new char[LMAX] ;
509  trim_spaces (ss.name_met, name) ;
510 }}
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
virtual Term_eq derive_flat_spher(int tipe, char ind, const Term_eq &so, const Metric *manip) const
Computes the flat derivative of a Term_eq, in spherical orthonormal coordinates.
Definition: domain.cpp:1721
virtual Term_eq partial_mtz(const Term_eq &so) const
Computes the part of the gradient containing the partial derivative of the field, in orthonormal coor...
Definition: domain.cpp:463
virtual Term_eq partial_cart(const Term_eq &so) const
Computes the part of the gradient containing the partial derivative of the field, in Cartesian coordi...
Definition: domain.cpp:338
virtual Term_eq connection_spher(const Term_eq &so) const
Computes the part of the gradient involving the connections, in spherical orthonormal coordinates.
Definition: domain.cpp:544
Val_domain const & get_radius() const
Returns the generalized radius.
Definition: space.hpp:1465
virtual Term_eq derive_flat_cart(int tipe, char ind, const Term_eq &so, const Metric *manip) const
Computes the flat derivative of a Term_eq, in Cartesian coordinates.
Definition: domain.cpp:1733
virtual Term_eq partial_spher(const Term_eq &so) const
Computes the part of the gradient containing the partial derivative of the field, in spherical orthon...
Definition: domain.cpp:383
virtual Term_eq derive_flat_mtz(int tipe, char ind, const Term_eq &so, const Metric *manip) const
Computes the flat derivative of a Term_eq, in spherical coordinates where the constant radii sections...
Definition: domain.cpp:1727
virtual Term_eq connection_mtz(const Term_eq &so) const
Computes the part of the gradient involving the connections, in spherical coordinates where the const...
Definition: domain.cpp:722
Class that deals with flat metric.
Definition: metric.hpp:222
virtual void compute_cov(int) const
Computes the covariant representation, in a given Domain.
Definition: metric_flat.cpp:44
virtual Term_eq derive_partial(int, char, const Term_eq &) const
Computes the partial derivative of a Term_eq (assumes Cartesian basis of decomposition).
Term_eq derive_partial_cart(int tder, char indder, const Term_eq &so) const
Computes the partial derivative part of the covariant derivative, in Cartesian coordinates.
Term_eq derive_partial_spher(int tder, char indder, const Term_eq &so) const
Computes the partial derivative part of the covariant derivative, in orthonormal spherical coordinate...
Term_eq derive_spher(int tder, char indder, const Term_eq &so) const
Computes the flat covariant derivative, in orthonormal spherical coordinates.
Term_eq derive_with_other(int tder, char indder, const Term_eq &so, const Metric *othermet) const
Computes the flat covariant derivative.
Term_eq derive_mtz(int tder, char indder, const Term_eq &so) const
Computes the flat covariant derivative, in orthonormal coordinates where the constant radii sections ...
const Base_tensor & basis
The tensorial basis used.
Definition: metric.hpp:225
virtual int give_type(int) const
Returns the type of tensorial basis of the covariant representation, in a given Domain.
Definition: metric_flat.cpp:59
virtual void compute_ricci_tensor(int) const
Computes the Ricci tensor, in a given Domain.
Definition: metric_flat.cpp:82
Term_eq derive_with_other_cart(int tder, char indder, const Term_eq &so, const Metric *othermet) const
Computes the flat covariant derivative, in Cartesian coordinates.
virtual void update()
Updates the derived quantities (Christoffels etc..) This is done only for the ones that are needed,...
Definition: metric_flat.cpp:36
Term_eq derive_partial_mtz(int tder, char indder, const Term_eq &so) const
Computes the partial derivative part of the covariant derivative, in orthonormal coordinates where th...
virtual void set_system(System_of_eqs &syst, const char *name)
Associate the metric to a given system of equations.
virtual void manipulate_ind(Term_eq &, int) const
Uses the Metric to manipulate one of the index of a Term_eq (i.e.
virtual void compute_christo(int) const
Computes the Christoffel symbols, in a given Domain.
Definition: metric_flat.cpp:77
virtual Term_eq derive(int, char, const Term_eq &) const
Computes the covariant derivative of a Term_eq (assumes Cartesian basis of decomposition).
Term_eq derive_with_other_mtz(int tder, char indder, const Term_eq &so, const Metric *othermet) const
Computes the flat covariant derivative, in orthonormal coordinates where the constant radii sections ...
Term_eq derive_cart(int tder, char indder, const Term_eq &so) const
Computes the flat covariant derivative, in Cartesian coordinates.
virtual void compute_ricci_scalar(int) const
Computes the Ricci scalar, in a given Domain.
Term_eq derive_with_other_spher(int tder, char indder, const Term_eq &so, const Metric *othermet) const
Computes the flat covariant derivative, in orthonormal spherical coordinates.
virtual void compute_con(int) const
Computes the contravariant representation, in a given Domain.
Definition: metric_flat.cpp:63
Particular type of Tensor, dedicated to the desription of metrics.
Purely abstract class for metric handling.
Definition: metric.hpp:39
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
MMPtr_array< Term_eq > p_ricci_scalar
Array of pointers on various Term_eq.
Definition: metric.hpp:75
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
virtual void annule_hard()
Sets the value to zero everywhere in the collocation space (the logical state of the Val_domain is NO...
Definition: scalar.hpp:379
void std_base()
Sets the standard basis of decomposition.
Definition: scalar.hpp:399
The Space class is an ensemble of domains describing the whole space of the computation.
Definition: space.hpp:1362
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.
char * name_met
Name by which the metric is recognized.
Metric * met
Pointer on the associated Metric, if defined.
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
virtual void std_base()
Sets the standard spectal bases of decomposition for each component.
Definition: tensor.cpp:385
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_valence() const
Returns the valence.
Definition: tensor.hpp:509
bool is_name_affected() const
Check whether the names of the indices have been affected.
Definition: tensor.hpp:429
Tensor do_summation_one_dom(int dd) const
Does the inner contraction of the Tensor in a given domain.
const Space & get_space() const
Returns the Space.
Definition: tensor.hpp:499
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
void set_der_t(Tensor)
Sets the tensorial variation (only the values in the pertinent Domain are copied).
Definition: term_eq.cpp:171
int get_dom() const
Definition: term_eq.hpp:135
int get_type_data() const
Definition: term_eq.hpp:131
void set_val_t(Tensor)
Sets the tensorial value (only the values in the pertinent Domain are copied).
Definition: term_eq.cpp:155
Tensor * val_t
Pointer on the value, if the Term_eq is a Tensor.
Definition: term_eq.hpp:68