136#include "connection.h"
173 cout <<
"Connection_fspher::operator= : not implemented yet !" << endl ;
192 int valence1 = valence0 + 1 ;
193 int valence1m1 = valence1 - 1 ;
213 Itbl tipe(valence1) ;
215 for (
int id = 0;
id<valence0;
id++) {
216 tipe.
set(
id) = tipeuu(
id) ;
218 tipe.
set(valence1m1) = COV ;
235 Itbl ind1(valence1) ;
236 Itbl ind0(valence0) ;
244 for (
int ic=0; ic<ncomp0; ic++) {
245 int dzp = uu(uu.
indices(ic)).get_dzpuis() ;
247 if (dzp > dz_in) dz_in = dzp ;
252 for (
int ic=0; ic<ncomp0; ic++) {
253 if ( !(uu(uu.
indices(ic)).check_dzpuis(dz_in)) ) {
254 cout <<
"######## WARNING #######\n" ;
255 cout <<
" Connection_fspher::p_derive_cov : the tensor components \n"
256 <<
" do not have all the same dzpuis ! : \n"
257 <<
" ic, dzpuis(ic), dz_in : " << ic <<
" "
258 << uu(uu.
indices(ic)).get_dzpuis() <<
" " << dz_in << endl ;
263 int dz_resu = (dz_in == 0) ? 2 : dz_in + 1 ;
264 int nzm1 =
mp->get_mg()->get_nzone() - 1 ;
265 if (
mp->get_mg()->get_type_r(nzm1) != UNSURR) dz_resu = 0 ;
269 for (
int ic=0; ic<ncomp1; ic++) {
278 for (
int id = 0;
id < valence0;
id++) {
279 ind0.
set(
id) = ind1(
id) ;
283 int k = ind1(valence1m1) ;
290 cresu = (uu(ind0)).
dsdr() ;
299 cresu = (uu(ind0)).
srdsdt() ;
302 for (
int id=0;
id<valence0;
id++) {
304 switch ( ind0(
id) ) {
336 cerr <<
"Connection_fspher::p_derive_cov : index problem ! "
353 for (
int id=0;
id<valence0;
id++) {
355 switch ( ind0(
id) ) {
402 cerr <<
"Connection_fspher::p_derive_cov : index problem ! "
414 cerr <<
"Connection_fspher::p_derive_cov : index problem ! \n" ;
440 int valence1 = valence0 - 1 ;
441 int valence0m1 = valence0 - 1 ;
447 assert (valence0 >= 1) ;
463 Itbl tipe(valence1) ;
465 for (
int id = 0;
id<valence1;
id++) {
466 tipe.
set(
id) = tipeuu(
id) ;
504 Itbl ind0(valence0) ;
505 Itbl ind1(valence1) ;
514 for (
int ic=0; ic<ncomp0; ic++) {
515 int dzp = uu(uu.
indices(ic)).get_dzpuis() ;
517 if (dzp > dz_in) dz_in = dzp ;
522 for (
int ic=0; ic<ncomp0; ic++) {
523 if ( !(uu(uu.
indices(ic)).check_dzpuis(dz_in)) ) {
524 cout <<
"######## WARNING #######\n" ;
525 cout <<
" Connection_fspher::p_divergence : the tensor components \n"
526 <<
" do not have all the same dzpuis ! : \n"
527 <<
" ic, dzpuis(ic), dz_in : " << ic <<
" "
528 << uu(uu.
indices(ic)).get_dzpuis() <<
" " << dz_in << endl ;
533 int dz_resu = (dz_in == 0) ? 2 : dz_in + 1 ;
536 for (
int ic=0; ic<ncomp1; ic++) {
546 for (
int id = 0;
id < valence1;
id++) {
547 ind0.
set(
id) = ind1(
id) ;
549 ind0.
set(valence0m1) = k ;
551 cresu = uu(ind0).dsdr() ;
558 for (
int id = 0;
id < valence1;
id++) {
559 ind0.
set(
id) = ind1(
id) ;
561 ind0.
set(valence0m1) = k ;
563 tmp1 = uu(ind0).dsdt() ;
566 ind.
set(valence0m1) = 1 ;
571 for (
int id=0;
id<valence0m1;
id++) {
573 switch ( ind0(
id) ) {
596 cout <<
"Connection_fspher::p_divergence : index problem ! "
609 for (
int id = 0;
id < valence1;
id++) {
610 ind0.
set(
id) = ind1(
id) ;
612 ind0.
set(valence0m1) = k ;
614 tmp1 += uu(ind0).stdsdp() ;
617 ind.
set(valence0m1) = 1 ;
619 ind.
set(valence0m1) = 2 ;
623 for (
int id=0;
id<valence0-1;
id++) {
625 switch ( ind0(
id) ) {
655 cout <<
"Connection_fspher::p_divergence : index problem ! "
Spherical orthonormal vectorial bases (triads).
Connection_flat(const Map &, const Base_vect &)
Contructor from a triad, has to be defined in the derived classes.
Connection_fspher(const Map &, const Base_vect_spher &)
Contructor from a spherical flat-metric-orthonormal basis.
void operator=(const Connection_fspher &)
Assignment to another Connection_fspher.
virtual Tensor * p_divergence(const Tensor &tens) const
Computes the divergence of a tensor (with respect to the current connection).
virtual ~Connection_fspher()
destructor
virtual Tensor * p_derive_cov(const Tensor &tens) const
Computes the covariant derivative of a tensor (with respect to the current connection).
const Base_vect *const triad
Triad with respect to which the connection coefficients are defined.
const Map *const mp
Reference mapping.
Basic integer array class.
int & set(int i)
Read/write of a particular element (index i ) (1D case).
Tensor field of valence 0 (or component of a tensorial field).
void div_r_dzpuis(int ced_mult_r)
Division by r everywhere but with the output flag dzpuis set to ced_mult_r .
void div_tant()
Division by .
Class intended to describe valence-2 symmetric tensors.
Symmetric tensors (with respect to two of their arguments).
Tensor field of valence 1.
int sym_index1() const
Number of the first symmetric index (0<= id_sym1 < valence ).
int get_index_type(int i) const
Gives the type (covariant or contravariant) of the index number i .
int sym_index2() const
Number of the second symmetric index (id_sym1 < id_sym2 < valence ).
int get_valence() const
Returns the valence.
virtual Itbl indices(int pos) const
Returns the indices of a component given by its position in the array cmp .
int get_n_comp() const
Returns the number of stored components.
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.
Scalar & set(const Itbl &ind)
Returns the value of a component (read/write version).
virtual void srstdsdp(const Cmp &ci, Cmp &resu) const =0
Computes of a Cmp .
virtual void dsdr(const Cmp &ci, Cmp &resu) const =0
Computes of a Cmp .
Map(const Mg3d &)
Constructor from a multi-domain 3D grid.
virtual void srdsdt(const Cmp &ci, Cmp &resu) const =0
Computes of a Cmp .