61 #include "type_parite.h" 62 #include "utilitaires.h" 72 Mtbl_cf sol_poisson_interne (
const Map_af& mapping,
73 const Mtbl_cf& source,
const Mtbl_cf& lim_der){
77 assert(source.get_mg()->get_type_r(0) == RARE) ;
78 assert (lim_der.get_mg() == source.get_mg()->get_angu()) ;
79 assert (source.get_etat() != ETATNONDEF) ;
80 assert (lim_der.get_etat() != ETATNONDEF) ;
83 const Base_val& base = source.base ;
86 int nr = source.get_mg()->get_nr(0) ;
87 int nt = source.get_mg()->get_nt(0) ;
88 int np = source.get_mg()->get_np(0) ;;
92 double alpha = mapping.get_alpha()[0] ;
93 double beta = mapping.get_beta()[0] ;
104 Mtbl_cf resultat(source.get_mg(), base) ;
105 resultat.annule_hard() ;
107 for (
int k=0 ; k<np+1 ; k++)
108 for (
int j=0 ; j<nt ; j++)
109 if (nullite_plm(j, nt, k, np, base) == 1)
112 donne_lm(nz, 0, j, k, base, m_quant, l_quant, base_r) ;
115 operateur =
new Matrice(laplacien_mat
116 (nr, l_quant, 0., 0, base_r)) ;
118 (*operateur) = combinaison(*operateur, l_quant, 0.,0, base_r) ;
121 nondege =
new Matrice(prepa_nondege(*operateur, l_quant,
125 sol_hom =
new Tbl(solh(nr, l_quant, 0., base_r)) ;
130 for (
int i=0 ; i<nr ; i++)
131 so->set(i) = source(0, k, j, i) ;
133 sol_part =
new Tbl (solp(*operateur, *nondege, alpha,
134 beta, *so, 0, base_r)) ;
141 double val_der_solp = 0 ;
142 for (
int i=0 ; i<nr ; i++)
144 val_der_solp += (2*i)*(2*i)*(*sol_part)(i)/alpha ;
146 val_der_solp += (2*i+1)*(2*i+1)*(*sol_part)(i)/alpha ;
148 double val_der_solh = 0 ;
149 for (
int i=0 ; i<nr ; i++)
151 val_der_solh += (2*i)*(2*i)*(*sol_hom)(i)/alpha ;
153 val_der_solh += (2*i+1)*(2*i+1)*(*sol_hom)(i)/alpha ;
156 assert (val_der_solh != 0) ;
158 facteur = (lim_der(0, k, j, 0)-val_der_solp) /
161 for (
int i=0 ; i<nr ; i++)
162 sol_part->set(i) += facteur*(*sol_hom)(i) ;
165 for (
int i=0 ; i<nr ; i++)
166 sol_part->set(i) = 0. ;
171 for (
int i=0 ; i<nr ; i++)
172 resultat.set(0, k, j, i) = (*sol_part)(i) ;
const Mg3d * get_mg() const
Returns the Mg3d on which the Mtbl_cf is defined.
int get_nzone() const
Returns the number of domains.