31char map_af_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Map/map_af.C,v 1.19 2014/10/13 08:53:02 j_novak Exp $" ;
180#include "utilitaires.h"
199 alpha =
new double[nzone] ;
200 beta =
new double[nzone] ;
202 for (
int l=0 ; l<nzone ; l++) {
205 alpha[l] = bornes[l+1] - bornes[l] ;
206 beta[l] = bornes[l] ;
211 alpha[l] = (bornes[l+1] - bornes[l]) * .5 ;
212 beta[l] = (bornes[l+1] + bornes[l]) * .5 ;
217 double umax = 1./bornes[l] ;
218 double umin = 1./bornes[l+1] ;
219 alpha[l] = (umin - umax) * .5 ;
220 beta[l] = (umin + umax) * .5 ;
225 cout <<
"Map_af::Map_af: unkown type_r ! " << endl ;
244 alpha =
new double[nzone] ;
245 beta =
new double[nzone] ;
247 for (
int l=0 ; l<nzone ; l++) {
250 alpha[l] = bornes(l+1) - bornes(l) ;
251 beta[l] = bornes(l) ;
256 alpha[l] = (bornes(l+1) - bornes(l)) * .5 ;
257 beta[l] = (bornes(l+1) + bornes(l)) * .5 ;
262 assert (l==nzone-1) ;
263 double umax = 1./bornes(l) ;
265 alpha[l] = (umin - umax) * .5 ;
266 beta[l] = (umin + umax) * .5 ;
271 cout <<
"Map_af::Map_af: unkown type_r ! " << endl ;
290 alpha =
new double[nzone] ;
291 beta =
new double[nzone] ;
293 for (
int l=0; l<nzone; l++){
304 alpha =
new double[nz] ;
305 beta =
new double[nz] ;
325 alpha =
new double[nz] ;
326 beta =
new double[nz] ;
331 if( (mp0 == 0x0) && (mp1 == 0x0) ) {
332 cout <<
"Map_af::Map_af(const Map& ) : unkown mapping type !"
338 assert( mp1 == 0x0 ) ;
339 for (
int l=0; l<nz; l++){
347 assert( mp0 == 0x0 ) ;
348 for (
int l=0; l<nz; l++){
382 assert(mpi.
mg ==
mg) ;
406 r.
set(
this, map_af_fait_r) ;
407 tet.
set(
this, map_af_fait_tet) ;
408 phi.
set(
this, map_af_fait_phi) ;
409 sint.
set(
this, map_af_fait_sint) ;
410 cost.
set(
this, map_af_fait_cost) ;
411 sinp.
set(
this, map_af_fait_sinp) ;
412 cosp.
set(
this, map_af_fait_cosp) ;
414 x.
set(
this, map_af_fait_x) ;
415 y.
set(
this, map_af_fait_y) ;
416 z.
set(
this, map_af_fait_z) ;
418 xa.
set(
this, map_af_fait_xa) ;
419 ya.
set(
this, map_af_fait_ya) ;
420 za.
set(
this, map_af_fait_za) ;
423 xsr.
set(
this, map_af_fait_xsr) ;
424 dxdr.
set(
this, map_af_fait_dxdr) ;
425 drdt.
set(
this, map_af_fait_drdt) ;
442 double precis = 1e-10 ;
461 for (
int i=0 ; i<nz ; i++) {
464 if ((i!=0) && (i!=nz-1))
507 ost <<
"Affine mapping (class Map_af)" << endl ;
509 for (
int l=0; l<nz; l++) {
510 ost <<
" Domain #" << l <<
" : alpha_l = " <<
alpha[l]
511 <<
" , beta_l = " <<
beta[l] << endl ;
514 ost << endl <<
" Values of r at the outer boundary of each domain [km] :"
517 for (
int l=0; l<nz; l++) {
518 ost <<
" " <<
val_r(l, 1., 0., 0.) / km ;
522 ost <<
" Coord r : " ;
523 for (
int l=0; l<nz; l++) {
525 ost <<
" " << (+
r)(l, 0, 0, nrm1) / km ;
541 for (
int l=0; l<nz; l++) {
565 cout <<
"Map_af::resize can be applied only to a shell !" << endl ;
571 double n_alpha = 0.5 * ( (lambda + 1.) *
alpha[l] +
572 (lambda - 1.) *
beta[l] ) ;
574 double n_beta = 0.5 * ( (lambda - 1.) *
alpha[l] +
575 (lambda + 1.) *
beta[l] ) ;
582 assert(l<mg->get_nzone()-1) ;
596 alpha[lp1] = n_alpha ;
620 double asauve =
alpha[1] ;
622 beta[1] = (1+fact)/2.*
beta[1]+ (1-fact)/2. * asauve ;
633 assert(l<mg->get_nzone()) ;
644 assert(l<mg->get_nzone()) ;
660 double Rb =
val_r_jk(l_zone, 1., 0, 0) ;
674 const char* f = __FILE__ ;
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
void set(const Map *mp, Mtbl *(*construct)(const Map *))
Semi-constructor from a mapping and a method.
virtual ostream & operator>>(ostream &) const
Operator >>
const double * get_beta() const
Returns the pointer on the array beta.
const double * get_alpha() const
Returns the pointer on the array alpha.
void set_beta(double beta0, int l)
Modifies the value of in domain no. l.
virtual void adapt(const Cmp &ent, const Param &par, int nbr=0)
Adaptation of the mapping to a given scalar field.
void set_coord()
Assignment of the building functions to the member Coords.
Map_af(const Mg3d &mgrille, const double *r_limits)
Standard Constructor.
virtual ~Map_af()
Destructor.
virtual void sauve(FILE *) const
Save in a file.
double * beta
Array (size: mg->nzone ) of the values of in each domain.
virtual void operator=(const Map_af &)
Assignment to another affine mapping.
void homothetie_interne(double lambda)
Sets a new radial scale at the bondary between the nucleus and the first shell.
virtual void homothetie(double lambda)
Sets a new radial scale.
double * alpha
Array (size: mg->nzone ) of the values of in each domain.
virtual bool operator==(const Map &) const
Comparison operator (egality)
void set_alpha(double alpha0, int l)
Modifies the value of in domain no. l.
virtual void resize(int l, double lambda)
Rescales the outer boundary of one domain.
virtual double val_r_jk(int l, double xi, int j, int k) const
Returns the value of the radial coordinate r for a given and a given collocation point in in a give...
virtual const Map_af & mp_angu(int) const
Returns the "angular" mapping for the outside of domain l_zone.
virtual double val_r(int l, double xi, double theta, double pphi) const
Returns the value of the radial coordinate r for a given in a given domain.
Radial mapping of rather general form.
const double * get_alpha() const
Returns a pointer on the array alpha (values of in each domain)
const double * get_beta() const
Returns a pointer on the array beta (values of in each domain)
Base class for pure radial mappings.
Coord d2rdx2
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
Coord sr2drdt
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
Coord srstdrdp
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
Coord d2rdtdx
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
Coord sstd2rdpdx
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
virtual void reset_coord()
Resets all the member Coords.
Coord lapr_tp
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
Coord sr2stdrdp
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
Coord drdt
in the nucleus and in the non-compactified shells; \ in the compactified external domain (CED).
Coord srdrdt
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
Coord xsr
in the nucleus; \ 1/R in the non-compactified shells; \ in the compactified outer domain.
virtual void sauve(FILE *) const
Save in a file.
Coord dxdr
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
Coord sr2d2rdt2
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
Coord stdrdp
in the nucleus and in the non-compactified shells; \ in the compactified external domain (CED).
Base class for coordinate mappings.
double get_ori_z() const
Returns the z coordinate of the origin.
const Base_vect_cart & get_bvect_cart() const
Returns the Cartesian basis associated with the coordinates (x,y,z) of the mapping,...
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.
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.
void set_ori(double xa0, double ya0, double za0)
Sets a new origin.
double get_ori_y() const
Returns the y coordinate of the origin.
Coord za
Absolute z coordinate.
Coord tet
coordinate centered on the grid
const Base_vect_spher & get_bvect_spher() const
Returns the orthonormal vectorial basis associated with the coordinates of the mapping.
Base_vect_cart bvect_cart
Cartesian basis associated with the coordinates (x,y,z) of the mapping, i.e.
double rot_phi
Angle between the x –axis and X –axis.
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.
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
const Mg3d * mg
Pointer on the multi-grid Mgd3 on which this is defined
const Mg3d * get_angu_1dom() const
Returns the pointer on the associated mono-domain angular grid.
int get_nzone() const
Returns the number of domains.
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
int get_type_r(int l) const
Returns the type of sampling in the radial direction in domain no.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
double & set(int i)
Read/write of a particular element (index i) (1D case)
void c_est_pas_fait(const char *)
Helpful function to say something is not implemented yet.
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.
Standard units of space, time and mass.