86 const DoubleTab& tab_tau = semi_impl.count(
"tau") ? semi_impl.at(
"tau") : tau.
valeurs();
87 const DoubleTab& tab_tau_passe = tau.
passe();
90 const IntTab& fcl = tau.
fcl();
91 const IntTab& e_f = domaine.elem_faces();
92 const IntTab& f_e = domaine.face_voisins();
96 const DoubleTab& xp = domaine.xp();
97 const DoubleTab& xv = domaine.xv();
100 const DoubleVect& ve = domaine.volumes();
101 const DoubleVect& fs = domaine.face_surfaces();
104 const int nf = domaine.nb_faces();
105 const int ne = domaine.nb_elem();
106 const int ne_tot = domaine.nb_elem_tot();
109 Matrice_Morse *Mtau = matrices.count(
"tau") ? matrices.at(
"tau") :
nullptr;
110 Matrice_Morse *Mk = matrices.count(
"k") ? matrices.at(
"k") :
nullptr;
112 DoubleTrav grad_sqrt_tau_faces(nf, N);
113 DoubleTrav grad_sqrt_tau_elems(ne, N*D);
114 DoubleTrav grad_tau_sqrt_tau_faces;
115 DoubleTrav grad_tau_sqrt_tau_elems;
116 if (!semi_impl.count(
"tau") && (Mtau))
118 grad_tau_sqrt_tau_faces = DoubleTrav(nf, N);
119 grad_tau_sqrt_tau_elems = DoubleTrav(ne, N*D);
127 const IntTab& fg_d = tau.
fgrad_d;
128 const IntTab& fg_e = tau.
fgrad_e;
133 for (
int f = 0; f < nf; f++)
134 for (
int n = 0; n < N; n++)
136 grad_sqrt_tau_faces(f, n) = 0;
137 for (
int j = fg_d(f); j < fg_d(f+1) ; j++)
139 const int e = fg_e(j);
141 if ( (f_bord = e-ne_tot) < 0)
142 grad_sqrt_tau_faces(f, n) += f_w(j) * std::sqrt(std::max(
limiter_tau_, tab_tau_passe(e, n))) ;
143 else if (fcl(f_bord, 0) == 1 || fcl(f_bord, 0) == 2)
144 grad_sqrt_tau_faces(f, n) += f_w(j, n) ? f_w(j, n) * ref_cast(
Echange_impose_base, cls[fcl(f_bord, 1)].valeur()).T_ext(fcl(f_bord, 2), n) / std::sqrt(std::max(
limiter_tau_, tab_tau_passe(domaine.face_voisins(f_bord, 0), n))) : 0;
145 else if (fcl(f_bord, 0) == 4)
147 else if (fcl(f_bord, 0) == 6)
148 grad_sqrt_tau_faces(f, n) += f_w(j) * std::sqrt(ref_cast(
Dirichlet, cls[fcl(f_bord, 1)].valeur()).val_imp(fcl(f_bord, 2), n));
152 if (!semi_impl.count(
"tau") && (Mtau))
153 for (
int f = 0; f < nf; f++)
154 for (
int n = 0 ; n < N; n++)
156 grad_tau_sqrt_tau_faces(f, n) = 0;
157 for (
int j = fg_d(f); j < fg_d(f+1) ; j++)
159 const int e = fg_e(j);
161 if ((f_bord = e-ne_tot) < 0)
162 grad_tau_sqrt_tau_faces(f, n) += f_w(j) * tab_tau(e, n) / std::sqrt(std::max(
limiter_tau_, tab_tau_passe(e, n))) ;
164 else if (fcl(f_bord, 0) == 1 || fcl(f_bord, 0) == 2)
165 grad_tau_sqrt_tau_faces(f, n) += f_w(j, n) ? f_w(j, n) * ref_cast(
Echange_impose_base, cls[fcl(f_bord, 1)].valeur()).T_ext(fcl(f_bord, 2), n) /std::sqrt(std::max(
limiter_tau_, tab_tau_passe(domaine.face_voisins(f_bord, 0), n))) : 0;
166 else if (fcl(f_bord, 0) == 4)
168 else if (fcl(f_bord, 0) == 6)
169 grad_tau_sqrt_tau_faces(f, n) += f_w(j) * std::sqrt(ref_cast(
Dirichlet, cls[fcl(f_bord, 1)].valeur()).val_imp(fcl(f_bord, 2), n));
174 for (
int e = 0; e < ne; e++)
175 for (
int n = 0; n < N ; n++)
176 for (
int d = 0; d < D; d++)
177 for (
int j = 0, f; j < e_f.
dimension(1) && (f = e_f(e, j)) >= 0; j++)
178 grad_sqrt_tau_elems(e, N*d+n) += (e == f_e(f, 0) ? 1 : -1) * fs(f) * (xv(f, d) - xp(e, d)) / ve(e) * grad_sqrt_tau_faces(f, n);
180 if (!semi_impl.count(
"tau") && (Mtau))
181 for (
int e = 0; e < ne; e++)
182 for (
int n = 0 ; n < N ; n++)
183 for (
int d = 0; d < D; d++)
184 for (
int j = 0, f; j < e_f.
dimension(1) && (f = e_f(e, j)) >= 0; j++)
185 grad_tau_sqrt_tau_elems(e, N*d+n) += (e == f_e(f, 0) ? 1 : -1) * fs(f) * (xv(f, d) - xp(e, d)) / ve(e) * grad_tau_sqrt_tau_faces(f, n);
187 for(
int e = 0 ; e < ne ; e++)
188 for (
int n=0 ; n<N ; n++)
192 for (
int d = 0; d<D; d++)
193 fac += grad_sqrt_tau_elems(e, N*d+n)* ((!semi_impl.count(
"tau") && (Mtau)) ? grad_tau_sqrt_tau_elems(e, N*d+n) :grad_sqrt_tau_elems(e, N*d+n));
196 secmem(e, n) += fac * -8 *
sigma_tau_ * tab_tau(e,n) * k(e,n);
199 (*Mtau)(N * e + n, N * e + n) += fac * 8 *
sigma_tau_ * k(e,n);
201 (*Mk)(N * e + n, N * e + n) += fac * 8 *
sigma_tau_ * tab_tau(e,n);
203 if (!semi_impl.count(
"tau") && (Mtau))
205 for (
int i = 0, f; i < e_f.
dimension(1) && (f = e_f(e, i)) >= 0; i++)
206 for (
int j = fg_d(f); j < fg_d(f+1) ; j++)
208 const int ed = fg_e(j);
210 for (
int d = 0; d < D ; d++)
212 const double inv_sqrt_tau = (tab_tau_passe(ed, n) >
limiter_tau_) ? std::sqrt(1/tab_tau_passe(ed, n)) : std::sqrt(1/
limiter_tau_);
213 (*Mtau)(N * e + n, N * ed + n) += pe(e)*ve(e) * 8 *
sigma_tau_ * tab_tau(e,n) * k(e,n) * grad_sqrt_tau_elems(e, N*d+n) * (e == f_e(f, 0) ? 1 : -1) * fs(f) * (xv(f, d) - xp(e, d)) / ve(e) * f_w(j) * inv_sqrt_tau ;
const Cond_lim & les_conditions_limites(int) const
Renvoie la i-ieme condition aux limites.