TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
EcritureLectureSpecial.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 <EcritureLectureSpecial.h>
17
18#include <Champ_Fonc_base.h>
19#include <Domaine_VF.h>
20#include <Domaine.h>
21#include <MD_Vector_tools.h>
22#include <Octree_Double.h>
23#include <MD_Vector_composite.h>
24#include <MD_Vector_seq.h>
25#include <TRUSTTab_parts.h>
26#include <TRUST_2_PDI.h>
27
31
32#ifdef MPI_
33Nom EcritureLectureSpecial::Input="LecFicDiffuseBin"; // "EFichierBin" was the past (<=1.6.9) and "LecFicPartageMPIIO" is may be the future
34Nom EcritureLectureSpecial::Output="EcrFicPartageMPIIO"; // "EcrFicPartageBin" was the past (<=1.6.9) and "EcrFicPartageMPIIO" is after 1.7.0
35#else
37Nom EcritureLectureSpecial::Output="EcrFicPartageBin";
38#endif
39
40Implemente_instanciable(EcritureLectureSpecial,"EcritureLectureSpecial",Interprete);
41
42const DoubleTab& get_ref_coordinates_items(const Domaine_VF& zvf, const MD_Vector& md)
43{
44 // I would have taken xv but it has no parallel structure !!!
45 if (md == zvf.face_sommets().get_md_vector())
46 return zvf.xv(); // Descriptor for faces
47 else if (md == zvf.md_vector_faces_bord())
48 return zvf.xv_bord();
49 // I would have taken xp but it has no parallel structure !!!!!!$&
50 else if (md == zvf.domaine().les_elems().get_md_vector())
51 return zvf.xp(); // Descriptor for elements
52 else if (md == zvf.xa().get_md_vector())
53 return zvf.xa(); // Descriptor for edges
54 else if (md == zvf.domaine().les_sommets().get_md_vector())
55 return zvf.domaine().les_sommets();
56 else
57 {
58 Cerr << "Error in get_ref_coordinates_items\n"
59 << " descriptor not found in this domaine" << finl;
61 }
62 return zvf.xv(); // for compiler
63}
65{
66 return os;
67}
68
70{
71 return is;
72}
73// XD ecriturelecturespecial interprete ecriturelecturespecial INHERITS_BRACE Class to write or not to write a .xyz file
74// XD_CONT on the disk at the end of the calculation.
75// XD attr type chaine type REQ If set to 0 (the default), no xyz file is created. If set to 1, the .xyz file is written
76// XD_CONT at the end of the computation.
78{
79 Nom option;
80 is >> option;
81 if (option=="EFichierBin" || option=="LecFicDiffuseBin" || option=="LecFicPartageMPIIO")
82 {
83 Cerr << "ERROR: EcritureLectureSpecial: - option '" << option << "' is obsolete! You may only specify 0 or 1." <<finl;
85 }
86 else if (option=="EcrFicPartageMPIIO" || option=="EcrFicPartageBin" || option=="EcrFicPartage")
87 {
88 Cerr << "ERROR: EcritureLectureSpecial: - option '" << option << "' is obsolete! You may only specify 0 or 1." <<finl;
90 }
91 else if (option=="0")
92 Active=0;
93 else if (option=="1")
94 Active=1;
95 else
96 {
97 Cerr << "ERROR: \"EcritureLectureSpecial " << option << "\" is not recognized." << finl;
99 }
100 Cerr << "EcritureLectureSpecial::Active set to " << Active << finl;
101 return is;
102}
103
104/*! @brief Indicates whether the special format was requested in active reading by xyz restart.
105 *
106 * ...
107 *
108 */
113
114/*! @brief Indicates whether the special format was requested in active writing by xyz save.
115 *
116 * ...
117 * if the write mode is special, i.e. if the save format is xyz:
118 * then special=1, a_faire=je_suis_maitre
119 * otherwise special=0, a_faire=1
120 *
121 *
122 */
124{
125 // with PDI, no one is writing, the library handles the IO
127 {
128 a_faire = 0;
129 special = 0;
130 }
131 else
132 {
133 special=0;
134 a_faire=1;
135 assert(mode_ecr>=0); // mode_ecr is not set
136 if (mode_ecr)
137 {
138 special=1;
139 a_faire=Process::je_suis_maitre();
140 }
141 }
142 return mode_ecr;
143}
144
145/*! @brief Simple call to EcritureLectureSpecial::ecriture_special (const Domaine_VF& zvf,Sortie& fich,int nbval,const DoubleTab& val)
146 *
147 * after retrieving the val array
148 *
149 */
151{
152 const Domaine_VF& zvf = ref_cast(Domaine_VF, ch.domaine_dis_base());
153 const DoubleTab& val = ch.valeurs();
154 return ecriture_special(zvf, fich, val);
155}
156
157int ecrit(Sortie& fich, const ArrOfBit& items_to_write, const DoubleTab& pos, const DoubleTab& val)
158{
159 const int nb_dim = val.nb_dim();
160 const int nb_comp = (nb_dim == 2) ? val.dimension(1) : 1;
161 const int nb_val = items_to_write.size_array();
162 const int dim = pos.dimension(1);
163
164 if (EcritureLectureSpecial::get_Output().finit_par("MPIIO"))
165 {
166 // No bufferisation needed for Parallel IO
167 int jmax = (dim + nb_comp) * nb_val;
168 ArrOfDouble tmp(jmax);
169 int j=0;
170 for (int p = 0; p < nb_val; p++)
171 {
172 // We only write the real non-shared items so as to have a .xyz file
173 // of the same size regardless of the partitioning, and above all to be able to re-read it
174 // regardless of the partitioning and the supports
175 if (items_to_write[p])
176 {
177 for (int k = 0; k < dim; k++)
178 tmp[j++] = pos(p, k);
179 if (nb_dim == 1)
180 tmp[j++] = val(p);
181 else
182 for (int k = 0; k < nb_comp; k++)
183 tmp[j++] = val(p, k);
184 }
185 }
186 fich.put(tmp.addr(), j, dim + nb_comp /* nb colonnes en ascii */);
187 }
188 else
189 {
190 // Bufferisation needed for EcrFicPartage
191 int jmax = (dim + nb_comp) * 128;
192 ArrOfDouble tmp(jmax);
193 int j = 0;
194 for (int p = 0; p < nb_val; p++)
195 {
196 // We only write the real non-shared items so as to have a .xyz file
197 // of the same size regardless of the partitioning, and above all to be able to re-read it
198 // regardless of the partitioning and the supports
199 if (items_to_write[p])
200 {
201 for (int k = 0; k < dim; k++)
202 tmp[j++] = pos(p, k);
203 if (nb_dim == 1)
204 tmp[j++] = val(p);
205 else
206 for (int k = 0; k < nb_comp; k++)
207 tmp[j++] = val(p, k);
208 if (j == jmax)
209 {
210 fich.put(tmp.addr(), j, dim + nb_comp /* nb colonnes en ascii */);
211 // We flush regularly in sequential mode because on some very large meshes
212 // a stack overflow is possible...
213 if (Process::is_sequential()) fich.syncfile();
214 j = 0;
215 }
216 }
217 }
218 if (j)
219 fich.put(tmp.addr(), j, dim + nb_comp /* nb colonnes en ascii */);
220 }
221 return 8 * (dim + nb_comp) * nb_val; // Bytes
222}
223
224/*! @brief "Inner" part of the write, called by the method below.
225 *
226 * Recursive method, if the array to write has an MD_Vector_composite descriptor
227 *
228 */
229static int ecriture_special_part2(const Domaine_VF& zvf, Sortie& fich, const DoubleTab& val)
230{
231 const MD_Vector& md = val.get_md_vector();
232 int bytes = 0;
233 if (sub_type(MD_Vector_composite, md.valeur()))
234 {
235 // p1bubble fields and others: recursive call for the different sub-arrays:
236 ConstDoubleTab_parts parts(val);
237 int n = zvf.que_suis_je() == "Domaine_PolyMAC_MPFA" ? 1 : parts.size();//skip auxiliary variables of Champ_{P0,Face}_PolyMAC_MPFA
238 for (int i = 0; i < n; i++)
239 bytes += ecriture_special_part2(zvf, fich, parts[i]);
240 }
241 else if (sub_type(MD_Vector_std, md.valeur()) || sub_type(MD_Vector_seq, md.valeur()))
242 {
243 ArrOfBit items_to_write;
244 md->get_sequential_items_flags(items_to_write);
245 const DoubleTab& coords = get_ref_coordinates_items(zvf, md);
246 bytes += ecrit(fich, items_to_write, coords, val);
247 fich.syncfile();
248 }
249 else
250 {
251 Cerr << "EcritureLectureSpecial::ecriture_special_part: Error, unknown Metadata vector type : "
252 << md->que_suis_je() << finl;
254 }
255 return bytes;
256}
257
258/*! @brief Encoding of the write of positions and values of val
259 *
260 */
261int EcritureLectureSpecial::ecriture_special(const Domaine_VF& zvf, Sortie& fich, const DoubleTab& val)
262{
263 const MD_Vector& md = val.get_md_vector();
264 if (!md)
265 {
266 Cerr << "EcritureLectureSpecial::ecriture_special: error, cannot save an array with no metadata" << finl;
268 }
269 const trustIdType nb_items_seq = md->nb_items_seq_tot();
270 if (nb_items_seq == 0)
271 return 0;
272
273 const int nb_dim = val.nb_dim();
274 const int nb_comp = (nb_dim == 2) ? val.dimension(1) : 1;
275 const int dim = Objet_U::dimension;
276 const trustIdType n = nb_items_seq * (nb_comp + dim);
277
278
280 {
281 fich << (int)1 << finl;
282 fich << n << finl ;
283 fich << (int)1 << finl;
284 fich << n << finl ;
285 fich << n <<finl;
286 }
287
288 int bytes = ecriture_special_part2(zvf, fich, val);
289
291 {
292 fich << n << finl;
293 fich << (int)0 << finl;
294 fich << (int)0 << finl;
295 fich << (int)0 << finl;
296 fich << (int)1 << finl;
297 fich << (int)0 << finl;
298 fich << n << finl;
299 fich << finl;
300 fich << (int)1 << finl;
301 fich << (int)0 << finl;
302 fich << (int)0 <<finl;
303 }
304 fich.syncfile();
305 return bytes;
306}
307
308/*! @brief Simple call to EcritureLectureSpecial::lecture_special (const Domaine_VF& zvf,Entree& fich,int nbval, DoubleTab& val )
309 *
310 */
312{
313 const Domaine_VF& zvf=ref_cast(Domaine_VF,ch.domaine_dis_base());
314 DoubleTab& val = ch.valeurs();
315 lecture_special(zvf, fich, val);
316}
317
318
319/*! @brief Reciprocal of the ecrit(.
320 *
321 * ..) method, reads only the sequential items (i.e. not the shared items received from another processor).
322 * We verify at the end that we have read exactly the expected number of items; if any are missing
323 * it means epsilon is wrong (or the mesh has changed...).
324 * Return value: total number of sequential items read (across all procs)
325 *
326 */
327static trustIdType lire_special(Entree& fich, const DoubleTab& coords, DoubleTab& val, const double epsilon)
328{
329 const int dim = coords.dimension(1);
330 const int nb_dim = val.nb_dim();
331 const int nb_comp = (nb_dim == 1) ? 1 : val.dimension(1);
332
333 const MD_Vector& md_vect = val.get_md_vector();
334 // Initially, 1 if the item is to be read, 0 if it is read by another processor.
335 // Once the item is read, the flag is set to 2.
336 ArrOfInt items_to_read;
337 const int n_to_read = md_vect->get_sequential_items_flags(items_to_read);
338 Octree_Double octree;
339 // Build an octree with "thick" nodes (epsilon size)
340 octree.build_nodes(coords, 0 /* do not include virtual elements */, epsilon);
341 const ArrOfInt& floor_elements = octree.floor_elements();
342
343 // The file contains this number of lines for this part of the array (total number of sequential items)
344 const trustIdType ntot = Process::mp_sum(n_to_read);
345
346 // We read from the file in blocks of buflines_max because there is
347 // a network broadcast at each comm:
348 const int buflines_max = 2048; // not too large, so as to have several blocks in test cases
349 DoubleTab buffer(buflines_max, dim + nb_comp);
350 int bufptr = buflines_max;
351 ArrOfInt items;
352
353
354 double max_epsilon_needed = epsilon;
355 // How many times did we find multiple candidates within epsilon?
356 int error_too_many_matches = 0;
357 // How many times did we encounter the same vertex to read multiple times?
358 int error_duplicate_read = 0;
359 // How many items have we read?
360 int count_items_read = 0;
361
362 // Loop over sequential items in the file:
363 trustIdType pourcent=0;
364 for (trustIdType i = 0; i < ntot; i++)
365 {
366 trustIdType tmp=(i*10)/(ntot-1);
367 if (tmp>pourcent || i==0)
368 {
369 pourcent=tmp;
370 Cerr<<"\r"<<pourcent*10<<"% of data has been found."<<flush;
371 }
372 if (bufptr == buflines_max)
373 {
374 bufptr = 0;
375 trustIdType n = std::min(static_cast<trustIdType>(buflines_max), ntot - i);
376 n *= (dim + nb_comp);
377 assert(n <= static_cast<trustIdType>(buffer.size_array()));
378 fich.get(buffer.addr(), static_cast<int>(n)); // n is small enough
379 }
380 const double x = buffer(bufptr, 0);
381 const double y = buffer(bufptr, 1);
382 const double z = (dim == 3) ? buffer(bufptr, 2) : 0.;
383 // Search for items potentially corresponding to the point (x,y,z)
384 int index = -1;
385 int nb_items_proches = octree.search_elements(x, y, z, index);
386 if (nb_items_proches > 0)
387 {
388 items.resize_array(nb_items_proches, RESIZE_OPTIONS::NOCOPY_NOINIT);
389 // See doc of Octree_Double::search_elements: copy the indices of nearby items into items:
390 for (int j = 0; j < nb_items_proches; j++)
391 items[j] = floor_elements[index++];
392 // Reduce the list to keep only items within epsilon
393 const int item_le_plus_proche = octree.search_nodes_close_to(x, y, z, coords, items, epsilon);
394 nb_items_proches = items.size_array();
395 if (nb_items_proches == 1)
396 {
397 const int flag = items_to_read[item_le_plus_proche];
398 if (flag == 1)
399 {
400 // Ok, we need to read this value
401 items_to_read[item_le_plus_proche] = 2;
402 count_items_read++;
403 if (nb_dim == 1)
404 {
405 val(item_le_plus_proche) = buffer(bufptr, dim);
406 }
407 else
408 {
409 for (int j = 0; j < nb_comp; j++)
410 val(item_le_plus_proche, j) = buffer(bufptr, dim + j);
411 }
412 }
413 else if (flag == 0)
414 {
415 // This item does not belong to me, do not read it
416 }
417 else
418 {
419 // Error, this item has already been read!!! epsilon is too large (or a save error???)
420 error_duplicate_read++;
421 }
422 }
423 else if (nb_items_proches == 0)
424 {
425 // ok, the vertex is on another processor (or epsilon too small??)
426 }
427 else
428 {
429 // Error: epsilon is too large, we have multiple candidates within epsilon
430 // Compute the distance to the second closest to display an error message at the end:
431 for (int ii = 0; ii < nb_items_proches; ii++)
432 {
433 const int i_coord = items[ii];
434 if (i_coord == item_le_plus_proche)
435 continue; // that one is probably the correct match, we need an epsilon smaller than this distance...
436 double xx = 0;
437 for (int j = 0; j < dim; j++)
438 {
439 double yy = coords(i_coord, j) - buffer(bufptr, j);
440 xx += yy * yy;
441 }
442 // We propose to set epsilon at most equal to 1/10 of the distance to the second closest point:
443 xx = sqrt(xx) * 0.1;
444 if (max_epsilon_needed > xx)
445 max_epsilon_needed = xx;
446 }
447 error_too_many_matches++;
448 }
449 }
450 bufptr++;
451 }
452 Cerr << finl;
453 // Errors?
454 int err = (count_items_read != n_to_read) || (error_too_many_matches > 0) || (error_duplicate_read > 0);
455 err = static_cast<int>(Process::mp_sum(err)); // sum of 0 and 1, always 'int'
456 if (err)
457 {
458 error_too_many_matches = static_cast<int>(Process::mp_sum(error_too_many_matches));
459 error_duplicate_read = static_cast<int>(Process::mp_sum(error_duplicate_read));
460 max_epsilon_needed = Process::mp_min(max_epsilon_needed);
462 {
463 if (error_too_many_matches)
464 {
465 Cerr << "Error in EcritureLectureSpecial: error_too_many_matches = " << error_too_many_matches
466 << ", epsilon is too large. Suggested value: " << max_epsilon_needed << finl;
467 if (max_epsilon_needed==0)
468 {
469 Cerr << "It could be because your mesh has two boundaries which match exactly." << finl;
470 Cerr << "It is possible to do calculation with this property but xyz restart process" << finl;
471 Cerr << "is impossible because it can't detect the differences between faces of the two boundaries..." << finl;
472 Cerr << "Try to do a classic restart with .sauv files." << finl;
473 }
474 }
475 else if (error_duplicate_read)
476 {
477 Cerr << "Error in EcritureLectureSpecial: error_duplicate_read = " << error_duplicate_read
478 << ", probably epsilon too large. " << finl;
479 }
480 else
481 {
482 Cerr << "Error in EcritureLectureSpecial: Some items were not found: epsilon too small (or the mesh has changed?)" << finl;
483 }
484 }
487 }
488 return ntot;
489}
490
491// Return value: total number of sequential items read (across all procs)
492static trustIdType lecture_special_part2(const Domaine_VF& zvf, Entree& fich, DoubleTab& val)
493{
494 const MD_Vector& md = val.get_md_vector();
495
496 trustIdType ntot = 0;
497 if (sub_type(MD_Vector_composite, md.valeur()))
498 {
499 // p1bubble fields and others: recursive call for the different sub-arrays:
500 DoubleTab_parts parts(val);
501 const int n = parts.size();
502 for (int i = 0; i < n; i++)
503 ntot += lecture_special_part2(zvf, fich, parts[i]);
504 }
505 else if (sub_type(MD_Vector_std, md.valeur()) || sub_type(MD_Vector_seq, md.valeur()))
506 {
507 const DoubleTab& coords = get_ref_coordinates_items(zvf, md);
508 const double epsilon = zvf.domaine().epsilon();
509 ntot += lire_special(fich, coords, val, epsilon);
510 }
511 else
512 {
513 Cerr << "EcritureLectureSpecial::lecture_special_part2: Error, unknown Metadata vector type : "
514 << md->que_suis_je() << finl;
516 }
517 return ntot;
518}
519
520/*! @brief Encoding of the re-reading of a field from a special positions/values file
521 *
522 */
523void EcritureLectureSpecial::lecture_special(const Domaine_VF& zvf, Entree& fich, DoubleTab& val)
524{
525
526 const MD_Vector& md_vect = val.get_md_vector();
527 if (!md_vect)
528 {
529 Cerr << "EcritureLectureSpecial::ecriture_special: error, cannot save an array with no metadata" << finl;
531 }
532 const trustIdType nb_items_seq = md_vect->nb_items_seq_tot();
533 if (nb_items_seq == 0)
534 return;
535
536 trustIdType bidon;
537 fich >> bidon >> bidon >> bidon >> bidon >> bidon;
538
539 trustIdType ntot = lecture_special_part2(zvf, fich, val);
540 if (ntot != nb_items_seq)
541 {
542 Cerr << "Internal error in EcritureLectureSpecial::lecture_special" << finl;
543 exit();
544 }
545
546 fich >> bidon >> bidon >> bidon >> bidon >> bidon >> bidon >> bidon >> bidon >> bidon >> bidon;
547
548 // Update the virtual parts of the val array
550}
551
552/*! @brief Returns the write mode in use (so it can be modified).
553 *
554 * This method is static.
555 *
556 */
558{
559 static Nom option=Output;
560
561 // disable MPIIO in sequential mode
562 if (Output=="EcrFicPartageMPIIO" && Process::is_sequential()) option="EcrFicPartageBin";
563
564 // disable MPIIO if TRUST_DISABLE_MPIIO=1
565 char* theValue = getenv("TRUST_DISABLE_MPIIO");
566 if (theValue != nullptr)
567 {
568 if (option=="EcrFicPartageMPIIO" && strcmp(theValue,"1")==0) option="EcrFicPartageBin";
569 }
570
571 return option;
572}
int_t size_array() const
Returns the size of the array in bits.
Definition ArrOfBit.h:45
virtual DoubleTab & valeurs()=0
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
virtual const Domaine_dis_base & domaine_dis_base() const
DoubleTab_t & les_sommets()
Definition Domaine.h:113
IntTab_t & les_elems()
Definition Domaine.h:129
class Domaine_VF
Definition Domaine_VF.h:44
virtual const DoubleTab & xv_bord() const
double xa(int num_arete, int k) const
Definition Domaine_VF.h:78
double xv(int num_face, int k) const
Definition Domaine_VF.h:76
int face_sommets(int i, int j) const
Returns the index of the i-th vertex of face num_face.
Definition Domaine_VF.h:582
double xp(int num_elem, int k) const
Definition Domaine_VF.h:77
const MD_Vector & md_vector_faces_bord() const
Definition Domaine_VF.h:157
double epsilon() const
const Domaine & domaine() const
static Nom & get_Output()
Returns the write mode in use (so it can be modified).
static int is_ecriture_special(int &special, int &a_faire)
Indicates whether the special format was requested in active writing by xyz save.
static int is_lecture_special()
Indicates whether the special format was requested in active reading by xyz restart.
Entree & interpreter(Entree &fich) override
static int ecriture_special(const Champ_base &ch, Sortie &fich)
Simple call to EcritureLectureSpecial::ecriture_special (const Domaine_VF& zvf,Sortie& fich,...
static void lecture_special(Champ_base &ch, Entree &fich)
Simple call to EcritureLectureSpecial::lecture_special (const Domaine_VF& zvf,Entree& fich,...
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual int get(int *ob, std::streamsize n)
Definition Entree.cpp:222
Base class for "interpreter" objects.
Definition Interprete.h:38
int get_sequential_items_flags(ArrOfBit &flags, int line_size=1) const
virtual trustIdType nb_items_seq_tot() const
Metadata for a distributed composite vector.
Dummy parallel descriptor used for sequential computations.
This is the simplest descriptor, used for arrays of values at vertices, elements, faces,...
: This class is an OWN_PTR but the pointed object is shared among multiple
Definition MD_Vector.h:48
const MD_Vector_base & valeur() const
Definition MD_Vector.h:77
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
friend class Entree
Definition Objet_U.h:71
static int dimension
Definition Objet_U.h:94
friend class Sortie
Definition Objet_U.h:70
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
const ArrOfInt_t & floor_elements() const
static int_t search_nodes_close_to(double x, double y, double z, const DoubleTab_t &coords, ArrOfInt_t &node_list, double epsilon)
Non-member method. Searches among the vertices in node_list for those within a distance.
void build_nodes(const DoubleTab_t &coords, const bool include_virtual, const double epsilon=0.)
builds an octree containing the points with coordinates coords.
int_t search_elements(double x, double y, double z, int_t &index) const
searches for the elements or points contained in the octree_floor that contains the point (x,...
static double mp_min(double)
Definition Process.cpp:391
static double mp_sum(double)
Computes the sum of x over all processors in the current group.
Definition Process.cpp:145
static void barrier()
Synchronizes all processors in the current group (waits until all processors have reached the barrier...
Definition Process.cpp:133
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
static int je_suis_maitre()
Returns 1 if on the master processor of the current group (i.e. me() == 0), 0 otherwise.
Definition Process.cpp:82
static bool is_sequential()
Definition Process.cpp:113
Base class for output streams.
Definition Sortie.h:52
virtual int put(const unsigned *ob, std::streamsize n, std::streamsize nb_colonnes=1)
Definition Sortie.cpp:101
virtual Sortie & syncfile()
Definition Sortie.cpp:187
_SIZE_ size_array() const
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
virtual const MD_Vector & get_md_vector() const
Definition TRUSTVect.h:123
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")
static int is_PDI_checkpoint()