20 #include "headcpp.hpp"
22 #include "utilities.hpp"
23 #include "polar_periodic.hpp"
24 #include "term_eq.hpp"
27 #include "tensor_impl.hpp"
37 type_ind.
set(0) = COV ;
38 for (
int i=1 ; i<val_res ; i++)
48 Index pos_auxi(auxi_val) ;
51 for (
int i=0 ; i<val_res-1 ; i++)
52 pos_so.
set(i) = pos_auxi(i+1) ;
53 switch (pos_auxi(0)) {
67 cerr <<
"Bad indice in Domain_polar_periodic_shell::derive_partial_spher" << endl ;
71 while (pos_auxi.
inc()) ;
74 return Term_eq (dom, auxi_val) ;
82 Index pos_auxi_der(auxi_der) ;
84 for (
int i=0 ; i<val_res-1 ; i++)
85 pos_so.
set(i) = pos_auxi_der(i+1) ;
86 switch (pos_auxi_der(0)) {
100 cerr <<
"Bad indice in Domain_polar_periodic_shell::derive_partial_spher" << endl ;
104 while (pos_auxi_der.
inc()) ;
106 return Term_eq (dom, auxi_val, auxi_der) ;
113 assert ((type_der==COV) || (type_der==CON)) ;
116 bool donames = (ind_der==
' ') ?
false :
true ;
117 bool need_sum = false ;
120 type_ind.
set(0) = COV ;
121 for (
int i=1 ; i<val_res ; i++)
128 for (
int i=1 ; i<val_res ; i++)
141 for (
int i=1 ; i<val_res ; i++)
147 Index pos_auxi_bis(auxi_val) ;
150 for (
int i=0 ; i<val_res-1 ; i++)
151 pos_so_bis.
set(i) = pos_auxi_bis(i+1) ;
152 switch (pos_auxi_bis(0)) {
166 cerr <<
"Bad indice in Domain_polar_periodic_shell::derive_flat_spher" << endl ;
170 while (pos_auxi_bis.
inc()) ;
173 for (
int ind_sum=0 ; ind_sum<val_res-1 ; ind_sum++) {
176 Index pos_auxi(auxi_val) ;
180 for (
int i=0 ; i<val_res-1 ; i++)
181 pos_so.
set(i) = pos_auxi(i+1) ;
183 switch (pos_auxi(0)) {
190 switch (pos_auxi(ind_sum+1)) {
193 pos_so.
set(ind_sum) = 1 ;
198 pos_so.
set(ind_sum) = 0 ;
205 cerr <<
"Bad indice in Domain_polar_periodic_shell::derive_flat_spher" << endl ;
212 switch (pos_auxi(ind_sum+1)) {
215 pos_so.
set(ind_sum) = 2 ;
220 pos_so.
set(ind_sum) = 2 ;
225 pos_so.
set(ind_sum) = 0 ;
227 pos_so.
set(ind_sum) = 1 ;
231 cerr <<
"Bad indice in Domain_shell::derive_flat_spher" << endl ;
236 cerr <<
"Bad indice in Domain_shell::derive_flat_spher" << endl ;
240 while (pos_auxi.
inc()) ;
266 for (
int i=1 ; i<val_res ; i++)
272 Index pos_auxi_der_bis(auxi_der) ;
274 for (
int i=0 ; i<val_res-1 ; i++)
275 pos_so_bis.
set(i) = pos_auxi_der_bis(i+1) ;
276 switch (pos_auxi_der_bis(0)) {
290 cerr <<
"Bad indice in Domain_polar_periodic_shell::derive_flat_spher" << endl ;
294 while (pos_auxi_der_bis.
inc()) ;
297 for (
int ind_sum=0 ; ind_sum<val_res-1 ; ind_sum++) {
300 Index pos_auxi_der(auxi_val) ;
304 for (
int i=0 ; i<val_res-1 ; i++)
305 pos_so.
set(i) = pos_auxi_der(i+1) ;
307 switch (pos_auxi_der(0)) {
314 switch (pos_auxi_der(ind_sum+1)) {
317 pos_so.
set(ind_sum) = 1 ;
322 pos_so.
set(ind_sum) = 0 ;
329 cerr <<
"Bad indice in Domain_shell::derive_flat_spher" << endl ;
336 switch (pos_auxi_der(ind_sum+1)) {
339 pos_so.
set(ind_sum) = 2 ;
344 pos_so.
set(ind_sum) = 2 ;
349 pos_so.
set(ind_sum) = 0 ;
351 pos_so.
set(ind_sum) = 1 ;
355 cerr <<
"Bad indice in Domain_polar_periodic_shell::derive_flat_spher" << endl ;
360 cerr <<
"Bad indice in Domain_polar_periodic_shell::derive_flat_spher" << endl ;
364 while (pos_auxi_der.
inc()) ;
reference set(const Index &pos)
Read/write of an element.
Describes the tensorial basis used by the various tensors.
int & set_basis(int nd)
Read/write the basis in a given domain.
virtual Val_domain div_r(const Val_domain &) const
Division by .
virtual Term_eq partial_spher(const Term_eq &) const
Computes the part of the gradient containing the partial derivative of the field, in spherical orthon...
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.
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.
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 const & get_val_t() const
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 .