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 ;
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 ! " 350 cresu = (uu(ind0)).srstdsdp() ;
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) ;
502 int ncomp1 = resu->get_n_comp() ;
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++) {
538 ind1 = resu->indices(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 ! " Connection_fspher(const Map &, const Base_vect_spher &)
Contructor from a spherical flat-metric-orthonormal basis.
int & set(int i)
Read/write of a particular element (index i ) (1D case)
virtual Tensor * p_divergence(const Tensor &tens) const
Computes the divergence of a tensor (with respect to the current connection).
const Map *const mp
Reference mapping.
int sym_index1() const
Number of the first symmetric index (0<= id_sym1 < valence )
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
Tensor field of valence 0 (or component of a tensorial field).
Base class for coordinate mappings.
int get_n_comp() const
Returns the number of stored components.
int sym_index2() const
Number of the second symmetric index (id_sym1 < id_sym2 < valence )
Basic integer array class.
Tensor field of valence 1.
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.
int get_index_type(int i) const
Gives the type (covariant or contravariant) of the index number i .
virtual ~Connection_fspher()
destructor
int get_nzone() const
Returns the number of domains.
void operator=(const Connection_fspher &)
Assignment to another Connection_fspher.
int get_valence() const
Returns the valence.
Spherical orthonormal vectorial bases (triads).
Scalar & set(const Itbl &ind)
Returns the value of a component (read/write version).
Symmetric tensors (with respect to two of their arguments).
int get_type_r(int l) const
Returns the type of sampling in the radial direction in domain no.
virtual Tensor * p_derive_cov(const Tensor &tens) const
Computes the covariant derivative of a tensor (with respect to the current connection).
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 .
const Base_vect *const triad
Triad with respect to which the connection coefficients are defined.
Class intended to describe valence-2 symmetric tensors.
virtual Itbl indices(int pos) const
Returns the indices of a component given by its position in the array cmp .