TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Op_Diff_RotRot.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 <Champ_P1_isoP1Bulle.h>
17#include <LecFicDistribueBin.h>
18#include <Matrice_Morse_Sym.h>
19#include <Champ_Uniforme.h>
20#include <Op_Diff_RotRot.h>
21
22#include <Domaine_Cl_VEF.h>
23
24#include <SFichier.h>
25#include <Solv_GCP.h>
26#include <SSOR.h>
27
28Implemente_instanciable(Op_Diff_RotRot, "Op_Diff_VEF_ROTROT_P1NC", Operateur_Diff_base);
29
30Sortie& Op_Diff_RotRot::printOn(Sortie& s) const { return s << que_suis_je(); }
31
32Entree& Op_Diff_RotRot::readOn(Entree& s) { return s; }
33
34const Domaine_VEF& Op_Diff_RotRot::domaine_vef() const { return ref_cast(Domaine_VEF, le_dom_vef.valeur()); }
35
36void Op_Diff_RotRot::associer(const Domaine_dis_base& domaine_dis, const Domaine_Cl_dis_base& domaine_Cl_dis, const Champ_Inc_base& inco)
37{
38 const Domaine_VEF& zvef = ref_cast(Domaine_VEF, domaine_dis);
39 const Domaine_Cl_VEF& zclvef = ref_cast(Domaine_Cl_VEF, domaine_Cl_dis);
40 le_dom_vef = zvef;
41 la_zcl_vef = zclvef;
42
43 curl_.associer(domaine_dis, domaine_Cl_dis, inco);
44 rot_.associer(domaine_dis, domaine_Cl_dis, inco);
45
46 //////////////////////////////////////////////
47 // Define the vorticity field
48 vorticite_.typer("Champ_P1_isoP1Bulle");
49 Champ_P1_isoP1Bulle& vorticite = ref_cast(Champ_P1_isoP1Bulle, vorticite_.valeur());
50
51 vorticite.associer_domaine_dis_base(zvef);
52 vorticite.nommer("vorticite");
53
54 if (dimension == 2)
55 vorticite.fixer_nb_comp(1);
56 else
57 vorticite.fixer_nb_comp(dimension);
58
59 int nb_tot = zvef.nb_elem() + zvef.nb_som() - 1;
60 vorticite.fixer_nb_valeurs_nodales(nb_tot);
61
62 vorticite.fixer_unite("s-1");
63
64 //////////////////////////////////////////////////
65
66 solveur_.typer("Solv_GCP");
68 p.typer("SSOR");
69 ref_cast(Solv_GCP,solveur.valeur()).set_precond(p);
71 tester();
72
73}
74
75DoubleTab& Op_Diff_RotRot::calculer(const DoubleTab& vitesse, DoubleTab& diffusion) const
76{
77 diffusion = 0;
78 return ajouter(vitesse, diffusion);
79}
80
81//Method of the diffusion operator in the form
82//curl of the vorticity without const — the only one that
83//should be called.
84DoubleTab& Op_Diff_RotRot::ajouter(const DoubleTab& vitesse, DoubleTab& diffusion) const
85{
86 Cerr << "entering OpDiffRotRot" << finl;
87 DoubleTab curl(matrice_vorticite_->ordre());
88
89 curl_.calculer(vitesse, curl);
90 //curl=-1*curl;
91 calculer_vorticite(vorticite_->valeurs(), curl);
92 rot_.calculer(vorticite_->valeurs(), diffusion);
93
94 Cerr << "je sors de OpDiffRotRot" << finl;
95
96 return diffusion;
97
98}
99
100int Op_Diff_RotRot::calculer_vorticite(DoubleTab& solution, const DoubleTab& curl) const
101{
102 const Domaine& domaine = domaine_vef().domaine();
103 //static int nb_appel2=0;
104
105 // Vorticity resolution: only sequential case is considered for now.
106 // For the parallel case, the approach used in class N_S.cpp should be followed.
107
109 {
110 // The vorticity matrix is treated as a Morse matrix
111 // by default, and the inverse() method is applied
112 // to solve the linear system.
113 const Matrice_Morse_Sym& la_matrice = ref_cast(Matrice_Morse_Sym, matrice_vorticite_.valeur());
114 // Matrice_Morse& la_matrice = (Matrice_Morse&) matrice_vorticite_.valeur();
115 DoubleTab solution_temporaire(la_matrice.ordre());
116
117 assert(solution_temporaire.size() == solution.size() - 1);
118 assert(curl.size() == solution_temporaire.size());
119
120 // Solve the linear system to compute the vorticity.
121 // The vorticity is then stored in the variable solution.
122 // la_matrice.inverse(curl,solution_temporaire,1e-15);
123 Solv_GCP& solv = ref_cast_non_const(Solv_GCP, solveur_.valeur());
124 solv.set_seuil(1e-17);
125 solv.resoudre_systeme(la_matrice, curl, solution_temporaire);
126
127 // Copy values from solution_temporaire into solution.
128 // One slot is not filled yet: it is done later.
129 for (int i = 0; i < solution_temporaire.size(); i++)
130 solution[i] = solution_temporaire[i];
131
132 // Fill in the last entry of "solution"
133 int sommet = domaine.nb_som() - 1;
134
135 for (int i = 0; i < curl_.elem_som_size(sommet); i++)
136 solution[sommet] += solution_temporaire[curl_.elements_pour_sommet(sommet, i)];
137
138 //nb_appel2++;
139
140 }
141
142 return 1;
143}
144
145//////////////////////////////////////////////////////
146/* Functions for assembling the vorticity matrix */
147/////////////////////////////////////////////////////
148/* Compute the vorticity matrix for the triple problem:
149 / we consider the case without boundary conditions for the vorticity
150 / for the moment, and the parallel part of the algorithm is not coded.
151 / REM: currently only works in 2D
152 */
154{
155 const Domaine& domaine = domaine_vef().domaine();
156
157 int colonne_a_remplir_tab2, colonne_a_remplir_coeff;
158
159 Cerr << "Assembling the vorticity matrix..." << finl;
160 matrice.typer("Matrice_Morse_Sym");
161 //Matrice_Morse& la_matrice=(Matrice_Morse&) matrice.valeur();
162
163 // Size the matrix appropriately.
164 // The matrix is square of size (nb_elem + nb_som).
165 // The number of non-zero coefficients does not exceed
166 // (2*(dimension+1) + 1)*nb_elem + (nb_som-1)*(nb_som-1).
167 // NOTE: a BASIS of our space consists of element indicator functions
168 // + hat functions - 1 of those functions.
169 // Otherwise the sum of all hat functions - the sum
170 // of all indicator functions = 0.
171 // By default we remove the last hat function to
172 // to form our basis.
173 // Cf. Paper in Latex/Vorticity
174 int nombre_coeff_non_nuls = (2 * dimension + 3) * domaine.nb_elem() + (domaine.nb_som() - 1) * (domaine.nb_som() - 1);
175 //la_matrice.dimensionner(domaine.nb_elem()+domaine.nb_som()-1,nombre_coeff_non_nuls);
176 Matrice_Morse la_matrice(domaine.nb_elem() + domaine.nb_som() - 1, nombre_coeff_non_nuls);
177
178 // In case the matrix already exists in a file
179 Nom nomfic("Vorticite.sv");
180 LecFicDistribueBin vorticite;
181 int fic_vorticite_existe;
182
183 if (vorticite.ouvrir(nomfic))
184 fic_vorticite_existe = 1;
185 else
186 fic_vorticite_existe = 0;
187
188 if (fic_vorticite_existe)
189 {
190 Cerr << "Reading the vorticity matrix from file: " << nomfic << finl;
191 vorticite >> la_matrice;
192 vorticite.close();
193 Cerr << "Done reading the vorticity matrix." << finl;
194 return 1;
195 }
196
197 Cerr << "Assembling the vorticity matrix " << nomfic << finl;
198
199 // Now fill the matrix row by row.
200 // Elements and vertices are numbered starting from 0.
201 // However, column and row indices of the arrays
202 // in a FORTRAN Morse matrix start at 1.
203 // Construction example: matrice[C++ index] = FORTRAN index
204
205 // Key parameters for filling the arrays
206 nombre_coeff_non_nuls = 1;
207 colonne_a_remplir_tab2 = 0; // for C++
208 colonne_a_remplir_coeff = 0; // for C++
209
210 // Start by filling the rows of the sub-matrix
211 // of size nb_elem * (nb_elem + nb_som): cf. matrix structure
212 for (int numero_elem = 0; numero_elem < domaine.nb_elem(); numero_elem++)
213 {
214 // For a given element "numero_elem", compute the list
215 // of vertices belonging to that element.
216 IntList sommets_pour_elem = sommets_pour_element(numero_elem);
217 Tri(sommets_pour_elem); //sorted array
218
219 // Fill tab1
220 la_matrice.get_set_tab1()(numero_elem) = nombre_coeff_non_nuls;
221
222 // Fill tab2 and coeff
223
224 // The nb_elem first entries of row "numero_elem" (FORTRAN indexing)
225 la_matrice.get_set_tab2()(colonne_a_remplir_tab2) = numero_elem + 1;
226 la_matrice.get_set_coeff()(colonne_a_remplir_coeff) = remplir_elem_elem_EF(numero_elem);
227
228 // Increment nb_coeff_non_nuls because one non-zero entry was just filled
229 nombre_coeff_non_nuls++;
230
231 // Increment column counters since array slots were just filled
232 colonne_a_remplir_tab2++;
233 colonne_a_remplir_coeff++;
234
235 // The nb_som entries of row "numero_elem"
236 for (int i = 0; i < domaine.nb_som_elem(); i++)
237 {
238 // If "sommet_pour_elem[i]" differs from the index of the last vertex,
239 // store the correct coefficient
240 if (sommets_pour_elem[i] != domaine.nb_som() - 1)
241 {
242 la_matrice.get_set_tab2()(colonne_a_remplir_tab2) = domaine.nb_elem() + sommets_pour_elem[i] + 1; //for FORTRAN indexing
243 la_matrice.get_set_coeff()(colonne_a_remplir_coeff) = remplir_elem_som_EF(numero_elem, sommets_pour_elem[i]);
244
245 // Increment nb_coeff_non_nuls since one non-zero entry was just filled
246 nombre_coeff_non_nuls++;
247
248 // Increment colonne_* to avoid overwriting already stored coefficients
249 colonne_a_remplir_tab2++;
250 colonne_a_remplir_coeff++;
251 }
252
253 }
254
255 // No need to modify the integers nombre_coeff_non_nuls and
256 // colonne_*: they are already at the correct value.
257
258 }
259
260 // Fill the rows of the sub-matrix of size
261 // nb_som * (nb_elem + nb_som): cf. matrix structure
262 for (int numero_som = 0; numero_som < domaine.nb_som() - 1; numero_som++)
263 {
264 // Store the arrays we need along with their respective sizes
265 IntList Elem_pour_sommet = elements_pour_sommet(numero_som);
266 IntList Sommets_voisins = sommets_voisins(numero_som, Elem_pour_sommet);
267 Tri(Elem_pour_sommet); //liste triee
268 Tri(Sommets_voisins); //liste triee
269
270 // Fill tab1 (FORTRAN indexing)
271 la_matrice.get_set_tab1()(domaine.nb_elem() + numero_som) = nombre_coeff_non_nuls;
272
273 // Fill tab2 and coeff
274
275 // The nb_elem first entries of row "numero_som"
276 for (int i = 0; i < Elem_pour_sommet.size(); i++)
277 {
278 // FORTRAN indexing
279 la_matrice.get_set_tab2()(colonne_a_remplir_tab2) = Elem_pour_sommet[i] + 1;
280 la_matrice.get_set_coeff()(colonne_a_remplir_coeff) = remplir_som_elem_EF(Elem_pour_sommet[i], numero_som);
281
282 // Increment nb_coeff_non_nuls since one non-zero entry was just filled
283 nombre_coeff_non_nuls++;
284
285 // Increment column indices accordingly
286 colonne_a_remplir_tab2++;
287 colonne_a_remplir_coeff++;
288 }
289
290 // No need to modify nb_coeff_non_nuls and colonne_*: they are at the correct value.
291
292 // The nb_som entries of row "numero_som"
293 for (int i = 0; i < Sommets_voisins.size(); i++)
294 {
295 // Retrieve the global index of the neighbouring vertex
296 int numero_som_global = Sommets_voisins[i];
297
298 // If "numero_som_global" differs from the index of the last vertex,
299 // store the correct coefficient
300
301 if (numero_som_global != domaine.nb_som() - 1)
302 {
303 // FORTRAN indexing
304 la_matrice.get_set_tab2()(colonne_a_remplir_tab2) = domaine.nb_elem() + Sommets_voisins[i] + 1;
305 la_matrice.get_set_coeff()(colonne_a_remplir_coeff) = remplir_som_som_EF(numero_som, Sommets_voisins[i], Elem_pour_sommet);
306
307 // Increment nb_coeff_non_nuls since one non-zero entry was just filled
308 nombre_coeff_non_nuls++;
309
310 // Increment indices
311 colonne_a_remplir_tab2++;
312 colonne_a_remplir_coeff++;
313 }
314
315 }
316
317 // No need to increment nombre_coeff_non_nuls and colonne_*:
318 // they are already at the correct value.
319 }
320
321 // By convention for Morse matrices, the last entry
322 // of tab1 is tab1[nb_elem + nb_som + 1] and equals
323 // the total number of non-zero coefficients + 1,
324 // i.e. with our algorithm: nombre_coeff_non_nuls
325 la_matrice.get_set_tab1()(domaine.nb_elem() + domaine.nb_som() - 1) = nombre_coeff_non_nuls;
326
327 // if(Debog::mode_db==2) Debog::save_matrix_seq(la_matrice);
328 // else if(Debog::mode_db==3)
329 // Debog::save_and_distribute_matrix_seq(la_matrice);
330
331 Matrice_Morse_Sym& la_matrice_sym = ref_cast(Matrice_Morse_Sym, matrice.valeur());
332 la_matrice_sym = la_matrice;
333
334 Cerr << "Fin de l'assemblage de la matrice de vorticite. " << finl;
335
336 return 1;
337}
338
339/* For a given element "numero_elem", returns */
340/* the list of vertices belonging to that element */
341IntList Op_Diff_RotRot::sommets_pour_element(int numero_elem) const
342{
343 IntList resultat;
344 int numero_global_sommet = 0;
345 const Domaine& domaine = domaine_vef().domaine();
346
347 // As a precaution but normally not needed
348 if (!resultat.est_vide())
349 resultat.vide();
350
351 for (int i = 0; i < domaine.nb_som_elem(); i++)
352 {
353 numero_global_sommet = domaine.sommet_elem(numero_elem, i);
354 resultat.add_if_not(numero_global_sommet);
355 }
356
357 return resultat;
358}
359
360/* For a given vertex "numero_sommet", returns */
361/* the list of elements containing that vertex */
362IntList Op_Diff_RotRot::elements_pour_sommet(int numero_sommet) const
363{
364 IntList resultat;
365 int numero_global_som;
366 const Domaine& domaine = domaine_vef().domaine();
367
368 // As a precaution but normally not needed
369 if (!resultat.est_vide())
370 resultat.vide();
371
372 // Not very efficient but works regardless of the dimension:
373 // loop over elements, check for each element
374 // its vertices, then compare those vertices to the input parameter;
375 // if one of them coincides with the input parameter, store the element.
376 for (int numero_elem = 0; numero_elem < domaine.nb_elem(); numero_elem++)
377 for (int numero_som = 0; numero_som < domaine.nb_som_elem(); numero_som++)
378 {
379 numero_global_som = domaine.sommet_elem(numero_elem, numero_som);
380 if (numero_sommet == numero_global_som)
381 resultat.add_if_not(numero_elem);
382 }
383
384 return resultat;
385
386}
387
388/* For a given vertex "numero_sommet", returns */
389/* the list of neighbouring vertices of "numero_sommet" */
390/* Parameter: the list of elements containing "numero_sommet" */
391/* Search within these elements to obtain the result */
392/* NOTE: the result list contains the vertex "numero_sommet" itself */
393IntList Op_Diff_RotRot::sommets_voisins(int numero_sommet, const IntList& liste) const
394{
395 IntList resultat;
396 int numero_global_som;
397 const Domaine& domaine = domaine_vef().domaine();
398
399 //Retrieve the vertices of the elements in "liste"
400 //then compare them to "numero_som" and keep them
401 //without duplicates.
402 for (int numero_elem_loc = 0; numero_elem_loc < liste.size(); numero_elem_loc++)
403 for (int numero_som = 0; numero_som < domaine.nb_som_elem(); numero_som++)
404 {
405 numero_global_som = domaine.sommet_elem(liste[numero_elem_loc], numero_som);
406 resultat.add_if_not(numero_global_som); //contains "numero_sommet"
407 }
408
409 // Cerr << "Affichage de sommets_voisins pour numero_som " << numero_sommet
410 // << finl;
411 // for (int i=0;i<resultat.size();i++)
412 // Cerr << resultat[i] << finl;
413
414 return resultat;
415}
416
417/* Sorting function for an IntList */
418/* The sort is performed in ascending order */
419/* REM: there are no duplicates in the sorted list */
420void Op_Diff_RotRot::Tri(IntList& liste_a_trier) const
421{
422 if (liste_a_trier.est_vide())
423 {
424 Cerr << "Error in Op_Diff_RotRot::Tri()." << finl;
425 Cerr << "The list to sort is empty: exiting." << finl;
427 }
428
429 IntList temporaire;
430 int minimum;
431
432 while (!liste_a_trier.est_vide())
433 {
434 minimum = liste_a_trier[0];
435
436 for (int i = 0; i < liste_a_trier.size(); i++)
437 minimum = (minimum <= liste_a_trier[i] ? minimum : liste_a_trier[i]);
438
439 temporaire.add_if_not(minimum);
440 liste_a_trier.suppr(minimum);
441 }
442
443 for (int i = 0; i < temporaire.size(); i++)
444 liste_a_trier.add_if_not(temporaire[i]);
445
446}
447
448/* For element "numero_elem", returns the coefficient */
449/* to place in the nb_elem * nb_elem sub-matrix */
450/* at row "numero_elem", column "numero_elem" */
451/* EF matrix */
452double Op_Diff_RotRot::remplir_elem_elem_EF(const int numero_elem) const
453{
454 return 1. * domaine_vef().volumes(numero_elem);
455}
456
457/* For element "numero_elem", returns the coefficient */
458/* to place in the nb_elem * nb_som sub-matrix */
459/* at row "numero_elem", column "numero_som" */
460/* EF matrix */
461double Op_Diff_RotRot::remplir_elem_som_EF(const int numero_elem, const int numero_som) const
462{
463 return (1. * domaine_vef().volumes(numero_elem) / (dimension + 1));
464}
465
466/* For vertex "numero_som", returns the coefficient */
467/* to place in the nb_som * nb_elem sub-matrix */
468/* at row "numero_som", column "numero_elem" */
469/* EF matrix */
470double Op_Diff_RotRot::remplir_som_elem_EF(const int numero_elem, const int numero_som) const
471{
472 return (1. * domaine_vef().volumes(numero_elem) / (dimension + 1));
473}
474
475/* For vertex "numero_som", returns the coefficient */
476/* to place in the nb_som * nb_som sub-matrix */
477/* at row "numero_som", column "sommet_voisin" */
478/* "elem_voisins" is the array of elements containing "numero_som" */
479/* EF matrix */
480double Op_Diff_RotRot::remplir_som_som_EF(const int numero_som, const int sommet_voisin, const IntList& elem_voisins) const
481{
482 double resultat = 0.;
483 int test = 0;
484
485 //First test: if numero_som == sommet_voisin
486 //then we can immediately return the result
487 if (numero_som == sommet_voisin)
488 {
489 for (int i = 0; i < elem_voisins.size(); i++)
490 {
491 resultat += domaine_vef().volumes(elem_voisins[i]);
492 }
493
494 //Account for the spatial dimension
495 resultat *= 2. / ((dimension + 1) * (dimension + 2));
496
497 return resultat;
498 }
499
500 //Sinon:
501 // Compute the contribution to the result
502
503 for (int i = 0; i < elem_voisins.size(); i++)
504 {
505 if (sommets_pour_element(elem_voisins[i]).contient(sommet_voisin))
506 {
507 resultat += domaine_vef().volumes(elem_voisins[i]);
508 test++;
509 }
510 }
511
512 //Account for the spatial dimension
513 resultat *= 1. / ((dimension + 1) * (dimension + 2));
514
515 //Verify that sommet_voisin was indeed in the neighbourhood of numero_voisin
516 if (test == 0)
517 {
518 Cerr << "Error in Op_Diff_RotRot::remplir_som_som_EF." << finl;
519 Cerr << "sommet_voisin is not in the neighbourhood of numero_voisin." << finl;
520 Cerr << "Exiting." << finl;
522 }
523
524 return resultat;
525
526}
527
528DoubleTab Op_Diff_RotRot::vecteur_normal(const int face, const int elem) const
529{
530 assert(dimension == 2);
531
532 const Domaine_VEF& domaine_VEF = le_dom_vef.valeur();
533 DoubleTab le_vecteur_normal(dimension);
534
535 for (int composante = 0; composante < dimension; composante++)
536
537 le_vecteur_normal(composante) = domaine_VEF.face_normales(face, composante) * domaine_VEF.oriente_normale(face, elem);
538
539 return le_vecteur_normal;
540}
541
543{
544 // const Domaine& domaine = domaine_Vef().domaine();
545
546 // if (vorticite_->nb_valeurs_nodales() !=
547 // domaine.nb_elem()+domaine.nb_som()-1 )
548 // {
549 // Cerr << "Probleme dans la definition de la vorticite." << finl;
550 // Cerr << "The number of registered components is incorrect." << finl;
551 // Process::exit();
552 // }
553
554 //Test the vorticity matrix
555 const Matrice_Morse_Sym& la_matrice = ref_cast(Matrice_Morse_Sym, matrice_vorticite_.valeur());
556 Solv_GCP& solv = ref_cast_non_const(Solv_GCP, solveur_.valeur());
557
558 DoubleTab resultat(la_matrice.ordre());
559 //DoubleTab resultat1(la_matrice.ordre());
560 DoubleTab secmem(la_matrice.ordre());
561 DoubleTab secmem1(la_matrice.ordre());
562 secmem = 0.;
563 secmem[0] = -0.25;
564 secmem[4] = -0.0833333;
565 secmem[5] = -0.0833333;
566 secmem1 = 1e-10 + 1e-15;
567
568 SFichier fic("Matrice.test");
569 la_matrice.imprimer_formatte(fic);
570
571 resultat = 0.;
572 solv.set_seuil(1e-17);
573 solv.resoudre_systeme(la_matrice, secmem, resultat);
574 Cerr << "Resultat de l'inversion" << finl;
575 for (int i = 0; i < 8; i++)
576 Cerr << resultat[i] << " ; ";
577 Cerr << finl;
578
579 solv.resoudre_systeme(la_matrice, secmem1, resultat);
580 Cerr << "Resultat de l'inversion" << finl;
581 for (int i = 0; i < 8; i++)
582 Cerr << resultat[i] << " ; ";
583 Cerr << finl;
584
585 return 1;
586}
587
589{
590 diffusivite_ = ref_cast(Champ_Uniforme, diffu);
591}
592
594{
595 return diffusivite_;
596}
Class Champ_Inc_base.
void associer_domaine_dis_base(const Domaine_dis_base &) override
int fixer_nb_valeurs_nodales(int) override
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 Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
class Domaine_VEF
Definition Domaine_VEF.h:53
virtual double face_normales(int face, int comp) const
Definition Domaine_VF.h:47
double volumes(int i) const
Definition Domaine_VF.h:113
int oriente_normale(int f, int e) const
Definition Domaine_VF.h:194
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
const Domaine & domaine() const
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual void fixer_nb_comp(int i)
Sets the number of components of the field.
void nommer(const Nom &) override
Gives a name to the field.
virtual const Nom & fixer_unite(const Nom &)
Specifies the unit of a scalar field or whose all components have the same unit.
Reading from a file in binary format.
int ouvrir(const char *name, IOS_OPEN_MODE mode=ios::in) override
Opens the file with the given mode and prot parameters. These parameters are the parameters of the st...
Matrice_Morse_Sym class - Represents a sparse symmetric matrix M stored in Morse format.
Sortie & imprimer_formatte(Sortie &s) const override
Matrice_Morse class - Represents a (sparse) matrix M, not necessarily square,.
auto & get_set_tab2()
int ordre() const override
Returns the order of the matrix: - the number of rows if the matrix is square.
auto & get_set_coeff()
auto & get_set_tab1()
Matrice class - Generic class in the matrix hierarchy.
Definition Matrice.h:34
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
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
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
double remplir_elem_som_EF(const int numero_elem, const int numero_som) const
IntList sommets_voisins(int numero_som, const IntList &liste) const
DoubleTab & calculer(const DoubleTab &, DoubleTab &) const override
void Tri(IntList &liste_a_trier) const
IntList elements_pour_sommet(int numero_som) const
Op_Rot_VEFP1B rot_
void associer(const Domaine_dis_base &, const Domaine_Cl_dis_base &, const Champ_Inc_base &) override
const Domaine_VEF & domaine_vef() const
DoubleTab vecteur_normal(const int face, const int elem) const
DoubleTab & ajouter(const DoubleTab &, DoubleTab &) const override
void associer_diffusivite(const Champ_base &) override
int assembler_matrice(Matrice &)
double remplir_elem_elem_EF(const int numero_elem) const
const Champ_base & diffusivite() const override
Matrice matrice_vorticite_
double remplir_som_som_EF(const int numero_som, const int sommet_voisin, const IntList &) const
OWN_PTR(Champ_Inc_base) vorticite_
SolveurSys solveur_
double remplir_som_elem_EF(const int numero_elem, const int numero_som) const
IntList sommets_pour_element(int numero_elem) const
int calculer_vorticite(DoubleTab &, const DoubleTab &) const
Op_Curl_VEFP1B curl_
Operateur_Diff_base This class is the base of the hierarchy of operators representing.
SolveurSys solveur
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
static bool is_sequential()
Definition Process.cpp:113
SFichier is to the C++ ofstream class what Sortie is to the C++ ostream class.
Definition SFichier.h:29
int resoudre_systeme(const Matrice_Base &, const DoubleVect &, DoubleVect &) override
Definition Solv_GCP.cpp:111
Base class for output streams.
Definition Sortie.h:52
int est_vide() const
TRUSTList & add_if_not(_TYPE_)
Ajout d'un element a la liste ssi il n'existe pas deja.
void suppr(_TYPE_)
Supprime un element contenu dans la liste.
void vide()
Vide la liste.
int size() const
Definition TRUSTList.h:68
_SIZE_ size() const
Definition TRUSTVect.tpp:45
void set_seuil(double s)