30char vector_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Tensor/vector.C,v 1.30 2014/10/13 08:53:44 j_novak Exp $" ;
221 for (
int i=0;
i<N_MET_MAX;
i++)
224 if (
p_A != 0x0)
delete p_A ;
234 for (
int i=0;
i<N_MET_MAX;
i++)
273 for (
int i=0 ;
i<3 ;
i++) {
287 for (
int i=0 ;
i<3 ;
i++) {
298 assert ( (index>=1) && (index<=3) ) ;
302 return *
cmp[index - 1] ;
307 assert ( (index>=1) && (index<=3) ) ;
309 return *
cmp[index - 1] ;
320 if (
triad->identify() == (
mp->get_bvect_cart()).identify() ) {
323 bases =
mp->get_mg()->std_base_vect_cart() ;
328 assert(
triad->identify() == (
mp->get_bvect_spher()).identify()) ;
329 bases =
mp->get_mg()->std_base_vect_spher() ;
332 for (
int i=0 ;
i<3 ;
i++) {
336 for (
int i=0 ;
i<3 ;
i++) {
350 if (
triad->identify() == (
mp->get_bvect_cart()).identify() ) {
353 bases =
mp->get_mg()->pseudo_base_vect_cart() ;
358 assert(
triad->identify() == (
mp->get_bvect_spher()).identify()) ;
359 bases =
mp->get_mg()->pseudo_base_vect_spher() ;
362 for (
int i=0 ;
i<3 ;
i++) {
366 for (
int i=0 ;
i<3 ;
i++) {
404 if (
triad->identify() == (
mp->get_bvect_cart()).identify() ) {
410 resu.pseudo_spectral_base();
414 assert(
triad->identify() == (
mp->get_bvect_spher()).identify()) ;
431 resu.pseudo_spectral_base();
443 for (
int i=1;
i<=3;
i++) {
444 for (
int j=
i;
j<=3;
j++) {
450 for (
int i=1;
i<=3;
i++) {
451 for (
int j=
i;
j<=3;
j++) {
467 for (
int i=1;
i<=3;
i++) {
468 for (
int j=
i;
j<=3;
j++) {
476 for (
int i=1;
i<=3;
i++) {
477 for (
int j=
i;
j<=3;
j++) {
534 int nz =
mmg->get_nzone() ;
547 if (
dive.get_etat() == ETATZERO) {
557 assert (
mmg->get_type_r(nz-1) == UNSURR) ;
565 int np =
mmg->get_np(0) ;
566 int nt =
mmg->get_nt(0) ;
568 for (
int lz=0;
lz<nz;
lz++) {
574 for (
int k=0;
k<np+1;
k++)
575 for (
int j=0;
j<nt;
j++)
576 if ( nullite_plm(
j, nt,
k, np, val.
base)) {
589 if (
l == 0) *(
ri[
l]) = 1. ;
591 ri[
l]->annule_domain(nz - 1) ;
592 ri[
l]->std_spectral_base() ;
593 if (
l==2) *(
rmi[
l]) = 1 ;
595 rmi[
l]->annule(0,nz-2) ;
597 tmp.annule_domain(nz-1) ;
598 tmp.annule_domain(0) ;
600 rmi[
l]->set_dzpuis(3) ;
601 rmi[
l]->std_spectral_base() ;
604 for (
int k=0;
k<np+1;
k++) {
605 for (
int j=0;
j<nt;
j++) {
606 if ( nullite_plm(
j, nt,
k, np, val.
base)) {
607 int m_quant, l_quant, base_r,
l, c ;
609 bool lzero = (l_quant == 0) || (l_quant == 1) ;
614 deuz.set_etat_qcq() ;
617 for (
l=0;
l<taille;
l++)
618 for (c=0; c<taille; c++)
systeme.set(
l,c) = 0 ;
619 for (
l=0;
l<taille;
l++)
deuz.set(
l) = 0 ;
626 ri[l_quant]->set_spectral_va().set_base_r(0, base_r) ;
628 double alpha =
mapping->get_alpha()[0] ;
629 int nr =
mmg->get_nr(0) ;
631 partn.set_etat_qcq() ;
632 for (
int i=0;
i<nr;
i++)
638 deuz.set(
l) -= val1_dern_1d(0,
partn, base_r) ;
642 systeme.set(
l,c) += l_quant *
pow(alpha,
double(l_quant - 1)) ;
644 deuz.set(
l) -= val1_dern_1d(1,
partn, base_r) / alpha ;
651 for (
int lz=1;
lz<nz-1;
lz++) {
654 double xm1 = beta - alpha ;
655 double xp1 = alpha + beta ;
656 nr =
mmg->get_nr(
lz) ;
658 parts.set_etat_qcq() ;
659 for (
int i=0;
i<nr;
i++)
678 pow(
xm1,
double(-l_quant - 2)) ;
698 pow(
xp1,
double(-l_quant - 2)) ;
707 assert(
mmg->get_type_r(nz-1) == UNSURR) ;
708 nr =
mmg->get_nr(nz-1) ;
710 partc.set_etat_qcq() ;
711 for (
int i=0;
i<nr;
i++)
714 alpha =
mapping->get_alpha()[nz-1] ;
715 double beta =
mapping->get_beta()[nz-1] ;
716 double xm1 = beta - alpha ;
734 pow(
xm1,
double(l_quant + 2)) ;
736 if ( (nz > 2) || (!
lzero))
748 ri[l_quant]->set_spectral_va().coef() ;
749 rmi[l_quant]->set_spectral_va().coef() ;
752 nr =
mmg->get_nr(0) ;
753 for (
int i=0;
i<nr;
i++)
755 facteur(0)*(*(
ri[l_quant]->get_spectral_va().c_cf))(0, 0, 0,
i) ;
758 for (
int lz=1;
lz<nz-1;
lz++) {
759 nr =
mmg->get_nr(
lz) ;
760 for (
int i=0;
i<nr;
i++)
762 (*(
ri[l_quant]->get_spectral_va().c_cf))(
lz, 0, 0,
i) ;
763 for (
int i=0;
i<nr;
i++)
765 (*(
rmi[l_quant]->get_spectral_va().c_cf))(
lz, 0, 0,
i) ;
769 nr =
mmg->get_nr(nz-1) ;
771 for (
int i=0;
i<nr;
i++)
774 (*(
rmi[l_quant]->get_spectral_va().c_cf))(nz-1, 0, 0,
i) ;
814 "Vector::flux : the case of a mapping outside the class Map_af\n"
815 <<
" is not implemented yet !" <<
endl ;
822 "Vector::flux : the case of a non flat metric is not implemented yet !"
831 vspher->change_triad(
mp->get_bvect_spher()) ;
852 if(
triad->identify() == (
mp->get_bvect_cart()).identify() )
856 assert(
triad->identify() == (
mp->get_bvect_spher()).identify()) ;
869 if(
triad->identify() == (
mp->get_bvect_cart()).identify() )
873 assert(
triad->identify() == (
mp->get_bvect_spher()).identify()) ;
Bases of the spectral expansions.
Cartesian vectorial bases (triads).
Spherical orthonormal vectorial bases (triads).
Vectorial bases (triads) with respect to which the tensorial components are defined.
Time evolution with partial storage (*** under development ***).
double integrale_surface_infini(const Cmp &ci) const
Performs the surface integration of ci at infinity.
double integrale_surface(const Cmp &ci, double rayon) const
Performs the surface integration of ci on the sphere of radius rayon .
Base class for coordinate mappings.
Flat metric for tensor calculation.
Metric for tensor calculation.
virtual const Sym_tensor & con() const
Read-only access to the contravariant representation.
virtual const Sym_tensor & cov() const
Read-only access to the covariant representation.
Coefficients storage for the multi-domain spectral method.
Tensor field of valence 0 (or component of a tensorial field).
const Scalar & dsdz() const
Returns of *this , where .
const Scalar & dsdt() const
Returns of *this .
int get_dzpuis() const
Returns dzpuis.
const Scalar & dsdy() const
Returns of *this , where .
const Scalar & srstdsdp() const
Returns of *this .
bool check_dzpuis(int dzi) const
Returns false if the last domain is compactified and *this is not zero in this domain and dzpuis is n...
const Scalar & dsdx() const
Returns of *this , where .
virtual void set_etat_zero()
Sets the logical state to ETATZERO (zero).
Valeur & set_spectral_va()
Returns va (read/write version)
void set_dzpuis(int)
Modifies the dzpuis flag.
const Vector & derive_con(const Metric &gam) const
Returns the "contravariant" derivative of *this with respect to some metric , by raising the index of...
void set_spectral_base(const Base_val &)
Sets the spectral bases of the Valeur va
Class intended to describe valence-2 symmetric tensors.
Values and coefficients of a (real-value) function.
void ylm()
Computes the coefficients of *this.
Mtbl_cf * c_cf
Coefficients of the spectral expansion of the function.
void ylm_i()
Inverse of ylm()
Base_val base
Bases on which the spectral expansion is performed.
Tensor field of valence 1.
const Scalar & operator()(int) const
Readonly access to a component.
Sym_tensor ope_killing(const Metric &gam) const
Computes the Killing operator associated with a given metric.
virtual void std_spectral_base()
Sets the standard spectal bases of decomposition for each component.
void decompose_div(const Metric &) const
Makes the Helmholtz decomposition (see documentation of p_potential ) of this with respect to a given...
const Scalar & divergence(const Metric &) const
The divergence of this with respect to a Metric .
Scalar * p_potential[N_MET_MAX]
The potential giving the gradient part in the Helmholtz decomposition of any 3D vector .
virtual void del_deriv() const
Deletes the derived quantities.
virtual const Scalar & mu() const
Gives the field such that the angular components of the vector are written:
virtual void del_derive_met(int) const
Logical destructor of the derivatives depending on the i-th element of met_depend in the class Vector...
double flux(double radius, const Metric &met) const
Computes the flux of the vector accross a sphere r = const.
Vector_divfree * p_div_free[N_MET_MAX]
The divergence-free vector of the Helmholtz decomposition of any 3D vector .
const Vector_divfree curl() const
The curl of this with respect to a (flat) Metric .
Scalar * p_A
Field defined by.
virtual const Scalar & eta() const
Gives the field such that the angular components of the vector are written:
virtual void exponential_filter_r(int lzmin, int lzmax, int p, double alpha=-16.)
Applies exponential filters to all components (see Scalar::exponential_filter_r ).
const Vector_divfree & div_free(const Metric &) const
Returns the div-free vector in the Helmholtz decomposition.
void set_der_0x0() const
Sets the pointers on derived quantities to 0x0.
virtual ~Vector()
Destructor.
virtual void pseudo_spectral_base()
Sets the standard spectal bases of decomposition for each component for a pseudo_vector.
void set_der_met_0x0(int) const
Sets all the i-th components of met_depend in the class Vector (p_potential , etc....
Scalar * p_mu
Field such that the angular components of the vector are written:
Scalar * p_eta
Field such that the angular components of the vector are written:
Sym_tensor ope_killing_conf(const Metric &gam) const
Computes the conformal Killing operator associated with a given metric.
virtual void operator=(const Vector &a)
Assignment from a Vector.
const Scalar & potential(const Metric &) const
Returns the potential in the Helmholtz decomposition.
Scalar & set(int)
Read/write access to a component.
void set_vr_eta_mu(const Scalar &vr_i, const Scalar &eta_i, const Scalar &mu_i)
Defines the components through potentials and (see members p_eta and p_mu ), as well as the compon...
virtual void exponential_filter_ylm(int lzmin, int lzmax, int p, double alpha=-16.)
Applies exponential filters to all components (see Scalar::exponential_filter_ylm ).
Vector derive_lie(const Vector &v) const
Computes the Lie derivative of this with respect to some vector field v.
Cmp pow(const Cmp &, int)
Power .
#define R_CHEBI
base de Cheb. impaire (rare) seulement
#define R_CHEB
base de Chebychev ordinaire (fin)
#define R_CHEBP
base de Cheb. paire (rare) seulement
virtual void del_derive_met(int) const
Logical destructor of the derivatives depending on the i-th element of met_depend .
virtual void dec_dzpuis(int dec=1)
Decreases by dec units the value of dzpuis and changes accordingly the values in the compactified ext...
const Map *const mp
Mapping on which the numerical values at the grid points are defined.
int get_place_met(const Metric &) const
Returns the position of the pointer on metre in the array met_depend .
const Tensor & derive_con(const Metric &gam) const
Returns the "contravariant" derivative of this with respect to some metric , by raising the last inde...
const Metric * met_depend[N_MET_MAX]
Array on the Metric 's which were used to compute derived quantities, like p_derive_cov ,...
int valence
Valence of the tensor (0 = scalar, 1 = vector, etc...)
void set_dependance(const Metric &) const
To be used to describe the fact that the derivatives members have been calculated with met .
Scalar ** cmp
Array of size n_comp of pointers onto the components.
void compute_derive_lie(const Vector &v, Tensor &resu) const
Computes the Lie derivative of this with respect to some vector field v (protected method; the public...
int n_comp
Number of stored components, depending on the symmetry.
virtual void del_deriv() const
Deletes the derived quantities.
const Tensor & divergence(const Metric &gam) const
Computes the divergence of this with respect to some metric .
const Tensor & derive_cov(const Metric &gam) const
Returns the covariant derivative of this with respect to some metric .
Itbl type_indice
1D array of integers (class Itbl ) of size valence containing the type of each index: COV for a cov...
const Base_vect * triad
Vectorial basis (triad) with respect to which the tensor components are defined.