39 #include "utilitaires.h" 72 for (
int l=0 ; l<nzone ; l++) {
73 for (
int k=0 ; k<
mg->
get_np(l); k++){
77 alpha.
set(l,k,j,0) = bornes(l+1,k,j) ;
83 alpha.
set(l,k,j,0) = 0.5*(bornes(l+1,k,j) - bornes(l,k,j)) ;
84 beta.
set(l,k,j,0) = 0.5*(bornes(l+1,k,j) + bornes(l,k,j)) ;
89 cout <<
"Warning ! No compactified domain allowed !" << endl;
95 cout <<
"Map_star::Map_star: unkown type_r ! " << endl ;
141 assert(mpi.
mg ==
mg) ;
169 tet.
set(
this, map_star_fait_tet) ;
170 phi.
set(
this, map_star_fait_phi) ;
171 sint.
set(
this, map_star_fait_sint) ;
172 cost.
set(
this, map_star_fait_cost) ;
173 sinp.
set(
this, map_star_fait_sinp) ;
174 cosp.
set(
this, map_star_fait_cosp) ;
176 x.
set(
this, map_star_fait_x) ;
177 y.
set(
this, map_star_fait_y) ;
178 z.
set(
this, map_star_fait_z) ;
180 xa.
set(
this, map_star_fait_xa) ;
181 ya.
set(
this, map_star_fait_ya) ;
182 za.
set(
this, map_star_fait_za) ;
185 xsr.
set(
this, map_star_fait_xsr) ;
186 dxdr.
set(
this, map_star_fait_dxdr) ;
187 drdt.
set(
this, map_star_fait_drdt) ;
204 double precis = 1e-10 ;
223 for (
int i=0 ; i<nz ; i++) {
240 const Valeur& Map_star::get_beta()
const {
265 ost <<
"Affine + starlike mapping (class Map_star)" << endl ;
267 for (
int l=0; l<nz; l++) {
268 for (
int k=0 ; k<
mg->
get_np(l); k++){
269 for (
int j=0; j<
mg->
get_nt(l); j++){
270 ost <<
" Domain #" << l <<
" grid point index in theta : " << j <<
" phi : " << k <<
'\n' <<
" : alpha(l,k,j) = " <<
alpha(l,k,j,0)
271 <<
'\n' <<
" : beta(l,k,j) = " << beta(l,k,j,0)
277 ost << endl <<
" Values of r at the outer boundary of each domain [km] :" 280 for (
int l=0; l<nz; l++) {
281 for (
int k=0 ; k<
mg->
get_np(l); k++){
282 for (
int j=0; j<
mg->
get_nt(l); j++){
283 ost <<
" " <<
val_r(l, 1., (+
tet)(l,k,j,0), (+
phi)(l,k,j,0)) / km ;
289 ost <<
" Coord r : " ;
290 for (
int l=0; l<nz; l++) {
291 for (
int k=0 ; k<
mg->
get_np(l); k++){
292 for (
int j=0; j<
mg->
get_nt(l); j++){
294 ost <<
" " << (+
r)(l, k, j, nrm1) / km ;
310 assert(l<mg->get_nzone()) ;
314 for (
int k=0; k<Np; k++)
315 for (
int j=0; j<Nt; j++){
316 alpha.
set(l, k, j, 0) = alpha0(k,j) ;
333 void Map_star::set_beta(
const Valeur& beta0) {
342 void Map_star::set_beta(
const Tbl& beta0,
int l) {
345 assert(l<mg->get_nzone()) ;
349 for (
int k=0; k<Np; k++)
350 for (
int j=0; j<Nt; j++){
351 beta.
set(l, k, j, 0) = beta0(k,j) ;
Coord xa
Absolute x coordinate.
Coord d2rdx2
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 sr2stdrdp
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
virtual bool operator==(const Map &) const
Comparison operator (egality)
void set_rot_phi(double phi0)
Sets a new rotation angle.
double get_ori_y() const
Returns the y coordinate of the origin.
const Base_vect_spher & get_bvect_spher() const
Returns the orthonormal vectorial basis associated with the coordinates of the mapping.
Standard units of space, time and mass.
void annule_hard()
Sets the Valeur to zero in a hard way.
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
Coord sr2drdt
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
Base class for coordinate mappings.
double get_ori_x() const
Returns the x coordinate of the origin.
friend Mtbl * map_star_fait_r(const Map *)
< Not implemented
Values and coefficients of a (real-value) function.
void set(const Map *mp, Mtbl *(*construct)(const Map *))
Semi-constructor from a mapping and a method.
Coord srstdrdp
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
void std_base_scal()
Sets the bases for spectral expansions (member base ) to the standard ones for a scalar.
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
virtual void operator=(const Map_af &)
Assignment to an affine mapping.
Coord stdrdp
in the nucleus and in the non-compactified shells; \ in the compactified external domain (CED)...
void set_alpha(const Tbl &alpha0, int l)
Modifies the value of in domain no. l.
void sauve(FILE *) const
Save in a file.
Coord dxdr
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
double ori_y
Absolute coordinate y of the origin.
double ori_z
Absolute coordinate z of the origin.
Base class for pure radial mappings.
Map_star(const Mg3d &mgrille, const double *r_limits)
Standard Constructor.
int get_nzone() const
Returns the number of domains.
Tbl max(const Cmp &)
Maximum values of a Cmp in each domain.
Coord sstd2rdpdx
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
virtual void sauve(FILE *) const
Save in a file.
Coord xsr
in the nucleus; \ 1/R in the non-compactified shells; \ in the compactified outer domain...
const Valeur & get_alpha() const
Returns the reference on the Tbl alpha.
Coord drdt
in the nucleus and in the non-compactified shells; \ in the compactified external domain (CED)...
void set_coord()
Assignment of the building functions to the member Coords.
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
Coord ya
Absolute y coordinate.
const Mg3d * mg
Pointer on the multi-grid Mgd3 on which this is defined.
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.
double ori_x
Absolute coordinate x 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, i.e.
void c_est_pas_fait(const char *)
Helpful function to say something is not implemented yet.
Coord y
y coordinate centered on the grid
Cmp abs(const Cmp &)
Absolute value.
Coord za
Absolute z coordinate.
Coord lapr_tp
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
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.
virtual void reset_coord()
Resets all the member Coords.
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
virtual ostream & operator>>(ostream &) const
Operator >>
int get_type_r(int l) const
Returns the type of sampling in the radial direction in domain no.
Coord srdrdt
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
virtual ~Map_star()
Destructor.
Coord z
z coordinate centered on the grid
double rot_phi
Angle between the x –axis and X –axis.
Base_vect_cart bvect_cart
Cartesian basis associated with the coordinates (x,y,z) of the mapping, i.e.
Valeur alpha
Array (size: mg->nzone*Nt*Np ) of the values of in each domain.
Coord r
r coordinate centered on the grid
Coord d2rdtdx
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
Tbl & set(int l)
Read/write of the value in a given domain (configuration space).
virtual void sauve(FILE *) const
Save in a file.