28char connection_fspher_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Connection/connection_fspher.C,v 1.24 2014/10/13 08:52:50 j_novak Exp $" ;
133#include "connection.h"
170 cout <<
"Connection_fspher::operator= : not implemented yet !" << endl ;
189 int valence1 = valence0 + 1 ;
190 int valence1m1 = valence1 - 1 ;
210 Itbl tipe(valence1) ;
212 for (
int id = 0;
id<valence0;
id++) {
213 tipe.
set(
id) = tipeuu(
id) ;
215 tipe.
set(valence1m1) = COV ;
232 Itbl ind1(valence1) ;
233 Itbl ind0(valence0) ;
241 for (
int ic=0; ic<ncomp0; ic++) {
242 int dzp = uu(uu.
indices(ic)).get_dzpuis() ;
244 if (dzp > dz_in) dz_in = dzp ;
249 for (
int ic=0; ic<ncomp0; ic++) {
250 if ( !(uu(uu.
indices(ic)).check_dzpuis(dz_in)) ) {
251 cout <<
"######## WARNING #######\n" ;
252 cout <<
" Connection_fspher::p_derive_cov : the tensor components \n"
253 <<
" do not have all the same dzpuis ! : \n"
254 <<
" ic, dzpuis(ic), dz_in : " << ic <<
" "
255 << uu(uu.
indices(ic)).get_dzpuis() <<
" " << dz_in << endl ;
260 int dz_resu = (dz_in == 0) ? 2 : dz_in + 1 ;
266 for (
int ic=0; ic<ncomp1; ic++) {
275 for (
int id = 0;
id < valence0;
id++) {
276 ind0.
set(
id) = ind1(
id) ;
280 int k = ind1(valence1m1) ;
287 cresu = (uu(ind0)).dsdr() ;
296 cresu = (uu(ind0)).srdsdt() ;
299 for (
int id=0;
id<valence0;
id++) {
301 switch ( ind0(
id) ) {
333 cerr <<
"Connection_fspher::p_derive_cov : index problem ! "
347 cresu = (uu(ind0)).srstdsdp() ;
350 for (
int id=0;
id<valence0;
id++) {
352 switch ( ind0(
id) ) {
399 cerr <<
"Connection_fspher::p_derive_cov : index problem ! "
411 cerr <<
"Connection_fspher::p_derive_cov : index problem ! \n" ;
437 int valence1 = valence0 - 1 ;
438 int valence0m1 = valence0 - 1 ;
444 assert (valence0 >= 1) ;
460 Itbl tipe(valence1) ;
462 for (
int id = 0;
id<valence1;
id++) {
463 tipe.
set(
id) = tipeuu(
id) ;
501 Itbl ind0(valence0) ;
502 Itbl ind1(valence1) ;
511 for (
int ic=0; ic<ncomp0; ic++) {
512 int dzp = uu(uu.
indices(ic)).get_dzpuis() ;
514 if (dzp > dz_in) dz_in = dzp ;
519 for (
int ic=0; ic<ncomp0; ic++) {
520 if ( !(uu(uu.
indices(ic)).check_dzpuis(dz_in)) ) {
521 cout <<
"######## WARNING #######\n" ;
522 cout <<
" Connection_fspher::p_divergence : the tensor components \n"
523 <<
" do not have all the same dzpuis ! : \n"
524 <<
" ic, dzpuis(ic), dz_in : " << ic <<
" "
525 << uu(uu.
indices(ic)).get_dzpuis() <<
" " << dz_in << endl ;
530 int dz_resu = (dz_in == 0) ? 2 : dz_in + 1 ;
533 for (
int ic=0; ic<ncomp1; ic++) {
543 for (
int id = 0;
id < valence1;
id++) {
544 ind0.
set(
id) = ind1(
id) ;
546 ind0.
set(valence0m1) = k ;
548 cresu = uu(ind0).dsdr() ;
555 for (
int id = 0;
id < valence1;
id++) {
556 ind0.
set(
id) = ind1(
id) ;
558 ind0.
set(valence0m1) = k ;
560 tmp1 = uu(ind0).dsdt() ;
563 ind.
set(valence0m1) = 1 ;
568 for (
int id=0;
id<valence0m1;
id++) {
570 switch ( ind0(
id) ) {
593 cout <<
"Connection_fspher::p_divergence : index problem ! "
606 for (
int id = 0;
id < valence1;
id++) {
607 ind0.
set(
id) = ind1(
id) ;
609 ind0.
set(valence0m1) = k ;
611 tmp1 += uu(ind0).stdsdp() ;
614 ind.
set(valence0m1) = 1 ;
616 ind.
set(valence0m1) = 2 ;
620 for (
int id=0;
id<valence0-1;
id++) {
622 switch ( ind0(
id) ) {
652 cout <<
"Connection_fspher::p_divergence : index problem ! "
Spherical orthonormal vectorial bases (triads).
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)
Base class for coordinate mappings.
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
int get_nzone() const
Returns the number of domains.
int get_type_r(int l) const
Returns the type of sampling in the radial direction in domain no.
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).