30char map_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Map/map.C,v 1.11 2014/10/13 08:53:02 j_novak Exp $" ;
130#include "utilitaires.h"
140 ori_x(0), ori_y(0), ori_z(0), rot_phi(0),
141 bvect_spher(ori_x, ori_y, ori_z, rot_phi,
142 "Mapping orthonormal spherical basis"),
143 bvect_cart(rot_phi,
"Mapping Cartesian basis"),
144 p_flat_met_spher(0x0),
145 p_flat_met_cart(0x0),
158 ori_x(mp.ori_x), ori_y(mp.ori_y), ori_z(mp.ori_z),
160 bvect_spher(ori_x, ori_y, ori_z, rot_phi,
161 "Mapping orthonormal spherical basis"),
162 bvect_cart(rot_phi,
"Mapping Cartesian basis"),
163 p_flat_met_spher(0x0),
164 p_flat_met_cart(0x0),
177 bvect_spher(0., 0., 0., 0.,
178 "Mapping orthonormal spherical basis"),
179 bvect_cart(0.,
"Mapping Cartesian basis"),
180 p_flat_met_spher(0x0),
181 p_flat_met_cart(0x0),
185 if (*
mg != *mg_tmp) {
186 cout <<
"Map::Map(const Mg3d&, FILE*): grid not consistent !"
239ostream& operator<<(ostream& o,
const Map & cv) {
240 o <<
"Absolute coordinates of the mapping origin: " << endl ;
241 o <<
" X_0, Y_0, Z_0 : " << cv.
get_ori_x() <<
" "
243 o <<
"Rotation angle between the x-axis and X-axis : "
303 double& rr,
double& theta,
double& pphi)
const {
307 double x1 = xx -
ori_x ;
308 double y1 = yy -
ori_y ;
309 double z1 = zz -
ori_z ;
312 double rho2 = x1*x1 + y1*y1 ;
313 double rho =
sqrt( rho2 ) ;
314 rr =
sqrt(rho2 + z1*z1) ;
315 theta = atan2(rho, z1) ;
316 pphi = atan2(y1, x1) -
rot_phi ;
317 if (pphi < 0) pphi += 2*M_PI ;
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.
void set_ori(double xa0, double ya0, double za0)
Sets a new origin.
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.
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
void del_t() const
Logical destructor (deletes the Mtbl member *c ).
Base class for coordinate mappings.
double get_ori_z() const
Returns the z coordinate of the origin.
virtual void reset_coord()
Resets all the member Coords.
Coord y
y coordinate centered on the grid
double ori_x
Absolute coordinate x of the origin.
Coord ya
Absolute y coordinate.
void set_rot_phi(double phi0)
Sets a new rotation angle.
Metric_flat * p_flat_met_cart
Pointer onto the flat metric associated with the Cartesian coordinates and with components expressed ...
double ori_y
Absolute coordinate y of the origin.
Coord r
r coordinate centered on the grid
Base_vect_spher bvect_spher
Orthonormal vectorial basis associated with the coordinates of the mapping.
Metric_flat * p_flat_met_spher
Pointer onto the flat metric associated with the spherical coordinates and with components expressed ...
void convert_absolute(double xx, double yy, double zz, double &rr, double &theta, double &pphi) const
Determines the coordinates corresponding to given absolute Cartesian coordinates (X,...
void set_ori(double xa0, double ya0, double za0)
Sets a new origin.
Map(const Mg3d &)
Constructor from a multi-domain 3D grid.
double get_ori_y() const
Returns the y coordinate of the origin.
Coord za
Absolute z coordinate.
Coord tet
coordinate centered on the grid
Base_vect_cart bvect_cart
Cartesian basis associated with the coordinates (x,y,z) of the mapping, i.e.
const Metric_flat & flat_met_cart() const
Returns the flat metric associated with the Cartesian coordinates and with components expressed in th...
double rot_phi
Angle between the x –axis and X –axis.
virtual void sauve(FILE *) const
Save in a file.
Coord z
z coordinate centered on the grid
double get_ori_x() const
Returns the x coordinate of the origin.
Map_af * p_mp_angu
Pointer on the "angular" mapping.
Coord x
x coordinate centered on the grid
Coord phi
coordinate centered on the grid
double ori_z
Absolute coordinate z of the origin.
double get_rot_phi() const
Returns the angle between the x –axis and X –axis.
Coord xa
Absolute x coordinate.
Cmp * p_cmp_zero
The null Cmp.
const Metric_flat & flat_met_spher() const
Returns the flat metric associated with the spherical coordinates and with components expressed in th...
const Mg3d * mg
Pointer on the multi-grid Mgd3 on which this is defined
virtual ~Map()
Destructor.
Flat metric for tensor calculation.
void sauve(FILE *fd, bool save_base=false) const
Saves into a file.
Cmp sqrt(const Cmp &)
Square root.
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.