39#include "utilitaires.h"
72 int nzone = mg->get_nzone() ;
74 const Grille3d* g = mg->get_grille3d(0) ;
76 for (
int l=0 ; l<nzone ; l++) {
77 for (
int k=0 ; k<mg->get_np(l); k++){
78 for (
int j=0; j<mg->get_nt(l); j++){
79 switch (mg->get_type_r(l)) {
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 ;
106 alpha.std_base_scal() ;
107 beta.std_base_scal() ;
147 assert(mpi.mg == mg) ;
149 set_ori( mpi.ori_x, mpi.ori_y, mpi.ori_z ) ;
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) ;
194 stdrdp.set(
this, map_eps_fait_stdrdp) ;
195 srdrdt.set(
this, map_eps_fait_srdrdt) ;
196 srstdrdp.set(
this, map_eps_fait_srstdrdp) ;
197 sr2drdt.set(
this, map_eps_fait_sr2drdt) ;
198 sr2stdrdp.set(
this, map_eps_fait_sr2stdrdp) ;
199 d2rdx2.set(
this, map_eps_fait_d2rdx2) ;
200 lapr_tp.set(
this, map_eps_fait_lapr_tp) ;
201 d2rdtdx.set(
this, map_eps_fait_d2rdtdx) ;
202 sstd2rdpdx.set(
this, map_eps_fait_sstd2rdpdx) ;
203 sr2d2rdt2.set(
this, map_eps_fait_sr2d2rdt2) ;
210 double precis = 1e-10 ;
218 if (*mg != *(mpi.get_mg()))
221 if (fabs(ori_x-mpi.get_ori_x()) > precis) resu = false ;
222 if (fabs(ori_y-mpi.get_ori_y()) > precis) resu = false ;
223 if (fabs(ori_z-mpi.get_ori_z()) > precis) resu = false ;
225 if (
bvect_spher != mpi.get_bvect_spher()) resu = false ;
226 if (
bvect_cart != mpi.get_bvect_cart()) resu = false ;
228 int nz = mg->get_nzone() ;
229 for (
int i=0 ; i<nz ; i++) {
230 if (
max(
abs(alpha(i)-mp0->alpha(i))/
abs(alpha(i))) > precis)
246const 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;
273 int nz = mg->get_nzone() ;
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++){
300 int nrm1 = mg->get_nr(l) - 1 ;
301 ost <<
" " << (+
r)(l, k, j, nrm1) / km ;
317 assert(l<mg->get_nzone()) ;
319 int Nt = mg->get_nt(l) ;
320 int Np = mg->get_np(l) ;
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) ;
340void Map_eps::set_beta(
const Valeur& beta0) {
349void Map_eps::set_beta(
const Tbl& beta0,
int l) {
352 assert(l<mg->get_nzone()) ;
354 int Nt = mg->get_nt(l) ;
355 int Np = mg->get_np(l) ;
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) ;
3D grid class in one domain.
double * phi
Array of values of at the np collocation points.
double * tet
Array of values of at the nt collocation points.
Map_eps(const Mg3d &mgrille, const double *r_limits)
Standard Constructor.
virtual void sauve(FILE *) const
Save in a file.
virtual ~Map_eps()
Destructor.
void set_alpha(const Tbl &alpha0, int l)
Modifies the value of in domain no. l.
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.
const Valeur & get_alpha() const
Returns the reference on the Tbl alpha.
friend Mtbl * map_eps_fait_r(const Map *)
< Not implemented
void set_coord()
Assignment of the building functions to the member Coords.
virtual void operator=(const Map_af &)
Assignment to an affine mapping.
virtual bool operator==(const Map &) const
Comparison operator (egality).
double aa
Array (size: mg->nzone*Nt*Np ) of the values of in each domain.
virtual ostream & operator>>(ostream &) const
Operator >>.
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.
Map_radial(const Mg3d &mgrid)
Constructor from a grid (protected to make Map_radial an abstract class).
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).
Values and coefficients of a (real-value) function.
void std_base_scal()
Sets the bases for spectral expansions (member base ) to the standard ones for a scalar.
Cmp sqrt(const Cmp &)
Square root.
Cmp sin(const Cmp &)
Sine.
Tbl max(const Cmp &)
Maximum values of a Cmp in each domain.
Cmp pow(const Cmp &, int)
Power .
Cmp cos(const Cmp &)
Cosine.
Cmp abs(const Cmp &)
Absolute value.
Base_vect_spher bvect_spher
Base class for coordinate mappings.
void c_est_pas_fait(const char *)
Helpful function to say something is not implemented yet.
Coord z
z coordinate centered on the grid
Base_vect_cart bvect_cart
Cartesian basis associated with the coordinates (x,y,z) of the mapping, i.e.
Coord y
y coordinate centered on the grid
Map(const Mg3d &)
Constructor from a multi-domain 3D grid.
Coord phi
coordinate centered on the grid
Coord tet
coordinate centered on the grid
void set_rot_phi(double phi0)
Sets a new rotation angle.
Coord x
x coordinate centered on the grid
Coord xa
Absolute x coordinate.
Coord za
Absolute z coordinate.
void set_ori(double xa0, double ya0, double za0)
Sets a new origin.
Coord r
r coordinate centered on the grid
Coord ya
Absolute y coordinate.
Standard units of space, time and mass.