39#include "utilitaires.h"
69 int nzone = mg->get_nzone() ;
72 for (
int l=0 ; l<nzone ; l++) {
73 for (
int k=0 ; k<mg->get_np(l); k++){
74 for (
int j=0; j<mg->get_nt(l); j++){
75 switch (mg->get_type_r(l)) {
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 ;
100 alpha.std_base_scal() ;
101 beta.std_base_scal() ;
141 assert(mpi.mg == mg) ;
143 set_ori( mpi.ori_x, mpi.ori_y, mpi.ori_z ) ;
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) ;
188 stdrdp.set(
this, map_star_fait_stdrdp) ;
189 srdrdt.set(
this, map_star_fait_srdrdt) ;
190 srstdrdp.set(
this, map_star_fait_srstdrdp) ;
191 sr2drdt.set(
this, map_star_fait_sr2drdt) ;
192 sr2stdrdp.set(
this, map_star_fait_sr2stdrdp) ;
193 d2rdx2.set(
this, map_star_fait_d2rdx2) ;
194 lapr_tp.set(
this, map_star_fait_lapr_tp) ;
195 d2rdtdx.set(
this, map_star_fait_d2rdtdx) ;
196 sstd2rdpdx.set(
this, map_star_fait_sstd2rdpdx) ;
197 sr2d2rdt2.set(
this, map_star_fait_sr2d2rdt2) ;
204 double precis = 1e-10 ;
212 if (*mg != *(mpi.get_mg()))
215 if (fabs(ori_x-mpi.get_ori_x()) > precis) resu = false ;
216 if (fabs(ori_y-mpi.get_ori_y()) > precis) resu = false ;
217 if (fabs(ori_z-mpi.get_ori_z()) > precis) resu = false ;
219 if (
bvect_spher != mpi.get_bvect_spher()) resu = false ;
220 if (
bvect_cart != mpi.get_bvect_cart()) resu = false ;
222 int nz = mg->get_nzone() ;
223 for (
int i=0 ; i<nz ; i++) {
240const Valeur& Map_star::get_beta()
const {
265 ost <<
"Affine + starlike mapping (class Map_star)" << endl ;
266 int nz = mg->get_nzone() ;
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++){
293 int nrm1 = mg->get_nr(l) - 1 ;
294 ost <<
" " << (+
r)(l, k, j, nrm1) / km ;
310 assert(l<mg->get_nzone()) ;
312 int Nt = mg->get_nt(l) ;
313 int Np = mg->get_np(l) ;
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) ;
324void Map_star::set_beta(
const Tbl& beta0,
int l) {
327 assert(l<mg->get_nzone()) ;
329 int Nt = mg->get_nt(l) ;
330 int Np = mg->get_np(l) ;
331 for (
int k=0; k<Np; k++)
332 for (
int j=0; j<Nt; j++){
333 beta.
set(l, k, j, 0) = beta0(k,j) ;
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).
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.
void set_alpha(const Tbl &alpha0, int l)
Modifies the value of in domain no. l.
virtual void sauve(FILE *) const
Save in a file.
Map_star(const Mg3d &mgrille, const double *r_limits)
Standard Constructor.
friend Mtbl * map_star_fait_r(const Map *)
< Not implemented
virtual ostream & operator>>(ostream &) const
Operator >>.
virtual void operator=(const Map_af &)
Assignment to an affine mapping.
Valeur alpha
Array (size: mg->nzone*Nt*Np ) of the values of in each domain.
void set_coord()
Assignment of the building functions to the member Coords.
virtual ~Map_star()
Destructor.
virtual bool operator==(const Map &) const
Comparison operator (egality).
Values and coefficients of a (real-value) function.
Tbl & set(int l)
Read/write of the value in a given domain (configuration space).
Tbl max(const Cmp &)
Maximum values of a Cmp in each domain.
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.