TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Op_EF_base.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#include <Op_EF_base.h>
17#include <Domaine_EF.h>
18#include <Domaine_Cl_EF.h>
19#include <Dirichlet.h>
20#include <Dirichlet_homogene.h>
21#include <Symetrie.h>
22#include <Matrice_Morse.h>
23#include <Equation_base.h>
24
25#include <Sortie.h>
26#include <Operateur.h>
27#include <Probleme_base.h>
28
29#include <Champ_Uniforme.h>
30#include <Schema_Temps_base.h>
31#include <Milieu_base.h>
32#include <Operateur_base.h>
33#include <Operateur_Diff_base.h>
34#include <EcrFicPartage.h>
35#include <Array_tools.h>
36#include <Echange_interne_global_impose.h>
37#include <Echange_interne_global_parfait.h>
38#include <Champ_front_calc_interne.h>
39
40#include <vector>
41
42/*! @brief Dimensionnement de la matrice qui devra recevoir les coefficients provenant de la convection, de la diffusion pour le cas des faces.
43 *
44 * Cette matrice a une structure de matrice morse.
45 * Nous commencons par calculer les tailles des tableaux tab1 et tab2.
46 *
47 */
48
50 const Domaine_Cl_EF& le_dom_cl,
51 Matrice_Morse& la_matrice) const
52{
53
54 int matrice_stocke=1;
55 if (matrice_stocke)
56 {
57 //if (matrice_sto_.nb_colonnes()) PL: non faux en //, nb_colonnes() peut etre nul localement
58 if (Process::mp_sum(matrice_sto_.nb_colonnes()))
59 {
60 la_matrice=matrice_sto_;
61 return;
62 }
63
64 }
65 // Dimensionnement de la matrice qui devra recevoir les coefficients provenant de
66 // la convection, de la diffusion pour le cas des faces.
67 // Cette matrice a une structure de matrice morse.
68 // Nous commencons par calculer les tailles des tableaux tab1 et tab2.
69 // Pour ce faire il faut chercher les sommets voisins du sommet considere.
70
71 int nb_som=le_dom.nb_som();
72 int nfin = le_dom.nb_som_tot();
73 // essai
74 nb_som=nfin;
75
76 const DoubleTab& champ_inconnue = le_dom_cl.equation().inconnue().valeurs();
77 int nb_comp = champ_inconnue.line_size();
78
79 // on ne s'occupe pas dans un premier temps des composantes
80
81 const IntTab& elems=le_dom.domaine().les_elems();
82 //int nb_elem=le_dom.domaine().nb_elem();
83 int nb_elem_tot=le_dom.domaine().nb_elem_tot();
84 int nb_som_elem=le_dom.domaine().nb_som_elem();
85 int nb_som_face=le_dom.nb_som_face();
86
87 // Computation of the number of non void coeffs:
88 int extra_nb_coeff = 0;
89 // Specific BC that will require extra terms in the matrix:
90 for(int i=0; i<le_dom_cl.nb_cond_lim(); i++)
91 {
92 const Cond_lim_base& ccl = le_dom_cl.les_conditions_limites(i).valeur();
93 if(sub_type(Echange_interne_global_impose, ccl))
94 {
95 if (nb_som_face != 1)
96 {
97 Cerr << "Boundary condition 'Echange_interne_global_impose' or 'Echange_interne_parfait' is not validated for EF and mesh_dim > 1 (i.e. sth other than a wire mesh)!!" << finl;
98 Process::exit(-1);
99 }
101 const Champ_front_calc_interne& ch = ref_cast(Champ_front_calc_interne, cl.T_ext());
102 extra_nb_coeff += ch.face_map().size_array();
103 if(sub_type(Echange_interne_global_parfait, ccl))
104 extra_nb_coeff += ch.face_map().size_array() / 2;
105 }
106 }
107 int nb_coeff=(int)(nb_elem_tot*(nb_som_elem*(nb_som_elem)))+extra_nb_coeff;
108 la_matrice.dimensionner(nb_som*nb_comp,nfin*nb_comp,0);
109 IntTab Indice(nb_coeff,2);//p(1,2);
110 int tot=0;
111 for (int elem=0; elem<nb_elem_tot; elem++)
112 {
113 for (int i1=0; i1<nb_som_elem; i1++)
114 {
115 int glob=elems(elem,i1);
116 for (int i2=0; i2<nb_som_elem; i2++)
117 {
118 int glob2=elems(elem,i2);
119 if (glob<nb_som)
120 {
121 Indice(tot,0)=glob;
122 Indice(tot,1)=glob2;
123 tot++;
124 }
125 }
126 }
127 }
128 // Specific BC that will require extra terms in the matrix:
129 for(int i=0; i<le_dom_cl.nb_cond_lim(); i++)
130 {
131 const Cond_lim_base& ccl = le_dom_cl.les_conditions_limites(i).valeur();
132 if(sub_type(Echange_interne_global_impose, ccl))
133 {
135 bool is_parfait = sub_type(Echange_interne_global_parfait, ccl);
136 const Champ_front_calc_interne& ch = ref_cast(Champ_front_calc_interne, cl.T_ext());
137 const IntVect& mp = ch.face_map(); // indices of (local) *faces*
138 const Front_VF& le_bord = ref_cast(Front_VF,cl.frontiere_dis());
139 int nfacedeb = le_bord.num_premiere_face();
140 int nfacefin = nfacedeb + le_bord.nb_faces();
141 std::vector<bool> hit(le_bord.nb_faces());
142 std::fill(hit.begin(), hit.end(), false);
143 for(int face_recto=nfacedeb; face_recto < nfacefin; face_recto++)
144 {
145 int face_verso = mp(face_recto-nfacedeb)+nfacedeb;
146 int face_plus_2 = 0;
147
148 if (is_parfait)
149 {
150 // element attached to the face
151 int elem1 = le_dom.face_voisins(face_verso, 0);
152 int elem = (elem1 != -1) ? elem1 : le_dom.face_voisins(face_verso, 1);
153 // other face of the element (i.e. face "after" opp_face)
154 int f1 = le_dom.elem_faces(elem, 0);
155 face_plus_2 = f1 != face_verso ? f1 : le_dom.elem_faces(elem, 1); // 2 faces per elem max - 1D
156 }
157
158 // all vertices of recto face are put in correspondance with all vertices of verso face:
159 for(int som_idx=0; som_idx < nb_som_face; som_idx++)
160 {
161 int som_recto = le_dom.face_sommets(face_recto, som_idx);
162 for(int som_idx2=0; som_idx2 < nb_som_face; som_idx2++)
163 {
164 int som_verso = le_dom.face_sommets(face_verso, som_idx2);
165 // tri-diagonal structure extended through the wall
166 // actually this puts too many coeffs in case of is_parfait, but I can't be bothered ...
167 Indice(tot, 0) = som_recto;
168 Indice(tot, 1) = som_verso;
169 tot++;
170
171 if (is_parfait) // more complicated: recto face takes (i-1), i and ("next face after opp_face")
172 // verso face will just serve to connect recto and verso
173 {
174 int som_plus_2 = le_dom.face_sommets(face_plus_2, som_idx2);
175 if(!hit[face_recto-nfacedeb]) // first inner face
176 {
177 Indice(tot, 0) = som_recto;
178 Indice(tot, 1) = som_plus_2;
179 tot++;
180 }
181 else // opposite inner face
182 {
183 // Nothing to do! no extra tri-band coeff.
184 }
185 }
186 }
187 }
188 hit[face_recto-nfacedeb] = true;
189 hit[face_verso-nfacedeb] = true;
190 }
191 }
192 }
193
194 Indice.resize(tot,2);
195
196 tableau_trier_retirer_doublons(Indice);
197 if (nb_comp==1)
198 la_matrice.dimensionner(Indice);
199 else
200 {
201 int ntot=Indice.dimension(0);
202 // on cree pour chaque coeff d'origine un bloc nb_comp*nb_comp
203 IntTab Indice_v(ntot*nb_comp*nb_comp,2);
204 int newcas=0;
205 for (int cas=0; cas<ntot; cas++)
206 {
207 for (int i=0; i<nb_comp; i++)
208 for (int j=0; j<nb_comp; j++)
209 {
210 int newi=Indice(cas,0)*nb_comp+i;
211 int newj=Indice(cas,1)*nb_comp+j;
212 Indice_v(newcas,0)=newi;
213 Indice_v(newcas,1)=newj;
214 newcas++;
215
216 }
217 }
218 tableau_trier_retirer_doublons(Indice_v);
219 la_matrice.dimensionner(Indice_v);
220 //Cerr<<Indice<<" nnnnnnnnn "<<Indice_v<<finl;
221 // abort();
222 }
223
224 if (matrice_stocke)
225 {
226 ref_cast_non_const(Matrice_Morse,matrice_sto_)=la_matrice;
227 }
228 //
229 if (0)
230 {
231 Cerr<<la_matrice.get_tab1()<<finl;
232 Cerr<<la_matrice.get_tab2()<<finl;
233 la_matrice.get_set_coeff() = 1;
234 Cerr<<"ici "<<tot <<" "<< nb_coeff<<finl;
235 Cerr<<"Indice"<<Indice<<finl;
236 la_matrice.imprimer_formatte(Cerr);
237
239 }
240
241}
242
243/*! @brief Modification des coef de la matrice et du second membre pour les conditions de Dirichlet
244 *
245 */
246
248 const Domaine_Cl_EF& le_dom_cl,
249 Matrice_Morse& la_matrice, DoubleTab& secmem) const
250{
251 // Dimensionnement de la matrice qui devra recevoir les coefficients provenant de
252 // la convection, de la diffusion pour le cas des faces.
253 // Cette matrice a une structure de matrice morse.
254 // Nous commencons par calculer les tailles des tableaux tab1 et tab2.
255 const Conds_lim& les_cl = le_dom_cl.les_conditions_limites();
256
257 const auto& tab1 = la_matrice.get_tab1();
258 auto& coeff = la_matrice.get_set_coeff();
259
260 // determination de la taille du champ inconnue.
261 // Cerr << "dans modifier cl " << finl;
262 const DoubleTab& champ_inconnue = le_dom_cl.equation().inconnue().valeurs();
263 int nb_comp = champ_inconnue.line_size();
264
265 const IntTab& faces_sommets=le_dom.face_sommets();
266 int nb_som_face=faces_sommets.dimension(1);
267
268 int nb_som=secmem.dimension(0);
269 for (const auto& itr : les_cl)
270 {
271 const Cond_lim& la_cl = itr;
272 const Front_VF& le_bord = ref_cast(Front_VF,la_cl->frontiere_dis());
273 int nfaces = le_bord.nb_faces_tot();
274 if (sub_type(Dirichlet,la_cl.valeur()))
275 {
276 const Dirichlet& la_cl_Dirichlet = ref_cast(Dirichlet,la_cl.valeur());
277 for (int ind_face=0; ind_face < nfaces; ind_face++)
278 for (int s=0; s<nb_som_face; s++)
279 {
280 int face=le_bord.num_face(ind_face);
281 int som=faces_sommets(face,s);
282 if (som<nb_som)
283 for (int comp=0; comp<nb_comp; comp++)
284 {
285 int m=som*nb_comp+comp;
286 auto idiag = tab1[som*nb_comp+comp]-1;
287 auto nbvois = tab1[som*nb_comp+1+comp] - tab1[som*nb_comp+comp];
288 for (auto k=0; k < nbvois; k++)
289 coeff[idiag+k]=0;
290 la_matrice.coef(m,m)=1;
291 assert(la_matrice.coef(som*nb_comp+comp,som*nb_comp+comp)==1);
292 // pour les voisins
293
294 // pour le second membre
295 secmem(som,comp)= la_cl_Dirichlet.val_imp(ind_face,comp);
296 secmem(som,comp)= champ_inconnue(som,comp);
297 }
298 }
299 }
300 if (sub_type(Dirichlet_homogene,la_cl.valeur()))
301 {
302 const Dirichlet_homogene& la_cl_Dirichlet = ref_cast(Dirichlet_homogene,la_cl.valeur());
303 for (int ind_face=0; ind_face < nfaces; ind_face++)
304 for (int s=0; s<nb_som_face; s++)
305 {
306 int face=le_bord.num_face(ind_face);
307 int som=faces_sommets(face,s);
308
309 for (int comp=0; comp<nb_comp; comp++)
310 {
311 int m=som*nb_comp+comp;
312 auto idiag = tab1[som*nb_comp+comp]-1;
313 auto nbvois = tab1[som*nb_comp+1+comp] - tab1[som*nb_comp+comp];
314 for (auto k=0; k < nbvois; k++)
315 coeff[idiag+k]=0;
316 la_matrice.coef(m,m)=1;
317 assert(la_matrice.coef(som*nb_comp+comp,som*nb_comp+comp)==1);
318 // pour les voisins
319
320 // pour le second membre
321 secmem(som,comp)= 0;
322 if (la_cl_Dirichlet.val_imp(ind_face,comp)!=0)
323 {
324 Cerr<<"impossible non ??? "<<finl;
326 }
327 }
328 }
329 }
330
331 if (sub_type(Symetrie,la_cl.valeur()))
332 {
333 // on ne fait rien ici on fait ensuite
334 }
335 }
336
337 // On modifie pour la symetrie
338
339 if (le_dom_cl.equation().inconnue().nature_du_champ()==vectoriel)
340 {
341 le_dom_cl.imposer_symetrie_matrice_secmem(la_matrice,secmem);
342 }
343
344 /*
345 la_matrice.imprimer(Cerr);
346 la_matrice.imprimer_formatte(Cerr);
347 Cerr<<"scd "<<secmem<<finl;
348 */
349 //exit();
350 // Prise en compte des conditions de type periodicite
351 // Cerr << "fin de modifier" << finl;
352}
353
354/*! @brief multiplie le flux bordpar rho cp ou rho si necessaire
355 *
356 */
358{
359 controle_modifier_flux_=1;
360 const Domaine_EF& le_dom_EF=ref_cast(Domaine_EF,op.equation().domaine_dis());
361 DoubleTab& flux_bords_=op.flux_bords();
362 int nb_compo=flux_bords_.dimension(1);
363 const Probleme_base& pb=op.equation().probleme();
364
365 // On multiplie par rho si Navier Stokes incompressible
366 Nom nom_eqn=op.equation().que_suis_je();
367 if (nom_eqn.debute_par("Navier_Stokes") && pb.milieu().que_suis_je()=="Fluide_Incompressible")
368 {
369 const Champ_base& rho = op.equation().milieu().masse_volumique();
370 if (sub_type(Champ_Uniforme,rho))
371 {
372 double coef = rho.valeurs()(0,0);
373 int nb_faces_bord=le_dom_EF.nb_faces_bord();
374 for (int face=0; face<nb_faces_bord; face++)
375 for(int k=0; k<nb_compo; k++)
376 flux_bords_(face,k) *= coef;
377 }
378 }
379
380}
381
382/*! @brief Impression des flux d'un operateur EF aux faces (ie: diffusion, convection)
383 *
384 */
385int Op_EF_base::impr(Sortie& os, const Operateur_base& op) const
386{
387 const Domaine_EF& le_dom_EF=ref_cast(Domaine_EF,op.equation().domaine_dis());
388 const DoubleTab& flux_bords_=op.flux_bords();
389 if (flux_bords_.nb_dim()!=2)
390 {
391 Cout << "L'impression des flux n'est pas codee pour l'operateur " << op.que_suis_je() << finl;
392 return 1;
393 }
394 if (controle_modifier_flux_==0)
395 {
396 Cerr<<op.que_suis_je()<<" appelle Op_EF_base::impr sans avoir appeler Op_EF_base::modifier_flux, on arrete tout "<<finl;
398 }
399
400 int nb_compo=flux_bords_.dimension(1);
401 const Probleme_base& pb=op.equation().probleme();
402 const Schema_Temps_base& sch=pb.schema_temps();
403 // On n'imprime les moments que si demande et si on traite l'operateur de diffusion de la vitesse
404 int impr_mom=0;
405 if (le_dom_EF.domaine().moments_a_imprimer() && sub_type(Operateur_Diff_base,op) && op.equation().inconnue().le_nom()=="vitesse")
406 impr_mom=1;
407
408 const int impr_sum=(le_dom_EF.domaine().bords_a_imprimer_sum().est_vide() ? 0:1);
409 const int impr_bord=(le_dom_EF.domaine().bords_a_imprimer().est_vide() ? 0:1);
410 int flag=0;
411 if (Process::je_suis_maitre()) flag=1;
412 op.ouvrir_fichier( Flux,"",flag);
413 op.ouvrir_fichier(Flux_moment,"moment",impr_mom&&flag);
414 op.ouvrir_fichier(Flux_sum,"sum",impr_sum&&flag);
415 EcrFicPartage Flux_face;
416 op.ouvrir_fichier_partage(Flux_face,"",impr_bord);
417
418
419 // Impression du temps
420 double temps=sch.temps_courant();
422 {
423 Flux.add_col(temps);
424 if (impr_mom) Flux_moment.add_col(temps);
425 if (impr_sum) Flux_sum.add_col(temps);
426 }
427
428 // Calcul des moments
429 DoubleTab xgr;
430 if (impr_mom) xgr = le_dom_EF.calculer_xgr();
431 DoubleVect moment(nb_compo);
432 moment=0;
433
434 // On parcours les frontieres pour sommer les flux par frontiere dans le tableau flux_bord
435 DoubleVect flux_bord(nb_compo);
436 DoubleVect bilan(nb_compo);
437 bilan = 0;
438 for (int num_cl=0; num_cl<le_dom_EF.nb_front_Cl(); num_cl++)
439 {
440 flux_bord=0;
441 const Frontiere_dis_base& la_fr = op.equation().domaine_Cl_dis().les_conditions_limites(num_cl)->frontiere_dis();
442 const Cond_lim& la_cl = op.equation().domaine_Cl_dis().les_conditions_limites(num_cl);
443 const Front_VF& frontiere_dis = ref_cast(Front_VF,la_cl->frontiere_dis());
444 int ndeb = frontiere_dis.num_premiere_face();
445 int nfin = ndeb + frontiere_dis.nb_faces();
446 for (int face=ndeb; face<nfin; face++)
447 {
448 for(int k=0; k<nb_compo; k++)
449 flux_bord(k)+=flux_bords_(face, k);
450
451 if (impr_mom)
452 {
453 // Calcul du moment exerce par le fluide sur le bord (OM/\F)
454 if (Objet_U::dimension==2)
455 moment(0)+=flux_bords_(face,1)*xgr(face,0)-flux_bords_(face,0)*xgr(face,1);
456 else
457 {
458 moment(0)+=flux_bords_(face,2)*xgr(face,1)-flux_bords_(face,1)*xgr(face,2);
459 moment(1)+=flux_bords_(face,0)*xgr(face,2)-flux_bords_(face,2)*xgr(face,0);
460 moment(2)+=flux_bords_(face,1)*xgr(face,0)-flux_bords_(face,0)*xgr(face,1);
461 }
462 }
463 }
464
465 // On somme les contributions de chaque processeur
466 for(int k=0; k<nb_compo; k++)
467 {
468 flux_bord(k)=Process::mp_sum(flux_bord(k));
469 if (impr_mom) moment(k)=Process::mp_sum(moment(k));
470 }
471
472 // Ecriture dans les fichiers
474 {
475 for(int k=0; k<nb_compo; k++)
476 {
477 Flux.add_col(flux_bord(k));
478 if (impr_mom) Flux_moment.add_col(moment(k));
479 if (le_dom_EF.domaine().bords_a_imprimer_sum().contient(la_fr.le_nom())) Flux_sum.add_col(flux_bord(k));
480
481 // On somme les flux de toutes les frontieres pour mettre dans le tableau bilan
482 bilan(k)+=flux_bord(k);
483 }
484 }
485 }
486
487 // On imprime les bilans et on va a la ligne
489 {
490 for(int k=0; k<nb_compo; k++)
491 Flux.add_col(bilan(k));
492
493 Flux << finl;
494 if (impr_mom) Flux_moment << finl;
495 if (impr_sum) Flux_sum << finl;
496 }
497
498 // Impression sur chaque face si demande
499 for (int num_cl=0; num_cl<le_dom_EF.nb_front_Cl(); num_cl++)
500 {
501 const Frontiere_dis_base& la_fr = op.equation().domaine_Cl_dis().les_conditions_limites(num_cl)->frontiere_dis();
502 const Cond_lim& la_cl = op.equation().domaine_Cl_dis().les_conditions_limites(num_cl);
503 const Front_VF& frontiere_dis = ref_cast(Front_VF,la_cl->frontiere_dis());
504 int ndeb = frontiere_dis.num_premiere_face();
505 int nfin = ndeb + frontiere_dis.nb_faces();
506 // Impression sur chaque face
507 if (le_dom_EF.domaine().bords_a_imprimer().contient(la_fr.le_nom()))
508 {
509 Flux_face << "# Flux par face sur " << la_fr.le_nom() << " au temps " << temps << " : " << finl;
510 const DoubleTab& xv=le_dom_EF.xv();
511 for (int face=ndeb; face<nfin; face++)
512 {
513 if (Objet_U::dimension==2)
514 Flux_face << "# Face a x= " << xv(face,0) << " y= " << xv(face,1) << " flux=" ;
515 else if (Objet_U::dimension==3)
516 Flux_face << "# Face a x= " << xv(face,0) << " y= " << xv(face,1) << " z= " << xv(face,2) << " flux=" ;
517 for(int k=0; k<nb_compo; k++)
518 Flux_face << " " << flux_bords_(face, k);
519 Flux_face << finl;
520 }
521 Flux_face.syncfile();
522 }
523 }
524
525 return 1;
526}
527
528int Op_EF_base::elem_contribue(const int elem) const
529{
530 if (marqueur_elem_.size_array()==0)
531 return 1;
532 else if (marqueur_elem_[elem]==1)
533 return 0;
534 return 1;
535}
536
538{
539 if (eqn.has_champ("marqueur_loi_de_paroi"))
540 {
541 const DoubleTab& marq = eqn.get_champ("marqueur_loi_de_paroi").valeurs();
542 int ntot = marq.dimension_tot(0);
543 marqueur_elem_.resize_array(ntot);
544 for (int n = 0; n < ntot; n++)
545 if (marq(n) > 0)
546 marqueur_elem_[n] = 1;
547 }
548}
DoubleTab & valeurs() override
Renvoie le tableau des valeurs du champ au temps courant.
virtual DoubleTab & valeurs()=0
classe Champ_Uniforme Represente un champ constant dans l'espace et dans le temps.
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_base Classe de base pour la hierarchie des classes qui representent les differentes c...
virtual Frontiere_dis_base & frontiere_dis()
Renvoie la frontiere discretisee a laquelle les conditions aux limites s'appliquent.
classe Cond_lim Classe generique servant a representer n'importe quelle classe
Definition Cond_lim.h:31
classe Conds_lim Cette classe represente un vecteur de conditions aux limites.
Definition Conds_lim.h:32
Classe Dirichlet_homogene Cette classe est la classe de base de la hierarchie des conditions aux limi...
double val_imp(int i) const
classe Dirichlet Cette classe est la classe de base de la hierarchie des conditions aux limites de ty...
Definition Dirichlet.h:31
virtual double val_imp(int i) const
Renvoie la valeur imposee sur la i-eme composante du champ a la frontiere au temps par defaut du cham...
Definition Dirichlet.cpp:35
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
IntTab_t & les_elems()
Definition Domaine.h:129
void imposer_symetrie_matrice_secmem(Matrice_Morse &la_matrice, DoubleTab &secmem) const
On transforme la_matrice et le secmem pour avoir un secmem normal aux bords , plus la matrice pour as...
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
double xv(int num_face, int k) const
Definition Domaine_VF.h:76
int face_sommets(int i, int j) const
renvoie le numero du ieme sommet de la face num_face.
Definition Domaine_VF.h:583
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
DoubleTab calculer_xgr() const
calcul le tableau xgr pour le calcul des moments des forces aux bords :
int face_voisins(int num_face, int i) const
renvoie l'element voisin de numface dans la direction i.
Definition Domaine_VF.h:418
int nb_faces_bord() const
renvoie le nombre de faces sur lesquelles sont appliquees les conditions limites :
Definition Domaine_VF.h:513
int moments_a_imprimer() const
int nb_front_Cl() const
const Domaine & domaine() const
int nb_som_tot() const
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...
Sortie & syncfile() override
Provoque l'ecriture sur disque des donnees accumulees sur les differents processeurs depuis le dernie...
classe Equation_base Le role d'une equation est le calcul d'un ou plusieurs champs....
virtual const Milieu_base & milieu() const =0
virtual const Champ_Inc_base & inconnue() const =0
const Champ_base & get_champ(const Motcle &nom) const override
bool has_champ(const Motcle &nom, OBS_PTR(Champ_base) &ref_champ) const override
virtual Domaine_Cl_dis_base & domaine_Cl_dis()
Renvoie le domaine des conditions aux limite discretisee associee a l'equation.
Probleme_base & probleme()
Renvoie le probleme associe a l'equation.
Domaine_dis_base & domaine_dis()
Renvoie le domaine discretise associe a l'equation.
const Nom & le_nom() const override
Renvoie le nom du champ.
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 Frontiere_dis_base Classe representant une frontiere discretisee.
const Nom & le_nom() const override
Renvoie le nom de la frontiere geometrique.
Classe Matrice_Morse Represente une matrice M (creuse), non necessairement carree.
const auto & get_tab2() const
Sortie & imprimer_formatte(Sortie &s) const override
void dimensionner(int n, _SIZE_ nnz)
Size the matrix with n lines and n columns and nnz zero-values coefficients.
const auto & get_tab1() const
auto & get_set_coeff()
double coef(int i, int j) const
virtual const Champ_base & masse_volumique() const
Renvoie la masse volumique du milieu.
const Equation_base & equation() const
Renvoie la reference sur l'equation pointe par MorEqn::mon_equation.
Definition MorEqn.h:62
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
virtual int debute_par(const char *const n) const
Definition Nom.cpp:319
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
void dimensionner(const Domaine_EF &, const Domaine_Cl_EF &, Matrice_Morse &) const
Dimensionnement de la matrice qui devra recevoir les coefficients provenant de la convection,...
void marque_elem(const Equation_base &eqn)
Matrice_Morse matrice_sto_
Definition Op_EF_base.h:40
int impr(Sortie &, const Operateur_base &) const
Impression des flux d'un operateur EF aux faces (ie: diffusion, convection).
int elem_contribue(const int elem) const
void modifier_pour_Cl(const Domaine_EF &, const Domaine_Cl_EF &, Matrice_Morse &, DoubleTab &) const
Modification des coef de la matrice et du second membre pour les conditions de Dirichlet.
void modifier_flux(const Operateur_base &) const
multiplie le flux bordpar rho cp ou rho si necessaire
classe Operateur_Diff_base Cette classe est la base de la hierarchie des operateurs representant
classe Operateur_base Classe est la base de la hierarchie des objets representant un
void ouvrir_fichier_partage(EcrFicPartage &, const Nom &, const int flag=1) const
Ouverture/creation d'un fichier d'impression d'un operateur A surcharger dans les classes derivees.
DoubleTab & flux_bords()
void ouvrir_fichier(SFichier &os, const Nom &, const int flag=1) const
Ouverture/creation d'un fichier d'impression d'un operateur A surcharger dans les classes derivees.
classe Probleme_base C'est un Probleme_U qui n'est pas un couplage.
virtual const Milieu_base & milieu() const
Renvoie le milieu physique associe au probleme.
const Schema_Temps_base & schema_temps() const
Renvoie le schema en temps associe au probleme.
static double mp_sum(double)
Calcule la somme de x sur tous les processeurs du groupe courant.
Definition Process.cpp:146
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
static int je_suis_maitre()
renvoie 1 si on est sur le processeur maitre du groupe courant (c'est a dire me() == 0),...
Definition Process.cpp:86
class Schema_Temps_base
double temps_courant() const
Renvoie le temps courant.
Classe de base des flux de sortie.
Definition Sortie.h:52
classe Symetrie Sur les faces de symetrie on a les proprietes suivantes:
Definition Symetrie.h:37
_SIZE_ size_array() const
int nb_dim() const
Definition TRUSTTab.h:199
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
Definition TRUSTTab.tpp:469
_SIZE_ dimension_tot(int) const override
Definition TRUSTTab.tpp:160
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133
int line_size() const
Definition TRUSTVect.tpp:67