76 #include "utilitaires.h" 80 double valeur_equipot_fonc(
double,
const Param&) ;
85 int& niter,
Itbl& l_iso,
Tbl& xi_iso)
const {
94 assert(
etat == ETATQCQ) ;
95 assert(nz_search > 0) ;
96 assert(nz_search <= nz) ;
97 for (
int l=1; l<nz_search; l++) {
121 for (k=0; k<np; k++) {
123 for (j=0; j<nt; j++) {
131 for (
int l=nz_search-1; l>= 0; l--) {
134 for (
int i=nr-1; i >= 0; i--) {
135 double uux = (*this)(l, k, j, i) ;
136 if ( ( (uux > uu0) || ( fabs(uux-uu0) < 1.e-14 ) ) &&
137 (uux != __infinity) ) {
148 cout <<
"Valeur::equipot: the point uu >= uu0 has not been found" << endl ;
149 cout <<
" for the phi index " << k << endl ;
150 cout <<
" and the theta index " << j << endl ;
151 cout <<
" uu0 = " << uu0 << endl ;
157 if (i2 < mg->get_nr(l2) -1) {
161 if (l2<nz_search-1) {
163 double uux = (*this)(l2, k, j, i2) ;
164 if ( ( fabs(uux-uu0) < 1.e-14 ) ) {
167 "Valeur::equipot: WARNING : fabs(uux-uu0) < 1.e-14" << endl ;
168 l_iso.
set(k, j) = l2 ;
172 cout <<
"Valeur::equipot: PROBLEM !!!" << endl ;
173 cout <<
" k, j : " << k <<
" " << j << endl ;
174 cout <<
" uu0 : " << uu0 << endl ;
179 l_iso.
set(k, j) = nz_search-1 ;
185 l_iso.
set(k, j) = l2 ;
190 double y2 = (*this)(l2, k, j, i2) - uu0 ;
195 if (fabs(y2) < 1.e-14) {
196 xi_iso.
set(k, j) = x2 ;
199 xi_iso.
set(k, j) =
zerosec(valeur_equipot_fonc, parf, x2, x3, precis,
203 niter = ( niter0 > niter ) ? niter0 : niter ;
214 double valeur_equipot_fonc(
double xi,
const Param& par) {
const Grille3d * get_grille3d(int l) const
Returns a pointer on the 3D mono-grid for domain no. l.
void equipot(double uu0, int nz_search, double precis, int nitermax, int &niter, Itbl &l_iso, Tbl &xi_iso) const
Determines an equipotential surface of the field represented by *this (inward search).
Mtbl_cf * c_cf
Coefficients of the spectral expansion of the function.
int & set(int i)
Read/write of a particular element (index i ) (1D case)
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
void coef() const
Computes the coeffcients of *this.
double & set(int i)
Read/write of a particular element (index i) (1D case)
Basic integer array class.
void add_mtbl_cf(const Mtbl_cf &mi, int position=0)
Adds the address of a new Mtbl_cf to the list.
double zerosec(double(*f)(double, const Param &), const Param &par, double a, double b, double precis, int nitermax, int &niter, bool abort=true)
Finding the zero a function.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
const Mg3d * mg
Multi-grid Mgd3 on which this is defined.
double val_point_jk(int l, double x, int j, int k) const
Computes the value of the field represented by *this at an arbitrary point in , but collocation point...
int get_nzone() const
Returns the number of domains.
int & get_int_mod(int position=0) const
Returns the reference of a modifiable int stored in the list.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
const Mtbl_cf & get_mtbl_cf(int position=0) const
Returns the reference of a Mtbl_cf stored in the list.
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
void add_double(const double &x, int position=0)
Adds the the address of a new double to the list.
Coefficients storage for the multi-domain spectral method.
int etat
Logical state (ETATNONDEF , ETATQCQ or ETATZERO ).
const double & get_double(int position=0) const
Returns the reference of a double stored in the list.
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
void add_int_mod(int &n, int position=0)
Adds the address of a new modifiable int to the list.