39 #include "utilitaires.h" 59 Map_eps::Map_eps(
const Mg3d& mgrille,
double a,
double b,
double c) :
Map_radial(mgrille),aa(a),bb(b),cc(c),alpha(mgrille.get_angu()),beta(mgrille.get_angu())
76 for (
int l=0 ; l<nzone ; l++) {
77 for (
int k=0 ; k<
mg->
get_np(l); k++){
81 double theta = (g->
tet)[j] ;
82 double pphi = (g->
phi)[k] ;
89 cout <<
"Warning ! No shell allowed !" << endl;
95 cout <<
"Warning ! No compactified domain allowed !" << endl;
101 cout <<
"Map_eps::Map_eps: unkown type_r ! " << endl ;
147 assert(mpi.
mg ==
mg) ;
175 tet.
set(
this, map_eps_fait_tet) ;
176 phi.
set(
this, map_eps_fait_phi) ;
177 sint.
set(
this, map_eps_fait_sint) ;
178 cost.
set(
this, map_eps_fait_cost) ;
179 sinp.
set(
this, map_eps_fait_sinp) ;
180 cosp.
set(
this, map_eps_fait_cosp) ;
182 x.
set(
this, map_eps_fait_x) ;
183 y.
set(
this, map_eps_fait_y) ;
184 z.
set(
this, map_eps_fait_z) ;
186 xa.
set(
this, map_eps_fait_xa) ;
187 ya.
set(
this, map_eps_fait_ya) ;
188 za.
set(
this, map_eps_fait_za) ;
191 xsr.
set(
this, map_eps_fait_xsr) ;
192 dxdr.
set(
this, map_eps_fait_dxdr) ;
193 drdt.
set(
this, map_eps_fait_drdt) ;
210 double precis = 1e-10 ;
229 for (
int i=0 ; i<nz ; i++) {
230 if (
max(
abs(alpha(i)-mp0->alpha(i))/
abs(alpha(i))) > precis)
246 const Valeur& Map_eps::get_beta()
const {
271 ost <<
"Ellipsoidal mapping (class Map_eps)" << endl ;
272 ost <<
"Parameters of the ellipsoid: (x-axis) a = " <<
aa <<
" (y-axis) b = " << bb <<
" (z-axis) c = " << cc << endl;
274 for (
int l=0; l<nz; l++) {
275 for (
int k=0 ; k<
mg->
get_np(l); k++){
276 for (
int j=0; j<
mg->
get_nt(l); j++){
277 ost <<
" Domain #" << l <<
" grid point index in theta : " << j <<
" phi : " << k <<
'\n' <<
" : alpha(l,k,j) = " << alpha(l,k,j,0)
278 <<
'\n' <<
" : beta(l,k,j) = " << beta(l,k,j,0)
284 ost << endl <<
" Values of r at the outer boundary of each domain [km] :" 287 for (
int l=0; l<nz; l++) {
288 for (
int k=0 ; k<
mg->
get_np(l); k++){
289 for (
int j=0; j<
mg->
get_nt(l); j++){
290 ost <<
" " <<
val_r(l, 1., (+
tet)(l,k,j,0), (+
phi)(l,k,j,0)) / km ;
296 ost <<
" Coord r : " ;
297 for (
int l=0; l<nz; l++) {
298 for (
int k=0 ; k<
mg->
get_np(l); k++){
299 for (
int j=0; j<
mg->
get_nt(l); j++){
301 ost <<
" " << (+
r)(l, k, j, nrm1) / km ;
317 assert(l<mg->get_nzone()) ;
321 for (
int k=0; k<Np; k++)
322 for (
int j=0; j<Nt; j++){
323 alpha.
set(l, k, j, 0) = alpha0(k,j) ;
340 void Map_eps::set_beta(
const Valeur& beta0) {
349 void Map_eps::set_beta(
const Tbl& beta0,
int l) {
352 assert(l<mg->get_nzone()) ;
356 for (
int k=0; k<Np; k++)
357 for (
int j=0; j<Nt; j++){
358 beta.
set(l, k, j, 0) = beta0(k,j) ;
virtual ostream & operator>>(ostream &) const
Operator >>
Coord xa
Absolute x coordinate.
Coord d2rdx2
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
const Grille3d * get_grille3d(int l) const
Returns a pointer on the 3D mono-grid for domain no. l.
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.
friend Mtbl * map_eps_fait_r(const Map *)
< Not implemented
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
Cmp sqrt(const Cmp &)
Square root.
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.
double * phi
Array of values of at the np collocation points.
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.
virtual void operator=(const Map_af &)
Assignment to an affine mapping.
Values and coefficients of a (real-value) function.
void set_alpha(const Tbl &alpha0, int l)
Modifies the value of in domain no. l.
void set(const Map *mp, Mtbl *(*construct)(const Map *))
Semi-constructor from a mapping and a method.
Map_eps(const Mg3d &mgrille, const double *r_limits)
Standard Constructor.
Cmp cos(const Cmp &)
Cosine.
virtual bool operator==(const Map &) const
Comparison operator (egality)
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
Coord stdrdp
in the nucleus and in the non-compactified shells; \ in the compactified external domain (CED)...
void sauve(FILE *) const
Save in a file.
Coord dxdr
in the nucleus and in the non-compactified shells; \ in the compactified outer domain.
const Valeur & get_alpha() const
Returns the reference on the Tbl alpha.
double ori_y
Absolute coordinate y of the origin.
double * tet
Array of values of at the nt collocation points.
double ori_z
Absolute coordinate z of the origin.
Base class for pure radial mappings.
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.
void set_coord()
Assignment of the building functions to the member Coords.
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...
Cmp pow(const Cmp &, int)
Power .
Coord drdt
in the nucleus and in the non-compactified shells; \ in the compactified external domain (CED)...
virtual void sauve(FILE *) const
Save in a file.
virtual ~Map_eps()
Destructor.
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.
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.
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.
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.
Cmp sin(const Cmp &)
Sine.
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
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.
double aa
Array (size: mg->nzone*Nt*Np ) of the values of in each domain.
Coord z
z coordinate centered on the grid
double rot_phi
Angle between the x –axis and X –axis.
3D grid class in one domain.
Base_vect_cart bvect_cart
Cartesian basis associated with the coordinates (x,y,z) of the mapping, i.e.
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).