TrioCFD 1.9.9_beta
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 Sizes the matrix that will receive the coefficients from the convection and diffusion operators for the face-based case.
43 *
44 * This matrix has a Morse matrix structure.
45 * We start by computing the sizes of the arrays tab1 and 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: not wrong in //, nb_colonnes() may be zero locally
58 if (Process::mp_sum(matrice_sto_.nb_colonnes()))
59 {
60 la_matrice=matrice_sto_;
61 return;
62 }
63
64 }
65 // Sizing the matrix that will receive coefficients from
66 // convection and diffusion in the face case.
67 // This matrix has a Morse matrix structure.
68 // We start by computing the sizes of arrays tab1 and tab2.
69 // For this we need to find the neighboring vertices of the considered vertex.
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 // for now we don't handle components
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 // create a nb_comp*nb_comp block for each original coefficient
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 of the matrix coefficients and the right-hand side for Dirichlet conditions.
244 *
245 */
246
248 const Domaine_Cl_EF& le_dom_cl,
249 Matrice_Morse& la_matrice, DoubleTab& secmem) const
250{
251 // Sizing the matrix that will receive coefficients from
252 // convection and diffusion in the face case.
253 // This matrix has a Morse matrix structure.
254 // We start by computing the sizes of arrays tab1 and 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 // determining the size of the unknown field.
261 // Cerr << "in 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 // for neighbors
293
294 // for the right-hand side
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 // for neighbors
319
320 // for the right-hand side
321 secmem(som,comp)= 0;
322 if (la_cl_Dirichlet.val_imp(ind_face,comp)!=0)
323 {
324 Cerr<<"not possible, is it ??? "<<finl;
326 }
327 }
328 }
329 }
330
331 if (sub_type(Symetrie,la_cl.valeur()))
332 {
333 // do nothing here, handled below
334 }
335 }
336
337 // Modify for symmetry
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 // Account for periodic boundary conditions
351 // Cerr << "fin de modifier" << finl;
352}
353
354/*! @brief Multiplies the boundary flux by rho cp or rho if necessary.
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 // Multiply by rho for incompressible Navier-Stokes
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 Prints the boundary fluxes of an EF operator at faces (i.e., 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 << "Flux printing is not implemented for the operator " << 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 // Print moments only if requested and if we are handling the velocity diffusion operator
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 // Print the current time
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 // Compute moments
429 DoubleTab xgr;
430 if (impr_mom) xgr = le_dom_EF.calculer_xgr();
431 DoubleVect moment(nb_compo);
432 moment=0;
433
434 // Iterate over boundaries to sum fluxes per boundary into the flux_bord array
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 // Compute the moment exerted by the fluid on the boundary (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 // Sum contributions from each processor
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 // Write to output files
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 // Sum fluxes from all boundaries into the bilan array
482 bilan(k)+=flux_bord(k);
483 }
484 }
485 }
486
487 // Print the balance values and move to next line
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 // Print per-face values if requested
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 // Print per-face values
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
Returns the array of field values at the current time.
virtual DoubleTab & valeurs()=0
Champ_Uniforme Represents a field that is constant in space and time.
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
class Champ_front_calc_interne Derived class of Champ_front_calc representing
const IntVect & face_map() const
class Cond_lim_base Base class for the hierarchy of classes that represent the different boundary con...
virtual Frontiere_dis_base & frontiere_dis()
Returns the discretized boundary to which the boundary conditions apply.
class Cond_lim Generic class used to represent any class
Definition Cond_lim.h:31
class Conds_lim This class represents a vector of boundary conditions.
Definition Conds_lim.h:32
Classe Dirichlet_homogene This class is the base class of the hierarchy of homogeneous Dirichlet-type...
double val_imp(int i) const
Dirichlet This class is the base class of the hierarchy of Dirichlet-type boundary conditions.
Definition Dirichlet.h:31
virtual double val_imp(int i) const
Returns the imposed value on the i-th component of the field at the boundary at the default time of c...
Definition Dirichlet.cpp:35
int nb_som_elem() const
Returns the number of vertices of the geometric elements that make up the domain.
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
Transforms la_matrice and secmem to produce a secmem normal to boundaries, plus the matrix needed to ...
int nb_cond_lim() const
Returns the number of boundary conditions.
const Cond_lim & les_conditions_limites(int) const
Returns the i-th boundary condition.
class Domaine_EF
Definition Domaine_EF.h:56
double xv(int num_face, int k) const
Definition Domaine_VF.h:76
int face_sommets(int i, int j) const
Returns the index of the i-th vertex of face num_face.
Definition Domaine_VF.h:582
int nb_som_face() const
Returns the number of vertices per face.
Definition Domaine_VF.h:493
int elem_faces(int i, int j) const
Returns the index of the i-th face of element num_elem; the face numbering convention is.
Definition Domaine_VF.h:542
DoubleTab calculer_xgr() const
Computes the xgr array for the computation of moments of forces at boundaries.
int face_voisins(int num_face, int i) const
Returns the neighbouring element of num_face in direction i.
Definition Domaine_VF.h:418
int nb_faces_bord() const
Returns the number of faces on which boundary conditions are applied:
Definition Domaine_VF.h:512
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
Returns the value of the imposed temperature on the i-th component of the boundary field.
Class Echange_interne_global_impose: This class represents the special case of.
Class Echange_interne_global_parfait: Special case of a perfect internal exchange (h=+inf).
Sortie & syncfile() override
Triggers writing to disk of the data accumulated on the different processors since the last call to s...
class Equation_base The role of an equation is the calculation of one or more fields....
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()
Returns the discretized boundary condition domain associated with the equation.
Probleme_base & probleme()
Returns the problem associated with the equation.
Domaine_dis_base & domaine_dis()
Returns the discretized domain associated with the equation.
const Nom & le_nom() const override
Returns the name of the field.
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
class Frontiere_dis_base Class representing a discretized boundary.
const Nom & le_nom() const override
Returns the name of the geometric boundary.
Matrice_Morse class - Represents a (sparse) matrix M, not necessarily square,.
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
Returns the mass density of the medium (const version).
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
Definition MorEqn.h:62
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
virtual int debute_par(const char *const n) const
Definition Nom.cpp:314
static int dimension
Definition Objet_U.h:94
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
void dimensionner(const Domaine_EF &, const Domaine_Cl_EF &, Matrice_Morse &) const
Sizes the matrix that will receive the coefficients from the convection and diffusion operators for t...
void marque_elem(const Equation_base &eqn)
Matrice_Morse matrice_sto_
Definition Op_EF_base.h:40
int impr(Sortie &, const Operateur_base &) const
Prints the boundary fluxes of an EF operator at faces (i.e., 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 of the matrix coefficients and the right-hand side for Dirichlet conditions.
void modifier_flux(const Operateur_base &) const
Multiplies the boundary flux by rho cp or rho if necessary.
Operateur_Diff_base This class is the base of the hierarchy of operators representing.
class Operateur_base This class is the base of the hierarchy of objects representing an
void ouvrir_fichier_partage(EcrFicPartage &, const Nom &, const int flag=1) const
Opening/creation of a shared file for printing an operator. To override in derived classes.
DoubleTab & flux_bords()
void ouvrir_fichier(SFichier &os, const Nom &, const int flag=1) const
Opening/creation of a file for printing an operator. To override in derived classes.
class Probleme_base It is a Probleme_U that is not a coupling.
virtual const Milieu_base & milieu() const
Returns the physical medium associated with the problem (const version).
const Schema_Temps_base & schema_temps() const
Returns the time scheme associated with the problem.
static double mp_sum(double)
Computes the sum of x over all processors in the current group.
Definition Process.cpp:145
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
static int je_suis_maitre()
Returns 1 if on the master processor of the current group (i.e. me() == 0), 0 otherwise.
Definition Process.cpp:82
class Schema_Temps_base
double temps_courant() const
Returns the current time.
Base class for output streams.
Definition Sortie.h:52
Symetrie On symmetry faces, the following properties hold:
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