TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Champ_front_contact_VEF.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 <Convection_Diffusion_Concentration.h>
17#include <Champ_front_contact_fictif_VEF.h>
18#include <Modele_turbulence_scal_base.h>
19#include <Op_Diff_VEF_Anisotrope_Face.h>
20#include <Modele_turbulence_hyd_base.h>
21#include <Raccord_distant_homogene.h>
22#include <Champ_front_contact_VEF.h>
23#include <Champ_Fonc_P0_VEF.h>
24#include <Format_Post_Med.h>
25#include <Domaine_Cl_VEF.h>
26#include <Champ_Uniforme.h>
27#include <distances_VEF.h>
28#include <Probleme_base.h>
29#include <Pb_Conduction.h>
30#include <Schema_Comm.h>
31#include <Constituant.h>
32#include <Interprete.h>
33#include <TRUST_Ref.h>
34#include <ArrOfBit.h>
35#include <SFichier.h>
36#include <Domaine.h>
37
38// WEC : Warning. Other arrays besides the champ_front would benefit from having multiple time values!
39// In particular the gradients...
40
41Implemente_instanciable(Champ_front_contact_VEF,"Champ_front_contact_VEF",Ch_front_var_instationnaire_dep);
42
43
45{
46 return os;
47}
48
49
51{
52 Motcle nom_inco;
53 nom_inco = "temperature";
54 is >> nom_pb1 >> nom_bord1 >> nom_pb2 >> nom_bord2;
55
56 Cerr << "Champ_front_contact_VEF::readOn : " << nom_pb1 << " " << nom_bord1 << " " << nom_inco << finl;
57 Cerr << " connecte a : " << nom_pb2 << " " << nom_bord2 << " " << nom_inco << finl;
58
59 fixer_nb_comp(1); // intended for temperature.
62 else
64
65 return is;
66}
67
69{
71 return 0;
72
73 // WEC : code taken from calculer_coeffs_echange which performed
74 // initializations at the first time step.
75
76 // XXX : We fill the values here and not in readOn because the medium of pb2 is not yet read !!!
77 creer(nom_pb1, nom_bord1, nom_pb2, nom_bord2, "temperature");
79
80 // Check/initialize Raccord boundaries in parallel:
82 {
84 associer_ch_inc_base(l_inconnue2.valeur());
85 const Domaine_dis_base& domaine_dis_opposee = front_dis().domaine_dis();
86 const Domaine_dis_base& domaine_dis_locale = frontiere_dis().domaine_dis();
87 const Frontiere& frontiere_opposee = front_dis().frontiere();
88 const Frontiere& frontiere_locale = frontiere_dis().frontiere();
89 if (!sub_type(Raccord_distant_homogene, frontiere_opposee))
90 {
91 const Nom& nom_domaine_oppose = domaine_dis_opposee.domaine().le_nom();
92 Cerr << "Error, the boundary " << frontiere_opposee.le_nom() << " should be a Raccord." << finl;
93 Cerr << "Add in your data file between the definition and the partition of the domain " << nom_domaine_oppose << " :" << finl;
94 Cerr << "Modif_bord_to_raccord " << nom_domaine_oppose << " " << frontiere_opposee.le_nom() << finl;
95 exit();
96 }
97 Raccord_distant_homogene& raccord_distant = ref_cast_non_const(Raccord_distant_homogene, frontiere_opposee);
98 raccord_distant.initialise(frontiere_locale, domaine_dis_locale, domaine_dis_opposee);
99 }
100
101 // filling the connectivity array of boundary face indices
102 // between the two coupled problems.
103 if (connect_est_remplit==0)
104 {
107 //The elems_voisin_bord_ have been filled for each boundary carrying a Champ_Front_contact_VEF
108 //We can now fill faces_coin
110 }
112
113 // Initialize the references to ch_fr_autre_pb and fr_vf_autre_pb
115
116 // Array sizing
117 int nb_faces=frontiere_dis().frontiere().nb_faces();
118 gradient_num_transf.resize(nb_faces);
119 gradient_fro_transf.resize(nb_faces);
120 Scal_moy.resize(nb_faces);
121 gradient_num_local.resize(nb_faces);
122 gradient_fro_local.resize(nb_faces);
123 coeff_amort_num.resize(nb_faces);
124 coeff_amort_denum.resize(nb_faces);
125
126 // Are we in a conduction problem?
127 // (used in rayo trans and semi_transp => factorization)
128 const Probleme_base& pb = l_inconnue1->equation().probleme();
129 if (sub_type(Pb_Conduction,pb))
131 else
133
134 // Initialization of gradient arrays
135 calculer_coeffs_echange(temps); // at the current time
136 return 1;
137}
138
139void Champ_front_contact_VEF::creer(const Nom& nompb1, const Nom& nom1, const Nom& nompb2, const Nom& nom2, const Motcle& nom_inco)
140{
141 nom_bord1 = nom1;
142 nom_bord2 = nom2;
143 Nom nom_inco1, nom_inco2;
144 nom_inco1 = nom_inco;
145 nom_inco2 = nom_inco;
146
147 OBS_PTR(Champ_base) rch1;
148 Probleme_base& pb1 = ref_cast(Probleme_base, Interprete::objet(nompb1));
149
150 if (!sub_type(Pb_Conduction, pb1))
151 if (pb1.equation(1).inconnue().le_nom() != "temperature")
152 nom_inco1 = "concentration";
153
154 rch1 = pb1.get_champ(nom_inco1);
155 l_inconnue1 = ref_cast(Champ_Inc_base, rch1.valeur());
156
157 OBS_PTR(Champ_base) rch2;
158 Probleme_base& pb2 = ref_cast(Probleme_base, Interprete::objet(nompb2));
159
160 if (!sub_type(Pb_Conduction, pb2))
161 if (pb2.equation(1).inconnue().le_nom() != "temperature")
162 nom_inco2 = "concentration";
163
164 rch2 = pb2.get_champ(nom_inco2);
165 l_inconnue2 = ref_cast(Champ_Inc_base, rch2.valeur());
166
167 if (nom_inco1 != nom_inco2)
168 {
169 Cerr << "A contact boundary condition is incorrectly specified" << finl;
170 Cerr << "There is an inconsistency in the unknown involved on both sides of the contact boundary" << finl;
171 exit();
172 }
173
174}
175
177{
178 l_inconnue = inco;
179}
180
181
186
187
189{
190 // In the case of homogeneous matching boundaries, i.e. perfectly coincident
191 // at the mesh level, gradient_num_local = gradient_num_transf and
192 // gradient_fro_local = gradient_fro_transf
193
196}
197
199{
200 // collect information from the local problem
202 associer_ch_inc_base(l_inconnue1.valeur());
203 const Champ_Inc_base& inco = l_inconnue.valeur();
204 const DoubleTab& inco_valeurs = l_inconnue->valeurs(temps);
205 assert (nom_bord != "??");
206
207 const Domaine_VEF& le_dom_dis = ref_cast(Domaine_VEF, domaine_dis());
208 const Front_VF& la_front_vf = ref_cast(Front_VF, front_dis());
209 const DoubleVect& vol = le_dom_dis.volumes();
210 const IntTab& face_voisins = le_dom_dis.face_voisins();
211 const IntTab& elem_faces = le_dom_dis.elem_faces();
212 const DoubleTab& face_normales = le_dom_dis.face_normales();
213 const Milieu_base& le_milieu = milieu();
214
215 const int nb_faces_elem = le_dom_dis.domaine().nb_faces_elem();
216 const int nb_faces = la_front_vf.nb_faces();
217 const int ndeb = la_front_vf.num_premiere_face();
218
219 DoubleTab coeff_lam, coeff_turb;
220
221 // laminar diffusivity (lambda or D)
222 if (!sub_type(Convection_Diffusion_Concentration, inco.equation()))
223 coeff_lam = le_milieu.conductivite().valeurs();
224 else
225 coeff_lam = ref_cast(Constituant,le_milieu).diffusivite_constituant().valeurs();
226
227 // turbulence
228 int ind_loi_paroi = 0;
229 DoubleVect d_equiv;
230 const RefObjU& mod = inco.equation().get_modele(TURBULENCE);
231 if (mod)
232 {
233 const Modele_turbulence_scal_base& mod_turb_scal = ref_cast(Modele_turbulence_scal_base, mod.valeur());
234 coeff_turb = mod_turb_scal.conductivite_turbulente().valeurs();
235 const Turbulence_paroi_scal_base& loipar = mod_turb_scal.loi_paroi();
236
237 if (mod_turb_scal.loi_paroi_non_nulle() && loipar.use_equivalent_distance())
238 {
239 ind_loi_paroi = 1;
240 d_equiv.resize(nb_faces);
241
242 // Search for the corresponding boundary
243 int i_bord = -1;
244 for (int n_bord = 0; n_bord < le_dom_dis.domaine().nb_front_Cl(); n_bord++)
245 if (le_dom_dis.front_VF(n_bord).le_nom() == la_front_vf.le_nom())
246 i_bord = n_bord;
247 // Copy data from a boundary into the temporary local arrays positions_Pf and d_equiv
248 for (int ind_face = 0; ind_face < nb_faces; ind_face++)
249 d_equiv(ind_face) = loipar.equivalent_distance(i_bord, ind_face);
250 }
251 }
252
253 int signe;
254 double surface_pond, surface_face;
255
256 const int nd = coeff_lam.nb_dim();
257 const bool is_uniforme = coeff_lam.dimension(0) == 1;
258
259 for (int fac_front = 0; fac_front < nb_faces; fac_front++)
260 {
261 gradient_num_local(fac_front) = 0.;
262 gradient_fro_local(fac_front) = 0.;
263 Scal_moy(fac_front) = 0.;
264
265 const int fac_glob = fac_front + ndeb;
266 int num = face_voisins(fac_glob, 0);
267 if (num < 0)
268 num = face_voisins(fac_glob, 1);
269
270 // unit normal to the face
271 double ratio = 0.;
272 for (int i = 0; i < dimension; i++)
273 ratio += (face_normales(fac_glob, i) * face_normales(fac_glob, i));
274 ratio = sqrt(ratio);
275
276
277 // effective conductivity/diffusivity k_eff = n^T K n
278 double k_eff = 0.;
279
280 int e_idx = 0; // element index
281 if (nd >= 1)
282 e_idx = is_uniforme ? 0 : num;
283
284 if (nd == 1) // scalar per cell OR uniform field
285 k_eff = coeff_lam(e_idx);
286 else if (nd == 2)
287 {
288 // XXX Elie Saikali : need to do something if the diffusion operator is anisotropic ...
289 DoubleTrav n(dimension);
290 for (int i = 0; i < dimension; i++)
291 n[i] = face_normales(fac_glob, i) / ratio;
292
293 const int s1 = coeff_lam.dimension(1);
294 if (s1 == 1)
295 k_eff = coeff_lam(e_idx, 0);
296 else if (s1 == dimension)
297 {
298 for (int i = 0; i < dimension; i++)
299 k_eff += n[i] * n[i] * coeff_lam(e_idx, i);
300 }
301 else if (s1 == dimension * dimension)
302 {
303
304 for (int i = 0; i < dimension; i++)
305 for (int j = 0; j < dimension; j++)
306 {
307 const double Kij = 0.5 * (coeff_lam(e_idx, i * dimension + j) + coeff_lam(e_idx, j * dimension + i));
308 k_eff += n[i] * n[j] * Kij;
309 }
310 }
311 else
312 k_eff = coeff_lam(e_idx, 0); // XXX same as before
313 }
314 else if (nd == 3)
315 {
316 DoubleTrav n(dimension);
317 for (int i = 0; i < dimension; i++)
318 n[i] = face_normales(fac_glob, i) / ratio;
319
320 for (int i = 0; i < dimension; i++)
321 for (int j = 0; j < dimension; j++)
322 k_eff += n[i] * coeff_lam(e_idx, i, j) * n[j];
323 }
324 else
325 throw;
326
327 // turbulence
328 if (mod)
329 k_eff += coeff_turb(num);
330
331 //Computation of the average temperature in the cell
332 surface_face = le_dom_dis.face_surfaces(fac_glob);
333 for (int i = 0; i < nb_faces_elem; i++)
334 {
335 // The wall temperature is not taken into account
336 // when computing the average temperature in the cell.
337 const int j = elem_faces(num, i);
338 if (j != fac_glob)
339 {
340 surface_pond = 0.;
341 for (int kk = 0; kk < dimension; kk++)
342 surface_pond -= (face_normales(j, kk) * le_dom_dis.oriente_normale(j, num) * face_normales(fac_glob, kk) * le_dom_dis.oriente_normale(fac_glob, num)) / (surface_face * surface_face);
343 Scal_moy(fac_front) += inco_valeurs(j) * surface_pond;
344 }
345 }
346
347 // num/fro contributions
348 for (int fac = 0; fac < dimension + 1; fac++)
349 for (int i = 0; i < dimension; i++)
350 {
351 const int fac_loc = elem_faces(num, fac);
352 signe = le_dom_dis.oriente_normale(fac_loc, num);
353 if (fac_loc != fac_glob)
354 gradient_num_local(fac_front) += (signe * face_normales(fac_glob, i) / ratio * face_normales(fac_loc, i) * inco_valeurs(fac_loc));
355 else
356 gradient_fro_local(fac_front) += (signe * face_normales(fac_loc, i) / ratio * face_normales(fac_loc, i));
357 }
358
359 gradient_num_local(fac_front) *= (k_eff / vol(num));
360 gradient_fro_local(fac_front) *= (k_eff / vol(num));
361
362 // wall law with equivalent distance
363 if (ind_loi_paroi == 1)
364 {
365 gradient_num_local(fac_front) = 0.;
366 gradient_fro_local(fac_front) = 0.;
367
368 gradient_num_local(fac_front) = -Scal_moy(fac_front);
369 const double coeff_equiv = k_eff / d_equiv(fac_front);
370 gradient_num_local(fac_front) *= coeff_equiv;
371 gradient_fro_local(fac_front) = coeff_equiv;
372 }
373 }
374}
375
377{
379 {
382 }
383
384 const Frontiere& la_front=la_frontiere_dis->frontiere();
385 int nb_faces=la_front.nb_faces();
386 DoubleTab& tab=valeurs_au_temps(temps);
387
388 // Retrieve the gradient_num_transf and gradient_fro_transf coefficients from the other problem
389 DoubleVect gradient_num_transf_autre_pb(nb_faces);
390 DoubleVect gradient_fro_transf_autre_pb(nb_faces);
391 if (!ch_fr_autre_pb)
392 {
393 Cerr << "Warning: You are using a contact condition Champ_front_contact_VEF on boundary " << nom_bord1 << " of problem "<< nom_pb1 <<" " << finl;
394 Cerr << "You must have an equivalent Champ_front_contact_VEF on boundary " << nom_bord2 << " of problem "<<nom_pb2<<" " << finl;
395 exit();
396 }
397 trace_face_raccord(fr_vf_autre_pb.valeur(),ch_fr_autre_pb->gradient_num_transf,gradient_num_transf_autre_pb);
398 trace_face_raccord(fr_vf_autre_pb.valeur(),ch_fr_autre_pb->gradient_fro_transf,gradient_fro_transf_autre_pb);
399 //
400 //
401 // gradient_fro_ h
402 // gradient_num_ -h*T
403 // Computation of the imposed temperature
404 for (int fac_front=0; fac_front<nb_faces; fac_front++)
405 {
406 tab(fac_front,0)= -(gradient_num_local(fac_front) + gradient_num_transf_autre_pb(fac_front))
407 / ( gradient_fro_transf_autre_pb(fac_front) + gradient_fro_local(fac_front)) ;
408 }
409 // Verification of the consistency of the computed boundary temperatures
410 //verifier_scalaire_bord();
411}
412
413
415{
416 // This method verifies that the computed boundary temperature for each
417 // face num_face lies between the average temperatures of the surrounding elements
418 // in each medium.
419 const Frontiere& la_front=la_frontiere_dis->frontiere();
420 int nb_faces=la_front.nb_faces();
421
422 DoubleVect Scal_moy_autre_pb(nb_faces);
423 trace_face_raccord(fr_vf_autre_pb.valeur(),ch_fr_autre_pb->Scal_moy,Scal_moy_autre_pb);
424
425 DoubleTab& tab=valeurs_au_temps(temps);
426
427 // Verification of temperatures
428 for (int fac_front=0; fac_front<nb_faces; fac_front++)
429 {
430 if (Scal_moy(fac_front) > Scal_moy_autre_pb(fac_front))
431 {
432 if ((tab(fac_front,0)>Scal_moy(fac_front)) || (tab(fac_front,0)<Scal_moy_autre_pb(fac_front)))
433 {
434 if (tab(fac_front,0)>Scal_moy(fac_front))
435 {
436 Cerr<<"Warning, Tp is not between the temperatures"<<finl;
437 Cerr<<"of the fluid and solid near the wall"<<finl;
438 Cerr<<"Tp("<<fac_front<<") = "<<tab(fac_front,0)<<" is too high"<<finl;
439 Cerr<<"by DT = "<<tab(fac_front,0)-Scal_moy(fac_front)<<" K"<<finl;
440 }
441 else
442 {
443 Cerr<<"Warning, Tp is not between the temperatures"<<finl;
444 Cerr<<"of the fluid and solid near the wall"<<finl;
445 Cerr<<"Tp("<<fac_front<<") = "<<tab(fac_front,0)<<" is too low"<<finl;
446 Cerr<<"by DT = "<<Scal_moy_autre_pb(fac_front)-tab(fac_front,0)<<" K"<<finl;
447 }
448 }
449 }
450 else
451 {
452 if ((tab(fac_front,0)<Scal_moy(fac_front)) || (tab(fac_front,0)>Scal_moy_autre_pb(fac_front)))
453 {
454 if (tab(fac_front,0)<Scal_moy(fac_front))
455 {
456 Cerr<<"Warning, Tp is not between the temperatures"<<finl;
457 Cerr<<"of the fluid and solid near the wall"<<finl;
458 Cerr<<"Tp("<<fac_front<<") = "<<tab(fac_front,0)<<" is too low"<<finl;
459 Cerr<<"by DT = "<<Scal_moy(fac_front)-tab(fac_front,0)<<" K"<<finl;
460 }
461 else
462 {
463 Cerr<<"Warning, Tp is not between the temperatures"<<finl;
464 Cerr<<"of the fluid and solid near the wall"<<finl;
465 Cerr<<"Tp("<<fac_front<<") = "<<tab(fac_front,0)<<" is too high"<<finl;
466 Cerr<<"by DT = "<<tab(fac_front,0)-Scal_moy_autre_pb(fac_front)<<" K"<<finl;
467 }
468 }
469 }
470 }
471}
472
473
475{
476 // Computation of the imposed temperature
477 calcul_grads_locaux(temps);
478 calcul_grads_transf(temps);
479}
480
481
483{
484 return l_inconnue.valeur();
485}
486
487
489{
490 return nom_bord;
491}
492
493
495{
496 if (!l_inconnue)
497 {
498 Cerr << "\nError in Champ_front_contact_VEF::equation() : not able to return the equation !" << finl;
500 }
501 return inconnue().equation();
502}
503
504
506{
507 return equation().milieu();
508}
509
510
515
516
521
522
527
528
530{
531 const Domaine_VEF& le_dom_dis=ref_cast(Domaine_VEF, l_inconnue1->equation().domaine_dis());
532 int rang_front = le_dom_dis.rang_frontiere(nom_bord1);
533 const Front_VF& la_front_vf=ref_cast(Front_VF, le_dom_dis.frontiere_dis(rang_front));
534 const DoubleVect& vol = le_dom_dis.volumes();
535 const IntTab& face_voisins = le_dom_dis.face_voisins();
536 const DoubleTab& face_normales = le_dom_dis.face_normales();
537 const Milieu_base& le_milieu = l_inconnue1->equation().milieu();
538
539 int nb_faces = la_front_vf.nb_faces();
540 int ndeb = la_front_vf.num_premiere_face();
541
542 int fac_front;
543 for (fac_front = 0; fac_front<nb_faces; fac_front++)
544 {
545 int fac = fac_front + ndeb;
546 int num = face_voisins(fac,0);
547 if (num < 0) num = face_voisins(fac,1);
548
549 // compute the area of the current face
550 double ratio = 0.;
551 for (int i=0; i<dimension; i++) ratio += (face_normales(fac,i) * face_normales(fac,i));
552 ratio = sqrt(ratio);
553
554 double alpha;
555 if(sub_type(Champ_Uniforme,le_milieu.diffusivite()))
556 alpha=le_milieu.diffusivite().valeurs()(0,0);
557 else
558 {
559 const DoubleTab& tab_alpha = le_milieu.diffusivite().valeurs();
560 alpha=tab_alpha(num);
561 }
562
563 double volume = vol(num);
564
565 coeff_amort_num(fac_front) = volume/ratio;
566 coeff_amort_denum(fac_front) = (alpha*ratio)/volume;
567 }
568}
569
570
572{
573 const Champ_Inc_base& temp_autre = l_inconnue2.valeur();
574 const Equation_base& eqn = temp_autre.equation();
575 const Domaine_Cl_dis_base& zcl = eqn.domaine_Cl_dis();
576
577 int num_cl;
578 for (num_cl = 0; num_cl<zcl.nb_cond_lim(); num_cl++)
579 {
580 const Cond_lim_base& la_cl = zcl.les_conditions_limites(num_cl);
581 const Nom& le_nom_cl = la_cl.frontiere_dis().le_nom();
582 if (le_nom_cl == nom_bord2)
583 {
584 if (sub_type(Champ_front_contact_VEF,la_cl.champ_front()))
585 {
586 ch_fr_autre_pb = ref_cast(Champ_front_contact_VEF,la_cl.champ_front());
587 // Safety check to verify that the Champ_front_contact_VEF has been correctly read.
588 if (ch_fr_autre_pb->nom_pb1 == nom_pb1)
589 if (!(sub_type(Champ_front_contact_fictif_VEF,(*this))))
590 {
591 Cerr<<"Warning, error when reading Champ_Front_Contact_VEF"<<finl;
592 Cerr<<"The syntax to use is: local_pb_name local_boundary_name remote_pb_name remote_boundary_name"<<finl;
593 exit();
594 }
595 fr_vf_autre_pb=ref_cast(Front_VF, la_cl.frontiere_dis());
596 }
597 }
598 }
599}
600
601DoubleVect& Champ_front_contact_VEF::trace_face_raccord(const Front_VF& fr_vf,const DoubleVect& y,DoubleVect& x)
602{
603 // Verify that the boundary is of type Raccord_distant_homogene
604 if (sub_type(Raccord_distant_homogene,fr_vf.frontiere()))
605 fr_vf.frontiere().trace_face_distant(y,x);
606 else
607 {
609 {
610 // Test that we have a homogeneous remote matching boundary, otherwise the connect array is not filled in parallel
611 // Indeed, remplir_connect_bords is only done sequentially
612 Cerr << "The boundary named " << fr_vf.frontiere().le_nom() << " is not a 'Raccord Distant Homogene'" << finl;
613 Cerr << "Use keyword modif_bord_to_raccord to change the boundary of kind Paroi into a boundary of kind Raccord" << finl;
614 Cerr << "after you read the meshes during the partitioning." << finl;
615 exit();
616 }
617 // Treating a local matching boundary
618 int nb_fac_front=x.size();
619 for(int fac_front=0; fac_front<nb_fac_front; fac_front++)
620 x(fac_front) = y(connect_bords(fac_front));
621 }
622
623 return x;
624}
625
626
628{
629 // By convention, quantities without index as well as those with index 1
630 // correspond to the current problem, while those with index 2
631 // correspond to the quantities of the problem coupled with the current problem.
632 const Frontiere& la_front = la_frontiere_dis->frontiere();
633 int nb_faces = la_front.nb_faces();
634
635 //
636 // collect information from problem 1
637 //
639 associer_ch_inc_base(l_inconnue1.valeur()) ;
640
641 assert (nom_bord != "??") ;
642 const Domaine_VEF& le_dom_dis1=ref_cast(Domaine_VEF, l_inconnue1->equation().domaine_dis());
643
644 int rang_front1 = le_dom_dis1.rang_frontiere(nom_bord1);
645 const Front_VF& la_front_vf1=ref_cast(Front_VF, le_dom_dis1.frontiere_dis(rang_front1));
646 const DoubleTab& xv1 = le_dom_dis1.xv();
647 const IntTab& face_voisin=le_dom_dis1.face_voisins();
648
649 const IntTab& elem_faces = le_dom_dis1.elem_faces();
650
651 int ndeb1 = la_front_vf1.num_premiere_face();
652
653 //
654 // collect information from problem 2
655 //
657 associer_ch_inc_base(l_inconnue2.valeur()) ;
658
659 assert (nom_bord != "??") ;
660 const Domaine_VEF& le_dom_dis2=ref_cast(Domaine_VEF, l_inconnue2->equation().domaine_dis());
661
662 int rang_front2 = le_dom_dis2.rang_frontiere(nom_bord2);
663 const Front_VF& la_front_vf2=ref_cast(Front_VF, le_dom_dis2.frontiere_dis(rang_front2));
664 const DoubleTab& xv2 = le_dom_dis2.xv();
665 int ndeb2 = la_front_vf2.num_premiere_face();
666
667 // Verify that the face numberings on this boundary are compatible
668 // for both considered problems.
669 int i,j,k,temoin,temoin_tot;
670
671 double erreur = 0.;
672 int ii;
673 for (ii=0; ii<dimension; ii++)
674 if (std::fabs(xv1(ndeb1,ii) - xv1(ndeb1+nb_faces,ii)) > erreur )
675 erreur = std::fabs(xv1(ndeb1,ii) - xv1(ndeb1+nb_faces,ii));
676 //
677 // The error tolerance is 1.e-5 times the maximum distance between two boundary faces
678 erreur *=1.e-5;
679
680 //GF the reference for computing the error did not correspond to anything meaningful
681 // distance between the first face of the boundary and the face after the boundary?????
682
683
684
685
686 // PAT version
687 // error = Objet_U::precision_geom
688 connect_bords.resize(nb_faces);
689
690 //assert(la_front_vf2.nb_faces()==la_front_vf1.nb_faces());
691 //Cout << "nb faces = " << la_front_vf2.nb_faces() << finl;
692 //Cout << "nb faces = " << la_front_vf1.nb_faces() << finl;
693
694 // PQ : 06/08/07
695
696 int nb_faces1 = la_front_vf1.nb_faces();
697 int nb_faces2 = la_front_vf2.nb_faces();
698
699 if(nb_faces1!=nb_faces2)
700 {
701 Cerr << "Warning, the number of faces (" << nb_faces1 << ") on the boundary " << la_front_vf1.le_nom();
702 Cerr << " of the domain " << le_dom_dis1.domaine().le_nom() << finl;
703 Cerr << "is different of the number of faces (" << nb_faces2 << ") on the boundary " << la_front_vf2.le_nom();
704 Cerr << " of the domain " << le_dom_dis2.domaine().le_nom() << " ..." << finl;
705 Cerr << "The exchange condition with the paroi_contact can't succeed!" << finl;
706 Nom fichier="connectivity_failed_";
707 Nom fichier_med="connectivity_failed_";
708 Nom nom_pb;
709 if(nb_faces1>nb_faces2)
710 {
711 nom_pb=nom_pb2;
712 fichier+=nom_bord2;
713 fichier_med+=nom_pb;
714 fichier_med+=".med";
715 connectivity_failed(le_dom_dis1, nb_faces1, ndeb1, le_dom_dis2, nb_faces2, ndeb2, fichier, fichier_med);
716 }
717 else
718 {
719 nom_pb=nom_pb1;
720 fichier+=nom_bord1;
721 fichier_med+=nom_pb;
722 fichier_med+=".med";
723 connectivity_failed(le_dom_dis2, nb_faces2, ndeb2, le_dom_dis1, nb_faces1, ndeb1, fichier, fichier_med);
724 }
725 Cerr << "Boundaries " << nom_bord1 << " from problem " << nom_pb1 << finl;
726 Cerr << " and " << nom_bord2 << " from problem " << nom_pb2 << finl;
727 Cerr << "have not the same number of faces." << finl;
728 Cerr << "Coincidence between meshes may be recovered " << finl;
729 Cerr << "by cutting mesh associated to " << nom_pb << finl;
730 Cerr << "thanks to decouper_bord_coincident keyword or HOMARD tool (see reference manual)." << finl;
731 exit();
732 }
733
734
735
736 // PQ : 03/03 : redefinition of the connectivity array
737 // "optimized" process applicable to any configuration type
738
739 temoin_tot=0;
740
741 for (i=0; i<nb_faces; i++)
742 {
743
744 // redefine the error for each face as:
745 // find the element associated to the face, compute the min distance from the element centroid
746 // to its faces -> d1
747 // d1*1e-2
748 int elem_voisin=face_voisin(ndeb1+i,0);
749 if (elem_voisin==-1)
750 elem_voisin=face_voisin(ndeb1+i,1);
751 int nbf=elem_faces.dimension(1);
752 double d1=DMAXFLOAT;
753 for (int f=0; f<nbf; f++)
754 {
755 int f2=elem_faces(elem_voisin,f);
756 if (dimension==2)
757 d1=std::min(d1,distance_2D(f2,elem_voisin,le_dom_dis1));
758 else
759 d1=std::min(d1,distance_3D(f2,elem_voisin,le_dom_dis1));
760 }
761 erreur=d1*1e-2;
762 temoin=0;
763 for (j=i; j<nb_faces; j++)
764 {
765 // O.C. : use dimension rather than dim1 in the following loop:
766 // for (k=0 ; k<dim1 ; k++)
767 for (k=0 ; k<dimension ; k++)
768 if (std::fabs(xv1(ndeb1+i,k) - xv2(ndeb2+j,k)) > erreur) break;
769 // If the above test is passed, then the dim coordinates of the face
770 // are the same (d == dim)
771 if (k==dimension)
772 {
773
774 /** if (j==1)
775 {
776 Cout << "connect i j " << i << " " << j << finl;
777 Cout << "xv i j " << xv1(ndeb1+i,0) << " " << xv2(ndeb2+j,0) << finl;
778 Cout << "xv i j " << xv1(ndeb1+i,1) << " " << xv2(ndeb2+j,1) << finl;
779 Cout << "xv i j " << xv1(ndeb1+i,2) << " " << xv2(ndeb2+j,2) << finl;
780 Cout << "err i j " << std::fabs(xv1(ndeb1+i,0) - xv2(ndeb2+j,0)) << finl;
781 Cout << "err i j " << std::fabs(xv1(ndeb1+i,1) - xv2(ndeb2+j,1)) << finl;
782 Cout << "err i j " << std::fabs(xv1(ndeb1+i,2) - xv2(ndeb2+j,2)) << finl;
783 Cout << "error " << erreur << finl;
784 }*/
785 connect_bords(i)=j;
786 temoin=1;
787 break;
788 }
789 }
790 if(temoin==0)
791 for (j=0; j<i; j++)
792 {
793 for (k=0 ; k<dimension ; k++)
794 if (std::fabs(xv1(ndeb1+i,k) - xv2(ndeb2+j,k)) > erreur) break;
795
796 // If the above test is passed, then the dim coordinates of the face
797 // are the same (d == dim)
798 if (k==dimension)
799 {
800 /** if (j==1)
801 {
802 Cout << "connect i j " << i << " " << j << finl;
803 Cout << "xv i j " << xv1(ndeb1+i,0) << " " << xv2(ndeb2+j,0) << finl;
804 Cout << "xv i j " << xv1(ndeb1+i,1) << " " << xv2(ndeb2+j,1) << finl;
805 Cout << "xv i j " << xv1(ndeb1+i,2) << " " << xv2(ndeb2+j,2) << finl;
806 Cout << "err i j " << std::fabs(xv1(ndeb1+i,0) - xv2(ndeb2+j,0)) << finl;
807 Cout << "err i j " << std::fabs(xv1(ndeb1+i,1) - xv2(ndeb2+j,1)) << finl;
808 Cout << "err i j " << std::fabs(xv1(ndeb1+i,2) - xv2(ndeb2+j,2)) << finl;
809 Cout << "error " << erreur << finl;
810 }*/
811 connect_bords(i)=j;
812 temoin=1;
813 break;
814 }
815 }
816 if(temoin==0)
817 {
818 temoin_tot=1;
819 if(dimension==2)
820 Cerr<<" no connectivity found for face : "<<ndeb1+i<<" located at : x= "<<xv1(ndeb1+i,0)<<" y= "<<xv1(ndeb1+i,1)<<finl;
821 else
822 Cerr<<" no connectivity found for face : "<<ndeb1+i<<" located at : x= "<<xv1(ndeb1+i,0)<<" y= "<<xv1(ndeb1+i,1)<< " z= "<<xv1(ndeb1+i,2)<<finl;
823 }
824 }
825
826
827 if(temoin_tot==1)
828 {
829 Cerr<<" Process stopped at Champ_front_contact_VEF::remplir_connect_bords() "<<finl;
830 exit();
831 }
832 // Verify that a proper bijection has been created
833 ArrOfInt inv_connect_bords;
834 inv_connect_bords.resize_array(nb_faces, RESIZE_OPTIONS::NOCOPY_NOINIT);
835 inv_connect_bords=-1;
836 for (i=0; i<nb_faces; i++)
837 {
838 inv_connect_bords[connect_bords(i)]=i;
839 }
840 if (min_array(inv_connect_bords) < 0)
841 {
842 Cerr<<"Problem creating connect_bord: the mapping is not a bijection"<<finl;
843 Cerr<<"inverse array "<<inv_connect_bords<<finl;
844 Cerr<<"connect array "<<connect_bords<<finl;
845 exit();
846 }
847}
848
850{
851 const Domaine_Cl_VEF& la_zcl_dis1=ref_cast(Domaine_Cl_VEF, l_inconnue1->equation().domaine_Cl_dis());
852 const Conds_lim& conds_lim = la_zcl_dis1.les_conditions_limites();
853 int size_cl = conds_lim.size();
854 int size = elems_voisin_bord_.size();
855 int elem_vois, elem_vois_autre_fr;
856
857 // Loop over the boundary faces
858
859 int elem_vois_face_1, elem_vois_face_2;
860 faces_coin.resize(size);
861
862 for (int ind_face_1=0; ind_face_1<size; ind_face_1++)
863 {
864 elem_vois_face_1 = elems_voisin_bord_[ind_face_1];
865 for (int ind_face_2 =0; ind_face_2<size; ind_face_2++)
866 {
867 if (ind_face_1!=ind_face_2)
868 {
869 elem_vois_face_2 = elems_voisin_bord_[ind_face_2];
870 if ((elem_vois_face_1==elem_vois_face_2) && (elem_vois_face_1!=-1))
871 faces_coin(ind_face_1)=1;
872
873 }
874 }
875 }
876
877 // Also account for faces belonging to other boundaries
878 // that may belong to a corner element
879
880 for (int num_cl=0; num_cl<size_cl; num_cl++)
881 {
882 const Champ_front_base& ch_front = conds_lim[num_cl]->champ_front();
883 if (sub_type(Champ_front_contact_VEF,ch_front))
884 {
885 const Champ_front_contact_VEF& ch_front_contact = ref_cast(Champ_front_contact_VEF,ch_front);
886 const Nom& nom_bord_autre_fr = ch_front_contact.get_nom_bord1();
887
888 if (nom_bord1!=nom_bord_autre_fr)
889 {
890 const IntVect& elems_autre_fr = ch_front_contact.get_elems_voisin_bord();
891 int size_autre_fr = elems_autre_fr.size();
892 for (int ind_face =0; ind_face<size; ind_face++)
893 {
894 elem_vois = elems_voisin_bord_[ind_face];
895 for (int ind_face_autre_fr =0; ind_face_autre_fr<size_autre_fr; ind_face_autre_fr++)
896 {
897 elem_vois_autre_fr = elems_autre_fr[ind_face_autre_fr];
898 if ((elem_vois==elem_vois_autre_fr) && (elem_vois!=-1))
899 faces_coin(ind_face)=1;
900 }
901 }
902 }
903 }
904 }
905}
906
908{
909 const Domaine_VEF& le_dom_dis1=ref_cast(Domaine_VEF, l_inconnue1->domaine_dis_base());
910 int rang_front1 = le_dom_dis1.rang_frontiere(nom_bord1);
911 const Front_VF& la_front_vf1=ref_cast(Front_VF, le_dom_dis1.frontiere_dis(rang_front1));
912 const IntTab& face_voisins1 = le_dom_dis1.face_voisins();
913 int nb_faces = la_front_vf1.nb_faces();
914 int ndeb = la_front_vf1.num_premiere_face();
915
916 int voisin_0, voisin_1;
917 int elem_vois;
918 elems_voisin_bord_.resize(nb_faces);
920
921 for (int face=0; face<nb_faces; face++)
922 {
923 elem_vois=-1;
924 voisin_0 = face_voisins1(ndeb+face,0);
925 voisin_1 = face_voisins1(ndeb+face,1);
926
927 if (voisin_0!=-1)
928 elem_vois=voisin_0;
929 else
930 elem_vois=voisin_1;
931 elems_voisin_bord_(face) = elem_vois;
932 }
933
934}
936{
937 const Domaine_VEF& le_dom_dis1=ref_cast(Domaine_VEF, l_inconnue1->domaine_dis_base());
938 const DoubleTab& xv1 = le_dom_dis1.xv();
939 const Domaine_Cl_VEF& la_zcl_dis1=ref_cast(Domaine_Cl_VEF, l_inconnue1->equation().domaine_Cl_dis());
940 const Conds_lim& conds_lim = la_zcl_dis1.les_conditions_limites();
941 int size_cl = conds_lim.size();
942
943 const Nom& nom_dom = l_inconnue1->equation().probleme().domaine().le_nom();
944 int erreur = 0;
945 for (int num_cl=0; num_cl<size_cl; num_cl++)
946 {
947 const Champ_front_base& ch_front = conds_lim[num_cl]->champ_front();
948 if (sub_type(Champ_front_contact_VEF,ch_front))
949 {
950 const Champ_front_contact_VEF& ch_front_contact = ref_cast(Champ_front_contact_VEF,ch_front);
951 const Nom& nom_bord_fr = ch_front_contact.get_nom_bord1();
952 int rang_front_fr = le_dom_dis1.rang_frontiere(nom_bord_fr);
953 const Front_VF& la_front_vf_fr = ref_cast(Front_VF, le_dom_dis1.frontiere_dis(rang_front_fr));
954 int ndeb_fr = la_front_vf_fr.num_premiere_face();
955 const IntVect& faces_coin_fr = ch_front_contact.get_faces_coin();
956
957 for (int i=0; i<faces_coin_fr.size(); i++)
958 {
959 if (faces_coin_fr(i)!=0)
960 {
961 erreur =1;
962 Cerr<<"The following face of boundary "<<nom_bord_fr<<" is a corner face for domain "<<nom_dom<<finl;
963 for (int k=0; k<dimension; k++)
964 Cerr<<"x_"<<k<<" "<<xv1(ndeb_fr+i,k)<<finl;
965 }
966 }
967 }
968 }
969 if (erreur)
970 {
971 Cerr<<"The Champ_front_contact_VEF implementation is not available for this situation"<<finl;
972 Cerr<<"Split the affected mesh cell(s) using the VerifierCoin interpreter"<<finl;
973 Cerr<<"or using Trianguler_H in 2D or Tetraedriser_homogene in 3D"<<finl;
974 //exit();
975 }
976}
977
978void Champ_front_contact_VEF::connectivity_failed(const Domaine_VEF& zvef1, int& nb_faces1, int& ndeb1,
979 const Domaine_VEF& zvef2, int& nb_faces2, int& ndeb2,
980 Nom& fichier, Nom& fichier_med)
981{
982
983 const IntTab& face_voisin2 = zvef2.face_voisins();
984 const IntTab& elem_faces2 = zvef2.elem_faces();
985 int nb_elem2 = zvef2.nb_elem();
986
987 const DoubleTab& xv1 = zvef1.xv();
988
989 int nbf = dimension+1; // number of faces per element
990 int fac,elem,face1,face2,elem2,trouve;
991 int j;
992
993 // Create the P0 field
994
996 chp.associer_domaine_dis_base(zvef2);
997 chp.dimensionner(nb_elem2,1);
998 chp.fixer_nb_comp(1);
999 chp.nommer("Raccord_Homard");
1000 DoubleTab& chp_val = chp.valeurs();
1001
1002 chp_val=0.;
1003
1004
1005 for (fac=0; fac<nb_faces1; fac++)
1006 {
1007 face1=fac+ndeb1;
1008
1009 elem2=-1;
1010
1011 if (dimension==2) elem2 = zvef2.domaine().chercher_elements(xv1(face1,0),xv1(face1,1));
1012 else elem2 = zvef2.domaine().chercher_elements(xv1(face1,0),xv1(face1,1),xv1(face1,2));
1013
1014 if(elem2==-1)
1015 {
1016 Cerr << "Problem searching for the associated element!" << finl;
1017 exit();
1018 }
1019
1020 chp_val(elem2)++;
1021 }
1022
1023 /////////////////////////////////////////////////////////
1024 // Write the Connectivity_failed file for mesh splitting
1025 // using the Decouper_Bord_coincident interpreter
1026 /////////////////////////////////////////////////////////
1027
1028 SFichier fic(fichier);
1029 fic << nb_faces2 << finl;
1030 fic << nb_faces1 << finl;
1031
1032 for (fac=0; fac<nb_faces2; fac++)
1033 {
1034 face2=fac+ndeb2;
1035 elem2=face_voisin2(face2,0);
1036 if (elem2==-1) elem2=face_voisin2(face2,1);
1037
1038 // find the local index of the face
1039 trouve=0;
1040 for(j=0; j<nbf; j++)
1041 if(face2==elem_faces2(elem2,j))
1042 {
1043 trouve=1;
1044 break;
1045 }
1046
1047 if(trouve==0)
1048 {
1049 Cerr << "Problem searching for the local index!" << finl;
1050 exit();
1051 }
1052
1053 fic << chp_val(elem2) << " " << fac << " " << elem2 << " " << j << finl;
1054 }
1055
1056 fic <<(int) -1;
1057 // force write to disk
1058 fic.close();
1059 /////////////////////////////////////////////////////////
1060 // Write the MED file for mesh splitting using HOMARD
1061 /////////////////////////////////////////////////////////
1062
1063 // renormalize chp_val
1064
1065 for (elem=0; elem<nb_elem2; elem++)
1066 {
1067 if(chp_val(elem)==(2*(dimension-1))) chp_val(elem)=1;
1068 else chp_val(elem)=0;
1069 }
1070 Nom bis(fichier_med);
1071 bis+="_index";
1072 fichier_med.prefix(".med");
1073 const Domaine& dom2 = zvef2.domaine();
1074 Noms unites_(1);
1075 unites_[0]="1";
1076 Noms nom_compos(1);
1077 nom_compos[0]=chp.le_nom();
1078 Format_Post_Med post;
1079 post.initialize_by_default(fichier_med);
1080 post.ecrire_domaine(dom2,1);
1081 post.ecrire_champ(dom2,unites_,nom_compos,-1, 0., chp.le_nom(), dom2.le_nom(), Motcle("elem"), "scalar",chp_val);
1082 post.ecrire_champ(dom2,unites_,nom_compos,-1, 0., chp.le_nom(), dom2.le_nom(), Motcle("elem"), "scalar",chp_val);
1083}
class Ch_front_var_instationnaire_dep This abstract class represents a field on a boundary,
int initialiser(double temps, const Champ_Inc_base &inco) override
Initialization at the beginning of calculation.
void dimensionner(int, int)
Sets the number of components and the number of nodal values.
DoubleTab & valeurs() override
Overrides Champ_base::valeurs() Returns the array of values.
class Champ_Fonc_P0_VEF
void associer_domaine_dis_base(const Domaine_dis_base &) override
Class Champ_Inc_base.
const Domaine_dis_base & domaine_dis_base() const override
DoubleTab & valeurs() override
Returns the array of field values at the current time.
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_base Base class for the hierarchy of boundary fields.
virtual const Frontiere_dis_base & frontiere_dis() const
Returns the discretized boundary associated with the field.
class Champ_front_contact_VEF Enables scalar coupling (temperature or concentration) between problems...
const IntVect & get_elems_voisin_bord() const
virtual void calcul_grads_transf(double temps)
const Equation_base & equation() const
void calculer_coeffs_echange(double temps) override
DOES NOTHING, to override. This method can calculate and store useful data for the.
void creer(const Nom &, const Nom &, const Nom &, const Nom &, const Motcle &)
virtual void calcul_grads_locaux(double temps)
const Domaine_Cl_dis_base & domaine_Cl_dis() const
void connectivity_failed(const Domaine_VEF &, int &, int &, const Domaine_VEF &, int &, int &, Nom &, Nom &)
const Frontiere_dis_base & front_dis() const
void verifier_scalaire_bord(double temps)
Champ_front_base & affecter_(const Champ_front_base &ch) override
void mettre_a_jour(double temps) override
DOES NOTHING, to override.
DoubleVect & trace_face_raccord(const Front_VF &fr_vf, const DoubleVect &y, DoubleVect &x)
void associer_ch_inc_base(const Champ_Inc_base &)
OBS_PTR(Champ_Inc_base) l_inconnue1
const IntVect & get_faces_coin() const
int initialiser(double temps, const Champ_Inc_base &inco) override
Initialization at the beginning of calculation.
const Domaine_dis_base & domaine_dis() const override
const Champ_Inc_base & inconnue() const
const Milieu_base & milieu() const
class Champ_front_contact_fictif_VEF Derived class from Champ_front_contact_VEF, which itself derives...
DoubleTab & valeurs_au_temps(double temps) override
Returns the values at the desired time.
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.
Champ_front_base & champ_front()
class Conds_lim This class represents a vector of boundary conditions.
Definition Conds_lim.h:32
Represents the constituent(s) of a fluid.
Definition Constituant.h:30
Convection_Diffusion_Concentration Special case of Convection_Diffusion_std.
SmallArrOfTID_t & chercher_elements(const DoubleTab &pos, SmallArrOfTID_t &elem, int reel=0) const
Searches for the elements containing the points whose coordinates are specified.
Definition Domaine.cpp:404
int nb_faces_elem(int=0) const
Returns the number of faces of type i of the geometric elements that make up the domain.
Definition Domaine.h:484
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
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_VEF
Definition Domaine_VEF.h:53
virtual const DoubleVect & face_surfaces() const
Definition Domaine_VF.h:51
virtual double face_normales(int face, int comp) const
Definition Domaine_VF.h:47
double xv(int num_face, int k) const
Definition Domaine_VF.h:76
double volumes(int i) const
Definition Domaine_VF.h:113
Frontiere_dis_base & frontiere_dis(int) override
Returns the i-th discrete boundary.
Definition Domaine_VF.h:630
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
int oriente_normale(int f, int e) const
Definition Domaine_VF.h:194
int face_voisins(int num_face, int i) const
Returns the neighbouring element of num_face in direction i.
Definition Domaine_VF.h:418
const Front_VF & front_VF(int i) const
Definition Domaine_VF.h:112
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
const Frontiere_dis_base & frontiere_dis(const Nom &) const
Returns the boundary of Name nom.
int rang_frontiere(const Nom &)
const Domaine & domaine() const
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
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 RefObjU & get_modele(Type_modele type) const
virtual const Champ_Inc_base & inconnue() const =0
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.
virtual void fixer_nb_comp(int i)
Sets the number of components of the field.
const Nom & le_nom() const override
Returns the name of the field.
void nommer(const Nom &) override
Gives a name to the field.
: Post-processing class for Eulerian fields in MED format.
int ecrire_domaine(const Domaine &domaine, const int est_le_premier_post) override
Writing a mesh.
int initialize_by_default(const Nom &file_basename) override
Initializes the class with default parameters.
int ecrire_champ(const Domaine &domaine, const Noms &unite_, const Noms &noms_compo, int ncomp, double temps_, const Nom &id_du_champ, const Nom &id_du_domaine, const Nom &localisation, const Nom &nature, const DoubleTab &data) override
voir Format_Post_base::ecrire_champ
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
virtual void trace_face_distant(const DoubleTab &, DoubleTab &) const
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
Definition Frontiere.h:49
int_t nb_faces() const
Returns the number of faces of the boundary.
Definition Frontiere.h:59
class Frontiere_dis_base Class representing a discretized boundary.
const Frontiere & frontiere() const
Returns the associated geometric boundary.
const Domaine_dis_base & domaine_dis() const
const Nom & le_nom() const override
Returns the name of the geometric boundary.
static Objet_U & objet(const Nom &)
See Interprete_bloc::objet_global(). BM: the Interprete class is not the best place for this.
Milieu_base This class is the base of the (physical) medium hierarchy.
Definition Milieu_base.h:50
virtual const Equation_base & equation(const std::string &nom_inc) const
virtual const Champ_Don_base & conductivite() const
Returns the conductivity of the medium (const version).
virtual const Champ_Don_base & diffusivite() const
Returns the diffusivity of the medium (const version).
Base class for scalar turbulence models coupled to a Navier-Stokes convection-diffusion equation.
const Champ_Fonc_base & conductivite_turbulente() const
const Turbulence_paroi_scal_base & loi_paroi() const
Returns the scalar wall-law turbulence model (const version).
int loi_paroi_non_nulle() const
Returns whether a wall law is set (const version).
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
Definition MorEqn.h:62
A character string (Nom) in uppercase.
Definition Motcle.h:26
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
Nom & prefix(const char *const)
Definition Nom.cpp:324
const Nom & le_nom() const override
Returns *this.
Definition Nom.cpp:555
An array of character strings (VECT(Nom)).
Definition Noms.h:26
static int dimension
Definition Objet_U.h:94
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
Class Pb_Conduction: represents a heat conduction problem with non-uniform rho and Cp:
class Probleme_base It is a Probleme_U that is not a coupling.
const Champ_base & get_champ(const Motcle &nom) const override
virtual const Equation_base & equation(int) const =0
static bool is_parallel()
Definition Process.cpp:108
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
void initialise(const Frontiere_t &, const Domaine_dis_base &, const Domaine_dis_base &)
SFichier is to the C++ ofstream class what Sortie is to the C++ ostream class.
Definition SFichier.h:29
Base class for output streams.
Definition Sortie.h:52
void resize_array(_SIZE_ new_size, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
int nb_dim() const
Definition TRUSTTab.h:199
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133
_SIZE_ size() const
Definition TRUSTVect.tpp:45
void resize(_SIZE_, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
Definition TRUSTVect.tpp:91
const Objet_U & valeur() const
Definition TRUST_Ref.h:134
Base class for the hierarchy of scalar wall-law models computing turbulent quantities near walls....
virtual bool use_equivalent_distance() const
Give a boolean indicating if we need to use equivant distance by default we consider that we use the ...
const DoubleVects & equivalent_distance() const