30char base_vect_cart_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Base_vect/base_vect_cart.C,v 1.8 2014/10/13 08:52:39 j_novak Exp $" ;
101#include "utilitaires.h"
192 "WARNING : Base_vect_cart::set_align : " << endl ;
193 cout <<
" rot_phi is close to zero !" << endl ;
197 if (fabs(
rot_phi - M_PI) < 1.e-14) {
199 "WARNING : Base_vect_cart::set_align : " << endl ;
200 cout <<
" rot_phi is close to Pi !" << endl ;
238 <<
"The two Base_vect_cart have different rot_phi : " <<
rot_phi
239 <<
" <-> " << bic.
rot_phi << endl ;
264 ost <<
"Azimuthal angle with respect to the Absolute frame : "
283 assert(ti.
get_etat() != ETATNONDEF) ;
287 assert(triad_i != 0x0) ;
323 ti.
set(0) = - ti(0) ;
324 ti.
set(1) = - ti(1) ;
330 ti.
set(0, 2) = - copie(0, 2) ;
331 ti.
set(1, 2) = - copie(1, 2) ;
332 ti.
set(2, 0) = - copie(2, 0) ;
333 ti.
set(2, 1) = - copie(2, 1) ;
340 "Base_vect_cart::change_basis : the case of valence "
341 << ti.
get_valence() <<
" is not treated !" << endl ;
352 "Base_vect_cart::change_basis : general value of rot_phi "
353 <<
" not contemplated yet, sorry !" << endl ;
360 "Base_vect_cart::change_basis : unexpected value of ind !" << endl ;
361 cout <<
" ind = " << ind << endl ;
384 assert( *
this == mp->get_bvect_cart() ) ;
385 assert( *bvs == mp->get_bvect_spher() ) ;
391 mp->comp_x_from_spherical(vr, vt, vp, ti.
set(0)) ;
392 mp->comp_y_from_spherical(vr, vt, vp, ti.
set(1)) ;
393 mp->comp_z_from_spherical(vr, vt, ti.
set(2)) ;
403 assert( *
this == mp->get_bvect_cart() ) ;
404 assert( *bvs == mp->get_bvect_spher() ) ;
406 for (
int i=0; i<2; i++)
411 Tenseur tmp(*mp, 2, COV, *
this) ;
413 for (
int i=0; i<3; i++) {
414 mp->comp_x_from_spherical(ti(0,i), ti(1,i), ti(2,i)
416 mp->comp_y_from_spherical(ti(0,i), ti(1,i), ti(2,i)
418 mp->comp_z_from_spherical(ti(0,i), ti(1,i), tmp.
set(2,i) ) ;
420 for (
int i=0; i<3; i++) {
421 mp->comp_x_from_spherical(tmp(i,0), tmp(i,1), tmp(i,2)
423 mp->comp_y_from_spherical(tmp(i,0), tmp(i,1), tmp(i,2)
425 mp->comp_z_from_spherical(tmp(i,0), tmp(i,1), ti.
set(i,2) ) ;
434 "Base_vect_cart::change_basis : the case of valence "
435 << ti.
get_valence() <<
" is not treated !" << endl ;
void set_rot_phi(double rot_phi_i)
Sets a new value to the angle rot_phi between the x –axis and the absolute frame X –axis.
virtual ~Base_vect_cart()
Destructor.
virtual ostream & operator>>(ostream &) const
Operator >>.
void set_align()
Computes align from the value of rot_phi.
int align
Indicator of alignment with respect to the absolute frame: \ align = 1 : basis aligned with the absol...
virtual void sauve(FILE *) const
Save in a file.
virtual int identify() const
Returns a number to identify the sub-classe of Base_vect the object belongs to.
virtual bool operator==(const Base_vect &) const
Comparison operator (egality).
Base_vect_cart(double rot_phi_i)
Standard constructor.
double rot_phi
Angle between the x –axis and the absolute frame X –axis.
virtual void change_basis(Tenseur &) const
Change the basis in which the components of a tensor are expressed.
void operator=(const Base_vect_cart &)
Assignment to another Base_vect_cart.
Spherical orthonormal vectorial bases (triads).
Base_vect()
Standard constructor.
virtual int identify() const =0
Returns a number to identify the sub-classe of Base_vect the object belongs to.
virtual void sauve(FILE *) const
Save in a file.
void set_name(const char *name_i)
Sets the basis name.
char name[100]
Name of the basis.
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Tensor handling *** DEPRECATED : use class Tensor instead ***.
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.
Cmp & set()
Read/write for a scalar (see also operator=(const Cmp&) ).
void allocate_all()
Sets the logical state to ETATQCQ (ordinary state) and performs the memory allocation of all the elem...
int get_type_indice(int i) const
Returns the type of the index number i .
const Map * get_mp() const
Returns pointer on the mapping.
int get_valence() const
Returns the valence.
void set_triad(const Base_vect &new_triad)
Assigns a new vectorial basis (triad) of decomposition.
int get_etat() const
Returns the logical state.
void arrete(int a=0)
Setting a stop point in a code.
int fread_be(int *aa, int size, int nb, FILE *fich)
Reads integer(s) from a binary file according to the big endian convention.
int fwrite_be(const int *aa, int size, int nb, FILE *fich)
Writes integer(s) into a binary file according to the big endian convention.
Map(const Mg3d &)
Constructor from a multi-domain 3D grid.