TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Cut_field.cpp
1/****************************************************************************
2* Copyright (c) 2019, 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 <Cut_field.h>
17#include <IJK_Interfaces.h>
18#include <Cut_cell_FT_Disc.h>
19#include <IJK_Navier_Stokes_tools.h>
20#include <IJK_Field.h>
21
22template<typename _TYPE_, typename _TYPE_ARRAY_>
26
27
28template<typename _TYPE_, typename _TYPE_ARRAY_>
30{
32 diph_l_.echange_espace_virtuel();
33 diph_v_.echange_espace_virtuel();
34}
35
36template<typename _TYPE_, typename _TYPE_ARRAY_>
38{
39 for (int n = 0; n < cut_cell_disc_->get_n_loc(); n++)
40 {
41 Int3 ijk = cut_cell_disc_->get_ijk(n);
42 int i = ijk[0];
43 int j = ijk[1];
44 int k = ijk[2];
45
46 diph_l_(n) = pure_(i,j,k);
47 diph_v_(n) = pure_(i,j,k);
48 }
49 diph_l_.echange_espace_virtuel();
50 diph_v_.echange_espace_virtuel();
51}
52
53template<typename _TYPE_, typename _TYPE_ARRAY_>
55{
56 if (!cut_cell_disc_)
57 {
58 // Si le champ n'est pas initialise, c'est normal de ne pas avoir de cut_cell_disc et on ne fait rien
62 }
63 else
64 {
66
67 int statut_diphasique_monophasique = static_cast<int>(Cut_cell_FT_Disc::STATUT_DIPHASIQUE::MONOPHASIQUE);
68 int statut_diphasique_naissant = static_cast<int>(Cut_cell_FT_Disc::STATUT_DIPHASIQUE::NAISSANT);
69 assert(statut_diphasique_naissant == statut_diphasique_monophasique + 1);
70 int index_min = cut_cell_disc_->get_statut_diphasique_value_index(statut_diphasique_monophasique);
71 int index_max = cut_cell_disc_->get_statut_diphasique_value_index(statut_diphasique_naissant+1);
72 for (int index = index_min; index < index_max; index++)
73 {
74 int n = cut_cell_disc_->get_n_from_statut_diphasique_index(index);
75
76 Int3 ijk = cut_cell_disc_->get_ijk(n);
77 int i = ijk[0];
78 int j = ijk[1];
79 int k = ijk[2];
80
81 if (!cut_cell_disc_->get_domaine().within_ghost(i, j, k, IJK_Field_template<_TYPE_,_TYPE_ARRAY_>::ghost(), IJK_Field_template<_TYPE_,_TYPE_ARRAY_>::ghost()))
82 continue;
83
84 double old_indicatrice = cut_cell_disc_->get_interfaces().I(i,j,k);
85
86 // On garde les donnees de l'ancienne phase pour la nouvelle cellule_diphasique
87 int ancienne_phase = IJK_Interfaces::convert_indicatrice_to_phase(old_indicatrice);
88 if (ancienne_phase == 1)
89 {
90 diph_l_(n) = pure_(i,j,k);
91 }
92 else if (ancienne_phase == 0)
93 {
94 diph_v_(n) = pure_(i,j,k);
95 }
96 }
97 }
98}
99
100template<typename _TYPE_, typename _TYPE_ARRAY_>
102{
103 int statut_diphasique_monophasique = static_cast<int>(Cut_cell_FT_Disc::STATUT_DIPHASIQUE::MONOPHASIQUE);
104 int statut_diphasique_naissant = static_cast<int>(Cut_cell_FT_Disc::STATUT_DIPHASIQUE::NAISSANT);
105 assert(statut_diphasique_naissant == statut_diphasique_monophasique + 1);
106 int index_min = cut_cell_disc_->get_statut_diphasique_value_index(statut_diphasique_monophasique);
107 int index_max = cut_cell_disc_->get_statut_diphasique_value_index(statut_diphasique_naissant+1);
108 for (int index = index_min; index < index_max; index++)
109 {
110 int n = cut_cell_disc_->get_n_from_statut_diphasique_index(index);
111
112 Int3 ijk = cut_cell_disc_->get_ijk(n);
113 int i = ijk[0];
114 int j = ijk[1];
115 int k = ijk[2];
116
117 if (!cut_cell_disc_->get_domaine().within_ghost(i, j, k, IJK_Field_template<_TYPE_,_TYPE_ARRAY_>::ghost(), IJK_Field_template<_TYPE_,_TYPE_ARRAY_>::ghost()))
118 continue;
119
120 double indicatrice = cut_cell_disc_->get_interfaces().I(i,j,k);
121 assert(cut_cell_disc_->get_interfaces().est_pure(indicatrice));
122 // On garde les donnees de la cellule diphasique pour pure
123 int phase_pure = IJK_Interfaces::convert_indicatrice_to_phase(indicatrice);
124 double diph_value = (phase_pure == 0) ? diph_v_(n) : diph_l_(n);
125 if (diph_value != pure_(i,j,k))
126 {
127 assert(0);
128 return 0;
129 }
130 }
131
132 return 1;
133}
134
135template<typename _TYPE_, typename _TYPE_ARRAY_>
137{
138 int statut_diphasique_mourrant = static_cast<int>(Cut_cell_FT_Disc::STATUT_DIPHASIQUE::MOURRANT);
139 int statut_diphasique_monophasique = static_cast<int>(Cut_cell_FT_Disc::STATUT_DIPHASIQUE::MONOPHASIQUE);
140 assert(statut_diphasique_monophasique == statut_diphasique_mourrant + 1);
141 int index_min = cut_cell_disc_->get_statut_diphasique_value_index(statut_diphasique_mourrant);
142 int index_max = cut_cell_disc_->get_statut_diphasique_value_index(statut_diphasique_monophasique+1);
143 for (int index = index_min; index < index_max; index++)
144 {
145 int n = cut_cell_disc_->get_n_from_statut_diphasique_index(index);
146
147 Int3 ijk = cut_cell_disc_->get_ijk(n);
148 int i = ijk[0];
149 int j = ijk[1];
150 int k = ijk[2];
151
152 if (!cut_cell_disc_->get_domaine().within_ghost(i, j, k, IJK_Field_template<_TYPE_,_TYPE_ARRAY_>::ghost(), IJK_Field_template<_TYPE_,_TYPE_ARRAY_>::ghost()))
153 continue;
154
155 double indicatrice = cut_cell_disc_->get_interfaces().In(i,j,k); // Note : In car on est avant l'inversion
156 assert(cut_cell_disc_->get_interfaces().est_pure(indicatrice));
157 // On garde les donnees de la cellule diphasique pour pure
158 int phase_pure = IJK_Interfaces::convert_indicatrice_to_phase(indicatrice);
159 double diph_value = (phase_pure == 0) ? diph_v_(n) : diph_l_(n);
160 if (diph_value != pure_(i,j,k))
161 {
162 assert(0);
163 return 0;
164 }
165 }
166
167 return 1;
168}
169
170template<typename _TYPE_, typename _TYPE_ARRAY_>
172{
173 if (!cut_cell_disc_)
174 {
175 // Si le champ n'est pas initialise, c'est normal de ne pas avoir de cut_cell_disc et on ne fait rien
179 }
180 else
181 {
182 int statut_diphasique_mourrant = static_cast<int>(Cut_cell_FT_Disc::STATUT_DIPHASIQUE::MOURRANT);
183 int statut_diphasique_monophasique = static_cast<int>(Cut_cell_FT_Disc::STATUT_DIPHASIQUE::MONOPHASIQUE);
184 assert(statut_diphasique_monophasique == statut_diphasique_mourrant + 1);
185 int index_min = cut_cell_disc_->get_statut_diphasique_value_index(statut_diphasique_mourrant);
186 int index_max = cut_cell_disc_->get_statut_diphasique_value_index(statut_diphasique_monophasique+1);
187 for (int index = index_min; index < index_max; index++)
188 {
189 int n = cut_cell_disc_->get_n_from_statut_diphasique_index(index);
190
191 Int3 ijk = cut_cell_disc_->get_ijk(n);
192 int i = ijk[0];
193 int j = ijk[1];
194 int k = ijk[2];
195
196 if (!cut_cell_disc_->get_domaine().within_ghost(i, j, k, IJK_Field_template<_TYPE_,_TYPE_ARRAY_>::ghost(), IJK_Field_template<_TYPE_,_TYPE_ARRAY_>::ghost()))
197 continue;
198
199 double indicatrice = cut_cell_disc_->get_interfaces().In(i,j,k);
200 assert(cut_cell_disc_->get_interfaces().est_pure(indicatrice));
201 // On garde les donnees de la cellule diphasique pour pure
202 int phase_pure = IJK_Interfaces::convert_indicatrice_to_phase(indicatrice);
203 _TYPE_ diph_value = (phase_pure == 0) ? diph_v_(n) : diph_l_(n);
204 if (diph_value != pure_(i,j,k))
205 {
206 pure_(i,j,k) = diph_value;
207 }
208 }
209 }
210}
211
212template<typename _TYPE_, typename _TYPE_ARRAY_>
214{
215 if (!cut_cell_disc_)
216 {
217 // Si le champ n'est pas initialise, c'est normal de ne pas avoir de cut_cell_disc et on ne fait rien
221 }
222 else
223 {
224 int statut_diphasique_mourrant = static_cast<int>(Cut_cell_FT_Disc::STATUT_DIPHASIQUE::MOURRANT);
225 int statut_diphasique_monophasique = static_cast<int>(Cut_cell_FT_Disc::STATUT_DIPHASIQUE::MONOPHASIQUE);
226 assert(statut_diphasique_monophasique == statut_diphasique_mourrant + 1);
227 int index_min = cut_cell_disc_->get_statut_diphasique_value_index(statut_diphasique_mourrant);
228 int index_max = cut_cell_disc_->get_statut_diphasique_value_index(statut_diphasique_monophasique+1);
229 for (int index = index_min; index < index_max; index++)
230 {
231 int n = cut_cell_disc_->get_n_from_statut_diphasique_index(index);
232
233 Int3 ijk = cut_cell_disc_->get_ijk(n);
234 int i = ijk[0];
235 int j = ijk[1];
236 int k = ijk[2];
237
238 if (!cut_cell_disc_->get_domaine().within_ghost(i, j, k, IJK_Field_template<_TYPE_,_TYPE_ARRAY_>::ghost(), IJK_Field_template<_TYPE_,_TYPE_ARRAY_>::ghost()))
239 continue;
240
241 double next_indicatrice = cut_cell_disc_->get_interfaces().In(i,j,k);
242
243 int phase_valide = IJK_Interfaces::convert_indicatrice_to_phase(next_indicatrice);
244 if (phase_valide == 1)
245 {
246 //assert(std::abs(diph_v_(n)) < 1e-12);
247 diph_v_(n) = 0.;
248 }
249 else if (phase_valide == 0)
250 {
251 //assert(std::abs(diph_l_(n)) < 1e-12);
252 diph_l_(n) = 0.;
253 }
254 }
255 }
256}
257
258template<>
260{
261 for (int n = 0; n < cut_cell_disc_->get_n_loc(); n++)
262 {
263 Int3 ijk = cut_cell_disc_->get_ijk(n);
264 int i = ijk[0];
265 int j = ijk[1];
266 int k = ijk[2];
267
268 double indicatrice = next_time ? cut_cell_disc_->get_interfaces().In(i,j,k) : cut_cell_disc_->get_interfaces().I(i,j,k);
269
270 if (diph_l_(n) == diph_v_(n))
271 {
272 if (pure_(i,j,k) != diph_l_(n))
273 {
274 assert(0);
275 return 0;
276 }
277 }
278 else
279 {
280 if (pure_(i,j,k) != indicatrice*diph_l_(n) + (1 - indicatrice)*diph_v_(n))
281 {
282 assert(0);
283 return 0;
284 }
285 }
286 }
287
288 return 1;
289}
290
291template<>
293{
294 for (int n = 0; n < cut_cell_disc_->get_n_loc(); n++)
295 {
296 Int3 ijk = cut_cell_disc_->get_ijk(n);
297 int i = ijk[0];
298 int j = ijk[1];
299 int k = ijk[2];
300
301 double indicatrice = next_time ? cut_cell_disc_->get_interfaces().In(i,j,k) : cut_cell_disc_->get_interfaces().I(i,j,k);
302
303 if (diph_l_(n) == diph_v_(n))
304 {
305 // The average based on the indicatrice does not guarantee the property pure_(i,j,k) = diph_l_(n) in the case diph_l_(n) == diph_v_(n).
306 pure_(i,j,k) = diph_l_(n);
307 }
308 else
309 {
310 pure_(i,j,k) = indicatrice*diph_l_(n) + (1 - indicatrice)*diph_v_(n);
311 }
312 }
314}
315
316template<>
318{
319 for (int n = 0; n < cut_cell_disc_->get_n_loc(); n++)
320 {
321 Int3 ijk = cut_cell_disc_->get_ijk(n);
322 int i = ijk[0];
323 int j = ijk[1];
324 int k = ijk[2];
325
326 if (diph_l_(n) == diph_v_(n))
327 {
328 // The average based on the indicatrice does not guarantee the property pure_(i,j,k) = diph_l_(n) in the case diph_l_(n) == diph_v_(n).
329 pure_(i,j,k) = diph_l_(n);
330 }
331 else
332 {
333 pure_(i,j,k) = std::max(diph_l_(n), diph_v_(n));
334 }
335 }
337}
338
339
340template<>
341void Cut_field_template<double,ArrOfDouble>::set_field_data(const Nom& parser_expression_of_x_y_z_and_t, const IJK_Field_template<double,ArrOfDouble>& input_f, const double current_time)
342{
343 ArrOfDouble coord_i, coord_j, coord_k;
344 build_local_coords(*this, coord_i, coord_j, coord_k);
345
349
350 std::string expr(parser_expression_of_x_y_z_and_t);
351 Parser parser;
352 parser.setString(expr);
353 parser.setNbVar(5);
354 parser.addVar("x");
355 parser.addVar("y");
356 parser.addVar("z");
357 parser.addVar("t");
358 parser.addVar("ff");
359 parser.parseString();
360 parser.setVar(3, current_time);
361 for (int k = 0; k < nk; k++)
362 {
363 double z = coord_k[k];
364 parser.setVar(2, z);
365 for (int j = 0; j < nj; j++)
366 {
367 double y = coord_j[j];
368 parser.setVar(1, y);
369 for (int i = 0; i < ni; i++)
370 {
371 double x = coord_i[i];
372 parser.setVar((int) 0, x);
373
374 int n = cut_cell_disc_->get_n(i, j, k);
375 if (n >= 0)
376 {
377 double vol_l = input_f(i, j, k);
378
379 double dx = cut_cell_disc_->get_domaine().get_constant_delta(DIRECTION_I);
380 double dy = cut_cell_disc_->get_domaine().get_constant_delta(DIRECTION_J);
381 double dz = cut_cell_disc_->get_domaine().get_constant_delta(DIRECTION_K);
382
383 assert(input_f.get_localisation() == localisation_);
384 double bary_x = cut_cell_disc_->get_interfaces().get_barycentre_phase1_next()[0](i,j,k);
385 double bary_y = cut_cell_disc_->get_interfaces().get_barycentre_phase1_next()[1](i,j,k);
386 double bary_z = cut_cell_disc_->get_interfaces().get_barycentre_phase1_next()[2](i,j,k);
387
388 parser.setVar((int) 0, x + (bary_x - .5)*dx);
389 parser.setVar(1, y + (bary_y - .5)*dy);
390 parser.setVar(2, z + (bary_z - .5)*dz);
391 parser.setVar(4, 1.);
392 diph_l_(n) = (vol_l > 0)*parser.eval();
393
394 double opposing_bar_x = IJK_Interfaces::opposing_barycentre(bary_x, vol_l);
395 double opposing_bar_y = IJK_Interfaces::opposing_barycentre(bary_y, vol_l);
396 double opposing_bar_z = IJK_Interfaces::opposing_barycentre(bary_z, vol_l);
397
398 parser.setVar((int) 0, x + (opposing_bar_x - .5)*dx);
399 parser.setVar(1, y + (opposing_bar_y - .5)*dy);
400 parser.setVar(2, z + (opposing_bar_z - .5)*dz);
401 parser.setVar(4, 0.);
402 diph_v_(n) = (vol_l < 1)*parser.eval();
403
404 // Re-setting the Cartesian coordinates into the parser
405 parser.setVar((int) 0, x);
406 parser.setVar(1, y);
407 parser.setVar(2, z);
408 }
409 else
410 {
411 parser.setVar(4, input_f(i, j, k));
412 pure_(i, j, k) = parser.eval();
413 assert((input_f(i, j, k) == 0.) || (input_f(i, j, k) == 1.));
414 }
415 }
416 }
417 }
419}
420
421template<>
422void Cut_field_template<double,ArrOfDouble>::dumplata_scalar(const char *filename, int step) const
423{
426 this_non_const->remplir_tableau_pure_cellules_diphasiques(true);
427
429
430 this_non_const->cut_cell_disc_->fill_buffer_with_variable(diph_l_);
431 this_non_const->cut_cell_disc_->get_write_buffer().nommer(this->le_nom() + "_CUT_L");
432 this_non_const->cut_cell_disc_->get_write_buffer().dumplata_scalar(filename, step);
433
434 this_non_const->cut_cell_disc_->fill_buffer_with_variable(diph_v_);
435 this_non_const->cut_cell_disc_->get_write_buffer().nommer(this->le_nom() + "_CUT_V");
436 this_non_const->cut_cell_disc_->get_write_buffer().dumplata_scalar(filename, step);
437
438}
439template<>
440void Cut_field_template<int,ArrOfInt>::dumplata_scalar(const char *filename, int step) const
441{
442 Cerr << "not implemented"<<finl;
443 throw;
444
445}
446
447template<typename _TYPE_, typename _TYPE_ARRAY_>
449{
451 for (int n = 0; n < cut_cell_disc_->get_n_tot(); n++)
452 {
453 diph_l_(n) = valeur;
454 diph_v_(n) = valeur;
455 }
456}
457
458
459template<typename _TYPE_, typename _TYPE_ARRAY_>
461{
462 cut_cell_disc_ = cut_cell_disc;
463 diph_l_.associer_persistant(cut_cell_disc_, 1);
464 diph_v_.associer_persistant(cut_cell_disc_, 1);
465}
466
467template<typename _TYPE_, typename _TYPE_ARRAY_>
469{
470 cut_cell_disc_ = cut_cell_disc;
471 diph_l_.associer_ephemere(cut_cell_disc_, 1);
472 diph_v_.associer_ephemere(cut_cell_disc_, 1);
473}
474
475template<typename _TYPE_, typename _TYPE_ARRAY_>
477{
478 cut_cell_disc_ = cut_cell_disc;
479 diph_l_.associer_paresseux(cut_cell_disc_, 1);
480 diph_v_.associer_paresseux(cut_cell_disc_, 1);
481}
482
483template<typename _TYPE_, typename _TYPE_ARRAY_>
485{
490 assert(ni == data.ni());
491 assert(nj == data.nj());
492 assert(nk == data.nk());
493 assert(data.ghost() >= ghost);
494 for (int k = -ghost; k < nk+ghost; k++)
495 {
496 for (int j = -ghost; j < nj+ghost; j++)
497 {
498 for (int i = -ghost; i < ni+ghost; i++)
499 {
500 pure_(i,j,k) = data.pure_(i,j,k);
501 }
502 }
503 }
504 for (int n = 0; n < cut_cell_disc_->get_n_tot(); n++)
505 {
506 diph_l_(n) = data.diph_l_(n);
507 diph_v_(n) = data.diph_v_(n);
508 }
509}
510
511template<typename _TYPE_, typename _TYPE_ARRAY_>
513{
514 assert(constant == 1 || constant == -1);
515 const int ni = data.ni();
516 const int nj = data.nj();
517 const int nk = data.nk();
521
523 if (ghost <= data.ghost())
524 {
525 for (int k = -ghost; k < nk+ghost; k++)
526 {
527 for (int j = -ghost; j < nj+ghost; j++)
528 {
529 for (int i = -ghost; i < ni+ghost; i++)
530 {
531 pure_(i,j,k) += constant*data.pure_(i,j,k);
532 }
533 }
534 }
535 }
536 else
537 {
538 for (int k = 0; k < nk; k++)
539 {
540 for (int j = 0; j < nj; j++)
541 {
542 for (int i = 0; i < ni; i++)
543 {
544 pure_(i,j,k) += constant*data.pure_(i,j,k);
545 }
546 }
547 }
549 }
550
551 for (int n = 0; n < cut_cell_disc_->get_n_tot(); n++)
552 {
553 diph_l_(n) += constant*data.diph_l_(n);
554 diph_v_(n) += constant*data.diph_v_(n);
555 }
556}
557
558template<typename _TYPE_, typename _TYPE_ARRAY_>
560{
561 const int ni = data_1.ni();
562 const int nj = data_1.nj();
563 const int nk = data_1.nk();
564 assert(ni == data_2.ni());
565 assert(nj == data_2.nj());
566 assert(nk == data_2.nk());
570
572 if (ghost <= data_1.ghost() && ghost <= data_2.ghost())
573 {
574 for (int k = -ghost; k < nk+ghost; k++)
575 {
576 for (int j = -ghost; j < nj+ghost; j++)
577 {
578 for (int i = -ghost; i < ni+ghost; i++)
579 {
580 pure_(i,j,k) = data_1.pure_(i,j,k) + data_2.pure_(i,j,k);
581 }
582 }
583 }
584 }
585 else
586 {
587 for (int k = 0; k < nk; k++)
588 {
589 for (int j = 0; j < nj; j++)
590 {
591 for (int i = 0; i < ni; i++)
592 {
593 pure_(i,j,k) = data_1.pure_(i,j,k) + data_2.pure_(i,j,k);
594 }
595 }
596 }
598 }
599
600 for (int n = 0; n < cut_cell_disc_->get_n_tot(); n++)
601 {
602 diph_l_(n) = data_1.diph_l_(n) + data_2.diph_l_(n);
603 diph_v_(n) = data_1.diph_v_(n) + data_2.diph_v_(n);
604 }
605}
606
607template<typename _TYPE_, typename _TYPE_ARRAY_>
609{
610 bool liquid = (signed_independent_index < 0);
611 int independent_index = Cut_field_template<_TYPE_,_TYPE_ARRAY_>::domaine_ref_->get_independent_index_from_signed_independent_index(signed_independent_index);
612 Int3 ijk = Cut_field_template<_TYPE_,_TYPE_ARRAY_>::domaine_ref_->get_ijk_from_independent_index(independent_index);
613 int i = ijk[0];
614 int j = ijk[1];
615 int k = ijk[2];
616 int n = cut_cell_disc_->get_n(i,j,k);
617 assert((cut_cell_disc_->get_domaine() == Cut_field_template<_TYPE_,_TYPE_ARRAY_>::domaine_ref_));
618
619 _TYPE_& value = (liquid && n >= 0) ? diph_l_(n) : ((n < 0) ? pure_(i,j,k) : diph_v_(n));
620 return value;
621}
622
623template<typename _TYPE_, typename _TYPE_ARRAY_>
624const _TYPE_& Cut_field_template<_TYPE_,_TYPE_ARRAY_>::from_signed_independent_index(int signed_independent_index) const
625{
626 bool liquid = (signed_independent_index < 0);
627 int independent_index = Cut_field_template<_TYPE_,_TYPE_ARRAY_>::domaine_ref_->get_independent_index_from_signed_independent_index(signed_independent_index);
628 Int3 ijk = Cut_field_template<_TYPE_,_TYPE_ARRAY_>::domaine_ref_->get_ijk_from_independent_index(independent_index);
629 int i = ijk[0];
630 int j = ijk[1];
631 int k = ijk[2];
632 int n = cut_cell_disc_->get_n(i,j,k);
633 assert((cut_cell_disc_->get_domaine() == Cut_field_template<_TYPE_,_TYPE_ARRAY_>::domaine_ref_));
634
635 const _TYPE_& value = (liquid && n >= 0) ? diph_l_(n) : ((n < 0) ? pure_(i,j,k) : diph_v_(n));
636 return value;
637}
638
639template<typename _TYPE_, typename _TYPE_ARRAY_>
641{
642 assert((phase == 0) || (phase == 1));
643 assert((cut_cell_disc_->get_domaine() == Cut_field_template<_TYPE_,_TYPE_ARRAY_>::domaine_ref_));
644
645 int n = cut_cell_disc_->get_n(i, j, k);
646 if (n < 0)
647 {
648 return pure_(i, j, k);
649 }
650 else
651 {
652 return (phase == 0) ? diph_v_(n) : diph_l_(n);
653 }
654}
655
656template<typename _TYPE_, typename _TYPE_ARRAY_>
657const _TYPE_& Cut_field_template<_TYPE_,_TYPE_ARRAY_>::from_ijk_and_phase(int i, int j, int k, bool phase) const
658{
659 assert((phase == 0) || (phase == 1));
660 assert((cut_cell_disc_->get_domaine() == Cut_field_template<_TYPE_,_TYPE_ARRAY_>::domaine_ref_));
661
662 int n = cut_cell_disc_->get_n(i, j, k);
663 if (n < 0)
664 {
665 return pure_(i, j, k);
666 }
667 else
668 {
669 return (phase == 0) ? diph_v_(n) : diph_l_(n);
670 }
671}
672
673template<typename _TYPE_, typename _TYPE_ARRAY_>
675{
676 assert((phase == 0) || (phase == 1));
677 assert((cut_cell_disc_->get_domaine() == Cut_field_template<_TYPE_,_TYPE_ARRAY_>::domaine_ref_));
678
679 assert(n >= 0);
680 return (phase == 0) ? diph_v_(n) : diph_l_(n);
681}
682
683template<typename _TYPE_, typename _TYPE_ARRAY_>
684const _TYPE_& Cut_field_template<_TYPE_,_TYPE_ARRAY_>::from_n_num_face_and_phase(int n, int num_face, bool phase) const
685{
686 assert((phase == 0) || (phase == 1));
687 assert((cut_cell_disc_->get_domaine() == Cut_field_template<_TYPE_,_TYPE_ARRAY_>::domaine_ref_));
688
689 assert(n >= 0);
690 return (phase == 0) ? diph_v_(n) : diph_l_(n);
691}
692
693template<>
695{
696 double norm_overall = 0.;
697 double norm_overall_l = 0.;
698 double norm_overall_v = 0.;
699 double norm_pure = 0.;
700 double norm_diph_l = 0.;
701 double norm_diph_v = 0.;
702 double norm_diph_small = 0.;
703 double norm_diph_regular = 0.;
704 double norm_diph_nascent = 0.;
705 double norm_diph_dying = 0.;
706 double count_overall = 0.;
707 double count_overall_l = 0.;
708 double count_overall_v = 0.;
709 double count_pure = 0.;
710 double count_diph_l = 0.;
711 double count_diph_v = 0.;
712 double count_diph_small = 0.;
713 double count_diph_regular = 0.;
714 double count_diph_nascent = 0.;
715 double count_diph_dying = 0.;
716 const IJK_Field_template<double,ArrOfDouble>& indic_old = cut_cell_disc_->get_interfaces().I();
717 const IJK_Field_template<double,ArrOfDouble>& indic_next = cut_cell_disc_->get_interfaces().In();
721 for (int k=0; k < nz ; k++)
722 {
723 for (int j=0; j< ny; j++)
724 {
725 for (int i=0; i < nx; i++)
726 {
727 int n = cut_cell_disc_->get_n(i,j,k);
728 if (n < 0)
729 {
730 norm_overall += std::abs(pure_(i,j,k));
731 count_overall += 1;
732
733 norm_overall_l += (indic_old(i,j,k) == 0) ? 0. : std::abs(pure_(i,j,k));
734 count_overall_l += (indic_old(i,j,k) == 0) ? 0 : 1;
735
736 norm_overall_v += (indic_old(i,j,k) == 0) ? std::abs(pure_(i,j,k)) : 0.;
737 count_overall_v += (indic_old(i,j,k) == 0) ? 1 : 0;
738
739 norm_pure += std::abs(pure_(i,j,k));
740 count_pure += 1;
741 }
742 else if (IJK_Interfaces::est_pure(.5*(cut_cell_disc_->get_interfaces().I(i,j,k) + cut_cell_disc_->get_interfaces().In(i,j,k))))
743 {
744 bool phase_invalide_l = (indic_old(i,j,k) == 0);
745 if (phase_invalide_l && diph_l_(n) != 0.)
746 {
747 Cerr << "compute_d_norm_cut_cell: There is a non-zero diph_l_(" << n << ") in an invalid cell (in the non-existant phase of a purely monophasic cell)." << finl;
749 }
750
751 bool phase_invalide_v = (indic_old(i,j,k) == 1);
752 if (phase_invalide_v && diph_v_(n) != 0.)
753 {
754 Cerr << "compute_d_norm_cut_cell: There is a non-zero diph_v_(" << n << ") in an invalid cell (in the non-existant phase of a purely monophasic cell)." << finl;
756 }
757
758 norm_overall += (indic_old(i,j,k) == 0) ? std::abs(diph_v_(n)) : std::abs(diph_l_(n));
759 count_overall += 1;
760
761 norm_overall_l += (indic_old(i,j,k) == 0) ? 0. : std::abs(diph_l_(n));
762 count_overall_l += (indic_old(i,j,k) == 0) ? 0 : 1;
763
764 norm_overall_v += (indic_old(i,j,k) == 0) ? std::abs(diph_v_(n)) : 0.;
765 count_overall_v += (indic_old(i,j,k) == 0) ? 1 : 0;
766
767 norm_pure += (indic_old(i,j,k) == 0) ? std::abs(diph_v_(n)) : std::abs(diph_l_(n));
768 count_pure += 1;
769 }
770 else
771 {
772 double chi_T_l = std::abs(diph_l_(n));
773 double chi_T_v = std::abs(diph_v_(n));
774
775 norm_overall += chi_T_l;
776 norm_overall += chi_T_v;
777 count_overall += 1;
778
779 norm_overall_l += chi_T_l;
780 count_overall_l += 1;
781
782 norm_overall_v += chi_T_v;
783 count_overall_v += 1;
784
785 norm_diph_l += chi_T_l;
786 count_diph_l += 1;
787
788 norm_diph_v += chi_T_v;
789 count_diph_v += 1;
790
791 if (cut_cell_disc_->get_interfaces().devient_pure(i,j,k))
792 {
793 int phase_dying = IJK_Interfaces::convert_indicatrice_to_phase(1 - indic_next(i,j,k));
794 if (phase_dying == 1)
795 {
796 norm_diph_dying += chi_T_l;
797 count_diph_dying += 1;
798 }
799 else
800 {
801 norm_diph_dying += chi_T_v;
802 count_diph_dying += 1;
803 }
804 }
805 else if (cut_cell_disc_->get_interfaces().devient_diphasique(i,j,k))
806 {
807 int phase_nascent = IJK_Interfaces::convert_indicatrice_to_phase(1 - indic_old(i,j,k));
808 if (phase_nascent == 1)
809 {
810 norm_diph_nascent += chi_T_l;
811 count_diph_nascent += 1;
812 }
813 else
814 {
815 norm_diph_nascent += chi_T_v;
816 count_diph_nascent += 1;
817 }
818 }
819 else if (cut_cell_disc_->get_interfaces().next_below_small_threshold_for_phase(1, indic_old(i,j,k), indic_next(i,j,k)))
820 {
821 norm_diph_small += chi_T_l;
822 count_diph_small += 1;
823
824 norm_diph_regular += chi_T_v;
825 count_diph_regular += 1;
826 }
827 else if (cut_cell_disc_->get_interfaces().next_below_small_threshold_for_phase(0, indic_old(i,j,k), indic_next(i,j,k)))
828 {
829 norm_diph_small += chi_T_v;
830 count_diph_small += 1;
831
832 norm_diph_regular += chi_T_l;
833 count_diph_regular += 1;
834 }
835 else
836 {
837 norm_diph_regular += chi_T_l;
838 norm_diph_regular += chi_T_v;
839 count_diph_regular += 1;
840 }
841
842 }
843 }
844 }
845 }
846 count_overall = Process::mp_sum(count_overall);
847 count_overall_l = Process::mp_sum(count_overall_l);
848 count_overall_v = Process::mp_sum(count_overall_v);
849 count_pure = Process::mp_sum(count_pure);
850 count_diph_l = Process::mp_sum(count_diph_l);
851 count_diph_v = Process::mp_sum(count_diph_v);
852 count_diph_small = Process::mp_sum(count_diph_small);
853 count_diph_regular = Process::mp_sum(count_diph_regular);
854 count_diph_nascent = Process::mp_sum(count_diph_nascent);
855 count_diph_dying = Process::mp_sum(count_diph_dying);
856 assert(count_overall == domaine_ref_->get_nb_items_global(Domaine_IJK::ELEM, DIRECTION_I)
857 *domaine_ref_->get_nb_items_global(Domaine_IJK::ELEM, DIRECTION_J)
858 *domaine_ref_->get_nb_items_global(Domaine_IJK::ELEM, DIRECTION_K));
859 norm_overall = Process::mp_sum(norm_overall);
860 norm_overall_l = Process::mp_sum(norm_overall_l);
861 norm_overall_v = Process::mp_sum(norm_overall_v);
862 norm_pure = Process::mp_sum(norm_pure);
863 norm_diph_l = Process::mp_sum(norm_diph_l);
864 norm_diph_v = Process::mp_sum(norm_diph_v);
865 norm_diph_small = Process::mp_sum(norm_diph_small);
866 norm_diph_regular = Process::mp_sum(norm_diph_regular);
867 norm_diph_nascent = Process::mp_sum(norm_diph_nascent);
868 norm_diph_dying = Process::mp_sum(norm_diph_dying);
869
870 if (count_overall != 0) norm_overall /= count_overall;
871 if (count_overall_l != 0) norm_overall_l /= count_overall_l;
872 if (count_overall_v != 0) norm_overall_v /= count_overall_v;
873 if (count_pure != 0) norm_pure /= count_pure;
874 if (count_diph_l != 0) norm_diph_l /= count_diph_l;
875 if (count_diph_v != 0) norm_diph_v /= count_diph_v;
876 if (count_diph_small != 0) norm_diph_small /= count_diph_small;
877 if (count_diph_regular != 0) norm_diph_regular /= count_diph_regular;
878 if (count_diph_nascent != 0) norm_diph_nascent /= count_diph_nascent;
879 if (count_diph_dying != 0) norm_diph_dying /= count_diph_dying;
880
881 return {norm_overall, norm_overall_l, norm_overall_v, norm_pure, norm_diph_l, norm_diph_v, norm_diph_small, norm_diph_regular, norm_diph_nascent, norm_diph_dying};
882}
883
884template<>
886{
887 double global_energy_overall = 0.;
888 double global_energy_overall_l = 0.;
889 double global_energy_overall_v = 0.;
890 double global_energy_pure = 0.;
891 double global_energy_diph_l = 0.;
892 double global_energy_diph_v = 0.;
893 double global_energy_diph_small = 0.;
894 double global_energy_diph_regular = 0.;
895 double global_energy_diph_nascent = 0.;
896 double global_energy_diph_dying = 0.;
897 double count_overall = 0.;
898 double count_overall_l = 0.;
899 double count_overall_v = 0.;
900 double count_pure = 0.;
901 double count_diph_l = 0.;
902 double count_diph_v = 0.;
903 double count_diph_small = 0.;
904 double count_diph_regular = 0.;
905 double count_diph_nascent = 0.;
906 double count_diph_dying = 0.;
907 const IJK_Field_template<double,ArrOfDouble>& indic_old = cut_cell_disc_->get_interfaces().I();
908 const IJK_Field_template<double,ArrOfDouble>& indic_next = cut_cell_disc_->get_interfaces().In();
912 const Domaine_IJK& geom = indic_next.get_domaine();
913 assert(geom.get_constant_delta(DIRECTION_K) >0); // To be sure we're on a regular mesh
914 for (int k=0; k < nz ; k++)
915 {
916 for (int j=0; j< ny; j++)
917 {
918 for (int i=0; i < nx; i++)
919 {
920 int n = cut_cell_disc_->get_n(i,j,k);
921 if (n < 0)
922 {
923 global_energy_overall += pure_(i,j,k);
924 count_overall += 1;
925
926 global_energy_overall_l += (indic_old(i,j,k) == 0) ? 0. : pure_(i,j,k);
927 count_overall_l += (indic_old(i,j,k) == 0) ? 0 : 1;
928
929 global_energy_overall_v += (indic_old(i,j,k) == 0) ? pure_(i,j,k) : 0.;
930 count_overall_v += (indic_old(i,j,k) == 0) ? 1 : 0;
931
932 global_energy_pure += pure_(i,j,k);
933 count_pure += 1;
934 }
935 else if (IJK_Interfaces::est_pure(.5*(cut_cell_disc_->get_interfaces().I(i,j,k) + cut_cell_disc_->get_interfaces().In(i,j,k))))
936 {
937 bool phase_invalide_l = (indic_old(i,j,k) == 0);
938 if (phase_invalide_l && diph_l_(n) != 0.)
939 {
940 Cerr << "compute_d_global_energy_cut_cell: There is a non-zero diph_l_(" << n << ") in an invalid cell (in the non-existant phase of a purely monophasic cell)." << finl;
942 }
943
944 bool phase_invalide_v = (indic_old(i,j,k) == 1);
945 if (phase_invalide_v && diph_v_(n) != 0.)
946 {
947 Cerr << "compute_d_global_energy_cut_cell: There is a non-zero diph_v_(" << n << ") in an invalid cell (in the non-existant phase of a purely monophasic cell)." << finl;
949 }
950
951 global_energy_overall += (indic_old(i,j,k) == 0) ? diph_v_(n) : diph_l_(n);
952 count_overall += 1;
953
954 global_energy_overall_l += (indic_old(i,j,k) == 0) ? 0. : diph_l_(n);
955 count_overall_l += (indic_old(i,j,k) == 0) ? 0 : 1;
956
957 global_energy_overall_v += (indic_old(i,j,k) == 0) ? diph_v_(n) : 0.;
958 count_overall_v += (indic_old(i,j,k) == 0) ? 1 : 0;
959
960 global_energy_pure += (indic_old(i,j,k) == 0) ? diph_v_(n) : diph_l_(n);
961 count_pure += 1;
962 }
963 else
964 {
965 double chi_T_l = diph_l_(n);
966 double chi_T_v = diph_v_(n);
967
968 global_energy_overall += chi_T_l;
969 global_energy_overall += chi_T_v;
970 count_overall += 1;
971
972 global_energy_overall_l += chi_T_l;
973 count_overall_l += 1;
974
975 global_energy_overall_v += chi_T_v;
976 count_overall_v += 1;
977
978 global_energy_diph_l += chi_T_l;
979 count_diph_l += 1;
980
981 global_energy_diph_v += chi_T_v;
982 count_diph_v += 1;
983
984 if (cut_cell_disc_->get_interfaces().devient_pure(i,j,k))
985 {
986 int phase_dying = IJK_Interfaces::convert_indicatrice_to_phase(1 - indic_next(i,j,k));
987 if (phase_dying == 1)
988 {
989 global_energy_diph_dying += chi_T_l;
990 count_diph_dying += 1;
991 }
992 else
993 {
994 global_energy_diph_dying += chi_T_v;
995 count_diph_dying += 1;
996 }
997 }
998 else if (cut_cell_disc_->get_interfaces().devient_diphasique(i,j,k))
999 {
1000 int phase_nascent = IJK_Interfaces::convert_indicatrice_to_phase(1 - indic_old(i,j,k));
1001 if (phase_nascent == 1)
1002 {
1003 global_energy_diph_nascent += chi_T_l;
1004 count_diph_nascent += 1;
1005 }
1006 else
1007 {
1008 global_energy_diph_nascent += chi_T_v;
1009 count_diph_nascent += 1;
1010 }
1011 }
1012 else if (cut_cell_disc_->get_interfaces().next_below_small_threshold_for_phase(1, indic_old(i,j,k), indic_next(i,j,k)))
1013 {
1014 global_energy_diph_small += chi_T_l;
1015 count_diph_small += 1;
1016
1017 global_energy_diph_regular += chi_T_v;
1018 count_diph_regular += 1;
1019 }
1020 else if (cut_cell_disc_->get_interfaces().next_below_small_threshold_for_phase(0, indic_old(i,j,k), indic_next(i,j,k)))
1021 {
1022 global_energy_diph_small += chi_T_v;
1023 count_diph_small += 1;
1024
1025 global_energy_diph_regular += chi_T_l;
1026 count_diph_regular += 1;
1027 }
1028 else
1029 {
1030 global_energy_diph_regular += chi_T_l;
1031 global_energy_diph_regular += chi_T_v;
1032 count_diph_regular += 1;
1033 }
1034
1035 }
1036 }
1037 }
1038 }
1039 count_overall = Process::mp_sum(count_overall);
1040 count_overall_l = Process::mp_sum(count_overall_l);
1041 count_overall_v = Process::mp_sum(count_overall_v);
1042 count_pure = Process::mp_sum(count_pure);
1043 count_diph_l = Process::mp_sum(count_diph_l);
1044 count_diph_v = Process::mp_sum(count_diph_v);
1045 count_diph_small = Process::mp_sum(count_diph_small);
1046 count_diph_regular = Process::mp_sum(count_diph_regular);
1047 count_diph_nascent = Process::mp_sum(count_diph_nascent);
1048 count_diph_dying = Process::mp_sum(count_diph_dying);
1049 assert(count_overall == domaine_ref_->get_nb_items_global(Domaine_IJK::ELEM, DIRECTION_I)
1050 *domaine_ref_->get_nb_items_global(Domaine_IJK::ELEM, DIRECTION_J)
1051 *domaine_ref_->get_nb_items_global(Domaine_IJK::ELEM, DIRECTION_K));
1052 const double vol_cell = geom.get_constant_delta(DIRECTION_I)*geom.get_constant_delta(DIRECTION_J)*geom.get_constant_delta(DIRECTION_K);
1053 global_energy_overall = vol_cell * mp_sum(global_energy_overall);
1054 global_energy_overall_l = vol_cell * mp_sum(global_energy_overall_l);
1055 global_energy_overall_v = vol_cell * mp_sum(global_energy_overall_v);
1056 global_energy_pure = vol_cell * mp_sum(global_energy_pure);
1057 global_energy_diph_l = vol_cell * mp_sum(global_energy_diph_l);
1058 global_energy_diph_v = vol_cell * mp_sum(global_energy_diph_v);
1059 global_energy_diph_small = vol_cell * mp_sum(global_energy_diph_small);
1060 global_energy_diph_regular = vol_cell * mp_sum(global_energy_diph_regular);
1061 global_energy_diph_nascent = vol_cell * mp_sum(global_energy_diph_nascent);
1062 global_energy_diph_dying = vol_cell * mp_sum(global_energy_diph_dying);
1063 return {global_energy_overall, global_energy_overall_l, global_energy_overall_v, global_energy_pure, global_energy_diph_l, global_energy_diph_v, global_energy_diph_small, global_energy_diph_regular, global_energy_diph_nascent, global_energy_diph_dying};
1064}
1065
1066template<>
1068{
1069 double global_energy_overall = 0.;
1070 double global_energy_overall_l = 0.;
1071 double global_energy_overall_v = 0.;
1072 double global_energy_pure = 0.;
1073 double global_energy_diph_l = 0.;
1074 double global_energy_diph_v = 0.;
1075 double global_energy_diph_small = 0.;
1076 double global_energy_diph_regular = 0.;
1077 double global_energy_diph_nascent = 0.;
1078 double global_energy_diph_dying = 0.;
1079 double count_overall = 0.;
1080 double count_overall_l = 0.;
1081 double count_overall_v = 0.;
1082 double count_pure = 0.;
1083 double count_diph_l = 0.;
1084 double count_diph_v = 0.;
1085 double count_diph_small = 0.;
1086 double count_diph_regular = 0.;
1087 double count_diph_nascent = 0.;
1088 double count_diph_dying = 0.;
1089 const IJK_Field_template<double,ArrOfDouble>& indic_old = cut_cell_disc_->get_interfaces().I();
1090 const IJK_Field_template<double,ArrOfDouble>& indic_next = cut_cell_disc_->get_interfaces().In();
1094 const Domaine_IJK& geom = indic_next.get_domaine();
1095 assert(geom.get_constant_delta(DIRECTION_K) >0); // To be sure we're on a regular mesh
1096 for (int k=0; k < nz ; k++)
1097 {
1098 for (int j=0; j< ny; j++)
1099 {
1100 for (int i=0; i < nx; i++)
1101 {
1102 double chi_l = next ? cut_cell_disc_->get_interfaces().In(i,j,k) : cut_cell_disc_->get_interfaces().I(i,j,k);
1103 double chi_v = next ? 1-cut_cell_disc_->get_interfaces().In(i,j,k) : 1-cut_cell_disc_->get_interfaces().I(i,j,k);
1104 double chi_nonzero_l = next ? cut_cell_disc_->get_interfaces().In_nonzero(1,i,j,k) : cut_cell_disc_->get_interfaces().I_nonzero(1,i,j,k);
1105 double chi_nonzero_v = next ? cut_cell_disc_->get_interfaces().In_nonzero(0,i,j,k) : cut_cell_disc_->get_interfaces().I_nonzero(0,i,j,k);
1106 int n = cut_cell_disc_->get_n(i,j,k);
1107 if (n < 0)
1108 {
1109 global_energy_overall += (chi_l * constant_l + chi_v * constant_v) * pure_(i,j,k);
1110 count_overall += 1;
1111
1112 global_energy_overall_l += chi_l * constant_l * pure_(i,j,k);
1113 count_overall_l += chi_l;
1114
1115 global_energy_overall_v += chi_v * constant_v * pure_(i,j,k);
1116 count_overall_v += chi_v;
1117
1118 global_energy_pure += (chi_l * constant_l + chi_v * constant_v) * pure_(i,j,k);
1119 count_pure += 1;
1120 }
1121 else if (IJK_Interfaces::est_pure(.5*(cut_cell_disc_->get_interfaces().I(i,j,k) + cut_cell_disc_->get_interfaces().In(i,j,k))))
1122 {
1123 bool phase_invalide_l = (indic_old(i,j,k) == 0);
1124 if (phase_invalide_l && diph_l_(n) != 0.)
1125 {
1126 Cerr << "compute_global_energy_cut_cell: There is a non-zero diph_l_(" << n << ") in an invalid cell (in the non-existant phase of a purely monophasic cell)." << finl;
1127 Process::exit();
1128 }
1129
1130 bool phase_invalide_v = (indic_old(i,j,k) == 1);
1131 if (phase_invalide_v && diph_v_(n) != 0.)
1132 {
1133 Cerr << "compute_global_energy_cut_cell: There is a non-zero diph_v_(" << n << ") in an invalid cell (in the non-existant phase of a purely monophasic cell)." << finl;
1134 Process::exit();
1135 }
1136
1137 global_energy_overall += (chi_l * constant_l + chi_v * constant_v) * ((indic_old(i,j,k) == 0) ? diph_v_(n) : diph_l_(n));
1138 count_overall += 1;
1139
1140 global_energy_overall_l += chi_l * constant_l * diph_l_(n);
1141 count_overall_l += chi_l;
1142
1143 global_energy_overall_v += chi_v * constant_v * diph_v_(n);
1144 count_overall_v += chi_v;
1145
1146 global_energy_pure += (chi_l * constant_l + chi_v * constant_v) * ((indic_old(i,j,k) == 0) ? diph_v_(n) : diph_l_(n));
1147 count_pure += 1;
1148 }
1149 else
1150 {
1151 double chi_T_l = chi_nonzero_l * diph_l_(n);
1152 double chi_T_v = chi_nonzero_v * diph_v_(n);
1153
1154 global_energy_overall += constant_l * chi_T_l;
1155 global_energy_overall += constant_v * chi_T_v;
1156 count_overall += 1;
1157
1158 global_energy_overall_l += constant_l * chi_T_l;
1159 count_overall_l += 1;
1160
1161 global_energy_overall_v += constant_v * chi_T_v;
1162 count_overall_v += 1;
1163
1164 global_energy_diph_l += constant_l * chi_T_l;
1165 count_diph_l += chi_nonzero_l;
1166
1167 global_energy_diph_v += constant_v * chi_T_v;
1168 count_diph_v += chi_nonzero_v;
1169
1170 if (cut_cell_disc_->get_interfaces().devient_pure(i,j,k))
1171 {
1172 int phase_dying = IJK_Interfaces::convert_indicatrice_to_phase(1 - indic_next(i,j,k));
1173 if (phase_dying == 1)
1174 {
1175 global_energy_diph_dying += constant_l * chi_T_l;
1176 count_diph_dying += chi_nonzero_l;
1177 }
1178 else
1179 {
1180 global_energy_diph_dying += constant_v * chi_T_v;
1181 count_diph_dying += chi_nonzero_v;
1182 }
1183 }
1184 else if (cut_cell_disc_->get_interfaces().devient_diphasique(i,j,k))
1185 {
1186 int phase_nascent = IJK_Interfaces::convert_indicatrice_to_phase(1 - indic_old(i,j,k));
1187 if (phase_nascent == 1)
1188 {
1189 global_energy_diph_nascent += constant_l * chi_T_l;
1190 count_diph_nascent += chi_nonzero_l;
1191 }
1192 else
1193 {
1194 global_energy_diph_nascent += constant_v * chi_T_v;
1195 count_diph_nascent += chi_nonzero_v;
1196 }
1197 }
1198 else if (cut_cell_disc_->get_interfaces().next_below_small_threshold_for_phase(1, indic_old(i,j,k), indic_next(i,j,k)))
1199 {
1200 global_energy_diph_small += constant_l * chi_T_l;
1201 count_diph_small += chi_nonzero_l;
1202
1203 global_energy_diph_regular += constant_v * chi_T_v;
1204 count_diph_regular += chi_nonzero_v;
1205 }
1206 else if (cut_cell_disc_->get_interfaces().next_below_small_threshold_for_phase(0, indic_old(i,j,k), indic_next(i,j,k)))
1207 {
1208 global_energy_diph_small += constant_v * chi_T_v;
1209 count_diph_small += chi_nonzero_v;
1210
1211 global_energy_diph_regular += constant_l * chi_T_l;
1212 count_diph_regular += chi_nonzero_l;
1213 }
1214 else
1215 {
1216 global_energy_diph_regular += constant_l * chi_T_l;
1217 global_energy_diph_regular += constant_v * chi_T_v;
1218 count_diph_regular += 1;
1219 }
1220
1221 }
1222 }
1223 }
1224 }
1225 count_overall = Process::mp_sum(count_overall);
1226 count_overall_l = Process::mp_sum(count_overall_l);
1227 count_overall_v = Process::mp_sum(count_overall_v);
1228 count_pure = Process::mp_sum(count_pure);
1229 count_diph_l = Process::mp_sum(count_diph_l);
1230 count_diph_v = Process::mp_sum(count_diph_v);
1231 count_diph_small = Process::mp_sum(count_diph_small);
1232 count_diph_regular = Process::mp_sum(count_diph_regular);
1233 count_diph_nascent = Process::mp_sum(count_diph_nascent);
1234 count_diph_dying = Process::mp_sum(count_diph_dying);
1235 assert(count_overall == domaine_ref_->get_nb_items_global(Domaine_IJK::ELEM, DIRECTION_I)
1236 *domaine_ref_->get_nb_items_global(Domaine_IJK::ELEM, DIRECTION_J)
1237 *domaine_ref_->get_nb_items_global(Domaine_IJK::ELEM, DIRECTION_K));
1238 const double vol_cell = geom.get_constant_delta(DIRECTION_I)*geom.get_constant_delta(DIRECTION_J)*geom.get_constant_delta(DIRECTION_K);
1239 global_energy_overall = vol_cell * mp_sum(global_energy_overall);
1240 global_energy_overall_l = vol_cell * mp_sum(global_energy_overall_l);
1241 global_energy_overall_v = vol_cell * mp_sum(global_energy_overall_v);
1242 global_energy_pure = vol_cell * mp_sum(global_energy_pure);
1243 global_energy_diph_l = vol_cell * mp_sum(global_energy_diph_l);
1244 global_energy_diph_v = vol_cell * mp_sum(global_energy_diph_v);
1245 global_energy_diph_small = vol_cell * mp_sum(global_energy_diph_small);
1246 global_energy_diph_regular = vol_cell * mp_sum(global_energy_diph_regular);
1247 global_energy_diph_nascent = vol_cell * mp_sum(global_energy_diph_nascent);
1248 global_energy_diph_dying = vol_cell * mp_sum(global_energy_diph_dying);
1249 return {global_energy_overall, global_energy_overall_l, global_energy_overall_v, global_energy_pure, global_energy_diph_l, global_energy_diph_v, global_energy_diph_small, global_energy_diph_regular, global_energy_diph_nascent, global_energy_diph_dying};
1250}
1251
1252template<>
1254{
1255 double Tmin_overall = 1.e20;
1256 double Tmin_overall_l = 1.e20;
1257 double Tmin_overall_v = 1.e20;
1258 double Tmin_pure = 1.e20;
1259 double Tmin_diph_l = 1.e20;
1260 double Tmin_diph_v = 1.e20;
1261 double Tmin_diph_small = 1.e20;
1262 double Tmin_diph_regular = 1.e20;
1263 double Tmin_diph_nascent = 1.e20;
1264 double Tmin_diph_dying = 1.e20;
1265 const IJK_Field_template<double,ArrOfDouble>& indic_old = cut_cell_disc_->get_interfaces().I();
1266 const IJK_Field_template<double,ArrOfDouble>& indic_next = cut_cell_disc_->get_interfaces().In();
1267 const IJK_Field_template<double,ArrOfDouble>& indic = next ? indic_next : indic_old;
1271 assert(indic.get_domaine().get_constant_delta(DIRECTION_K) >0); // To be sure we're on a regular mesh
1272 for (int k=0; k < nz ; k++)
1273 {
1274 for (int j=0; j< ny; j++)
1275 {
1276 for (int i=0; i < nx; i++)
1277 {
1278 double chi_l = indic(i,j,k);
1279 int n = cut_cell_disc_->get_n(i,j,k);
1280 if (n < 0)
1281 {
1282 Tmin_overall = std::min(Tmin_overall, pure_(i,j,k));
1283 Tmin_overall_l = (chi_l == 0) ? Tmin_overall_l : std::min(Tmin_overall_l, pure_(i,j,k));
1284 Tmin_overall_v = (chi_l == 1) ? Tmin_overall_v : std::min(Tmin_overall_v, pure_(i,j,k));
1285 Tmin_pure = std::min(Tmin_pure, pure_(i,j,k));
1286 }
1287 else if (IJK_Interfaces::est_pure(.5*(cut_cell_disc_->get_interfaces().I(i,j,k) + cut_cell_disc_->get_interfaces().In(i,j,k))))
1288 {
1289 Tmin_overall = std::min(Tmin_overall, (chi_l == 0) ? diph_v_(n) : diph_l_(n));
1290 Tmin_overall_l = (chi_l == 0) ? Tmin_overall_l : std::min(Tmin_overall_l, diph_l_(n));
1291 Tmin_overall_v = (chi_l == 1) ? Tmin_overall_v : std::min(Tmin_overall_v, diph_v_(n));
1292 Tmin_pure = std::min(Tmin_pure, (chi_l == 0) ? diph_v_(n) : diph_l_(n));
1293 }
1294 else
1295 {
1296 // Excluding the value of the phase in dying cells
1297 bool exclude_l = (next && (cut_cell_disc_->get_interfaces().phase_mourrante(1, i,j,k))) || ((!next) && (cut_cell_disc_->get_interfaces().phase_naissante(1, i,j,k)));
1298 bool exclude_v = (next && (cut_cell_disc_->get_interfaces().phase_mourrante(0, i,j,k))) || ((!next) && (cut_cell_disc_->get_interfaces().phase_naissante(0, i,j,k)));
1299
1300 Tmin_overall = exclude_l ? Tmin_overall : std::min(Tmin_overall, diph_l_(n));
1301 Tmin_overall = exclude_v ? Tmin_overall : std::min(Tmin_overall, diph_v_(n));
1302
1303 Tmin_overall_l = exclude_l ? Tmin_overall_l : std::min(Tmin_overall_l, diph_l_(n));
1304 Tmin_overall_v = exclude_v ? Tmin_overall_v : std::min(Tmin_overall_v, diph_v_(n));
1305
1306 Tmin_diph_l = exclude_l ? Tmin_diph_l : std::min(Tmin_diph_l, diph_l_(n));
1307 Tmin_diph_v = exclude_v ? Tmin_diph_v : std::min(Tmin_diph_v, diph_v_(n));
1308
1309 if (cut_cell_disc_->get_interfaces().next_below_small_threshold_for_phase(1, indic_old(i,j,k), indic_next(i,j,k)))
1310 {
1311 Tmin_diph_small = exclude_l ? Tmin_diph_small : std::min(Tmin_diph_small, diph_l_(n));
1312 Tmin_diph_regular = exclude_v ? Tmin_diph_regular : std::min(Tmin_diph_regular, diph_v_(n));
1313 }
1314 else if (cut_cell_disc_->get_interfaces().next_below_small_threshold_for_phase(0, indic_old(i,j,k), indic_next(i,j,k)))
1315 {
1316 Tmin_diph_small = exclude_v ? Tmin_diph_small : std::min(Tmin_diph_small, diph_v_(n));
1317 Tmin_diph_regular = exclude_l ? Tmin_diph_regular : std::min(Tmin_diph_regular, diph_l_(n));
1318 }
1319 else
1320 {
1321 Tmin_diph_regular = exclude_l ? Tmin_diph_regular : std::min(Tmin_diph_regular, diph_l_(n));
1322 Tmin_diph_regular = exclude_v ? Tmin_diph_regular : std::min(Tmin_diph_regular, diph_v_(n));
1323 }
1324
1325 if (cut_cell_disc_->get_interfaces().devient_pure(i,j,k))
1326 {
1327 int phase_dying = IJK_Interfaces::convert_indicatrice_to_phase(1 - indic_next(i,j,k));
1328 if (phase_dying == 1)
1329 {
1330 Tmin_diph_dying = std::min(Tmin_diph_dying, diph_l_(n));
1331 }
1332 else
1333 {
1334 Tmin_diph_dying = std::min(Tmin_diph_dying, diph_v_(n));
1335 }
1336 }
1337
1338 if (cut_cell_disc_->get_interfaces().devient_diphasique(i,j,k))
1339 {
1340 int phase_nascent = IJK_Interfaces::convert_indicatrice_to_phase(1 - indic_old(i,j,k));
1341 if (phase_nascent == 1)
1342 {
1343 Tmin_diph_nascent = std::min(Tmin_diph_nascent, diph_l_(n));
1344 }
1345 else
1346 {
1347 Tmin_diph_nascent = std::min(Tmin_diph_nascent, diph_v_(n));
1348 }
1349 }
1350 }
1351 }
1352 }
1353 }
1354 Tmin_overall = Process::mp_min(Tmin_overall);
1355 Tmin_overall_l = Process::mp_min(Tmin_overall_l);
1356 Tmin_overall_v = Process::mp_min(Tmin_overall_v);
1357 Tmin_pure = Process::mp_min(Tmin_pure);
1358 Tmin_diph_l = Process::mp_min(Tmin_diph_l);
1359 Tmin_diph_v = Process::mp_min(Tmin_diph_v);
1360 Tmin_diph_small = Process::mp_min(Tmin_diph_small);
1361 Tmin_diph_regular = Process::mp_min(Tmin_diph_regular);
1362 Tmin_diph_nascent = Process::mp_min(Tmin_diph_nascent);
1363 Tmin_diph_dying = Process::mp_min(Tmin_diph_dying);
1364 return {Tmin_overall, Tmin_overall_l, Tmin_overall_v, Tmin_pure, Tmin_diph_l, Tmin_diph_v, Tmin_diph_small, Tmin_diph_regular, Tmin_diph_nascent, Tmin_diph_dying};
1365}
1366
1367template<>
1369{
1370 double Tmax_overall = -1.e20;
1371 double Tmax_overall_l = -1.e20;
1372 double Tmax_overall_v = -1.e20;
1373 double Tmax_pure = -1.e20;
1374 double Tmax_diph_l = -1.e20;
1375 double Tmax_diph_v = -1.e20;
1376 double Tmax_diph_small = -1.e20;
1377 double Tmax_diph_regular = -1.e20;
1378 double Tmax_diph_nascent = -1.e20;
1379 double Tmax_diph_dying = -1.e20;
1380 const IJK_Field_template<double,ArrOfDouble>& indic_old = cut_cell_disc_->get_interfaces().I();
1381 const IJK_Field_template<double,ArrOfDouble>& indic_next = cut_cell_disc_->get_interfaces().In();
1382 const IJK_Field_template<double,ArrOfDouble>& indic = next ? indic_next : indic_old;
1386 // To be sure we're on a regular mesh
1387 assert(indic.get_domaine().get_constant_delta(DIRECTION_K) >0);
1388 for (int k=0; k < nz ; k++)
1389 {
1390 for (int j=0; j< ny; j++)
1391 {
1392 for (int i=0; i < nx; i++)
1393 {
1394 double chi_l = indic(i,j,k);
1395 int n = cut_cell_disc_->get_n(i,j,k);
1396 if (n < 0)
1397 {
1398 Tmax_overall = std::max(Tmax_overall, pure_(i,j,k));
1399 Tmax_overall_l = (chi_l == 0) ? Tmax_overall_l : std::max(Tmax_overall_l, pure_(i,j,k));
1400 Tmax_overall_v = (chi_l == 1) ? Tmax_overall_v : std::max(Tmax_overall_v, pure_(i,j,k));
1401 Tmax_pure = std::max(Tmax_pure, pure_(i,j,k));
1402 }
1403 else if (IJK_Interfaces::est_pure(.5*(cut_cell_disc_->get_interfaces().I(i,j,k) + cut_cell_disc_->get_interfaces().In(i,j,k))))
1404 {
1405 Tmax_overall = std::max(Tmax_overall, (chi_l == 0) ? diph_v_(n) : diph_l_(n));
1406 Tmax_overall_l = (chi_l == 0) ? Tmax_overall_l : std::max(Tmax_overall_l, diph_l_(n));
1407 Tmax_overall_v = (chi_l == 1) ? Tmax_overall_v : std::max(Tmax_overall_v, diph_v_(n));
1408 Tmax_pure = std::max(Tmax_pure, (chi_l == 0) ? diph_v_(n) : diph_l_(n));
1409 }
1410 else
1411 {
1412 // Excluding the value of the phase in dying cells
1413 bool exclude_l = (next && (cut_cell_disc_->get_interfaces().phase_mourrante(1, i,j,k))) || ((!next) && (cut_cell_disc_->get_interfaces().phase_naissante(1, i,j,k)));
1414 bool exclude_v = (next && (cut_cell_disc_->get_interfaces().phase_mourrante(0, i,j,k))) || ((!next) && (cut_cell_disc_->get_interfaces().phase_naissante(0, i,j,k)));
1415
1416 Tmax_overall = exclude_l ? Tmax_overall : std::max(Tmax_overall, diph_l_(n));
1417 Tmax_overall = exclude_v ? Tmax_overall : std::max(Tmax_overall, diph_v_(n));
1418
1419 Tmax_overall_l = exclude_l ? Tmax_overall_l : std::max(Tmax_overall_l, diph_l_(n));
1420 Tmax_overall_v = exclude_v ? Tmax_overall_v : std::max(Tmax_overall_v, diph_v_(n));
1421
1422 Tmax_diph_l = exclude_l ? Tmax_diph_l : std::max(Tmax_diph_l, diph_l_(n));
1423 Tmax_diph_v = exclude_v ? Tmax_diph_v : std::max(Tmax_diph_v, diph_v_(n));
1424
1425 if (cut_cell_disc_->get_interfaces().next_below_small_threshold_for_phase(1, indic_old(i,j,k), indic_next(i,j,k)))
1426 {
1427 Tmax_diph_small = exclude_l ? Tmax_diph_small : std::max(Tmax_diph_small, diph_l_(n));
1428 Tmax_diph_regular = exclude_v ? Tmax_diph_regular : std::max(Tmax_diph_regular, diph_v_(n));
1429 }
1430 else if (cut_cell_disc_->get_interfaces().next_below_small_threshold_for_phase(0, indic_old(i,j,k), indic_next(i,j,k)))
1431 {
1432 Tmax_diph_small = exclude_v ? Tmax_diph_small : std::max(Tmax_diph_small, diph_v_(n));
1433 Tmax_diph_regular = exclude_l ? Tmax_diph_regular : std::max(Tmax_diph_regular, diph_l_(n));
1434 }
1435 else
1436 {
1437 Tmax_diph_regular = exclude_l ? Tmax_diph_regular : std::max(Tmax_diph_regular, diph_l_(n));
1438 Tmax_diph_regular = exclude_v ? Tmax_diph_regular : std::max(Tmax_diph_regular, diph_v_(n));
1439 }
1440
1441 if (cut_cell_disc_->get_interfaces().devient_pure(i,j,k))
1442 {
1443 int phase_dying = IJK_Interfaces::convert_indicatrice_to_phase(1 - indic_next(i,j,k));
1444 if (phase_dying == 1)
1445 {
1446 Tmax_diph_dying = std::max(Tmax_diph_dying, diph_l_(n));
1447 }
1448 else
1449 {
1450 Tmax_diph_dying = std::max(Tmax_diph_dying, diph_v_(n));
1451 }
1452 }
1453
1454 if (cut_cell_disc_->get_interfaces().devient_diphasique(i,j,k))
1455 {
1456 int phase_nascent = IJK_Interfaces::convert_indicatrice_to_phase(1 - indic_old(i,j,k));
1457 if (phase_nascent == 1)
1458 {
1459 Tmax_diph_nascent = std::max(Tmax_diph_nascent, diph_l_(n));
1460 }
1461 else
1462 {
1463 Tmax_diph_nascent = std::max(Tmax_diph_nascent, diph_v_(n));
1464 }
1465 }
1466 }
1467 }
1468 }
1469 }
1470 Tmax_overall = Process::mp_max(Tmax_overall);
1471 Tmax_overall_l = Process::mp_max(Tmax_overall_l);
1472 Tmax_overall_v = Process::mp_max(Tmax_overall_v);
1473 Tmax_pure = Process::mp_max(Tmax_pure);
1474 Tmax_diph_l = Process::mp_max(Tmax_diph_l);
1475 Tmax_diph_v = Process::mp_max(Tmax_diph_v);
1476 Tmax_diph_small = Process::mp_max(Tmax_diph_small);
1477 Tmax_diph_regular = Process::mp_max(Tmax_diph_regular);
1478 Tmax_diph_nascent = Process::mp_max(Tmax_diph_nascent);
1479 Tmax_diph_dying = Process::mp_max(Tmax_diph_dying);
1480 return {Tmax_overall, Tmax_overall_l, Tmax_overall_v, Tmax_pure, Tmax_diph_l, Tmax_diph_v, Tmax_diph_small, Tmax_diph_regular, Tmax_diph_nascent, Tmax_diph_dying};
1481}
1482
1483template<typename _TYPE_, typename _TYPE_ARRAY_>
1485{
1489 const Cut_cell_FT_Disc& cut_cell_disc = get_cut_cell_disc();
1490 for (int k=0; k < nz ; k++)
1491 {
1492 for (int j=0; j< ny; j++)
1493 {
1494 for (int i=0; i < nx; i++)
1495 {
1496 int n = cut_cell_disc.get_n(i,j,k);
1497 if (n < 0)
1498 {
1499 if (T == pure_(i,j,k))
1500 {
1501 return Nom("ijk_pure_") + Nom(i) + Nom("_") + Nom(j) + Nom("_") + Nom(k);
1502 }
1503 }
1504 else
1505 {
1506 if (T == diph_l_(n))
1507 {
1508 return Nom("ijk_l_") + Nom(i) + Nom("_") + Nom(j) + Nom("_") + Nom(k);
1509 }
1510 if (T == diph_v_(n))
1511 {
1512 return Nom("ijk_v_") + Nom(i) + Nom("_") + Nom(j) + Nom("_") + Nom(k);
1513 }
1514 }
1515 }
1516 }
1517 }
1518 return Nom("_not_here_");
1519}
1520
1521template<>
1523{
1527 for (int k = 0; k < nk; k++)
1528 {
1529 for (int j = 0; j < nj; j++)
1530 {
1531 for (int i = 0; i < ni; i++)
1532 {
1533 int n = cut_cell_disc_->get_n(i,j,k);
1534 if (n < 0)
1535 {
1536 int phase = IJK_Interfaces::convert_indicatrice_to_phase(cut_cell_disc_->indic_pure(i,j,k));
1537 pure_(i,j,k) *= (phase == 0) ? scalar_v : scalar_l;
1538 }
1539 else
1540 {
1541 diph_l_(n) *= scalar_l;
1542 diph_v_(n) *= scalar_v;
1543 }
1544 }
1545 }
1546 }
1547}
1548
1549template<>
1551{
1552 multiply_by_scalar(1./scalar_l, 1./scalar_v);
1553}
1554
1555template<class T, int N>
1559
1560template<class T, int N>
1562{
1563 for (int i = 0; i < N; i++)
1564 {
1565 Cut_field_vector<T, N>::operator[](i).set_to_uniform_value(valeur);
1566 }
1567}
1568
1569template<class T, int N>
1571{
1572 for (int i = 0; i < N; i++)
1573 {
1574 Cut_field_vector<T, N>::operator[](i).echange_espace_virtuel(ghost);
1575 }
1576}
1577
1578template<class T, int N>
1580{
1581 for (int i = 0; i < N; i++)
1582 {
1584 }
1585 return Cut_field_vector<T, N>::operator[](0).ghost();
1586}
1587
1588template<class T, int N>
1590{
1591 for (int i = 0; i < N; i++)
1592 {
1593 Cut_field_vector<T, N>::operator[](i).echange_pure_vers_diph_cellules_initialement_pures();
1594 }
1595}
1596
1597template<class T, int N>
1599{
1600 for (int i = 0; i < N; i++)
1601 {
1602 Cut_field_vector<T, N>::operator[](i).echange_diph_vers_pure_cellules_finalement_pures();
1603 }
1604}
1605
1606template<class T, int N>
1608{
1609 for (int i = 0; i < N; i++)
1610 {
1611 Cut_field_vector<T, N>::operator[](i).vide_phase_invalide_cellules_diphasiques();
1612 }
1613}
1614
1615
1616// Explicit instantiations
1617
1620
1621template class Cut_field_vector<int, 3>;
1622template class Cut_field_vector<double, 3>;
1623
1624
int get_n(int i, int j, int k) const
: class Cut_field_template
Definition Cut_field.h:45
CutCell_GlobalInfo compute_d_global_energy_cut_cell(bool next) const
void remplir_tableau_pure_cellules_diphasiques_max(bool next_time)
_TYPE_ & from_ijk_and_phase(int i, int j, int k, bool phase)
void echange_espace_virtuel(int ghost)
Definition Cut_field.cpp:29
void multiply_by_scalar(_TYPE_ scalar_l, _TYPE_ scalar_v)
bool check_agreement_diph_pure_cellules_initialement_pures() const
void divide_by_scalar(_TYPE_ scalar_l, _TYPE_ scalar_v)
_TYPE_ & pure_(int i, int j, int k)
Definition Cut_field.h:116
void copie_pure_vers_diph_sans_interpolation()
Definition Cut_field.cpp:37
CutCell_GlobalInfo compute_min_cut_cell(bool next) const
void add_from(const Cut_field_template< _TYPE_, _TYPE_ARRAY_ > &data, _TYPE_ constant=1)
const Cut_cell_FT_Disc & get_cut_cell_disc() const
Definition Cut_field.h:78
void associer_ephemere(Cut_cell_FT_Disc &cut_cell_disc)
void remplir_tableau_pure_cellules_diphasiques(bool next_time)
bool check_agreement_tableau_pure_cellules_diphasiques(bool next_time) const
void set_to_uniform_value(_TYPE_ valeur)
CutCell_GlobalInfo compute_max_cut_cell(bool next) const
TRUSTTabFT_cut_cell< _TYPE_ > diph_l_
Definition Cut_field.h:49
void associer_paresseux(Cut_cell_FT_Disc &cut_cell_disc)
CutCell_GlobalInfo compute_norm_cut_cell(bool next) const
_TYPE_ & from_signed_independent_index(int signed_independent_index)
void set_to_sum(const Cut_field_template< _TYPE_, _TYPE_ARRAY_ > &data_1, const Cut_field_template< _TYPE_, _TYPE_ARRAY_ > &data_2)
void copy_from(const Cut_field_template< _TYPE_, _TYPE_ARRAY_ > &data)
void vide_phase_invalide_cellules_diphasiques()
void echange_pure_vers_diph_cellules_initialement_pures()
Definition Cut_field.cpp:54
bool check_agreement_diph_pure_cellules_finalement_pures() const
void dumplata_scalar(const char *filename, int step) const override
void set_field_data(const Nom &parser_expression_of_x_y_z_and_t, const IJK_Field_template< _TYPE_, _TYPE_ARRAY_ > &input_f, const double current_time)
_TYPE_ & from_n_num_face_and_phase(int n, int num_face, bool phase)
void echange_diph_vers_pure_cellules_finalement_pures()
TRUSTTabFT_cut_cell< _TYPE_ > diph_v_
Definition Cut_field.h:50
CutCell_GlobalInfo compute_global_energy_cut_cell(bool next, double constant_l, double constant_v) const
void associer_persistant(Cut_cell_FT_Disc &cut_cell_disc)
Nom get_value_location(_TYPE_ T) const
: class Cut_field_vector
Definition Cut_field.h:169
void set_to_uniform_value(int valeur)
void echange_diph_vers_pure_cellules_finalement_pures()
void vide_phase_invalide_cellules_diphasiques()
Cut_field_template< T, TRUSTArray< T > > & operator[](int i)
Definition Cut_field.h:181
void echange_pure_vers_diph_cellules_initialement_pures()
This class encapsulates all the information related to the eulerian mesh for TrioIJK.
Definition Domaine_IJK.h:47
double get_constant_delta(int direction) const
Returns the size of cells in a direction.
const Nom & le_nom() const override
Renvoie le nom du champ.
void nommer(const Nom &) override
Donne un nom au champ.
void echange_espace_virtuel(int ghost)
Exchange data over "ghost" number of cells.
Domaine_IJK::Localisation get_localisation() const
Domaine_IJK::Localisation localisation_
virtual void dumplata_scalar(const char *filename, int step) const
const Domaine_IJK & get_domaine() const
static double opposing_barycentre(double initial_barycentre, double initial_area)
static int est_pure(double indicatrice)
static int convert_indicatrice_to_phase(double indicatrice)
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
Representation des donnees de la classe Parser.
Definition Parser.h:39
void addVar(const char *)
Definition Parser.cpp:565
virtual void setNbVar(int nvar)
Definition Parser.cpp:116
void setVar(const char *sv, double val)
Definition Parser.h:73
double eval()
Definition Parser.h:68
void setString(const std::string &s)
Definition Parser.h:102
virtual void parseString()
Definition Parser.cpp:124
static double mp_min(double)
Definition Process.cpp:386
static double mp_max(double)
Definition Process.cpp:376
static double mp_sum(double)
Calcule la somme de x sur tous les processeurs du groupe courant.
Definition Process.cpp:146
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455