23 char cmp_pde_frontiere_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Cmp/cmp_pde_frontiere.C,v 1.7 2014/10/13 08:52:48 j_novak Exp $" ;
86 Mtbl_cf sol_poisson_frontiere(
const Map_af&,
const Mtbl_cf&,
const Mtbl_cf&,
87 int,
int,
int,
double = 0.,
90 Mtbl_cf sol_poisson_frontiere_double (
const Map_af&,
const Mtbl_cf&,
const Mtbl_cf&,
91 const Mtbl_cf&,
int) ;
93 Mtbl_cf sol_poisson_interne(
const Map_af&,
const Mtbl_cf&,
const Mtbl_cf&) ;
117 Cmp Cmp::poisson_frontiere_double (
const Valeur& lim_func,
const Valeur& lim_der,
118 int num_zone)
const {
120 mp->poisson_frontiere_double (*
this, lim_func, lim_der, num_zone, resu) ;
125 cout <<
"Procedure non implantee ! " << endl ;
129 void Map_et::poisson_frontiere_double (
const Cmp&,
const Valeur&,
const Valeur&,
131 cout <<
"Procedure non implantee ! " << endl ;
136 int type_raccord,
int num_front,
137 Cmp& pot,
double fact_dir,
double fact_neu)
const {
139 assert(source.
get_etat() != ETATNONDEF) ;
145 assert ((type_raccord == 1) || (type_raccord==2)|| (type_raccord==3)) ;
164 if (sourva.
get_etat() == ETATZERO) {
168 so_cf = *sourva.
c_cf ;
171 Valeur conditions (limite) ;
177 if (conditions.
get_etat() == ETATZERO)
180 auxiliaire = *conditions.
c_cf ;
184 if (type_raccord == 3){
188 resu = sol_poisson_frontiere(*
this, so_cf, auxiliaire,
189 type_raccord, num_front, dzpuis,
190 fact_dir, fact_neu) ;
193 resu = sol_poisson_frontiere(*
this, so_cf, auxiliaire,
194 type_raccord, num_front, dzpuis) ;
209 const Valeur& lim_der,
int num_zone,
Cmp& pot)
const {
211 assert(source.
get_etat() != ETATNONDEF) ;
225 Mtbl_cf so_cf (sourva.get_mg(), sourva.base) ;
226 if (sourva.get_etat() == ETATZERO) {
230 so_cf = *sourva.c_cf ;
233 Valeur cond_func (lim_func) ;
239 if (cond_func.
get_etat() == ETATZERO)
242 auxi_func = *cond_func.
c_cf ;
244 Valeur cond_der (lim_der) ;
250 if (cond_der.
get_etat() == ETATZERO)
253 auxi_der = *cond_der.
c_cf ;
260 Mtbl_cf resu = sol_poisson_frontiere_double (*
this, so_cf, auxi_func,
261 auxi_der, num_zone) ;
277 assert(source.
get_etat() != ETATNONDEF) ;
278 assert(source.
get_mp() ==
this) ;
280 assert(uu.
get_mp() ==
this) ;
282 int nz = mg->get_nzone() ;
288 Mtbl unjj = 1 + srdrdt*srdrdt + srstdrdp*srstdrdp ;
292 for (
int l=0; l<nz; l++) {
293 *(apre1.
t[l]) = alpha[l]*alpha[l] ;
296 apre1 = apre1 * dxdr * dxdr * unjj ;
306 for (
int l=0; l<nz; l++) {
307 *(amax1.
t[l]) = amax0(l) ;
321 double unmlambda = 1. - lambda ;
345 cout <<
"Map_et::poisson : relat. diff. u^J <-> u^{J-1} : " << endl ;
381 sxlapang = sxlapang.
lapang() ;
383 sxlapang = sxlapang.
sx() ;
401 vuu = 2. * dxdr * ( rsxdxdr * unjj - 1.) * varduudx
402 + ( rsxdxdr*rsxdxdr * unjj - 1.) * xsr * sxlapang ;
415 sauve_base = vuu.
base ;
418 + 2. * dxdr * ( sr2drdt * d2uudtdx
419 + sr2stdrdp * std2uudpdx ) ;
421 vuu += dxdr * ( lapr_tp + dxdr * (
423 - 2. * ( sr2drdt * d2rdtdx + sr2stdrdp * sstd2rdpdx ) )
433 ssj = lambda * ssjm1 + unmlambda * ssjm2 ;
435 ssj = ( source + uu + (amax - apre) * ssj ) / amax ;
437 (ssj.
va).set_base((source.
va).base) ;
447 cout <<
" step " << niter <<
" : " ;
448 cout << tdiff(0) <<
" " ;
463 while ( (tdiff(0) > precis) && (niter < nitermax) ) ;
477 assert(source.
get_etat() != ETATNONDEF) ;
490 Mtbl_cf so_cf (sourva.get_mg(), sourva.base) ;
491 if (sourva.get_etat() == ETATZERO) {
495 so_cf = *sourva.c_cf ;
497 Valeur conditions (limite) ;
504 if (conditions.
get_etat() == ETATZERO)
507 auxiliaire = *conditions.
c_cf ;
512 Mtbl_cf resu = sol_poisson_interne(*
this, so_cf, auxiliaire) ;
const Map * get_mp() const
Returns the mapping.
const Valeur & dsdt() const
Returns of *this.
Mtbl_cf * c_cf
Coefficients of the spectral expansion of the function.
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
const Cmp & dsdx() const
Returns of *this , where .
const Valeur & lapang() const
Returns the angular Laplacian of *this.
void coef() const
Computes the coeffcients of *this.
void ylm()
Computes the coefficients of *this.
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
int get_etat() const
Returns the logical state.
virtual void poisson_frontiere_double(const Cmp &source, const Valeur &lim_func, const Valeur &lim_der, int num_zone, Cmp &pot) const
Solver of the Poisson equation with boundary condition for the affine mapping case, cases with boundary conditions of both Dirichlet and Neumann type (no condition imposed at infinity).
const Valeur & sx() const
Returns (r -sampling = RARE ) \ Id (r sampling = FIN ) \ (r -sampling = UNSURR ) ...
Values and coefficients of a (real-value) function.
void set_base(const Base_val &)
Sets the bases for spectral expansions (member base )
Tbl diffrel(const Cmp &a, const Cmp &b)
Relative difference between two Cmp (norme version).
const Mg3d * get_mg() const
Returns the Mg3d on which the this is defined.
Cmp & get_cmp_mod(int position=0) const
Returns the reference of a modifiable Cmp stored in the list.
virtual void poisson_interne(const Cmp &source, const Valeur &limite, Param &par, Cmp &pot) const =0
Computes the solution of a Poisson equation in the shell, imposing a boundary condition at the surfac...
int get_etat() const
Returns the logical state.
virtual void poisson_frontiere(const Cmp &, const Valeur &, int, int, Cmp &, double=0., double=0.) const
Not yet implemented.
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
const int & get_int(int position=0) const
Returns the reference of a int stored in the list.
const Mg3d * get_angu() const
Returns the pointer on the associated angular grid.
int dzpuis
Power of r by which the quantity represented by this must be divided in the external compactified zon...
Base_val base
Bases on which the spectral expansion is performed.
virtual void poisson_frontiere(const Cmp &, const Valeur &, int, int, Cmp &, double=0., double=0.) const
Solver of the Poisson equation with boundary condition for the affine mapping case.
bool dz_nonzero() const
Returns true if the last domain is compactified and *this is not zero in this domain.
const Valeur & stdsdp() const
Returns of *this.
int & get_int_mod(int position=0) const
Returns the reference of a modifiable int stored in the list.
Cmp poisson_dirichlet(const Valeur &limite, int num) const
Is identicall to Cmp::poisson() .
Tbl max(const Cmp &)
Maximum values of a Cmp in each domain.
virtual void poisson_interne(const Cmp &source, const Valeur &limite, Param &par, Cmp &pot) const
Computes the solution of a Poisson equation in the shell .
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
virtual void poisson_frontiere(const Cmp &source, const Valeur &limite, int raccord, int num_front, Cmp &pot, double=0., double=0.) const =0
Computes the solution of a Poisson equation from the domain num_front+1 .
Bases of the spectral expansions.
const Map * mp
Reference mapping.
int get_dzpuis() const
Returns dzpuis.
Coefficients storage for the multi-domain spectral method.
bool check_dzpuis(int dzi) const
Returns false if the last domain is compactified and *this is not zero in this domain and dzpuis is n...
virtual void poisson_interne(const Cmp &source, const Valeur &limite, Param &par, Cmp &pot) const
Computes the solution of a Poisson equation in the shell, imposing a boundary condition at the surfac...
Cmp poisson_neumann(const Valeur &, int) const
Idem as Cmp::poisson_dirichlet , the boundary condition being on the radial derivative of the solutio...
void set_dzpuis(int)
Set a value to dzpuis.
const double & get_double(int position=0) const
Returns the reference of a double stored in the list.
Tbl ** t
Array (size nzone ) of pointers on the Tbl 's.
Valeur va
The numerical value of the Cmp.
Cmp poisson_neumann_interne(const Valeur &, Param &par, Cmp &resu) const
Idem as Cmp::poisson_neumann , the boundary condition is on the radial derivative of the solution...