29 char valeur_equipot_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Valeur/valeur_equipot.C,v 1.5 2014/10/13 08:53:50 j_novak Exp $" ;
73 #include "utilitaires.h" 77 double valeur_equipot_fonc(
double,
const Param&) ;
82 int& niter,
Itbl& l_iso,
Tbl& xi_iso)
const {
91 assert(
etat == ETATQCQ) ;
92 assert(nz_search > 0) ;
93 assert(nz_search <= nz) ;
94 for (
int l=1; l<nz_search; l++) {
118 for (k=0; k<np; k++) {
120 for (j=0; j<nt; j++) {
128 for (
int l=nz_search-1; l>= 0; l--) {
131 for (
int i=nr-1; i >= 0; i--) {
132 double uux = (*this)(l, k, j, i) ;
133 if ( ( (uux > uu0) || ( fabs(uux-uu0) < 1.e-14 ) ) &&
134 (uux != __infinity) ) {
145 cout <<
"Valeur::equipot: the point uu >= uu0 has not been found" << endl ;
146 cout <<
" for the phi index " << k << endl ;
147 cout <<
" and the theta index " << j << endl ;
148 cout <<
" uu0 = " << uu0 << endl ;
154 if (i2 < mg->get_nr(l2) -1) {
158 if (l2<nz_search-1) {
160 double uux = (*this)(l2, k, j, i2) ;
161 if ( ( fabs(uux-uu0) < 1.e-14 ) ) {
164 "Valeur::equipot: WARNING : fabs(uux-uu0) < 1.e-14" << endl ;
165 l_iso.
set(k, j) = l2 ;
169 cout <<
"Valeur::equipot: PROBLEM !!!" << endl ;
170 cout <<
" k, j : " << k <<
" " << j << endl ;
171 cout <<
" uu0 : " << uu0 << endl ;
176 l_iso.
set(k, j) = nz_search-1 ;
182 l_iso.
set(k, j) = l2 ;
187 double y2 = (*this)(l2, k, j, i2) - uu0 ;
192 if (fabs(y2) < 1.e-14) {
193 xi_iso.
set(k, j) = x2 ;
196 xi_iso.
set(k, j) =
zerosec(valeur_equipot_fonc, parf, x2, x3, precis,
200 niter = ( niter0 > niter ) ? niter0 : niter ;
211 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.