20 #include "headcpp.hpp"
21 #include "utilities.hpp"
22 #include "spheric_symphi.hpp"
23 #include "term_eq.hpp"
26 #include "tensor_impl.hpp"
30 assert ((type_der==COV) || (type_der==CON)) ;
33 bool donames = (ind_der==
' ') ?
false :
true ;
34 bool need_sum = false ;
37 type_ind.
set(0) = COV ;
38 for (
int i=1 ; i<val_res ; i++)
45 for (
int i=1 ; i<val_res ; i++)
58 for (
int i=1 ; i<val_res ; i++)
64 Index pos_auxi_bis(auxi_val) ;
67 for (
int i=0 ; i<val_res-1 ; i++)
68 pos_so_bis.
set(i) = pos_auxi_bis(i+1) ;
69 switch (pos_auxi_bis(0)) {
83 cerr <<
"Bad indice in Domain_nucleus_symphi::derive_flat_spher" << endl ;
87 while (pos_auxi_bis.
inc()) ;
90 for (
int ind_sum=0 ; ind_sum<val_res-1 ; ind_sum++) {
93 Index pos_auxi(auxi_val) ;
97 for (
int i=0 ; i<val_res-1 ; i++)
98 pos_so.
set(i) = pos_auxi(i+1) ;
100 switch (pos_auxi(0)) {
107 switch (pos_auxi(ind_sum+1)) {
110 pos_so.
set(ind_sum) = 1 ;
115 pos_so.
set(ind_sum) = 0 ;
122 cerr <<
"Bad indice in Domain_nucleus_symphi::derive_flat_spher" << endl ;
129 switch (pos_auxi(ind_sum+1)) {
132 pos_so.
set(ind_sum) = 2 ;
137 pos_so.
set(ind_sum) = 2 ;
142 pos_so.
set(ind_sum) = 0 ;
144 pos_so.
set(ind_sum) = 1 ;
148 cerr <<
"Bad indice in Domain_nucleus_symphi::derive_flat_spher" << endl ;
153 cerr <<
"Bad indice in Domain_nucleus_symphi::derive_flat_spher" << endl ;
157 while (pos_auxi.
inc()) ;
181 for (
int i=1 ; i<val_res ; i++)
187 Index pos_auxi_der_bis(auxi_der) ;
189 for (
int i=0 ; i<val_res-1 ; i++)
190 pos_so_bis.
set(i) = pos_auxi_der_bis(i+1) ;
191 switch (pos_auxi_der_bis(0)) {
205 cerr <<
"Bad indice in Domain_nucleus_symphi::derive_flat_spher" << endl ;
209 while (pos_auxi_der_bis.
inc()) ;
212 for (
int ind_sum=0 ; ind_sum<val_res-1 ; ind_sum++) {
215 Index pos_auxi_der(auxi_val) ;
219 for (
int i=0 ; i<val_res-1 ; i++)
220 pos_so.
set(i) = pos_auxi_der(i+1) ;
222 switch (pos_auxi_der(0)) {
229 switch (pos_auxi_der(ind_sum+1)) {
232 pos_so.
set(ind_sum) = 1 ;
237 pos_so.
set(ind_sum) = 0 ;
244 cerr <<
"Bad indice in Domain_nucleus_symphi::derive_flat_spher" << endl ;
251 switch (pos_auxi_der(ind_sum+1)) {
254 pos_so.
set(ind_sum) = 2 ;
259 pos_so.
set(ind_sum) = 2 ;
264 pos_so.
set(ind_sum) = 0 ;
266 pos_so.
set(ind_sum) = 1 ;
270 cerr <<
"Bad indice in Domain_nucleus_symphi::derive_flat_spher" << endl ;
275 cerr <<
"Bad indice in Domain_nucleus_symphi::derive_flat_spher" << endl ;
279 while (pos_auxi_der.
inc()) ;
298 bool doder = (so.
der_t==0x0) ?
false :
true ;
302 assert ((type_der==COV) || (type_der==CON)) ;
311 type_ind.
set(0) = COV ;
312 for (
int i=1 ; i<val_res ; i++)
316 bool need_sum = false ;
318 for (
int i=1 ; i<val_res ; i++)
331 for (
int i=1 ; i<val_res ; i++)
336 Index pos_auxi(auxi_val) ;
339 for (
int i=0 ; i<val_res-1 ; i++)
340 pos_so.
set(i) = pos_auxi(i+1) ;
343 while (pos_auxi.
inc()) ;
364 for (
int i=1 ; i<val_res ; i++)
368 Index pos_auxi_der(auxi_der) ;
370 for (
int i=0 ; i<val_res-1 ; i++)
371 pos_so.
set(i) = pos_auxi_der(i+1) ;
374 while (pos_auxi_der.
inc()) ;
reference set(const Index &pos)
Read/write of an element.
Describes the tensorial basis used by the various tensors.
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 derive_flat_spher(int, char, const Term_eq &, const Metric *) const
Computes the flat derivative of a Term_eq, in spherical orthonormal coordinates.
virtual Val_domain der_r(const Val_domain &) const
Compute the radial derivative of a scalar field.
virtual Val_domain div_r(const Val_domain &) const
Division 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_r() const
Division by the radius.
Val_domain div_sin_theta() const
Division by .
Val_domain mult_cos_theta() const
Multiplication by .