TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Op_Diff_EF.cpp
1/****************************************************************************
2* Copyright (c) 2026, CEA
3* All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9*
10* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13*
14*****************************************************************************/
15
16//static int transpose_=1;
17#include <Op_Diff_EF.h>
18#include <Domaine_EF.h>
19#include <Champ_Uniforme.h>
20#include <Milieu_base.h>
21#include <Debog.h>
22#include <TRUSTTrav.h>
23#include <Probleme_base.h>
24#include <Neumann_paroi.h>
25#include <Echange_global_impose.h>
26#include <Echange_interne_global_impose.h>
27#include <Echange_couplage_thermique.h>
28#include <Echange_interne_global_parfait.h>
29#include <Champ_front_calc_interne.h>
30
31#include <Param.h>
32#include <Op_Conv_EF.h>
33
34#include <vector>
35
36Implemente_instanciable_sans_constructeur(Op_Diff_EF,"Op_Diff_EF",Op_Diff_EF_base);
37
38Op_Diff_EF::Op_Diff_EF():transpose_(1),transpose_partout_(0),nouvelle_expression_(0)
39{
40}
41//// printOn
42//
44{
45 return s << que_suis_je() ;
46}
47
48//// readOn
49//
50
52{
53 return s ;
54}
55Implemente_instanciable(Op_Diff_option_EF,"Op_Diff_option_EF",Op_Diff_EF);
56
57
58//// printOn
59//
60
62{
63 return s << que_suis_je() ;
64}
65
66//// readOn
67//
68
70{
71 Param param(que_suis_je());
72 param.ajouter("grad_u_transpose", &transpose_ );
73 param.ajouter("grad_u_transpose_partout", &transpose_partout_ );
74 param.ajouter("nouvelle_expression",&nouvelle_expression_);
75 param.ajouter_condition("(value_of_grad_u_transpose_EQ_0)_OR_(value_of_grad_u_transpose_EQ_1)"," grad_u_transpose doit valoir 0 ou 1 ");
76 param.ajouter_condition("(value_of_grad_u_transpose_partout_EQ_0)_OR_(value_of_grad_u_transpose_partout_EQ_1)"," grad_u_transpose_partout doit valoir 0 ou 1 ");
77 param.ajouter_condition("(value_of_grad_u_transpose_partout_EQ_0)_OR_((value_of_grad_u_transpose_partout_EQ_1)_AND_(value_of_grad_u_transpose_EQ_1))"," si grad_u_transpose_partout vaut 1 alors grad_u_transpose doit valoir 1");
78 param.lire_avec_accolades_depuis(s);
79
80 return s ;
81}
82
83/*! @brief associe le champ de diffusivite
84 *
85 */
87{
88 diffusivite_ = diffu;
89}
90
92{
93 diffusivite_volumique_ = diffu;
94}
95
101
103{
104 return diffusivite_;
105}
106
108{
109 if (!diffusivite_volumique_)
110 {
111 Cerr << que_suis_je() << " has no volumic diffusivity associated." << finl;
113 }
114 return diffusivite_volumique_.valeur();
115}
116
117void Op_Diff_EF::remplir_nu(DoubleTab& nu) const
118{
119 const Domaine_EF& domaine_EF = le_dom_EF.valeur();
120 // On dimensionne nu
121 if (!nu.get_md_vector())
122 domaine_EF.domaine().creer_tableau_elements(nu);
123 const DoubleTab& diffu=diffusivite().valeurs();
124 if (diffu.size()==1)
125 nu = diffu(0,0);
126 else if (diffu.nb_dim()==1)
127 nu = diffu;
128 else
129 {
130 assert(diffu.dimension(1)==1);
131 for (int i=0; i<diffu.size_totale(); i++) nu(i)=diffu(i,0);
132 }
133
134// nu.echange_espace_virtuel();
135}
136
137void Op_Diff_EF::remplir_lambda(DoubleTab& lambda) const
138{
139 assert(diffusivite_volumique_);
140 const Domaine_EF& domaine_EF = le_dom_EF.valeur();
141 if (!lambda.get_md_vector())
142 domaine_EF.domaine().creer_tableau_elements(lambda);
143
144 const DoubleTab& diffu = diffusivite_volumique().valeurs();
145 if (diffu.size() == 1)
146 lambda = diffu(0, 0);
147 else if (diffu.nb_dim() == 1)
148 lambda = diffu;
149 else
150 {
151 assert(diffu.dimension(1) == 1);
152 for (int i = 0; i < diffu.size_totale(); i++) lambda(i) = diffu(i, 0);
153 }
154}
155
156void Op_Diff_EF::calculer_von_mises(const DoubleTab& deplacement, DoubleTab& deformation, DoubleTab& contraintes, DoubleTab& von_mises) const
157{
158 const Domaine_EF& domaine_ef = le_dom_EF.valeur();
159 const Domaine& domaine = domaine_ef.domaine();
160 const int nb_elem_tot = domaine.nb_elem_tot();
161 const int nb_som_elem = domaine.nb_som_elem();
162 const DoubleTab& Bij_thilde = domaine_ef.Bij_thilde();
163 const DoubleTab& iphi_thilde = domaine_ef.IPhi_thilde();
164 const DoubleVect& volumes_thilde = domaine_ef.volumes_thilde();
165 const IntTab& elems = domaine.les_elems();
166 const DoubleTab& xs = domaine_ef.domaine().les_sommets();
167 const double r_tol = 1e-12;
168
170 const bool have_lambda = bool(diffusivite_volumique_);
171 if (have_lambda) remplir_lambda(lambda_);
172
173 von_mises = 0.;
174
175 for (int elem = 0; elem < nb_elem_tot; elem++)
176 if (elem_contribue(elem))
177 {
178 double grad[3][3] = {{0., 0., 0.}, {0., 0., 0.}, {0., 0., 0.}};
179 double sum_ur_over_r = 0.;
180 double sum_w = 0.;
181
182 for (int j = 0; j < nb_som_elem; j++)
183 {
184 const int som = elems(elem, j);
185 for (int comp = 0; comp < dimension; comp++)
186 for (int dir = 0; dir < dimension; dir++)
187 grad[comp][dir] += deplacement(som, comp) * Bij_thilde(elem, j, dir);
188 if (bidim_axi)
189 {
190 const double r_s = xs(som, 0);
191 const double w = iphi_thilde(elem, j);
192 if (r_s > r_tol && w > 0.)
193 {
194 sum_ur_over_r += (deplacement(som, 0) / r_s) * w;
195 sum_w += w;
196 }
197 }
198 }
199
200 const double vol = volumes_thilde(elem);
201 double inv_vol = 1.0 / vol;
202 // En RZ: Bij_thilde porte r, volumes_thilde porte 2π r ⇒ il faut remonter le facteur 2π
203 for (int comp = 0; comp < dimension; comp++)
204 for (int dir = 0; dir < dimension; dir++)
205 grad[comp][dir] *= inv_vol;
206
207 double eps_xx = grad[0][0];
208 double eps_yy = grad[1][1];
209 double eps_zz = (dimension == 3) ? grad[2][2] : 0.;
210 double gamma_xy = grad[0][1] + grad[1][0];
211 double gamma_yz = (dimension == 3) ? (grad[1][2] + grad[2][1]) : 0.;
212 double gamma_zx = (dimension == 3) ? (grad[2][0] + grad[0][2]) : 0.;
213
214 if (bidim_axi)
215 {
216 // hoop strain eps_theta = average of (u_r / r) over the element with IPhi_thilde weights
217 const double eps_theta = (sum_w > 0.) ? (sum_ur_over_r / sum_w) : eps_xx; // at the axis, fallback to eps_rr
218 eps_zz = eps_theta;
219 }
220
221 const double mu = nu_(elem);
222 const double lambda = have_lambda ? lambda_(elem) : 0.;
223 const double trace_eps = eps_xx + eps_yy + eps_zz;
224
225 const double sigma_xx = 2. * mu * eps_xx + lambda * trace_eps;
226 const double sigma_yy = 2. * mu * eps_yy + lambda * trace_eps;
227 const double sigma_zz = 2. * mu * eps_zz + lambda * trace_eps;
228 const double tau_xy = mu * gamma_xy;
229 const double tau_yz = mu * gamma_yz;
230 const double tau_zx = mu * gamma_zx;
231
232 const double vm2 = 0.5 * ((sigma_xx - sigma_yy) * (sigma_xx - sigma_yy) +
233 (sigma_yy - sigma_zz) * (sigma_yy - sigma_zz) +
234 (sigma_zz - sigma_xx) * (sigma_zz - sigma_xx)) +
235 3. * (tau_xy * tau_xy + tau_yz * tau_yz + tau_zx * tau_zx);
236 const double vm = (vm2 > 0.) ? std::sqrt(vm2) : 0.;
237
238 von_mises(elem, 0) = vm;
239 deformation(elem, 0) = eps_xx;
240 deformation(elem, 1) = eps_yy;
241 deformation(elem, 2) = eps_zz;
242 contraintes(elem, 0) = sigma_xx;
243 contraintes(elem, 1) = sigma_yy;
244 contraintes(elem, 2) = sigma_zz;
245 }
246}
247
248DoubleTab& Op_Diff_EF::ajouter(const DoubleTab& tab_inconnue, DoubleTab& resu) const
249{
250 if ((equation().nombre_d_operateurs()>1)&&sub_type(Op_Conv_EF,equation().operateur(1).l_op_base()))
251 ref_cast(Op_Conv_EF,equation().operateur(1).l_op_base()).ajouter_a_la_diffusion(tab_inconnue,resu);
252 // ref_cast(Op_Conv_EF,equation().operateur(1).l_op_base()).ajouter_sous_cond(tab_inconnue,resu,0,0,1);
254 return ajouter_new(tab_inconnue,resu);
255
257 // const Domaine_Cl_EF& domaine_Cl_EF = la_zcl_EF.valeur();
258 const Domaine_EF& domaine_ef = le_dom_EF.valeur();
259 int nb_som_elem=domaine_ef.domaine().nb_som_elem();
260
261 int N = resu.line_size();
262 Nature_du_champ nat= equation().inconnue().nature_du_champ();
263 if (nat==vectoriel)
264 {
265 if ((dimension==3)&&(nb_som_elem==8))
266 return ajouter_vectoriel_dim3_nbn_8(tab_inconnue,resu);
267 else if ((dimension==2)&&(nb_som_elem==4))
268 {
269 return ajouter_vectoriel_dim2_nbn_4(tab_inconnue,resu);
270 }
271 else
272 {
273 //Cerr<<__FILE__<<(int)__LINE__<< "cas non optimise "<<finl;
274 return ajouter_vectoriel_gen(tab_inconnue,resu);
275 }
276 }
277 else
278 {
279 if (N != 1)
280 {
281 Cerr<<__FILE__<<(int)__LINE__<< "cas non prevu "<<finl;
282 assert(0);
283 exit();
284 return ajouter(tab_inconnue,resu);
285 }
286 if ((dimension==3)&&(nb_som_elem==8))
287 return ajouter_scalaire_dim3_nbn_8(tab_inconnue,resu);
288 else if ((dimension==2)&&(nb_som_elem==4))
289 {
290 return ajouter_scalaire_dim2_nbn_4(tab_inconnue,resu);
291 }
292 else
293 {
294 //Cerr<<__FILE__<<(int)__LINE__<< "cas non optimise "<<finl;
295 return ajouter_scalaire_gen(tab_inconnue,resu);
296 }
297
298 }
299}
300
301DoubleTab& Op_Diff_EF::ajouter_vectoriel_gen(const DoubleTab& tab_inconnue, DoubleTab& resu) const
302{
303 return ajouter_vectoriel_template<AJOUTE_VECT::GEN>(tab_inconnue,resu);
304}
305
306DoubleTab& Op_Diff_EF::ajouter_vectoriel_dim2_nbn_4(const DoubleTab& tab_inconnue, DoubleTab& resu) const
307{
308 return ajouter_vectoriel_template<AJOUTE_VECT::D2_4>(tab_inconnue,resu);
309}
310
311DoubleTab& Op_Diff_EF::ajouter_vectoriel_dim3_nbn_8(const DoubleTab& tab_inconnue, DoubleTab& resu) const
312{
313 return ajouter_vectoriel_template<AJOUTE_VECT::D3_8>(tab_inconnue,resu);
314}
315
316DoubleTab& Op_Diff_EF::ajouter_scalaire_dim3_nbn_8(const DoubleTab& tab_inconnue, DoubleTab& resu) const
317{
318 return ajouter_scalaire_template<AJOUTE_SCAL::D3_8>(tab_inconnue,resu);
319}
320
321DoubleTab& Op_Diff_EF::ajouter_scalaire_dim2_nbn_4(const DoubleTab& tab_inconnue, DoubleTab& resu) const
322{
323 return ajouter_scalaire_template<AJOUTE_SCAL::D2_4>(tab_inconnue,resu);
324}
325
326DoubleTab& Op_Diff_EF::ajouter_scalaire_gen(const DoubleTab& tab_inconnue, DoubleTab& resu) const
327{
328 return ajouter_scalaire_template<AJOUTE_SCAL::GEN>(tab_inconnue,resu);
329}
330
331DoubleTab& Op_Diff_EF::ajouter_new(const DoubleTab& tab_inconnue, DoubleTab& resu) const
332{
333 Cerr<<"NEW"<<finl;
335 // const Domaine_Cl_EF& domaine_Cl_EF = la_zcl_EF.valeur();
336 //const Domaine_EF& domaine_EF = le_dom_EF.valeur();
337
338
339 const int N = resu.line_size();
340 ArrOfInt marqueur_neuman;
341 const Domaine_EF& domaine_ef=ref_cast(Domaine_EF,equation().domaine_dis());
342 if(N > 1)
343 remplir_marqueur_sommet_neumann( marqueur_neuman,domaine_ef,la_zcl_EF.valeur(),transpose_partout_ );
344
345 const DoubleVect& volumes= domaine_ef.volumes();
346
347 const DoubleTab& bij=domaine_ef.Bij();
348 const DoubleTab& bij_thilde=domaine_ef.Bij_thilde();
349 int nb_elem_tot=domaine_ef.domaine().nb_elem_tot();
350 int nb_som_elem=domaine_ef.domaine().nb_som_elem();
351 const IntTab& elems=domaine_ef.domaine().les_elems() ;
352
353 for (int elem=0; elem<nb_elem_tot; elem++)
354 if (elem_contribue(elem))
355 {
356 double pond=1./volumes(elem);
357 assert(N == dimension || N == 1);
358
359 for (int i1=0; i1<nb_som_elem; i1++)
360 {
361 int glob=elems(elem,i1);
362 int transpose = (marqueur_neuman[glob] == 1 || N == 1) ? 0 : transpose_;
363 for (int i2=0; i2<nb_som_elem; i2++)
364 {
365 int glob2=elems(elem,i2);
366 for (int n = 0; n < N; n++)
367 for (int d = 0; d < dimension; d++)
368 resu(glob, n) -= bij(elem, i1, d) * (bij_thilde(elem, i2, d) * tab_inconnue(glob2, n) + transpose * bij_thilde(elem, i2, n) * tab_inconnue(glob2, d)) * nu_(elem) * pond;
369 }
370 }
371 }
372
373 // on ajoute la contribution des bords
374 ajouter_bords(tab_inconnue,resu);
375 return resu;
376}
377
378DoubleTab& Op_Diff_EF::calculer(const DoubleTab& tab_inconnue, DoubleTab& resu) const
379{
380 resu = 0;
381 return ajouter(tab_inconnue,resu);
382}
383
384/////////////////////////////////////////
385// Methode pour l'implicite
386/////////////////////////////////////////
387
388// essai
389inline double& coeff_opt(Matrice_Morse& matrice,int i, int j)
390{
391 const auto& tab1_ = matrice.get_tab1();
392 const auto& tab2_ = matrice.get_tab2();
393 auto k1=tab1_[i]-1;
394 auto k2=tab1_[i+1]-1;
395 for (auto k=k1; k<k2; k++)
396 if (tab2_[k]-1 == j) return(matrice.get_set_coeff()(k));
397 Cerr << "i ou j ne conviennent pas " << finl;
398 Cerr << "i=" << i << finl;
399 Cerr << "j=" << j << finl;
400 Cerr << "n_lignes=" << matrice.nb_lignes() << finl;
401 Cerr << "n_colonnes=" << matrice.nb_colonnes() << finl;
403 return coeff_opt(matrice,i,j);
404}
405//#define matrice_coef(i,j) coeff_opt(matrice,i,j)
406#define matrice_coef(i,j) matrice.coef(i,j)
407void Op_Diff_EF::ajouter_contribution(const DoubleTab& transporte, Matrice_Morse& matrice ) const
408{
409 if (1)
410 if ((equation().nombre_d_operateurs()>1)&&sub_type(Op_Conv_EF,equation().operateur(1).l_op_base()))
411 ref_cast(Op_Conv_EF,equation().operateur(1).l_op_base()).ajouter_contribution_a_la_diffusion(transporte,matrice);
412
414 {
415 ajouter_contribution_new(transporte,matrice);
416 }
417 // On remplit le tableau nu car l'assemblage d'une
418 // matrice avec ajouter_contribution peut se faire
419 // avant le premier pas de temps
421
422 const int N = transporte.line_size();
423 const Domaine_EF& domaine_ef=ref_cast(Domaine_EF,equation().domaine_dis());
424 const DoubleVect& volumes_thilde= domaine_ef.volumes_thilde();
425 const DoubleVect& volumes= domaine_ef.volumes();
426
427 const DoubleTab& bij=domaine_ef.Bij();
428 int nb_elem_tot=domaine_ef.domaine().nb_elem_tot();
429 int nb_som_elem=domaine_ef.domaine().nb_som_elem();
430 const IntTab& elems=domaine_ef.domaine().les_elems() ;
431 int nb_som=domaine_ef.domaine().nb_som();
432
433 ArrOfInt marqueur_neuman;
434 remplir_marqueur_sommet_neumann( marqueur_neuman,domaine_ef,la_zcl_EF.valeur(),transpose_partout_ );
435 for (int elem=0; elem<nb_elem_tot; elem++)
436 if (elem_contribue(elem))
437 {
438 double pond=volumes_thilde(elem)/volumes(elem)/volumes(elem);
439
440 for (int i1=0; i1<nb_som_elem; i1++)
441 {
442 int glob=elems(elem,i1);
443
444 int transpose = (marqueur_neuman[glob] == 1 || N == 1) ? 0 : transpose_;
445 if (glob<nb_som)
446 for (int i2=0; i2<nb_som_elem; i2++)
447 {
448 int glob2=elems(elem,i2);
449 double cb=0;
450 for (int b=0; b<dimension; b++)
451 cb+=bij(elem,i1,b)*bij(elem,i2,b);
452 for (int n = 0; n < N; n++)
453 {
454 matrice_coef(glob * N + n, glob2 * N + n) += cb * nu_(elem) * pond;
455 if (transpose)
456 for (int d = 0; d < dimension; d++)
457 matrice_coef(glob * N + n, glob2 * N + d) += bij(elem, i1, d) * bij(elem, i2, n) * nu_(elem) * pond;
458 }
459 }
460 }
461 }
462 if (N == 1) ajouter_contributions_bords(matrice);
463 else if (bidim_axi) ajouter_contribution_axisymetrique(N, matrice);
464
465 if (diffusivite_volumique_)
466 ajouter_contribution_diffusivite_volumique(N, matrice);
467}
468
469void Op_Diff_EF::ajouter_contribution_axisymetrique(int N, Matrice_Morse& matrice) const
470{
471 const Domaine_EF& domaine_ef = ref_cast(Domaine_EF, equation().domaine_dis());
472 const DoubleTab& IPhi_thilde = domaine_ef.IPhi_thilde();
473 const DoubleTab& xs = domaine_ef.domaine().les_sommets();
474 const IntTab& elems = domaine_ef.domaine().les_elems();
475 const int nb_elem_tot = domaine_ef.domaine().nb_elem_tot();
476 const int nb_som_elem = domaine_ef.domaine().nb_som_elem();
477 const int nb_som = domaine_ef.domaine().nb_som();
478
479 const double r_tol = 1e-12;
480 for (int elem = 0; elem < nb_elem_tot; elem++)
481 if (elem_contribue(elem))
482 for (int i1 = 0; i1 < nb_som_elem; i1++)
483 {
484 const int glob = elems(elem, i1);
485 if (glob >= nb_som) continue;
486 const double r_s = xs(glob, 0);
487 if (r_s <= r_tol) continue;
488 const double coeff = 2.0 * nu_(elem) / (r_s * r_s);
489 matrice_coef(glob * N, glob * N) += IPhi_thilde(elem, i1) * coeff;
490 }
491}
492
493void Op_Diff_EF::ajouter_contribution_diffusivite_volumique(int N, Matrice_Morse& matrice) const
494{
496 const double *lambda_ptr = lambda_.addr();
497
498 const Domaine_EF& domaine_ef = ref_cast(Domaine_EF, equation().domaine_dis());
499 const DoubleVect& volumes = domaine_ef.volumes();
500 const DoubleTab& bij = domaine_ef.Bij();
501 const DoubleTab& IPhi_thilde = domaine_ef.IPhi_thilde();
502 const IntTab& elems = domaine_ef.domaine().les_elems();
503 const int nb_elem_tot = domaine_ef.domaine().nb_elem_tot();
504 const int nb_som_elem = domaine_ef.domaine().nb_som_elem();
505 const int nb_som = domaine_ef.domaine().nb_som();
506
507 for (int elem = 0; elem < nb_elem_tot; elem++)
508 if (elem_contribue(elem))
509 {
510 double pond_lambda = lambda_ptr[elem] / volumes(elem);
511
512 for (int i1 = 0; i1 < nb_som_elem; i1++)
513 {
514 const int glob = elems(elem, i1);
515 if (glob >= nb_som) continue;
516 for (int i2 = 0; i2 < nb_som_elem; i2++)
517 {
518 const int glob2 = elems(elem, i2);
519 for (int n = 0; n < N; n++)
520 for (int d = 0; d < N; d++)
521 matrice_coef(glob * N + n, glob2 * N + d) += bij(elem, i1, n) * bij(elem, i2, d) * pond_lambda;
522 }
523 }
524
525 if (bidim_axi)
526 {
527 const DoubleTab& xs = domaine_ef.domaine().les_sommets();
528 const double r_tol = 1e-12;
529 for (int i1 = 0; i1 < nb_som_elem; i1++)
530 {
531 const int glob = elems(elem, i1);
532 if (glob >= nb_som) continue;
533 const double r_s1 = xs(glob, 0);
534 const double inv_r1 = (r_s1 > r_tol) ? (1.0 / r_s1) : 0.0;
535 const double m1 = IPhi_thilde(elem, i1) * inv_r1; // v_r / r
536
537 for (int i2 = 0; i2 < nb_som_elem; i2++)
538 {
539 const int glob2 = elems(elem, i2);
540 const double r_s2 = xs(glob2, 0);
541 const double inv_r2 = (r_s2 > r_tol) ? (1.0 / r_s2) : 0.0;
542 const double m2 = IPhi_thilde(elem, i2) * inv_r2; // u_r / r
543
544 for (int n = 0; n < N; n++)
545 matrice_coef(glob * N + n, glob2 * N + 0) += bij(elem, i1, n) * m2 * pond_lambda;
546
547 for (int n = 0; n < N; n++)
548 matrice_coef(glob * N + 0, glob2 * N + n) += m1 * bij(elem, i2, n) * pond_lambda;
549
550 matrice_coef(glob * N + 0, glob2 * N + 0) += m1 * m2 * pond_lambda;
551 }
552 }
553 }
554 }
555}
556
557void Op_Diff_EF::ajouter_contribution_new(const DoubleTab& transporte, Matrice_Morse& matrice ) const
558{
559 //Cerr<<" NEW"<<finl;
560 // On remplit le tableau nu car l'assemblage d'une
561 // matrice avec ajouter_contribution peut se faire
562 // avant le premier pas de temps
564
565 const int N = transporte.line_size();
566 const Domaine_EF& domaine_ef=ref_cast(Domaine_EF,equation().domaine_dis());
567 //const DoubleVect& volumes_thilde= domaine_ef.volumes_thilde();
568 const DoubleVect& volumes= domaine_ef.volumes();
569
570 const DoubleTab& bij=domaine_ef.Bij();
571 const DoubleTab& bij_thilde=domaine_ef.Bij_thilde();
572 int nb_elem_tot=domaine_ef.domaine().nb_elem_tot();
573 int nb_som_elem=domaine_ef.domaine().nb_som_elem();
574 const IntTab& elems=domaine_ef.domaine().les_elems() ;
575 int nb_som=domaine_ef.domaine().nb_som();
576
577 ArrOfInt marqueur_neuman;
578 remplir_marqueur_sommet_neumann( marqueur_neuman,domaine_ef,la_zcl_EF.valeur(),transpose_partout_ );
579 for (int elem=0; elem<nb_elem_tot; elem++)
580 if (elem_contribue(elem))
581 {
582 double pond=1./volumes(elem);
583
584 for (int i1=0; i1<nb_som_elem; i1++)
585 {
586 int glob=elems(elem,i1);
587
588 int transpose = (marqueur_neuman[glob] == 1 || N == 1) ? 0 : transpose_;
589 if (glob<nb_som)
590 for (int i2=0; i2<nb_som_elem; i2++)
591 {
592 int glob2=elems(elem,i2);
593 double cb=0;
594 for (int b=0; b<dimension; b++)
595 cb+=bij(elem,i1,b)*bij_thilde(elem,i2,b);
596 for (int n = 0; n < N; n++)
597 {
598 matrice_coef(glob * N + n, glob2 * N + n) += cb * nu_(elem) * pond;
599 if (transpose)
600 for (int d = 0; d < dimension; d++)
601 matrice_coef(glob * N + n, glob2 * N + d) += bij(elem, i1, d) * bij_thilde(elem, i2, n) * nu_(elem) * pond;
602 }
603 }
604 }
605 }
606
607}
608void Op_Diff_EF::contribuer_au_second_membre(DoubleTab& resu ) const
609{
610
611 if ((equation().nombre_d_operateurs()>1)&&sub_type(Op_Conv_EF,equation().operateur(1).l_op_base()))
612 ref_cast(Op_Conv_EF,equation().operateur(1).l_op_base()).contribue_au_second_membre_a_la_diffusion(resu);
613 const DoubleTab& tab_inconnue=equation().inconnue().valeurs();
614 ajouter_bords(tab_inconnue,resu,0);
615}
616void Op_Diff_EF::ajouter_bords(const DoubleTab& tab_inconnue,DoubleTab& resu, int contrib_interne ) const
617{
618 // a mettre dans calculer_flux_bord....
619
620 const Domaine_Cl_EF& domaine_Cl_EF = la_zcl_EF.valeur();
621 const Domaine_EF& domaine_EF = le_dom_EF.valeur();
622 flux_bords_=0.;
623 // const DoubleTab& tab_inconnue=equation().inconnue().valeurs();
624 // on parcourt toutes les faces de bord et on calcule lambda*gradT
625 const Domaine_EF& domaine_ef=ref_cast(Domaine_EF,equation().domaine_dis());
626 const IntTab& face_voisins=domaine_ef.face_voisins();
627 const DoubleTab& bij=domaine_ef.Bij();
628 int nb_som_elem=domaine_ef.domaine().nb_som_elem();
629 const IntTab& elems=domaine_ef.domaine().les_elems() ;
630 const DoubleTab& face_normales=domaine_ef.face_normales();
631 const DoubleVect& volumes_thilde= domaine_ef.volumes_thilde();
632 const DoubleVect& volumes= domaine_ef.volumes();
633 const int nb_som = domaine_ef.domaine().nb_som();
634
635 const IntTab& face_sommets=domaine_ef.face_sommets();
636 int nb_som_face=domaine_ef.nb_som_face();
637
638 const int N = resu.line_size();
639
640 if (N > 1)
641 {
642 bool has_traction_bc = false;
643 for (int n_bord = 0; n_bord < domaine_Cl_EF.nb_cond_lim(); n_bord++)
644 if (Motcle(domaine_Cl_EF.les_conditions_limites(n_bord)->que_suis_je()) == Motcle("Paroi_pression_imposee"))
645 {
646 has_traction_bc = true;
647 break;
648 }
649
650 if (!has_traction_bc)
651 {
652 modifier_flux(*this);
653 return;
654 }
655
656 flux_bords_ = 0.;
657 for (int n_bord = 0; n_bord < domaine_Cl_EF.nb_cond_lim(); n_bord++)
658 {
659 const Cond_lim& la_cl = domaine_Cl_EF.les_conditions_limites(n_bord);
660 if (Motcle(la_cl->que_suis_je()) != Motcle("Paroi_pression_imposee")) continue;
661
662 const Front_VF& le_bord = ref_cast(Front_VF, la_cl->frontiere_dis());
663 const Neumann& la_cl_paroi = ref_cast(Neumann, la_cl.valeur());
664 for (int i = 0; i < le_bord.nb_faces_tot(); i++)
665 {
666 const int face=le_bord.num_face(i);
667 const double val = la_cl_paroi.flux_impose(i);
668 for (int i1 = 0; i1 < nb_som_face; i1++)
669 {
670 const int glob = face_sommets(face, i1);
671 if (glob < nb_som)
672 for (int comp = 0; comp < N; comp++)
673 resu(glob, comp) -= val * face_normales(face, comp) / nb_som_face;
674 }
675 }
676 }
677
678 modifier_flux(*this);
679 return;
680 }
681 int premiere_face_int=domaine_ef.premiere_face_int();
682 for (int face=0; face<premiere_face_int; face++)
683 {
684 int elem=face_voisins(face,0);
685 if (elem==-1) face_voisins(face,1);
686
687 double pond= volumes_thilde(elem)/volumes(elem)/volumes(elem);
688
689 for (int i1=0; i1<nb_som_elem; i1++)
690 {
691
692 int glob2=elems(elem,i1);
693 {
694
695 for (int a=0; a<dimension; a++)
696 {
697 flux_bords_(face,0)+=face_normales(face,a)*bij(elem,i1,a)*tab_inconnue(glob2)*nu_(elem)*pond;
698 }
699 }
700 }
701
702 }
703
704 // Neumann :
705 int n_bord;
706 int nb_bords=domaine_Cl_EF.nb_cond_lim();
707
708 for (n_bord=0; n_bord<nb_bords; n_bord++)
709 {
710 const Cond_lim& la_cl = domaine_Cl_EF.les_conditions_limites(n_bord);
711 const Front_VF& le_bord = ref_cast(Front_VF,la_cl->frontiere_dis());
712 int ndeb = le_bord.num_premiere_face();
713 int nfin = ndeb + le_bord.nb_faces();
714
715 if (sub_type(Neumann_paroi,la_cl.valeur()))
716 {
717 const Neumann_paroi& la_cl_paroi = ref_cast(Neumann_paroi, la_cl.valeur());
718 for (int face=ndeb; face<nfin; face++)
719 {
720
721 double flux=la_cl_paroi.flux_impose(face-ndeb)*domaine_EF.surface(face);
722 for (int i1=0; i1<nb_som_face; i1++)
723 {
724 int glob2=face_sommets(face,i1);
725 {
726
727 resu[glob2] += flux/nb_som_face;
728 }
729 flux_bords_(face,0) = flux;
730 }
731 }
732 }
733 else if (sub_type(Echange_couplage_thermique, la_cl.valeur()))
734 {
735 const Echange_couplage_thermique& la_cl_paroi = ref_cast(Echange_couplage_thermique, la_cl.valeur());
736 for (int face=ndeb; face<nfin; face++)
737 {
738
739 double h=la_cl_paroi.h_imp(face-ndeb);
740 double Text=la_cl_paroi.T_ext(face-ndeb);
741 double phiext=la_cl_paroi.flux_exterieur_impose(face-ndeb);
742
743 double tm=0;
744 if (contrib_interne)
745 {
746 for (int i1=0; i1<nb_som_face; i1++)
747 {
748 int glob2=face_sommets(face,i1);
749 tm+=tab_inconnue(glob2);
750 }
751 tm/=nb_som_face;
752 }
753 double flux=(phiext+h*(Text-tm))*domaine_EF.surface(face);
754 flux_bords_(face,0) = flux;
755 flux/=nb_som_face;
756 for (int i1=0; i1<nb_som_face; i1++)
757 {
758 int glob2=face_sommets(face,i1);
759 resu[glob2] += flux;
760 }
761 }
762 }
763 else if (sub_type(Echange_interne_global_parfait, la_cl.valeur()))
764 {
765 if (contrib_interne)
766 {
767 const Echange_interne_global_parfait& la_cl_paroi = ref_cast(Echange_interne_global_parfait, la_cl.valeur());
768 const Champ_front_calc_interne& Text = ref_cast(Champ_front_calc_interne, la_cl_paroi.T_ext());
769 const IntVect& fmap = Text.face_map();
770 std::vector<bool> hit(nfin-ndeb);
771 std::fill(hit.begin(), hit.end(), false);
772 for (int face=ndeb; face<nfin; face++)
773 {
774 int opp_face = fmap(face-ndeb)+ndeb; // face on the other side of the inner wall:
775
776 // STRONG assumption : 1D, only one node per face:
777 int som=face_sommets(face,0);
778 int som_opp=face_sommets(opp_face,0);
779 if (!hit[face-ndeb]) // first time we encounter one of the face of the pair
780 {
781 // This where we write the heat equation skipping duplicated face: -A.T(i-1) + (A*T(i)+B.T(i)) - B.T(i+2)
782 // By default, we just have -A.T(i-1) + A*T(i)
783 // Recompute the extra bit of flux coming from the other side:
784 // Get opposite element
785 int elem1 = domaine_EF.face_voisins(opp_face, 0);
786 int elem_opp = (elem1 != -1) ? elem1 : domaine_EF.face_voisins(opp_face, 1);
787 // Other face of the opposite element (i.e. face "after" opp_face)
788 int f1 = domaine_EF.elem_faces(elem_opp, 0);
789 int face_plus_2 = f1 != opp_face ? f1 : domaine_EF.elem_faces(elem_opp, 1); // 2 faces per elem max - 1D
790 int som_p2 = face_sommets(face_plus_2, 0);
791
792 double pond = volumes_thilde(elem_opp)/volumes(elem_opp)/volumes(elem_opp); // taken from ajouter() ...
793 double B = nu_(elem_opp)*pond;
794 resu[som] -= B*(tab_inconnue[som]-tab_inconnue[som_p2]);
795 }
796 else
797 {
798 // This is where we set a Dirichlet T(face) = T(opposite_face)
799 // Initially, flux for this som is -B.T(i+1) + B.T(i+2) with B = nu(i+1) (nu being the diffusivity)
800 // -> We want to have B.T(i) - B.T(i+1)
801 int elem = domaine_EF.face_voisins(face, 0);
802 int f1 = domaine_EF.elem_faces(elem, 0);
803 int face_p2 = f1 != face ? f1 : domaine_EF.elem_faces(elem, 1); // other face of the current elem
804 int som_p2=face_sommets(face_p2,0);
805
806 double pond = volumes_thilde(elem)/volumes(elem)/volumes(elem); // taken from ajouter() ...
807 double B = nu_(elem)*pond;
808 resu[som] += B*(-tab_inconnue[som_p2] + tab_inconnue[som_opp]); // remove B.T(i+2) and add B.T(i)
809 }
810 hit[face-ndeb] = true;
811 hit[opp_face-ndeb] = true;
812 }
813 }
814 else // contrib_interne=0 --> implicit
815 {
816 for (int face=ndeb; face<nfin; face++)
817 {
818 flux_bords_(face,0) = 0.0;
819 }
820 }
821 }
822 else if (sub_type(Echange_interne_global_impose, la_cl.valeur()))
823 {
824 const Echange_interne_global_impose& la_cl_paroi = ref_cast(Echange_interne_global_impose, la_cl.valeur());
825 const DoubleVect& surface_gap = la_cl_paroi.surface_gap();
826 for (int face=ndeb; face<nfin; face++)
827 {
828 double h=la_cl_paroi.h_imp(face-ndeb);
829 const Champ_front_calc_interne& Text = ref_cast(Champ_front_calc_interne, la_cl_paroi.T_ext());
830 const IntVect& fmap = Text.face_map();
831 int opp_face = fmap(face-ndeb)+ndeb;
832
833 double tm=0.0;
834 double to=0.0; // opposite temp.
835 double flux=0.0;
836 if (contrib_interne) // explicit case
837 {
838 for (int i1=0; i1<nb_som_face; i1++)
839 {
840 int glob2=face_sommets(face,i1);
841 int glob3 =face_sommets(opp_face,i1);
842 tm+=tab_inconnue(glob2);
843 to+=tab_inconnue(glob3);
844 }
845 tm/=nb_som_face;
846 to/=nb_som_face;
847 //flux=h*(to-tm)*domaine_EF.surface(face);
848 flux=h*(to-tm)*surface_gap(face-ndeb);
849 }
850 else // implicit case via contribuer_au_second_membre()
851 {
852 flux = 0.0;
853 }
854 flux_bords_(face,0) = flux;
855 flux/=nb_som_face;
856 for (int i1=0; i1<nb_som_face; i1++)
857 {
858 int glob2=face_sommets(face,i1);
859 resu[glob2] += flux;
860 }
861 }
862 }
863 else if (sub_type(Echange_global_impose, la_cl.valeur()))
864 {
865 const Echange_global_impose& la_cl_paroi = ref_cast(Echange_global_impose, la_cl.valeur());
866 for (int face=ndeb; face<nfin; face++)
867 {
868
869 double h=la_cl_paroi.h_imp(face-ndeb);
870 double Text=la_cl_paroi.T_ext(face-ndeb);
871
872
873 double tm=0;
874 if (contrib_interne)
875 {
876 for (int i1=0; i1<nb_som_face; i1++)
877 {
878 int glob2=face_sommets(face,i1);
879 {
880 tm+=tab_inconnue(glob2);
881 }
882 }
883 tm/=nb_som_face;
884 }
885 double flux=h*(Text-tm)*domaine_EF.surface(face);
886 flux_bords_(face,0) = flux;
887 flux/=nb_som_face;
888 for (int i1=0; i1<nb_som_face; i1++)
889 {
890 int glob2=face_sommets(face,i1);
891 {
892 resu[glob2] += flux;
893 }
894
895 }
896 }
897 }
898
899
900 }
901 modifier_flux(*this);
902}
903
904
905
906
908{
909 const Domaine_Cl_EF& domaine_Cl_EF = la_zcl_EF.valeur();
910 const Domaine_EF& domaine_EF = le_dom_EF.valeur();
911 const Domaine_EF& domaine_ef=ref_cast(Domaine_EF,equation().domaine_dis());
912
913 const IntTab& face_sommets=domaine_ef.face_sommets();
914 int nb_som_face=domaine_ef.nb_som_face();
915
916 int N = equation().inconnue().valeurs().line_size();
917
918 if (N > 1)
919 {
920 // Cerr<<__PRETTY_FUNCTION__<<" non code pour les vecteurs"<<finl;
921 throw;
922 }
923
924 // Neumann :
925 int n_bord;
926 int nb_bords=domaine_Cl_EF.nb_cond_lim();
927
928 for (n_bord=0; n_bord<nb_bords; n_bord++)
929 {
930 const Cond_lim& la_cl = domaine_Cl_EF.les_conditions_limites(n_bord);
931 const Front_VF& le_bord = ref_cast(Front_VF,la_cl->frontiere_dis());
932 int ndeb = le_bord.num_premiere_face();
933 int nfin = ndeb + le_bord.nb_faces();
934
935 if (sub_type(Echange_couplage_thermique, la_cl.valeur()))
936 {
937 // matrice.imprimer(Cout);
938 const Echange_couplage_thermique& la_cl_paroi = ref_cast(Echange_couplage_thermique, la_cl.valeur());
939 for (int face=ndeb; face<nfin; face++)
940 {
941
942 double h=la_cl_paroi.h_imp(face-ndeb);
943 double dphi_dT=la_cl_paroi.derivee_flux_exterieur_imposee(face-ndeb);
944
945 double tm=1./(nb_som_face*nb_som_face);
946 double flux=(dphi_dT+h)*domaine_EF.surface(face)*tm;
947
948 for (int i1=0; i1<nb_som_face; i1++)
949 {
950 int glob2=face_sommets(face,i1);
951 for (int j1=0; j1<nb_som_face; j1++)
952 {
953 int glob1=face_sommets(face,j1);
954 matrice.coef(glob1,glob2) += flux;
955 }
956 }
957 }
958 // matrice.imprimer(Cout);exit();
959 }
960 else if (sub_type(Echange_interne_global_parfait, la_cl.valeur()))
961 {
962 const Echange_interne_global_parfait& la_cl_paroi = ref_cast(Echange_interne_global_parfait, la_cl.valeur());
963 const Champ_front_calc_interne& Text = ref_cast(Champ_front_calc_interne, la_cl_paroi.T_ext());
964 const IntVect& fmap = Text.face_map();
965 std::vector<bool> hit(nfin-ndeb);
966 std::fill(hit.begin(), hit.end(), false);
967 for (int face=ndeb; face<nfin; face++)
968 {
969 // face on the other side of the inner wall:
970 int opp_face = fmap(face-ndeb)+ndeb;
971 // element attached to it
972 int elem1 = domaine_EF.face_voisins(opp_face, 0);
973 int elem_opp = (elem1 != -1) ? elem1 : domaine_EF.face_voisins(opp_face, 1);
974 // other face of the opposite element (i.e. face "after" opp_face)
975 int f1 = domaine_EF.elem_faces(elem_opp, 0);
976 int face_plus_2 = f1 != opp_face ? f1 : domaine_EF.elem_faces(elem_opp, 1); // 2 faces per elem max - 1D
977 // other face of the current elem
978 int elem = domaine_EF.face_voisins(face, 0);
979 f1 = domaine_EF.elem_faces(elem, 0);
980 int face_min_1 = f1 != face ? f1 : domaine_EF.elem_faces(elem, 1);
981
982 for (int i1=0; i1<nb_som_face; i1++)
983 {
984 int som=face_sommets(face,i1);
985 int som_opp=face_sommets(opp_face,i1);
986 if (!hit[face-ndeb]) // first time we encounter one of the face of the pair
987 {
988 for (int j1=0; j1<nb_som_face; j1++)
989 {
990 // heat equation skipping duplicated face: -T(i-1) + 2*T(i) - T(i+2)
991 int som_p2=face_sommets(face_plus_2,j1);
992 matrice.coef(som,som_p2) -= matrice.coef(som_opp, som_opp);
993 matrice.coef(som, som) += matrice.coef(som_opp, som_opp);
994 }
995 hit[face-ndeb] = true;
996 hit[opp_face-ndeb] = true;
997 }
998 else // we have already handled the opposite side of the wall
999 for (int j1=0; j1<nb_som_face; j1++)
1000 {
1001 // Dirichlet T(face) = T(opposite_face) and cancelling right term in the tri-band
1002 int som_m1=face_sommets(face_min_1, j1);
1003 matrice.coef(som,som_opp) = -matrice.coef(som,som);
1004 matrice.coef(som,som_m1) = 0;
1005 }
1006 }
1007 }
1008// matrice.imprimer(Cout);
1009 }
1010 else if (sub_type(Echange_interne_global_impose, la_cl.valeur()))
1011 {
1012 const Echange_interne_global_impose& la_cl_paroi = ref_cast(Echange_interne_global_impose, la_cl.valeur());
1013 const Champ_front_calc_interne& Text = ref_cast(Champ_front_calc_interne, la_cl_paroi.T_ext());
1014 const IntVect& fmap = Text.face_map();
1015 const DoubleVect& surface_gap = la_cl_paroi.surface_gap();
1016 for (int face=ndeb; face<nfin; face++)
1017 {
1018 double h=la_cl_paroi.h_imp(face-ndeb);
1019 double tm=1./(nb_som_face*nb_som_face);
1020 //double flux=h*domaine_EF.surface(face)*tm;
1021 double flux=h*surface_gap(face-ndeb)*tm;
1022 int opp_face = fmap(face-ndeb)+ndeb;
1023
1024 for (int i1=0; i1<nb_som_face; i1++)
1025 {
1026 int glob2=face_sommets(face,i1);
1027 int glob3=face_sommets(opp_face,i1);
1028 for (int j1=0; j1<nb_som_face; j1++)
1029 {
1030 int glob1=face_sommets(face,j1);
1031 matrice.coef(glob1,glob2) += flux;
1032 matrice.coef(glob1,glob3) -= flux;
1033 }
1034 }
1035 }
1036// matrice.imprimer(Cout);
1037 }
1038 else if (sub_type(Echange_global_impose, la_cl.valeur()))
1039 {
1040 // matrice.imprimer(Cout);
1041 const Echange_global_impose& la_cl_paroi = ref_cast(Echange_global_impose, la_cl.valeur());
1042 for (int face=ndeb; face<nfin; face++)
1043 {
1044 double h=la_cl_paroi.h_imp(face-ndeb);
1045 double tm=1./(nb_som_face*nb_som_face);
1046 double flux=h*domaine_EF.surface(face)*tm;
1047 for (int i1=0; i1<nb_som_face; i1++)
1048 {
1049 int glob2=face_sommets(face,i1);
1050 for (int j1=0; j1<nb_som_face; j1++)
1051 {
1052 int glob1=face_sommets(face,j1);
1053 matrice.coef(glob1,glob2) += flux;
1054 }
1055 }
1056 }
1057 }
1058 }
1059}
1061{
1062 static int testee=0;
1063 if(testee)
1064 return;
1065 testee=1;
1066}
DoubleTab & valeurs() override
Renvoie le tableau des valeurs du champ au temps courant.
virtual DoubleTab & valeurs()=0
classe Champ_base Cette classe est la base de la hierarchie des champs.
Definition Champ_base.h:43
classe Champ_front_calc_interne Classe derivee de Champ_front_calc qui represente
const IntVect & face_map() const
classe Cond_lim Classe generique servant a representer n'importe quelle classe
Definition Cond_lim.h:31
int nb_som_elem() const
Renvoie le nombre de sommets des elements geometriques constituants le domaine.
Definition Domaine.h:474
int_t nb_elem_tot() const
Definition Domaine.h:132
virtual void creer_tableau_elements(Array_base &, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT) const
creation d'un tableau parallele de valeurs aux elements.
Definition Domaine.cpp:851
DoubleTab_t & les_sommets()
Definition Domaine.h:113
IntTab_t & les_elems()
Definition Domaine.h:129
int_t nb_som() const
Renvoie le nombre de sommets du domaine.
Definition Domaine.h:121
int nb_cond_lim() const
Renvoie le nombre de conditions aux limites.
const Cond_lim & les_conditions_limites(int) const
Renvoie la i-ieme condition aux limites.
class Domaine_EF
Definition Domaine_EF.h:59
const DoubleTab & IPhi_thilde() const
Definition Domaine_EF.h:95
const DoubleTab & Bij() const
Definition Domaine_EF.h:92
const DoubleTab & Bij_thilde() const
Definition Domaine_EF.h:93
const DoubleVect & volumes_thilde() const
Definition Domaine_EF.h:85
virtual double face_normales(int face, int comp) const
Definition Domaine_VF.h:47
double volumes(int i) const
Definition Domaine_VF.h:113
int face_sommets(int i, int j) const
renvoie le numero du ieme sommet de la face num_face.
Definition Domaine_VF.h:583
virtual double surface(int i) const
Definition Domaine_VF.h:53
int nb_som_face() const
renvoie le nombre de sommets par face.
Definition Domaine_VF.h:494
int elem_faces(int i, int j) const
renvoie le numero de le ieme face de la maille num_elem la facon dont ces faces sont numerotees est
Definition Domaine_VF.h:543
int premiere_face_int() const
une face est interne ssi elle separe deux elements.
Definition Domaine_VF.h:463
int face_voisins(int num_face, int i) const
renvoie l'element voisin de numface dans la direction i.
Definition Domaine_VF.h:418
const Domaine & domaine() const
: class Echange_couplage_thermique
double flux_exterieur_impose(int i) const override
Classe Echange_global_impose Cette classe represente le cas particulier de la classe.
virtual double derivee_flux_exterieur_imposee(int i) const
virtual double h_imp(int num) const
Renvoie la valeur du coefficient d'echange de chaleur impose sur la i-eme composante.
virtual double T_ext(int num) const
Renvoie la valeur de la temperature imposee sur la i-eme composante du champ de frontiere.
Classe Echange_interne_global_impose: Cette classe represente le cas particulier de la classe.
Classe Echange_interne_global_parfait Cette classe represente le cas particulier d'un echange interne...
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual const Champ_Inc_base & inconnue() const =0
virtual Nature_du_champ nature_du_champ() const
Definition Field_base.h:77
class Front_VF
Definition Front_VF.h:36
int nb_faces() const
Definition Front_VF.h:53
int num_premiere_face() const
Definition Front_VF.h:63
int nb_faces_tot() const
Definition Front_VF.h:58
int num_face(const int) const
Definition Front_VF.h:68
Classe Matrice_Morse Represente une matrice M (creuse), non necessairement carree.
const auto & get_tab2() const
const auto & get_tab1() const
auto & get_set_coeff()
double coef(int i, int j) const
int nb_colonnes() const override
Return local number of columns (=size on the current proc).
int nb_lignes() const override
Return local number of lines (=size on the current proc).
const Equation_base & equation() const
Renvoie la reference sur l'equation pointe par MorEqn::mon_equation.
Definition MorEqn.h:62
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
Classe Neumann_paroi Cette condition limite correspond a un flux impose pour l'equation de.
Classe Neumann Cette classe est la classe de base de la hierarchie des conditions aux limites de type...
Definition Neumann.h:31
virtual double flux_impose(int i) const
Renvoie la valeur du flux impose sur la i-eme composante du champ representant le flux a la frontiere...
Definition Neumann.cpp:35
static int dimension
Definition Objet_U.h:99
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
static int bidim_axi
Definition Objet_U.h:102
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
class Op_Conv_EF Cette classe represente l'operateur de convection associe a une equation de
Definition Op_Conv_EF.h:39
class Op_Diff_EF_base Classe de base des operateurs de diffusion EF
class Op_Diff_EF Cette classe represente l'operateur de diffusion
Definition Op_Diff_EF.h:37
DoubleTab lambda_
Definition Op_Diff_EF.h:88
void ajouter_contribution_new(const DoubleTab &, Matrice_Morse &) const
void verifier() const
DoubleTab & ajouter_vectoriel_dim3_nbn_8(const DoubleTab &, DoubleTab &) const
DoubleTab & ajouter_scalaire_template(const DoubleTab &, DoubleTab &) const
Definition Op_Diff_EF.h:101
DoubleTab & ajouter_vectoriel_gen(const DoubleTab &, DoubleTab &) const
DoubleTab & ajouter_vectoriel_dim2_nbn_4(const DoubleTab &, DoubleTab &) const
const Champ_base & diffusivite() const override
void remplir_lambda(DoubleTab &) const
DoubleTab & ajouter_new(const DoubleTab &, DoubleTab &) const
DoubleTab & calculer(const DoubleTab &, DoubleTab &) const override
int nouvelle_expression_
Definition Op_Diff_EF.h:70
DoubleTab & ajouter(const DoubleTab &, DoubleTab &) const override
void contribuer_au_second_membre(DoubleTab &) const override
DOES NOTHING - to override in derived classes.
int transpose_
Definition Op_Diff_EF.h:68
DoubleTab & ajouter_scalaire_gen(const DoubleTab &, DoubleTab &) const
void remplir_nu(DoubleTab &) const override
void completer() override
Associe l'operateur au domaine_dis, le domaine_Cl_dis, et a l'inconnue de son equation.
int transpose_partout_
Definition Op_Diff_EF.h:69
void ajouter_contribution(const DoubleTab &, Matrice_Morse &) const
void ajouter_bords(const DoubleTab &, DoubleTab &, int contrib_interne=1) const
DoubleTab & ajouter_scalaire_dim3_nbn_8(const DoubleTab &, DoubleTab &) const
void associer_diffusivite_volumique(const Champ_base &) override
void associer_diffusivite(const Champ_base &) override
associe le champ de diffusivite
const Champ_base & diffusivite_volumique() const
DoubleTab & ajouter_vectoriel_template(const DoubleTab &, DoubleTab &) const
Definition Op_Diff_EF.h:163
DoubleTab & ajouter_scalaire_dim2_nbn_4(const DoubleTab &, DoubleTab &) const
void calculer_von_mises(const DoubleTab &deplacement, DoubleTab &deformation, DoubleTab &contraintes, DoubleTab &von_mises) const override
void ajouter_contributions_bords(Matrice_Morse &matrice) const
void marque_elem(const Equation_base &eqn)
int elem_contribue(const int elem) const
void modifier_flux(const Operateur_base &) const
multiplie le flux bordpar rho cp ou rho si necessaire
DoubleTab flux_bords_
virtual void completer()
Associe l'operateur au domaine_dis, le domaine_Cl_dis, et a l'inconnue de son equation.
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
Classe de base des flux de sortie.
Definition Sortie.h:52
int nb_dim() const
Definition TRUSTTab.h:199
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133
_SIZE_ size() const
Definition TRUSTVect.tpp:45
_SIZE_ size_totale() const
Definition TRUSTVect.tpp:61
int line_size() const
Definition TRUSTVect.tpp:67
virtual const MD_Vector & get_md_vector() const
Definition TRUSTVect.h:123