133 #include "utilitaires.h" 143 ori_x(0), ori_y(0), ori_z(0), rot_phi(0),
144 bvect_spher(ori_x, ori_y, ori_z, rot_phi,
145 "Mapping orthonormal spherical basis"),
146 bvect_cart(rot_phi,
"Mapping Cartesian basis"),
147 p_flat_met_spher(0x0),
148 p_flat_met_cart(0x0),
161 ori_x(mp.ori_x), ori_y(mp.ori_y), ori_z(mp.ori_z),
163 bvect_spher(ori_x, ori_y, ori_z, rot_phi,
164 "Mapping orthonormal spherical basis"),
165 bvect_cart(rot_phi,
"Mapping Cartesian basis"),
166 p_flat_met_spher(0x0),
167 p_flat_met_cart(0x0),
180 bvect_spher(0., 0., 0., 0.,
181 "Mapping orthonormal spherical basis"),
182 bvect_cart(0.,
"Mapping Cartesian basis"),
183 p_flat_met_spher(0x0),
184 p_flat_met_cart(0x0),
188 if (*
mg != *mg_tmp) {
189 cout <<
"Map::Map(const Mg3d&, FILE*): grid not consistent !" 242 ostream& operator<<(ostream& o,
const Map & cv) {
243 o <<
"Absolute coordinates of the mapping origin: " << endl ;
244 o <<
" X_0, Y_0, Z_0 : " << cv.
get_ori_x() <<
" " 246 o <<
"Rotation angle between the x-axis and X-axis : " 306 double& rr,
double& theta,
double& pphi)
const {
310 double x1 = xx -
ori_x ;
311 double y1 = yy -
ori_y ;
312 double z1 = zz -
ori_z ;
315 double rho2 = x1*x1 + y1*y1 ;
316 double rho =
sqrt( rho2 ) ;
317 rr =
sqrt(rho2 + z1*z1) ;
318 theta = atan2(rho, z1) ;
319 pphi = atan2(y1, x1) -
rot_phi ;
320 if (pphi < 0) pphi += 2*M_PI ;
Coord xa
Absolute x coordinate.
void set_ori(double xa0, double ya0, double za0)
Sets a new origin.
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
virtual void sauve(FILE *) const
Save in a file.
Cmp sqrt(const Cmp &)
Square root.
void set_rot_phi(double phi0)
Sets a new rotation angle.
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...
double get_ori_y() const
Returns the y coordinate of the origin.
Cmp * p_cmp_zero
The null Cmp.
Flat metric for tensor calculation.
Base class for coordinate mappings.
double get_ori_x() const
Returns the x coordinate of the 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...
Map_af * p_mp_angu
Pointer on the "angular" mapping.
double get_rot_phi() const
Returns the angle between the x –axis and X –axis.
const Metric_flat & flat_met_cart() const
Returns the flat metric associated with the Cartesian coordinates and with components expressed in th...
Coord tet
coordinate centered on the grid
void set_ori(double xa0, double ya0, double za0)
Sets a new origin.
Coord phi
coordinate centered on the grid
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
Metric_flat * p_flat_met_spher
Pointer onto the flat metric associated with the spherical coordinates and with components expressed ...
void sauve(FILE *fd, bool save_base=false) const
Saves into a file.
double ori_y
Absolute coordinate y of the origin.
double ori_z
Absolute coordinate z of the origin.
Metric_flat * p_flat_met_cart
Pointer onto the flat metric associated with the Cartesian coordinates and with components expressed ...
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.
virtual void reset_coord()
Resets all the member Coords.
int fread_be(int *aa, int size, int nb, FILE *fich)
Reads integer(s) from a binary file according to the big endian convention.
Coord ya
Absolute y coordinate.
const Mg3d * mg
Pointer on the multi-grid Mgd3 on which this is defined.
double ori_x
Absolute coordinate x of the origin.
Coord y
y coordinate centered on the grid
Coord za
Absolute z coordinate.
Coord x
x coordinate centered on the grid
Base_vect_spher bvect_spher
Orthonormal vectorial basis associated with the coordinates of the mapping.
double get_ori_z() const
Returns the z coordinate of the origin.
Map(const Mg3d &)
Constructor from a multi-domain 3D grid.
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...
virtual ~Map()
Destructor.
Coord z
z coordinate centered on the grid
double rot_phi
Angle between the x –axis and X –axis.
const Metric_flat & flat_met_spher() const
Returns the flat metric associated with the spherical coordinates and with components expressed in th...
Base_vect_cart bvect_cart
Cartesian basis associated with the coordinates (x,y,z) of the mapping, i.e.
void del_t() const
Logical destructor (deletes the Mtbl member *c ).
Coord r
r coordinate centered on the grid