76#include "utilitaires.h"
80double valeur_equipot_fonc(
double,
const Param&) ;
85 int& niter,
Itbl& l_iso,
Tbl& xi_iso)
const {
88 int nz =
mg->get_nzone() ;
89 int nt =
mg->get_nt(0) ;
90 int np =
mg->get_np(0) ;
94 assert(
etat == ETATQCQ) ;
95 assert(nz_search > 0) ;
96 assert(nz_search <= nz) ;
97 for (
int l=1; l<nz_search; l++) {
98 assert(
mg->get_nt(l) == nt ) ;
99 assert(
mg->get_np(l) == np ) ;
121 for (k=0; k<np; k++) {
123 for (j=0; j<nt; j++) {
131 for (
int l=nz_search-1; l>= 0; l--) {
132 int nr =
mg->get_nr(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 ;
169 xi_iso.
set(k, j) = (
mg->get_grille3d(l2))->x[i2] ;
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 ;
180 xi_iso.
set(k, j) = (
mg->get_grille3d(l2))->x[i2] ;
185 l_iso.
set(k, j) = l2 ;
187 double x2 = (
mg->get_grille3d(l2))->x[i2] ;
188 double x3 = (
mg->get_grille3d(l2))->x[i3] ;
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 ;
214double valeur_equipot_fonc(
double xi,
const Param& par) {
Basic integer array class.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
int & set(int i)
Read/write of a particular element (index i ) (1D case).
Coefficients storage for the multi-domain spectral method.
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...
void add_double(const double &x, int position=0)
Adds the the address of a new double to the list.
const double & get_double(int position=0) const
Returns the reference of a double stored in the list.
void add_mtbl_cf(const Mtbl_cf &mi, int position=0)
Adds the address of a new Mtbl_cf to the list.
void add_int_mod(int &n, int position=0)
Adds the address of a new modifiable int to the list.
int & get_int_mod(int position=0) const
Returns the reference of a modifiable int stored in the list.
const Mtbl_cf & get_mtbl_cf(int position=0) const
Returns the reference of a Mtbl_cf stored in the list.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
double & set(int i)
Read/write of a particular element (index i) (1D case).
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).
const Mg3d * mg
Multi-grid Mgd3 on which this is defined.
Mtbl_cf * c_cf
Coefficients of the spectral expansion of the function.
void coef() const
Computes the coeffcients of *this.
int etat
Logical state (ETATNONDEF , ETATQCQ or ETATZERO ).
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.