20 #include "headcpp.hpp"
21 #include "utilities.hpp"
22 #include "adapted.hpp"
24 #include "array_math.hpp"
25 #include "term_eq.hpp"
28 #include "tensor_impl.hpp"
33 assert ((type_der==COV) || (type_der==CON)) ;
36 bool donames = (ind_der==
' ') ?
false :
true ;
37 bool need_sum = false ;
40 type_ind.
set(0) = COV ;
41 for (
int i=1 ; i<val_res ; i++)
48 for (
int i=1 ; i<val_res ; i++)
56 bool doder = (fgrad.
der_t==0x0) ?
false :
true ;
69 for (
int i=1 ; i<val_res ; i++) {
77 Index pos_auxi_bis(auxi_val) ;
81 for (
int ind_sum=0 ; ind_sum<val_res-1 ; ind_sum++) {
84 Index pos_auxi(auxi_val) ;
88 for (
int i=0 ; i<val_res-1 ; i++)
89 pos_so.
set(i) = pos_auxi(i+1) ;
91 switch (pos_auxi(0)) {
98 switch (pos_auxi(ind_sum+1)) {
101 pos_so.
set(ind_sum) = 1 ;
106 pos_so.
set(ind_sum) = 0 ;
113 cerr <<
"Bad indice in Domain_shell_inner_adapted::derive_flat_spher" << endl ;
120 switch (pos_auxi(ind_sum+1)) {
123 pos_so.
set(ind_sum) = 2 ;
128 pos_so.
set(ind_sum) = 2 ;
133 pos_so.
set(ind_sum) = 0 ;
135 pos_so.
set(ind_sum) = 1 ;
139 cerr <<
"Bad indice in Domain_shell_inner_adapted::derive_flat_spher" << endl ;
144 cerr <<
"Bad indice in Domain_shell_inner_adapted::derive_flat_spher" << endl ;
148 while (pos_auxi.
inc()) ;
178 for (
int i=1 ; i<val_res ; i++) {
186 Index pos_auxi_der_bis(auxi_der) ;
189 for (
int ind_sum=0 ; ind_sum<val_res-1 ; ind_sum++) {
192 Index pos_auxi_der(auxi_val) ;
196 for (
int i=0 ; i<val_res-1 ; i++)
197 pos_so.
set(i) = pos_auxi_der(i+1) ;
199 switch (pos_auxi_der(0)) {
206 switch (pos_auxi_der(ind_sum+1)) {
209 pos_so.
set(ind_sum) = 1 ;
214 pos_so.
set(ind_sum) = 0 ;
221 cerr <<
"Bad indice in Domain_shell_inner_adapted::derive_flat_spher" << endl ;
228 switch (pos_auxi_der(ind_sum+1)) {
231 pos_so.
set(ind_sum) = 2 ;
236 pos_so.
set(ind_sum) = 2 ;
241 pos_so.
set(ind_sum) = 0 ;
243 pos_so.
set(ind_sum) = 1 ;
247 cerr <<
"Bad indice in Domain_shell_inner_adapted::derive_flat_spher" << endl ;
252 cerr <<
"Bad indice in Domain_shell_inner_adapted::derive_flat_spher" << endl ;
256 while (pos_auxi_der.
inc()) ;
278 bool doder = (so.
der_t==0x0) ?
false :
true ;
282 assert ((type_der==COV) || (type_der==CON)) ;
291 if (fgrad.
der_t==0x0)
295 bool need_sum = false ;
297 for (
int i=1 ; i<val_res ; i++)
305 for (
int i=1 ; i<val_res ; i++)
324 for (
int i=1 ; i<val_res ; i++)
reference set(const Index &pos)
Read/write of an element.
Describes the tensorial basis used by the various tensors.
Term_eq flat_grad_spher(const Term_eq &) const
Computes the flat gradient of a field, in orthonormal spherical coordinates.
virtual Term_eq derive_flat_spher(int, char, const Term_eq &, const Metric *) const
Computes the flat derivative of a Term_eq, in spherical orthonormal coordinates.
Term_eq * rad_term_eq
Pointer on the Term_eq containing the radius.
virtual Term_eq derive_flat_cart(int, char, const Term_eq &, const Metric *) const
Computes the flat derivative of a Term_eq, in Cartesian coordinates.
virtual Term_eq partial_cart(const Term_eq &) const
Computes the part of the gradient containing the partial derivative of the field, in Cartesian coordi...
virtual Val_domain mult_cos_theta(const Val_domain &) const
Multiplication by .
int num_dom
Number of the current domain (used by the Space)
Class that gives the position inside a multi-dimensional Array.
int & set(int i)
Read/write of the position in a given dimension.
bool inc(int increm, int var=0)
Increments the position of the Index.
Purely abstract class for metric handling.
MMPtr_array< Term_eq > p_met_con
Array of pointers on various Term_eq.
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.
Val_domain & set_domain(int)
Read/write of a particular Val_domain.
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.
Scalar & set(const Array< int > &ind)
Returns the value of a component (read/write version).
char const * get_name_ind() const
int get_index_type(int i) const
Gives the type (covariant or contravariant) of a given index.
int get_valence() const
Returns the valence.
bool is_name_affected() const
Check whether the names of the indices have been affected.
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.
This class is intended to describe the manage objects appearing in the equations.
Tensor * der_t
Pointer on the variation, if the Term_eq is a Tensor.
Tensor * val_t
Pointer on the value, if the Term_eq is a Tensor.
Val_domain div_sin_theta() const
Division by .