20 #include "headcpp.hpp"
22 #include "utilities.hpp"
23 #include "spheric.hpp"
24 #include "val_domain.hpp"
26 #include "tensor_impl.hpp"
27 #include "term_eq.hpp"
32 assert ((type_der==COV) || (type_der==CON)) ;
35 bool donames = (ind_der==
' ') ?
false :
true ;
36 bool need_sum = false ;
39 type_ind.
set(0) = COV ;
40 for (
int i=1 ; i<val_res ; i++)
47 for (
int i=1 ; i<val_res ; i++)
60 for (
int i=1 ; i<val_res ; i++)
66 Index pos_auxi_bis(auxi_val) ;
69 for (
int i=0 ; i<val_res-1 ; i++)
70 pos_so_bis.
set(i) = pos_auxi_bis(i+1) ;
71 switch (pos_auxi_bis(0)) {
85 cerr <<
"Bad indice in Domain_shell::derive_flat_spher" << endl ;
89 while (pos_auxi_bis.
inc()) ;
92 for (
int ind_sum=0 ; ind_sum<val_res-1 ; ind_sum++) {
95 Index pos_auxi(auxi_val) ;
99 for (
int i=0 ; i<val_res-1 ; i++)
100 pos_so.
set(i) = pos_auxi(i+1) ;
102 switch (pos_auxi(0)) {
109 switch (pos_auxi(ind_sum+1)) {
112 pos_so.
set(ind_sum) = 1 ;
117 pos_so.
set(ind_sum) = 0 ;
124 cerr <<
"Bad indice in Domain_shell::derive_flat_spher" << endl ;
131 switch (pos_auxi(ind_sum+1)) {
134 pos_so.
set(ind_sum) = 2 ;
139 pos_so.
set(ind_sum) = 2 ;
144 pos_so.
set(ind_sum) = 0 ;
146 pos_so.
set(ind_sum) = 1 ;
150 cerr <<
"Bad indice in Domain_shell::derive_flat_spher" << endl ;
155 cerr <<
"Bad indice in Domain_shell::derive_flat_spher" << endl ;
159 while (pos_auxi.
inc()) ;
183 for (
int i=1 ; i<val_res ; i++)
189 Index pos_auxi_der_bis(auxi_der) ;
191 for (
int i=0 ; i<val_res-1 ; i++)
192 pos_so_bis.
set(i) = pos_auxi_der_bis(i+1) ;
193 switch (pos_auxi_der_bis(0)) {
207 cerr <<
"Bad indice in Domain_shell::derive_flat_spher" << endl ;
211 while (pos_auxi_der_bis.
inc()) ;
214 for (
int ind_sum=0 ; ind_sum<val_res-1 ; ind_sum++) {
217 Index pos_auxi_der(auxi_val) ;
221 for (
int i=0 ; i<val_res-1 ; i++)
222 pos_so.
set(i) = pos_auxi_der(i+1) ;
224 switch (pos_auxi_der(0)) {
231 switch (pos_auxi_der(ind_sum+1)) {
234 pos_so.
set(ind_sum) = 1 ;
239 pos_so.
set(ind_sum) = 0 ;
246 cerr <<
"Bad indice in Domain_shell::derive_flat_spher" << endl ;
253 switch (pos_auxi_der(ind_sum+1)) {
256 pos_so.
set(ind_sum) = 2 ;
261 pos_so.
set(ind_sum) = 2 ;
266 pos_so.
set(ind_sum) = 0 ;
268 pos_so.
set(ind_sum) = 1 ;
272 cerr <<
"Bad indice in Domain_shell::derive_flat_spher" << endl ;
277 cerr <<
"Bad indice in Domain_shell::derive_flat_spher" << endl ;
281 while (pos_auxi_der.
inc()) ;
301 bool doder = (so.
der_t==0x0) ?
false :
true ;
305 assert ((type_der==COV) || (type_der==CON)) ;
314 type_ind.
set(0) = COV ;
315 for (
int i=1 ; i<val_res ; i++)
319 bool need_sum = false ;
321 for (
int i=1 ; i<val_res ; i++)
334 for (
int i=1 ; i<val_res ; i++)
339 Index pos_auxi(auxi_val) ;
342 for (
int i=0 ; i<val_res-1 ; i++)
343 pos_so.
set(i) = pos_auxi(i+1) ;
346 while (pos_auxi.
inc()) ;
367 for (
int i=1 ; i<val_res ; i++)
371 Index pos_auxi_der(auxi_der) ;
373 for (
int i=0 ; i<val_res-1 ; i++)
374 pos_so.
set(i) = pos_auxi_der(i+1) ;
377 while (pos_auxi_der.
inc()) ;
397 assert ((type_der==COV) || (type_der==CON)) ;
400 bool donames = (ind_der==
' ') ?
false :
true ;
401 bool need_sum = false ;
404 type_ind.
set(0) = COV ;
405 for (
int i=1 ; i<val_res ; i++)
412 for (
int i=1 ; i<val_res ; i++)
425 for (
int i=1 ; i<val_res ; i++)
431 Index pos_auxi_bis(auxi_val) ;
434 for (
int i=0 ; i<val_res-1 ; i++)
435 pos_so_bis.
set(i) = pos_auxi_bis(i+1) ;
436 switch (pos_auxi_bis(0)) {
450 cerr <<
"Bad indice in Domain_shell::derive_flat_mtz" << endl ;
454 while (pos_auxi_bis.
inc()) ;
457 for (
int ind_sum=0 ; ind_sum<val_res-1 ; ind_sum++) {
460 Index pos_auxi(auxi_val) ;
464 for (
int i=0 ; i<val_res-1 ; i++)
465 pos_so.
set(i) = pos_auxi(i+1) ;
467 switch (pos_auxi(0)) {
474 switch (pos_auxi(ind_sum+1)) {
477 pos_so.
set(ind_sum) = 1 ;
482 pos_so.
set(ind_sum) = 0 ;
489 cerr <<
"Bad indice in Domain_shell::derive_flat_mtz" << endl ;
496 switch (pos_auxi(ind_sum+1)) {
499 pos_so.
set(ind_sum) = 2 ;
504 pos_so.
set(ind_sum) = 2 ;
509 pos_so.
set(ind_sum) = 0 ;
511 pos_so.
set(ind_sum) = 1 ;
515 cerr <<
"Bad indice in Domain_shell::derive_flat_mtz" << endl ;
520 cerr <<
"Bad indice in Domain_shell::derive_flat_mtz" << endl ;
524 while (pos_auxi.
inc()) ;
548 for (
int i=1 ; i<val_res ; i++)
554 Index pos_auxi_der_bis(auxi_der) ;
556 for (
int i=0 ; i<val_res-1 ; i++)
557 pos_so_bis.
set(i) = pos_auxi_der_bis(i+1) ;
558 switch (pos_auxi_der_bis(0)) {
572 cerr <<
"Bad indice in Domain_shell::derive_flat_mtz" << endl ;
576 while (pos_auxi_der_bis.
inc()) ;
579 for (
int ind_sum=0 ; ind_sum<val_res-1 ; ind_sum++) {
582 Index pos_auxi_der(auxi_val) ;
586 for (
int i=0 ; i<val_res-1 ; i++)
587 pos_so.
set(i) = pos_auxi_der(i+1) ;
589 switch (pos_auxi_der(0)) {
596 switch (pos_auxi_der(ind_sum+1)) {
599 pos_so.
set(ind_sum) = 1 ;
604 pos_so.
set(ind_sum) = 0 ;
611 cerr <<
"Bad indice in Domain_shell::derive_flat_mtz" << endl ;
618 switch (pos_auxi_der(ind_sum+1)) {
621 pos_so.
set(ind_sum) = 2 ;
626 pos_so.
set(ind_sum) = 2 ;
631 pos_so.
set(ind_sum) = 0 ;
633 pos_so.
set(ind_sum) = 1 ;
637 cerr <<
"Bad indice in Domain_shell::derive_flat_mtz" << endl ;
642 cerr <<
"Bad indice in Domain_shell::derive_flat_mtz" << endl ;
646 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 Val_domain div_r(const Val_domain &) const
Division by .
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 Val_domain der_r(const Val_domain &) const
Compute the radial derivative of a scalar field.
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 Term_eq derive_flat_mtz(int, char, const Term_eq &, const Metric *) const
Computes the flat derivative of a Term_eq, in spherical coordinates where the constant radii sections...
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 .