TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Sonde.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_Generique_Interpolation.h>
17#include <Champ_Generique_refChamp.h>
18#include <Domaine_Cl_dis_base.h>
19#include <Entree_complete.h>
20
21#include <Process.h>
22#include <Champ_Inc_base.h>
23#include <Postraitement.h>
24#include <Domaine_VF.h>
25#include <sys/stat.h>
26#include <Sonde.h>
27
28Implemente_instanciable_sans_constructeur_ni_destructeur(Sonde,"Sonde",Objet_U);
29// XD sonde objet_lecture nul NO_BRACE Keyword is used to define the probes. Observations: the probe coordinates should
30// XD_CONT be given in Cartesian coordinates (X, Y, Z), including axisymmetric.
31// XD attr nom_sonde chaine nom_sonde REQ Name of the file in which the values taken over time will be saved. The
32// XD_CONT complete file name is nom_sonde.son.
33// XD attr special chaine(into=["grav","som","nodes","chsom","gravcl"]) special OPT Option to change the positions of
34// XD_CONT the probes. Several options are available: NL2 grav : each probe is moved to the nearest cell center of the
35// XD_CONT mesh; NL2 som : each probe is moved to the nearest vertex of the mesh NL2 nodes : each probe is moved to the
36// XD_CONT nearest face center of the mesh; NL2 chsom : only available for P1NC sampled field. The values of the probes
37// XD_CONT are calculated according to P1-Conform corresponding field. NL2 gravcl : Extend to the domain face boundary a
38// XD_CONT cell-located segment probe in order to have the boundary condition for the field. For this type the extreme
39// XD_CONT probe point has to be on the face center of gravity.
40// XD attr nom_inco chaine nom_inco REQ Name of the sampled field.
41// XD attr mperiode chaine(into=["periode"]) mperiode REQ Keyword to set the sampled field measurement frequency.
42// XD attr prd floattant prd REQ Period value. Every prd seconds, the field value calculated at the previous time step
43// XD_CONT is written to the nom_sonde.son file.
44// XD attr type sonde_base type REQ Type of probe.
45
46// XD sonde_base objet_lecture sonde_base NO_BRACE Basic probe. Probes refer to sensors that allow a value or several
47// XD_CONT points of the domain to be monitored over time. The probes may be a set of points defined one by one (keyword
48// XD_CONT Points) or a set of points evenly distributed over a straight segment (keyword Segment) or arranged according
49// XD_CONT to a layout (keyword Plan) or according to a parallelepiped (keyword Volume). The fields allow all the values
50// XD_CONT of a physical value on the domain to be known at several moments in time.
51
52// XD segmentfacesx sonde_base segmentfacesx NO_BRACE Segment probe where points are moved to the nearest x faces
53// XD attr nbr entier nbr REQ Number of probe points of the segment, evenly distributed.
54// XD attr point_deb un_point point_deb REQ First outer probe segment point.
55// XD attr point_fin un_point point_fin REQ Second outer probe segment point.
56
57// XD segmentfacesy sonde_base segmentfacesy NO_BRACE Segment probe where points are moved to the nearest y faces
58// XD attr nbr entier nbr REQ Number of probe points of the segment, evenly distributed.
59// XD attr point_deb un_point point_deb REQ First outer probe segment point.
60// XD attr point_fin un_point point_fin REQ Second outer probe segment point.
61
62// XD segmentfacesz sonde_base segmentfacesz NO_BRACE Segment probe where points are moved to the nearest z faces
63// XD attr nbr entier nbr REQ Number of probe points of the segment, evenly distributed.
64// XD attr point_deb un_point point_deb REQ First outer probe segment point.
65// XD attr point_fin un_point point_fin REQ Second outer probe segment point.
66
67// XD radius sonde_base radius NO_BRACE not_set
68// XD attr nbr entier nbr REQ Number of probe points of the segment, evenly distributed.
69// XD attr point_deb un_point point_deb REQ First outer probe segment point.
70// XD attr radius floattant radius REQ not_set
71// XD attr teta1 floattant teta1 REQ not_set
72// XD attr teta2 floattant teta2 REQ not_set
73
74// XD un_point objet_lecture nul NO_BRACE A point.
75// XD attr pos listf pos REQ Point coordinates.
76
77// XD listpoints listobj nul NO_BRACE un_point NO_COMMA Points.
78// XD points sonde_base points NO_BRACE Keyword to define the number of probe points. The file is arranged in columns.
79// XD attr points listpoints points REQ Probe points.
80
81// XD numero_elem_sur_maitre sonde_base numero_elem_sur_maitre NO_BRACE Keyword to define a probe at the special
82// XD_CONT element. Useful for min/max sonde.
83// XD attr numero entier numero REQ element number
84
85// XD segmentpoints points segmentpoints NO_BRACE This keyword is used to define a probe segment from specifics points.
86// XD_CONT The nom_champ field is sampled at ns specifics points.
87
88// XD position_like sonde_base position_like NO_BRACE Keyword to define a probe at the same position of another probe
89// XD_CONT named autre_sonde.
90// XD attr autre_sonde chaine autre_sonde REQ Name of the other probe.
91
92// XD plan sonde_base plan NO_BRACE Keyword to set the number of probe layout points. The file format is type .lml
93// XD attr nbr entier nbr REQ Number of probes in the first direction.
94// XD attr nbr2 entier nbr2 REQ Number of probes in the second direction.
95// XD attr point_deb un_point point_deb REQ First point defining the angle. This angle should be positive.
96// XD attr point_fin un_point point_fin REQ Second point defining the angle. This angle should be positive.
97// XD attr point_fin_2 un_point point_fin_2 REQ Third point defining the angle. This angle should be positive.
98
99// XD volume sonde_base volume NO_BRACE Keyword to define the probe volume in a parallelepiped passing through 4 points
100// XD_CONT and the number of probes in each direction.
101// XD attr nbr entier nbr REQ Number of probes in the first direction.
102// XD attr nbr2 entier nbr2 REQ Number of probes in the second direction.
103// XD attr nbr3 entier nbr3 REQ Number of probes in the third direction.
104// XD attr point_deb un_point point_deb REQ Point of origin.
105// XD attr point_fin un_point point_fin REQ Point defining the first direction (from point of origin).
106// XD attr point_fin_2 un_point point_fin_2 REQ Point defining the second direction (from point of origin).
107// XD attr point_fin_3 un_point point_fin_3 REQ Point defining the third direction (from point of origin).
108
109// XD circle sonde_base circle NO_BRACE Keyword to define several probes located on a circle.
110// XD attr nbr entier nbr REQ Number of probes between teta1 and teta2 (angles given in degrees).
111// XD attr point_deb un_point point_deb REQ Center of the circle.
112// XD attr direction entier(into=[0,1,2]) direction OPT Axis normal to the circle plane (0:x axis, 1:y axis, 2:z axis).
113// XD attr radius floattant radius REQ Radius of the circle.
114// XD attr theta1 floattant theta1 REQ First angle.
115// XD attr theta2 floattant theta2 REQ Second angle.
116
117// XD circle_3 sonde_base circle_3 NO_BRACE Keyword to define several probes located on a circle (in 3-D space).
118// XD attr nbr entier nbr REQ Number of probes between teta1 and teta2 (angles given in degrees).
119// XD attr point_deb un_point point_deb REQ Center of the circle.
120// XD attr direction entier(into=[0,1,2]) direction REQ Axis normal to the circle plane (0:x axis, 1:y axis, 2:z axis).
121// XD attr radius floattant radius REQ Radius of the circle.
122// XD attr theta1 floattant theta1 REQ First angle.
123// XD attr theta2 floattant theta2 REQ Second angle.
124
125static int fichier_sondes_cree=0;
126static SFichier fichier_sondes;
127
128/*! @brief Constructeur d'une sonde a partir de son nom.
129 *
130 * @param (Nom& nom) le nom de la sonde a construire
131 */
132Sonde::Sonde(const Nom& nom) :
133 nom_(nom),
134 dim(-1),
135 ncomp(-1),
136 numero_elem_(-1),
137 periode(1.e10), // initialisation de periode par defaut
138 nb_bip(0.),
140{}
141
142/*! @brief Constructeur d'une sonde sans parametre.
143 *
144 */
146 Sonde(Nom()) // thank you C++11
147{}
148
149/*! @brief Imprime le type de l'objet sur un flot de sortie.
150 *
151 * @param (Sortie& s) un flot de sortie
152 * @return (Sortie&) le flot de sortie modifie
153 */
154Sortie& Sonde::printOn(Sortie& s ) const
155{
156 return s << que_suis_je();
157}
158
160{
161 // Recherche du champ sonde
162 // Remplissage de la reference au champ
163 Cerr << "Reading of the probe: " << nom_ << " on the field: " << nom_champ_lu_ << finl;
164 //On devrait acceder au domaine par le champ generique
165 //Mais reference pas encore faite
166 Probleme_base& Pb = mon_post->probleme();
167 const Motcle nom_domaine = mon_post->domaine()->le_nom();
168 Motcle nom_champ_ref;
169 Motcle nom_macro=nom_champ_lu_;
170 Motcle nom_macro_test, nom1("_not_def"), nom2("_not_def");
171 const Motcles& noms_champs_postraitables = mon_post->les_sondes().get_noms_champs_postraitables();
172 if (!(noms_champs_postraitables.contient_(nom_champ_lu_)||mon_post->comprend_champ_post(nom_champ_lu_)))
173 {
174 if (nom_champ_lu_.debute_par("MOYENNE_"))
175 nom_macro = nom_macro.suffix("MOYENNE_");
176 else if (nom_champ_lu_.debute_par("ECART_TYPE_"))
177 nom_macro = nom_macro.suffix("ECART_TYPE_");
178
179 if (nom_champ_lu_.debute_par("CORRELATION_"))
180 {
181 nom_macro_test = nom_champ_lu_;
182 nom_macro_test = nom_macro_test.suffix("CORRELATION_");
183 for (auto& itr : noms_champs_postraitables)
184 {
185 nom_macro_test = nom_macro_test.suffix(itr);
186 if (nom_macro_test.debute_par("_"))
187 {
188 nom1 = itr;
189 nom2 = nom_macro_test.suffix("_");
190 }
191 }
192 }
193 }
194
195 if (noms_champs_postraitables.contient_(nom_macro))
196 {
197 if (nom_macro==Motcle(nom_champ_lu_))
198 {
199 OBS_PTR(Champ_base) champ_ref = Pb.get_champ(nom_champ_lu_);
200 const Nom& nom_champ_base = champ_ref->le_nom();
201 const Noms& compos_base = champ_ref->noms_compo();
202 int ncomposante = Champ_Generique_base::composante(nom_champ_lu_,nom_champ_base,compos_base,champ_ref->get_synonyms());
203
204 if (ncomposante==-1)
205 nom_champ_ref = nom_champ_base +"_natif_"+ nom_domaine;
206 else
207 {
208 Nom nume(ncomposante);
209 nom_champ_ref = nom_champ_base+"_natif_"+ nom_domaine+nume;
210 }
211 }
212 else
213 nom_champ_ref = nom_champ_lu_+"_natif_"+nom_domaine;
214 }
215 else
216 {
217 //Cas des correlations
218 if ((noms_champs_postraitables.contient_(nom1)) && (noms_champs_postraitables.contient_(nom2)))
219 {
220 nom_champ_ref = "Correlation_";
221 nom_champ_ref += nom1+"_natif_"+nom_domaine+"_"+nom2+"_natif_"+nom_domaine;
222 }
223 else
224 //Cas d un champ generique general
225 nom_champ_ref = nom_champ_lu_;
226 }
227
228 mon_champ = mon_post->get_champ_post(nom_champ_ref);
229
230 // Remplissage de l'attribut ncomp (il vaut -1 par defaut)
231
232 const Noms nom_champ = mon_champ->get_property("nom");
233 const Noms noms_comp = mon_champ->get_property("composantes");
234 ncomp = Champ_Generique_base::composante(nom_champ_ref,nom_champ[0],noms_comp,mon_champ->get_property("synonyms"));
235
236 initialiser();
237}
238/*! @brief Lit les specifications d'une sonde a partir d'un flot d'entree.
239 *
240 * Format:
241 * Sondes
242 * {
243 * [nom_sonde nom_champ Periode dts Points n x1 y1 [z1] ... xn yn [zn]
244 * [nom_sonde nom_champ Periode dts Segment ns x1 y1 [z1] x2 y2 [z2]
245 * ...
246 * }
247 *
248 * @param (Entree& is) un flot d'entree
249 * @return (Entree&) le flot d'entree modifie
250 * @throws donnees de la sonde non definies
251 * @throws erreur de format, mot clef inconnus
252 * @throws donnees de la sonde pas definies correctement
253 */
255{
256 assert(mon_post);
257 Motcle motlu;
258 //Motcle accolade_ouverte("{");
259 Motcle accolade_fermee("}");
260 int nbre_points;
261
262 is >> motlu;
263 // Lecture d'un mot cle qui n'est pas le champ
264 if (motlu=="nodes")
265 {
266 nodes = true;
267 is >> motlu;
268 }
269 else if (motlu=="chsom")
270 {
271 chsom = true;
272 is >> motlu;
273 }
274 else if (motlu=="grav")
275 {
276 grav = true;
277 is >> motlu;
278 }
279 else if (motlu=="gravcl")
280 {
281 gravcl = true;
282 is >> motlu;
283 }
284 else if (motlu=="som")
285 {
286 som = true;
287 is >> motlu;
288 }
289 // Affectation du nom du champ
290 nom_champ_lu_ = motlu;
291
293 create_champ_generique(is, motlu);
294
295 // Lecture des caracteristiques de la sonde
296 IntVect fait(2);
297
298 Motcles les_motcles(16);
299 {
300 les_motcles[0] = "periode";
301 les_motcles[1] = "point";
302 les_motcles[2] = "points";
303 les_motcles[3] = "segment";
304 les_motcles[4] = "plan";
305 les_motcles[5] = "volume";
306 les_motcles[6] = "segmentxdx";
307 les_motcles[7] = "planxdxdy";
308 les_motcles[8] = "circle";
309 les_motcles[9] = "position_like";
310 les_motcles[10] = "numero_elem_sur_maitre";
311 les_motcles[11] = "segmentpoints";
312 les_motcles[12] = "segmentfacesx";
313 les_motcles[13] = "segmentfacesy";
314 les_motcles[14] = "segmentfacesz";
315 les_motcles[15] = "radius";
316 }
317
318 while ((fait(0) != 1) || (fait(1) != 1))
319 {
320 is >> motlu;
321 if (motlu == accolade_fermee)
322 {
323 Cerr << "Error while reading the probe " << nom_ <<finl;
324 Cerr << "The data of the probe were not defined" << finl;
325 exit();
326 }
327 int rang=les_motcles.search(motlu);
328 if (rang == -1)
329 {
330 Cerr << "Error while reading the probe " << nom_ <<finl;
331 Cerr << motlu << " is not understood; the keywords understood are : " << finl;
332 Cerr << les_motcles;
333 exit();
334 }
335
336 if(rang != 0)
337 validate_type(motlu); // restrict valid localisation for IJK notably
338
339 switch(rang)
340 {
341 case 0:
342 {
343 is >> periode;
344 break;
345 }
346 case 1:
347 case 2:
348 case 11:
349 {
350 type_ = les_motcles[rang];
351 rang = 1;
352 dim = 0;
353 is >> nbre_points;
354 les_positions_sondes_initiales_.resize(nbre_points,dimension);
355
356 for (int i=0; i<nbre_points; i++)
357 for (int j=0; j<dimension; j++)
359
360 break;
361 }
362 case 10:
363 {
364 type_ = les_motcles[rang];
365 rang=1;
366 dim=0;
367 gravcl = false;
368 is >> numero_elem_;
370 break;
371 }
372 case 3:
373 case 6:
374 case 12:
375 case 13:
376 case 14:
377 {
378 type_ = les_motcles[rang];
379 int rang2=rang;
380 rang = 1;
381 dim = 1;
382 if (rang2==12 || rang2==13 || rang2==14)
383 {
384 nodes = true;
385 grav = false;
386 gravcl = false;
387 som = false;
388 }
389 const Motcle mot = type_.getSuffix("SEGMENTFACES");
390 Motcles nom_dir(3);
391
392 nom_dir[0] = "X";
393 nom_dir[1] = "Y";
394 nom_dir[2] = "Z";
395
396 orientation_faces_ = nom_dir.search(mot);
397
398 DoubleVect origine(dimension);
399 DoubleVect extremite(dimension);
400 DoubleVect dx(dimension);
401 is >> nbre_points;
402 les_positions_sondes_initiales_.resize(nbre_points,dimension);
403
404 for (int i=0; i<dimension; i++)
405 {
406 is >> origine(i);
407 type_+=" ";
408 type_+=(Nom)origine(i);
409 }
410 for (int i=0; i<dimension; i++)
411 {
412 is >> extremite(i);
413 type_+=" ";
414 type_+=(Nom)extremite(i);
415 }
416 for (int i=0; i<dimension; i++)
417 if (rang2==6)
418 dx(i)=(extremite(i))/(nbre_points-1);
419 else
420 dx(i)=(extremite(i)-origine(i))/(nbre_points-1);
421 for (int i=0; i<nbre_points; i++)
422 for (int j=0; j<dimension; j++)
423 les_positions_sondes_initiales_(i,j)=origine(j)+i*dx(j);
424 break;
425 }
426 case 4:
427 case 7:
428 {
429 type_ = les_motcles[rang];
430 int rang2=rang;
431 rang = 1;
432 dim = 2;
433 gravcl = false;
434 DoubleVect origine(dimension);
435 DoubleVect extremite1(dimension);
436 DoubleVect extremite2(dimension);
437 DoubleVect dx1(dimension);
438 DoubleVect dx2(dimension);
439 is >> nbre_points1;
440 is >> nbre_points2;
441 nbre_points=nbre_points1*nbre_points2;
442 les_positions_sondes_initiales_.resize(nbre_points,dimension);
443
444 for (int i=0; i<dimension; i++)
445 is >> origine(i);
446 for (int i=0; i<dimension; i++)
447 is >> extremite1(i);
448 for (int i=0; i<dimension; i++)
449 is >> extremite2(i);
450 if (rang2==7)
451 {
452 for (int i=0; i<dimension; i++)
453 dx1(i)=(extremite1(i))/(nbre_points1-1);
454 for (int i=0; i<dimension; i++)
455 dx2(i)=(extremite2(i))/(nbre_points2-1);
456 }
457 else
458 {
459 for (int i=0; i<dimension; i++)
460 dx1(i)=(extremite1(i)-origine(i))/(nbre_points1-1);
461 for (int i=0; i<dimension; i++)
462 dx2(i)=(extremite2(i)-origine(i))/(nbre_points2-1);
463 }
464 for (int i=0; i<nbre_points1; i++)
465 for (int j=0; j<nbre_points2; j++)
466 for (int k=0; k<dimension; k++)
467 les_positions_sondes_initiales_(i*nbre_points2+j,k)=origine(k)+i*dx1(k)+j*dx2(k);
468 break;
469 }
470
471 case 5:
472 {
473 type_ = les_motcles[rang];
474 rang = 1;
475 dim = 3;
476 gravcl = false;
477 ArrOfDouble origine(dimension);
478 ArrOfDouble extremite1(dimension);
479 ArrOfDouble extremite2(dimension);
480 ArrOfDouble extremite3(dimension);
481 ArrOfDouble dx1(dimension);
482 ArrOfDouble dx2(dimension);
483 ArrOfDouble dx3(dimension);
484 is >> nbre_points1;
485 is >> nbre_points2;
486 is >> nbre_points3;
488 les_positions_sondes_initiales_.resize(nbre_points,dimension);
489
490 for (int i=0; i<dimension; i++)
491 is >> origine[i];
492 for (int i=0; i<dimension; i++)
493 is >> extremite1[i];
494 for (int i=0; i<dimension; i++)
495 is >> extremite2[i];
496 for (int i=0; i<dimension; i++)
497 is >> extremite3[i];
498 for (int i=0; i<dimension; i++)
499 dx1[i]=(extremite1[i]-origine[i])/(nbre_points1-1);
500 for (int i=0; i<dimension; i++)
501 dx2[i]=(extremite2[i]-origine[i])/(nbre_points2-1);
502 for (int i=0; i<dimension; i++)
503 dx3[i]=(extremite3[i]-origine[i])/(nbre_points3-1);
504 for (int i=0; i<nbre_points1; i++)
505 for (int j=0; j<nbre_points2; j++)
506 for (int m=0; m<nbre_points3; m++)
507 for (int k=0; k<dimension; k++)
508 les_positions_sondes_initiales_(i+j*nbre_points1+m*nbre_points1*nbre_points2,k)=origine[k]+i*dx1[k]+j*dx2[k]+m*dx3[k];
509 break;
510 }
511 case 8:
512 {
513 type_ = les_motcles[rang];
514 // circle nbre_points x0 y0 [z0 dir] radius teta1 teta2
515 rang = 1;
516 dim = 1;
517 gravcl = false;
518 int dir;
519 double radius, teta1, teta2;
520 DoubleVect origine(dimension);
521 is >> nbre_points;
522 les_positions_sondes_initiales_.resize(nbre_points,dimension);
523 for (int i=0; i<dimension; i++)
524 is >> origine(i);
525 if (dimension==3) is >> dir;
526 is >> radius >> teta1 >> teta2;
527 // Ajout des informations
528 for (int i=0; i<dimension; i++)
529 {
530 type_+=" ";
531 type_+=(Nom)origine(i);
532 }
533 type_+=" ";
534 type_+=(Nom)radius;
535 type_+=" ";
536 type_+=(Nom)teta1;
537 type_+=" ";
538 type_+=(Nom)teta2;
539 // We calculate the positions
540 for (int i=0; i<nbre_points; i++)
541 {
542 double angle=teta1+(teta2-teta1)*i/(nbre_points-1);
543 angle*=M_PI/180;
544 if (dimension==2)
545 {
546 les_positions_sondes_initiales_(i,0)=origine(0)+radius*cos(angle);
547 les_positions_sondes_initiales_(i,1)=origine(1)+radius*sin(angle);
548 }
549 else if (dimension==3)
550 {
551 if (dir==0)
552 {
553 les_positions_sondes_initiales_(i,0)=origine(0);
554 les_positions_sondes_initiales_(i,1)=origine(1)+radius*cos(angle);
555 les_positions_sondes_initiales_(i,2)=origine(2)+radius*sin(angle);
556 }
557 else if (dir==1)
558 {
559 les_positions_sondes_initiales_(i,0)=origine(0)+radius*cos(angle);
560 les_positions_sondes_initiales_(i,1)=origine(1);
561 les_positions_sondes_initiales_(i,2)=origine(2)+radius*sin(angle);
562 }
563 else if (dir==2)
564 {
565 les_positions_sondes_initiales_(i,0)=origine(0)+radius*cos(angle);
566 les_positions_sondes_initiales_(i,1)=origine(1)+radius*sin(angle);
567 les_positions_sondes_initiales_(i,2)=origine(2);
568 }
569 }
570 }
571 break;
572 }
573 case 15:
574 {
575 assert(dimension==3);
576 type_ = les_motcles[rang];
577 // radius nbre_points x0 y0 z0 theta radius1 radius2
578 rang = 1;
579 dim = 1;
580 gravcl = false;
581 double theta, radius1, radius2;
582 DoubleVect origine(dimension);
583 is >> nbre_points;
584 les_positions_sondes_initiales_.resize(nbre_points,dimension);
585 for (int i=0; i<dimension; i++)
586 is >> origine(i);
587 is >> theta >> radius1 >> radius2;
588 // Ajout des informations
589 for (int i=0; i<dimension; i++)
590 {
591 type_+=" ";
592 type_+=(Nom)origine(i);
593 }
594 type_+=" ";
595 type_+=(Nom)theta;
596 type_+=" ";
597 type_+=(Nom)radius1;
598 type_+=" ";
599 type_+=(Nom)radius2;
600 // We calculate the positions
601 theta*=M_PI/180;
602 for (int i=0; i<nbre_points; i++)
603 {
604 double radius = radius1+(radius2-radius1)*i/(nbre_points-1);
605 les_positions_sondes_initiales_(i,0)=origine(0)+radius*cos(theta);
606 les_positions_sondes_initiales_(i,1)=origine(1)+radius*sin(theta);
607 les_positions_sondes_initiales_(i,2)=origine(2);
608 }
609 break;
610 }
611 case 9:
612 {
613 Motcle autre_sonde;
614 is >> autre_sonde;
615 // on cherche la sonde correspondante
616 int m=-1;
617 const Sondes& les_sondes=mon_post->les_sondes();
618 for (int i=0; i<les_sondes.size(); i++)
619 if (les_sondes(i)->get_nom()==autre_sonde)
620 {
621 m=i;
622 break;
623 }
624 //else Cerr<<les_sondes(i).get_nom()<<finl;
625 if (m==-1)
626 {
627 Cerr<<" The probe name "<<autre_sonde<< " was not found"<<finl;
628 exit();
629 }
630 // on recupere les_positions_
631 const Sonde& la_sonde_ref=les_sondes(m);
632 type_ = la_sonde_ref.get_type();
634 dim = la_sonde_ref.get_dim();
635 rang=1;
636 break;
637 }
638 default:
639 {
640 Cerr << motlu <<"is not yet understood!" << finl;
641 exit();
642 }
643 }
644 fait(rang) = 1;
645 }
646 if ( (fait[0] == 0) || (fait[1] == 0) || (dim==-1))
647 {
648 Cerr << "Error while reading the probe " << nom_ << finl;
649 Cerr << "The data of the probe have not been properly defined" << finl;
650 exit();
651 }
652
653 // Construction du fichier associe a la sonde
655 nom_fichier_+= "_";
657 if (dim==2)
658 nom_fichier_+= ".plan";
659 else
660 nom_fichier_+= ".son";
661
663 {
664 // Ajout du nom du fichier sonde dans le fichier listant les sondes
665 // Ce fichier sera utilise par Run_sonde
666 // SFichier fichier_sondes;
667 Nom nom_fich = nom_du_cas();
668 nom_fich += ".sons";
669 if (!fichier_sondes.is_open())
670 {
671 if (!fichier_sondes_cree)
672 fichier_sondes.ouvrir(nom_fich);
673 else
674 fichier_sondes.ouvrir(nom_fich, ios::app);
675 }
676 fichier_sondes << nom_fichier_ << finl;
677 fichier_sondes_cree = 1;
678 }
679 return is;
680}
681
682/** Creation des Champ_Generique_refChamp necessaire pour l initialisation de la REF a Champ_Generique_base
683 * Si le champ demande est un Champ_base connu du probleme on cree le Champ_Generique_refChamp correspondant
684 */
686{
687 Probleme_base& Pb = mon_post->probleme();
688 const Motcles& noms_champs_postraitables = mon_post->les_sondes().get_noms_champs_postraitables();
689 if (noms_champs_postraitables.contient_(nom_champ_lu_))
690 {
692 //On va creer un Champ_Generique_refChamp dont le nom a pour base
693 //le nom du champ auquel on fait reference et non pas une composante de ce champ
694 OBS_PTR(Champ_base) champ_ref = Pb.get_champ(nom_champ_lu_);
695 const Nom& le_nom_champ = champ_ref->le_nom();
696 const Motcle nom_domaine = mon_post->domaine()->le_nom();
697 Motcle identifiant;
698
699 identifiant = Motcle(le_nom_champ)+"_natif_"+nom_domaine;
700 if (!mon_post->comprend_champ_post(identifiant))
701 {
702 mon_post->creer_champ_post(le_nom_champ,"natif",is);
703 }
704 }
705 else
706 {
707 Nom expression;
708 int is_champ_predefini = Pb.expression_predefini(motlu,expression);
709 if ((is_champ_predefini) && (!mon_post->comprend_champ_post(nom_champ_lu_)))
710 {
711 OWN_PTR(Champ_Generique_base) champ;
712 Entree_complete s_complete(expression,is);
713 s_complete>>champ;
714 mon_post->complete_champ(champ,nom_champ_lu_);
715 }
716 }
717}
718
719/*! @brief Associer le postraitement a la sonde.
720 *
721 * @param (Postraitement& le_post) le postraitement a associer
722 */
724{
725 mon_post=le_post;
726 if (mon_post->noms_fichiers_sondes().contient(nom_)==0)
727 mon_post->noms_fichiers_sondes().add(nom_);
728 else
729 {
730 Cerr << "The filename " << nom_ << " is used several times for probes." << finl;
731 Cerr << "A probe must have a unique filename to avoid writing conflicts." << finl;
732 exit();
733 }
734}
735
736const Domaine& Sonde::get_domaine_geom() const
737{
738 return mon_champ->get_ref_domain();
739}
740
742{
743 return mon_champ->get_property("nom");
744}
745
747{
748 const Noms noms_comp = mon_champ->get_property("composantes");
749 Motcle directive = mon_champ->get_directive_pour_discr();
750 int nb_comp = (directive == "champ_Fonc_Quad_DG" || directive == "champ_elem_DG") ? 1 : noms_comp.size();
751 return nb_comp;
752}
753
755{
756 // TODO ABN : when is it different from Pb::temps_courant ?? Inc fields maybe ?
757 return mon_champ->get_time();
758}
759
761{
762 int nbre_points_tot = les_positions_sondes_.dimension(0);
763 DoubleTab coords_bords(2,dimension);
764 for (int idim=0; idim<dimension; idim++)
765 {
766 coords_bords(0,idim) = les_positions_sondes_(0,idim);
767 coords_bords(1,idim) = les_positions_sondes_(nbre_points_tot-1,idim);
768 }
769
770 Cerr<<"The location of the probe named "<<nom_<<" are modified (to centers of gravity). Check the .log files to see the new location."<<finl;
771 const Domaine_VF& domaineVF = ref_cast(Domaine_VF,mon_champ->get_ref_domaine_dis_base());
772 const DoubleTab& xp = domaineVF.xp();
773 for (int i=0; i<nbre_points_tot; i++)
774 {
775 if(elem_[i]!=-1)
776 {
777 Journal()<<"The point " << i << " of the probe "<<nom_<<" is moved:";
778 for (int dir=0; dir<dimension; dir++)
779 {
780 Journal() << " x(" << dir << "): " << les_positions_sondes_(i,dir) << " -> " << xp(elem_[i],dir);
781 les_positions_sondes_(i,dir)=xp(elem_[i],dir);
782 }
783 Journal() << finl;
784 }
785 }
786 if (gravcl)
787 ajouter_bords(coords_bords);
788}
789
790/*! @brief Initialise la sonde.
791 *
792 * Dimensionne les tableaux, de valeurs, verifie si les points specifies sont
793 * bien dans le domaine de calcul.
794 *
795 * @param (Domaine& domaine_geom) le domaine de calcul qui sera sondee
796 * @throws point de sondage en dehors du domaine de calcul
797 */
799{
800 // Calcul des positions exactes a partir des positions initiales des sondes:
802 // Dimension the elem_ array:
803 int nbre_points_tot = les_positions_sondes_.dimension(0);
804 if(elem_.size() != nbre_points_tot)
805 elem_.resize(nbre_points_tot);
806
807 const Domaine& domaine_geom = get_domaine_geom();
808
809 if (numero_elem_==-1)
810 {
811 // Location of probes is given by coordinates in the les_positions_ array:
812 int nb_coord = les_positions_sondes_.dimension(1);
813 if (nb_coord != Objet_U::dimension)
814 {
815 Cerr << "You can't specify the probe named " << nom_ << " with "<< nb_coord << " coordinates on the domain named " <<domaine_geom.le_nom()<<finl;
816 Cerr << "which has spatial dimension " << Objet_U::dimension << finl;
817 Cerr << "Change the probe coordinates or use numero_elem_sur_maitre keyword (see documentation)" << finl;
818 Cerr << "to specify a cell containing the probe and not its coordinates." << finl;
819 // [ABN] : we should exit, otherwise we just don't see the warning:
821 }
822 // Fill the elem_ array (which list real cells containing all the probes):
824 }
825 else
826 {
827 // Location of the probe is given by an element number:
829 const IntTab& les_elems=mon_champ->get_ref_domaine_dis_base().domaine().les_elems();
830 if (numero_elem_<les_elems.dimension_tot(0))
831 {
832 const DoubleTab& coord=mon_champ->get_ref_domaine_dis_base().domaine().les_sommets();
833 int nb_som=les_elems.dimension(1);
834 // Fill les_positions_ with the cog of the cell numero_elem_
835 for (int s=0; s<nb_som; s++)
836 {
837 int soml=les_elems(numero_elem_,s);
838 if (soml>-1)
839 for (int dir=0; dir<dimension; dir++)
840 les_positions_sondes_(0,dir)+=coord(soml,dir)/nb_som;
841 }
842 }
843 else
844 {
845 if (je_suis_maitre())
846 {
847 Cerr<<" On the probe named " << nom_ << " , the element number "<<numero_elem_<<" does not exist on the master processor, we put the position to zero"<<finl;
849 }
850 elem_[0]=-1;
851 }
852 }
853 // Check if some probes are outside the domain:
854 ArrOfDouble tmp(nbre_points_tot);
855 for (int i=0; i<nbre_points_tot; i++)
856 tmp[i] = elem_[i];
858 for (int i=0; i<nbre_points_tot; i++)
859 if (tmp[i]==-1)
860 Cerr << "WARNING: The point number " << i+1 << " of the probe named " << nom_ << " is outside the computational domain " << domaine_geom.le_nom() << finl;
861
862 const Noms noms_champ = get_noms_champ();
863
864 if (grav || gravcl)
866 else if (nodes)
867 {
868 const Domaine_VF& domaineVF = ref_cast(Domaine_VF,mon_champ->get_ref_domaine_dis_base());
869 const DoubleTab& xv = domaineVF.xv();
870 const IntTab& elem_faces = domaineVF.elem_faces();
871 if (mp_max(elem_faces.size_array())==0)
872 {
873 Cerr << "Error: the domain " << domaineVF.domaine().le_nom() << " is not discretized." << finl;
874 exit();
875 }
876 if (sub_type(Champ_Generique_Interpolation,mon_champ.valeur()))
877 {
878 Motcle dom_interp=mon_champ->get_ref_domain().le_nom();
879 Cerr << finl;
880 Cerr << "Error in your probe : " << nom_ << finl;
881 Cerr << "You can not project to nodes, the field " << noms_champ[0] << finl;
882 Cerr << "which is interpolated on the domain " << dom_interp << finl;
883 exit();
884 }
885 Cerr<<"The location of the probe named "<<nom_<<" are modified (to faces). Check the .log files to see the new location."<<finl;
886 const int nfaces_par_element = domaine_geom.nb_faces_elem() ;
887 for (int i=0; i<nbre_points_tot; i++)
888 {
889 double dist_min=DMAXFLOAT;
890 int face_min=-1;
891 if(elem_[i]!=-1)
892 {
893 Journal()<<"The point " << i << " of the probe "<<nom_<<" is moved:";
894 for(int fac=0; fac<nfaces_par_element; fac++)
895 {
896 int face=elem_faces(elem_[i],fac);
897 // Sonde de type segmentfaces : on recherche seulement parmi les faces orientees selon
898 // orientation_faces_
899 if (face >= 0 &&
901 {
902 double dist=0.;
903
904 for (int dir=0; dir<dimension; dir++)
905 dist+=(xv(face,dir)-les_positions_sondes_(i,dir))*(xv(face,dir)-les_positions_sondes_(i,dir));
906
907 if(dist<=dist_min)
908 {
909 dist_min=dist;
910 face_min=face;
911 }
912 }
913 }
914
915 for (int dir=0; dir<dimension; dir++)
916 {
917 Journal() << " x(" << dir << "): " << les_positions_sondes_(i,dir) << " -> " << xv(face_min,dir);
918 les_positions_sondes_(i,dir)=xv(face_min,dir);
919 }
920 Journal() << " (" << (face_min < domaineVF.premiere_face_int() ? "boundary face " : "internal face ") << face_min<<")" << finl;
921 }
922 }
923 }
924 else if (som)
925 {
926 if (sub_type(Champ_Generique_Interpolation,mon_champ.valeur()))
927 {
928 Motcle dom_interp=mon_champ->get_ref_domain().le_nom();
929 Cerr << finl;
930 Cerr << "Error in your probe : " << nom_ << finl;
931 Cerr << "You can not project to vertexes, the field " << noms_champ[0] << finl;
932 Cerr << "which is interpolated on the domain " << dom_interp << finl;
933 exit();
934 }
935 Cerr<<"The location of the probe named "<<nom_<<" are modified (to vertexes). Check the .log files to see the new location."<<finl;
936 const IntTab& sommet_elem = domaine_geom.les_elems();
937 const int sommets_par_element = domaine_geom.les_elems().dimension(1);
938 const DoubleTab& coord = domaine_geom.les_sommets();
939 for (int i=0; i<nbre_points_tot; i++)
940 {
941 double dist_min=DMAXFLOAT;
942 int sommet_min=-1;
943 if(elem_[i]!=-1)
944 {
945 Journal()<<"The point " << i << " of the probe "<<nom_<<" is moved:";
946 for(int isom=0, sommet; isom<sommets_par_element && (sommet = sommet_elem(elem_[i],isom)) >= 0; isom++)
947 {
948 double dist=0.;
949 for (int dir=0; dir<dimension; dir++)
950 dist+=(coord(sommet,dir)-les_positions_sondes_(i,dir))*(coord(sommet,dir)-les_positions_sondes_(i,dir));
951
952 if(dist<=dist_min)
953 {
954 dist_min=dist;
955 sommet_min=sommet;
956 }
957 }
958
959 for (int dir=0; dir<dimension; dir++)
960 {
961 Journal() << " x(" << dir << "): " << les_positions_sondes_(i,dir) << " -> " << coord(sommet_min,dir);
962 les_positions_sondes_(i,dir)=coord(sommet_min,dir);
963 }
964 Journal() << finl;
965 }
966 }
967 }
968
969 // See if some positions should be modified (to elem with "grav" for instance)
970 // Should be done before supprime_doublons, because it may create duplicated values.
972
973 bool supprime_doublons = true; // Nouveaute 1.8.4 (unicite des points de sondes)
974 if (mon_post->DeprecatedKeepDuplicatedProbes) supprime_doublons = false; // option a garder car besoin pour P-E de garder les sondes dupliquees en 1.9.3
975 ArrOfInt doublon(elem_.size_array());
976 if (supprime_doublons)
977 {
978 int doublons=0;
979 int size = elem_.size();
980 for (int i=0; i<size; i++)
981 {
982 for (int j=i+1; j<size; j++)
983 {
984 bool same = true;
985 if (elem_[i]!=elem_[j])
986 same = false;
987 else
988 for (int dir = 0; dir < dimension; dir++)
989 if (les_positions_sondes_(i, dir) != les_positions_sondes_(j, dir))
990 {
991 same = false;
992 break;
993 }
994 if (same)
995 {
996 doublon[i] = 1;
997 doublons++;
998 break;
999 }
1000 }
1001 }
1002 if (doublons)
1003 Cerr << "We remove " << doublons << " duplicated points from the probe " << nom_ << finl;
1004 }
1005
1006 // chaque processeur a regarde s'il avait le point
1007 // le maitre construit un tableau (prop) determinant qui va donner la valeur au maitre
1008 // Le maitre construit aussi le ArrsOfInt participant
1009 // lui donnant pour un proc les differents elements de celui-ci
1010 IntVect prop(elem_);
1011 if (je_suis_maitre())
1012 {
1013 ArrOfInt elems2(elem_);
1014 prop=0; // Par defaut c'est le maitre le proprio (en particulier pour les sondes en dehors)
1015 ArrOfInt elem_recu, doublon_recu;
1016 DoubleTab positions_recu;
1017 int nbproc=Process::nproc();
1018 for(int p=1; p<nbproc; p++)
1019 {
1020 recevoir(doublon_recu,p,2003+p);
1021 recevoir(elem_recu,p,0,2002+p);
1022 recevoir(positions_recu,p,0,2001+p);
1023 for (int el=0; el<nbre_points_tot; el++)
1024 if (elems2[el]==-1 && elem_recu[el]!=-1)
1025 {
1026 elems2[el]=elem_recu[el];
1027 doublon[el]=doublon_recu[el];
1028 prop[el]=p;
1029 for (int j=0; j<dimension; j++)
1030 les_positions_sondes_(el,j)=positions_recu(el,j);
1031 }
1032 }
1033 // OK On a rempli le tableau prop;
1034 // le maitre dimensionne participant;
1035 participant.dimensionner(nbproc);
1036 for(int p=0; p<nbproc; p++)
1037 {
1038 int size=0;
1039 for (int el=0; el<nbre_points_tot; el++)
1040 if (prop[el]==p&&!doublon[el]) size++;
1041 participant[p].resize_array(size);
1042 participant[p]=-1;
1043 int pos=0;
1044 int pt=0;
1045 for (int el=0; el<nbre_points_tot; el++)
1046 if (!doublon[el])
1047 {
1048 if (prop[el] == p)
1049 {
1050 participant[p][pos] = pt;
1051 pos++;
1052 }
1053 pt++;
1054 }
1055 assert((size==0)||(min_array(participant[p])>-1));
1056 }
1057 }
1058 else
1059 {
1060 envoyer(doublon, Process::me(),0,2003+Process::me());
1061 envoyer(elem_,Process::me(),0,2002+Process::me());
1062 envoyer(les_positions_sondes_,Process::me(),0,2001+Process::me());
1063 }
1064 envoyer_broadcast(prop, 0);
1065 //
1066 // on redimensionne les tableaux a la taille locale a partir de prop et en supprimant les doublons
1067 int nbre_points=0;
1068 nbre_points_tot=0;
1070 for (int el=0; el<prop.size(); el++)
1071 {
1072 if (!doublon[el])
1073 {
1074 if (prop(el) == me())
1075 {
1076 elem_(nbre_points) = elem_(el);
1077 for (int dir = 0; dir < dimension; dir++)
1078 les_positions_(nbre_points, dir) = les_positions_(el, dir);
1079 nbre_points++;
1080 }
1081 for (int dir = 0; dir < dimension; dir++)
1082 les_positions_sondes_(nbre_points_tot, dir) = les_positions_sondes_(el, dir);
1083 nbre_points_tot++;
1084 }
1085 }
1086#ifndef NDEBUG
1087 int test = static_cast<int>(mp_sum(nbre_points));
1088 //cerr << "Remove " << Process::me() << " " << nbre_points << " " << nbre_points_tot << " = " << test << endl;
1089 if (je_suis_maitre()) assert(test==nbre_points_tot);
1090#endif
1091 elem_.resize(nbre_points);
1092 les_positions_.resize(nbre_points, dimension);
1093 if (je_suis_maitre()) // Tableau uniquement sur le maitre:
1094 les_positions_sondes_.resize(nbre_points_tot, dimension);
1095 else
1096 les_positions_sondes_.resize(0,0);
1097 // Dimensionnement de valeurs_sur_maitre
1098 if (je_suis_maitre()&&(nproc()>1))
1099 {
1100 if (ncomp == -1)
1101 {
1102 int nb_comp = get_nb_compo_champ();
1103 valeurs_sur_maitre.resize(nbre_points_tot,nb_comp);
1104 }
1105 else
1106 valeurs_sur_maitre.resize(nbre_points_tot, 1);
1107 }
1108 // Dimensionnement de valeurs_locales
1109 if (ncomp == -1)
1110 {
1111 int nb_comp = get_nb_compo_champ();
1112 valeurs_locales.resize(nbre_points,nb_comp);
1113 }
1114 else
1115 valeurs_locales.resize(nbre_points, 1);
1116}
1117
1118
1119/*! @brief Ouvre le fichier associe a la sonde.
1120 *
1121 * (*.son)
1122 *
1123 */
1125{
1126 if (je_suis_maitre() && !le_fichier_.is_open())
1127 {
1128 struct stat f;
1129 int reprise = !stat(nom_fichier_, &f) && mon_post->probleme().reprise_effectuee();
1130 if (reprise)
1131 {
1132 // Reprise d'un calcul, on ecrit a la suite:
1133 le_fichier_.ouvrir(nom_fichier_, ios::app);
1134 le_fichier_.setf(ios::scientific);
1135 le_fichier_.precision(8);
1136 }
1137 else
1138 {
1139 // Demarrage calcul ou fichier inexistant:
1140 le_fichier_.ouvrir(nom_fichier_);
1141 le_fichier_.setf(ios::scientific);
1142 le_fichier_.precision(8);
1143 // Ecriture en tete:
1144 SFichier& s = le_fichier_;
1145 // Ecriture de l'en tete des fichiers sondes :
1146 if (dim == 0 || dim == 1)
1147 {
1148 const DoubleTab& p = les_positions_sondes();
1149 int nbre_points = les_positions_sondes_.dimension(0);
1150 s << "# " << nom_fichier_ << finl;
1151 s << "# Temps";
1152 for (int i = 0; i < nbre_points; i++)
1153 {
1154 s << " x= " << p(i, 0) << " y= " << p(i, 1);
1155 if (dimension == 3) fichier() << " z= " << p(i, 2);
1156 }
1157 s << finl;
1158 if (mon_champ)
1159 {
1160 const Noms unites = mon_champ->get_property("unites");
1161 s << "# Champ " << nom_champ_lu_ << " [" << unites[ncomp == -1 ? 0 : ncomp] << "]" << finl;
1162 }
1163 else
1164 s << "# Champ " << nom_champ_lu_ << " [??]" << finl;
1165 s << "# Type " << get_type() << finl;
1166 }
1167 // Ecriture de l'en tete des fichiers plan :
1168 else
1169 {
1170 s << "TRUST Version1 01/09/96" << finl;
1171 s << nom_du_cas() << finl;
1172 s << "TRUST" << finl;
1173 s << "GRILLE";
1174 const DoubleTab& p = les_positions_sondes();
1175 // Nouveau on ajoute des informations pour Run_sonde
1176 s << " " << get_type() << " " << nom_champ_lu_ << " " << nbre_points1 << " " << nbre_points2;
1177 for (int j = 0; j < dimension; j++) s << " " << p(0, j);
1178 for (int j = 0; j < dimension; j++) s << " " << p((nbre_points1 - 1) * nbre_points2, j);
1179 for (int j = 0; j < dimension; j++) s << " " << p(nbre_points2 - 1, j);
1180 s << finl;
1181 Nom nom_grille("Grille");
1182 Nom nom_topologie("Topologie");
1183 nom_grille += "_";
1184 nom_grille += nom_;
1185 nom_topologie += "_";
1186 nom_topologie += nom_;
1187 int k, kn;
1188 int nbre_points = les_positions_sondes_.dimension(0);
1189 if (dim == 2)
1190 {
1191 double xn = 0., yn = 0., zn = 0., norme = 0.;
1192 int p1 = 1, p_nbre_points2 = nbre_points2;
1193 while (p(0, 0) == p(p1, 0) && p(0, 1) == p(p1, 1) && p(0, 2) == p(p1, 2))
1194 {
1195 p1 += 1;
1196 assert(p1 < nbre_points);
1197 }
1198 while (p(0, 0) == p(p_nbre_points2, 0) && p(0, 1) == p(p_nbre_points2, 1) &&
1199 p(0, 2) == p(p_nbre_points2, 2))
1200 {
1201 p_nbre_points2 += 1;
1202 assert(p_nbre_points2 < nbre_points);
1203 }
1204 while (p(p1, 0) == p(p_nbre_points2, 0) && p(p1, 1) == p(p_nbre_points2, 1) &&
1205 p(p1, 2) == p(p_nbre_points2, 2))
1206 {
1207 p_nbre_points2 += 1;
1208 assert(p_nbre_points2 < nbre_points);
1209 }
1210
1211 if (dimension == 3)
1212 {
1213 xn = (p(p1, 2) - p(0, 2)) * (p(p_nbre_points2, 1) - p(0, 1))
1214 - (p(p1, 1) - p(0, 1)) * (p(p_nbre_points2, 2) - p(0, 2));
1215 yn = (p(p1, 0) - p(0, 0)) * (p(p_nbre_points2, 2) - p(0, 2))
1216 - (p(p1, 2) - p(0, 2)) * (p(p_nbre_points2, 0) - p(0, 0));
1217 }
1218 else if (dimension == 2)
1219 {
1220 xn = 0.;
1221 yn = 0.;
1222 }
1223 zn = (p(p1, 1) - p(0, 1)) * (p(p_nbre_points2, 0) - p(0, 0))
1224 - (p(p1, 0) - p(0, 0)) * (p(p_nbre_points2, 1) - p(0, 1));
1225 norme = std::fabs(xn) + std::fabs(yn) + std::fabs(zn);
1226 xn /= norme;
1227 yn /= norme;
1228 zn /= norme;
1229 s << nom_grille << " 3 " << 2 * nbre_points << finl;
1230 int i;
1231 for (i = 0; i < nbre_points; i++)
1232 {
1233 s << p(i, 0) << " " << p(i, 1);
1234 if (dimension == 3) fichier() << " " << p(i, 2) << finl;
1235 else if (dimension == 2) s << " 0." << finl;
1236 }
1237 for (i = 0; i < nbre_points; i++)
1238 {
1239 s << p(i, 0) + xn << " " << p(i, 1) + yn;
1240 if (dimension == 3) s << " " << p(i, 2) + zn << finl;
1241 else if (dimension == 2) s << " " << zn << finl;
1242 }
1243 s << "TOPOLOGIE" << finl;
1244 s << nom_topologie << " " << nom_grille << finl;
1245 s << "MAILLE" << finl;
1246 s << (nbre_points1 - 1) * (nbre_points2 - 1) << finl;
1247 for (int j = 0; j < nbre_points2 - 1; j++)
1248 for (i = 0; i < nbre_points1 - 1; i++)
1249 {
1250 k = j * nbre_points1 + i + 1;
1251 kn = k + nbre_points;
1252 s << "VOXEL8 " << k << " " << k + 1 << " ";
1253 s << k + nbre_points1 << " " << k + nbre_points1 + 1;
1254 s << " " << kn << " " << kn + 1 << " " << kn + nbre_points1;
1255 s << " " << kn + nbre_points1 + 1 << finl;
1256 }
1257 s << "FACE" << finl;
1258 s << "0" << finl;
1259 }
1260 else if (dim == 3)
1261 {
1262 const DoubleTab& pbis = les_positions_sondes();
1263 s << nom_grille << " 3 " << nbre_points << finl;
1264 int i;
1265 for (i = 0; i < nbre_points; i++)
1266 {
1267 s << pbis(i, 0) << " " << pbis(i, 1);
1268 s << " " << pbis(i, 2) << finl;
1269 }
1270 s << "TOPOLOGIE" << finl;
1271 s << nom_topologie << " " << nom_grille << finl;
1272 s << "MAILLE" << finl;
1273 s << (nbre_points1 - 1) * (nbre_points2 - 1) * (nbre_points3 - 1) << finl;
1274 for (int m = 0; m < nbre_points3 - 1; m++)
1275 for (int j = 0; j < nbre_points2 - 1; j++)
1276 for (i = 0; i < nbre_points1 - 1; i++)
1277 {
1278 k = m * nbre_points2 * nbre_points1 + j * nbre_points1 + i + 1;
1279 kn = k + nbre_points2 * nbre_points1;
1280 s << "VOXEL8 " << k << " " << k + 1 << " ";
1281 s << k + nbre_points1 << " " << k + nbre_points1 + 1;
1282 s << " " << kn << " " << kn + 1 << " " << kn + nbre_points1;
1283 s << " " << kn + nbre_points1 + 1 << finl;
1284 }
1285 s << "FACE" << finl;
1286 s << "0" << finl;
1287 }
1288 }
1289 }
1290 }
1291}
1292
1293void Sonde::update_source(double un_temps)
1294{
1295 // Mecanisme de cache du champ Source derriere le champ postraite (mon_champ)
1296 // Implemente au niveau de Sondes
1297 OBS_PTR(Champ_base) ma_source = mon_post->les_sondes().get_from_cache(mon_champ, nom_champ_lu_);
1298 ma_source->mettre_a_jour(un_temps);
1299}
1300
1301/*! @brief Effectue une mise a jour en temps de la sonde effectue le postraitement.
1302 *
1303 * @param (double un_temps) le temps de mise a jour
1304 * @param (double tinit) le temps initial de la sonde
1305 */
1306void Sonde::mettre_a_jour(double un_temps, double tinit)
1307{
1308 double temps_courant = get_temps_champ();
1309 double dt=mon_post->probleme().schema_temps().pas_de_temps();
1310 double nb;
1311
1312 // Le *(1+Objet_U::precision_geom) est pour eviter des erreurs d'arrondi selon les machines
1313 // 21/01/25 : remplacement de Objet_U::precision_geom par 1e-15 (issue des patch M3D) suite bttrust #242895
1314 // car precision_geom est un parametre que l'utilisateur peut changer via jdd
1315 if (periode<=dt)
1316 nb=nb_bip+1.;
1317 else
1318 modf(temps_courant*(1+1e-15)/periode, &nb);
1319
1320 // On doit ecrire les sondes
1321 if (nb>nb_bip)
1322 {
1323 update_source(un_temps);
1324
1325 // Si le maillage est deformable il faut reconstruire les sondes
1326 if (mon_post->les_sondes().get_update_positions())
1327 {
1328 if (mon_post->probleme().domaine().deformable())
1329 initialiser();
1330 }
1331 nb_bip=nb;
1332 postraiter();
1333 }
1334}
1335
1336
1338{
1339 // Mecanisme de cache du champ Source derriere le champ postraite (mon_champ)
1340 // Implemente au niveau de Sondes
1341 OBS_PTR(Champ_base) ma_source = mon_post->les_sondes().get_from_cache(mon_champ, nom_champ_lu_);
1342 if (chsom)
1343 {
1344 Champ_base& ma_source_mod =ref_cast_non_const(Champ_base,ma_source.valeur());
1345 if (ncomp == -1)
1347 else
1349 }
1350 else
1351 {
1352 if (ncomp == -1)
1353 ma_source->valeur_aux_elems(les_positions(),elem_, valeurs_locales);
1354 else
1355 ma_source->valeur_aux_elems_compo(les_positions(),elem_,valeurs_locales, ncomp);
1356 }
1357}
1358
1359/*! @brief Effectue un postraitement.
1360 *
1361 * Calcul les valeurs du champ aux position demandees
1362 * et les imprime sur le fichier associe.
1363 *
1364 */
1366{
1368
1369 if (gravcl)
1371 const int N = valeurs_locales.line_size();
1372
1373 // le maitre reconstruit le tableau valeurs a partir des differents contributeurs
1374 if(je_suis_maitre())
1375 {
1377 int nbproc = Process::nproc();
1378 DoubleTab valeurs_pe;
1379 DoubleTab& valeurs=(nbproc==1?valeurs_locales:valeurs_sur_maitre);
1380 if (nbproc==1) { /* Do nothing */} //valeurs=valeurs_locales;
1381 else
1382 {
1383 int nb_val = valeurs_locales.dimension(0);
1384 for (int i = 0; i < nb_val; i++)
1385 for (int n = 0; n < N; n++)
1386 valeurs(participant[0][i], n) = valeurs_locales(i, n);
1387 }
1388 for(int p=1; p<nbproc; p++)
1389 {
1390 // le message n'est envoye que si le proc participe
1391 if (participant[p].size_array()!=0)
1392 {
1393 recevoir(valeurs_pe,p,0,2002+p);
1394 int nb_val1=valeurs_pe.dimension(0);
1395 assert(N == valeurs_pe.line_size());
1396 for(int i=0; i<nb_val1; i++)
1397 for(int n = 0; n < N; n++)
1398 {
1399 valeurs(participant[p][i], n)=valeurs_pe(i, n);
1400 // val_max = std::max(std::fabs(valeurs(i,k)),std::fabs(valeurs_pe(i,k)));
1401 // if(val_max==(std::fabs(valeurs_pe(i,k))))
1402 // valeurs(i,k)=valeurs_pe(i,k);
1403 }
1404 }
1405 }
1406
1407 double temps_courant = mon_post->probleme().schema_temps().temps_courant();
1408
1409 if (dim==0 || dim==1)
1410 {
1411 fichier() << temps_courant;
1412 for(int i=0; i<valeurs.dimension(0); i++)
1413 for(int k=0; k<N; k++)
1414 fichier() << " " << valeurs(i,k);
1415 fichier() << finl;
1416 }
1417 // Pour les sondes type plan, impression au format lml :
1418 // num_sommet comp1 [comp2] [comp3]
1419 // et dans la troisieme direction :
1420 else if (dim==2 || dim==3)
1421 {
1422 Nom nom_post;
1423 int nbre_points = valeurs.dimension(0);
1424 const Noms noms_comp = mon_champ->get_property("composantes");
1425 int nb_comp = noms_comp.size();
1426 const Noms unites = mon_champ->get_property("unites");
1427 if (ncomp==-1)
1428 {
1429 const Noms noms_champ = mon_champ->get_property("nom");
1430 nom_post = noms_champ[0];
1431 }
1432 else
1433 nom_post = noms_comp[ncomp];
1434
1435 Nom nom_topologie("Topologie");
1436 nom_topologie += "_";
1437 nom_topologie += nom_;
1438
1439 fichier() << "TEMPS " << temps_courant << "\n";
1440 fichier() << "CHAMPPOINT " << nom_post << " " << nom_topologie
1441 << " " << temps_courant << "\n";
1442 fichier() << nom_post << " " << nb_comp << " " << unites[0] << "\n";
1443
1444 int nbp=nbre_points;
1445 if (dim==2) nbp*=2;
1446 if (nb_comp>1)
1447 fichier() << "type1 " << nbp << "\n";
1448 else fichier() << "type0 " << nbp << "\n";
1449 int i;
1450 for(i=0; i<nbre_points; i++)
1451 {
1452 fichier() << i+1;
1453 for(int j=0; j<N; j++)
1454 fichier() << " " << valeurs(i,j);
1455 // Pour ne pas flusher :
1456 fichier() << "\n";
1457 }
1458 // Pour le 2D, on rajoute une direction
1459 if (dim==2)
1460 {
1461 for(i=0; i<nbre_points; i++)
1462 {
1463 fichier() << nbre_points+i+1;
1464 for(int j=0; j<N; j++)
1465 fichier() << " " << valeurs(i,j);
1466 // Pour ne pas flusher :
1467 fichier() << "\n";
1468 }
1469 }
1470 }
1471 fichier().flush();
1472 }
1473 else
1474 {
1475 // le processeur envoye un message que si il participe
1476 if (valeurs_locales.dimension(0)!=0)
1477 envoyer(valeurs_locales,Process::me(),0,2002+Process::me());
1478 }
1479}
1480
1482{
1483 if (!gravcl)
1484 return;
1485
1486 const int nbf = faces_bords_.size_array();
1487 rang_cl_.resize(nbf);
1488
1489 if (sub_type(Champ_Generique_refChamp,mon_champ.valeur()))
1490 {
1491 Probleme_base& Pb = mon_post->probleme();
1493 const Champ_Inc_base& ch_inc = ref_cast(Champ_Inc_base,chref.valeur());
1494 const Domaine_Cl_dis_base& zcl = ch_inc.domaine_Cl_dis();
1495
1496 for (int iface=0; iface<nbf; iface++)
1497 {
1498 int face = faces_bords_[iface];
1499 for (int icl=0; icl<zcl.nb_cond_lim(); icl++)
1500 {
1501 const Cond_lim& cl = zcl.les_conditions_limites(icl);
1502 const Front_VF& le_bord = ref_cast(Front_VF,cl->frontiere_dis());
1503 const int ndeb = le_bord.num_premiere_face();
1504 const int nfin = ndeb + le_bord.nb_faces();
1505 for (int i=ndeb; i<nfin; i++)
1506 {
1507 if (i==face)
1508 rang_cl_[iface] = icl;
1509 }
1510 }
1511 }
1512 }
1513}
1514
1515void Sonde::ajouter_bords(const DoubleTab& coords_bords)
1516{
1517 double eps = mon_champ->get_ref_domain().epsilon();
1518 const Domaine_VF& domaineVF = ref_cast(Domaine_VF,mon_champ->get_ref_domaine_dis_base());
1519
1520 const DoubleTab& xv = domaineVF.xv();
1521 const IntTab& e_f = domaineVF.elem_faces(), &f_e = domaineVF.face_voisins();
1522 int nbre_points = les_positions_sondes_.dimension(0), face;
1523
1524
1525
1526 IntTab tmp(2);
1527 tmp[0] = 0;
1528 tmp[1] = nbre_points-1;
1529
1530 for (int i = 0; i<coords_bords.dimension(0); i++)
1531 {
1532 int e = tmp[i];
1533 int elem = elem_[e];
1534 if (elem !=-1)
1535 {
1536 for (int j = 0; j < e_f.dimension(1) && (face = e_f(elem, j)) >= 0; j++)
1537 {
1538 if(f_e(face, 1) == -1 || f_e(face, 0) == -1)
1539 {
1540 double dist=0.;
1541 for (int idim=0; idim<dimension; idim++)
1542 dist+=((xv(face,idim)-coords_bords(i,idim))*(xv(face,idim)-coords_bords(i,idim)));
1543
1544 if (sqrt(dist) < eps)
1545 {
1546 faces_bords_.append_array(face);
1547 for (int idim=0; idim<dimension; idim++)
1548 les_positions_sondes_(e,idim) = coords_bords(i,idim);
1549 }
1550 }
1551 }
1552 }
1553 }
1554// [ABN] skiping the assert below. On funny shaped domains (e.g. U-shape) a probe might
1555// re-enter the domain, and hence hit more than two faces overall:
1556// assert(mp_sum(faces_bords_.size_array())<=2);
1557}
1558
1560{
1561 if (sub_type(Champ_Generique_refChamp,mon_champ.valeur()))
1562 {
1563 Probleme_base& Pb = mon_post->probleme();
1565 const Champ_Inc_base& ch_inc = ref_cast(Champ_Inc_base,chref.valeur());
1566 const Domaine_Cl_dis_base& zcl = ch_inc.domaine_Cl_dis();
1567 const DoubleTab& vals_ch = ch_inc.valeurs();
1568 const Domaine_VF& domaineVF = ref_cast(Domaine_VF,mon_champ->get_ref_domaine_dis_base());
1569 const IntTab& face_voisins = domaineVF.face_voisins();
1570
1571 int nbval = valeurs_locales.dimension(0);
1572
1573 for (int iface=0; iface<faces_bords_.size_array(); iface++)
1574 {
1575 int face = faces_bords_[iface];
1576 int icl = rang_cl_[iface];
1577 const Cond_lim& cl = zcl.les_conditions_limites(icl);
1578 const Front_VF& le_bord = ref_cast(Front_VF,cl->frontiere_dis());
1579 const int ndeb = le_bord.num_premiere_face();
1580 DoubleVect valcl;
1581 cl->champ_front().valeurs_face(face-ndeb,valcl);
1582
1583 if (valcl.size() == 0)
1584 {
1585 int elem0 = face_voisins(face,0);
1586 int elem1 = face_voisins(face,1);
1587
1588 if (elem0 != -1)
1589 valeurs_locales(nbval-1) = vals_ch[elem0];
1590 else
1591 valeurs_locales(0) = vals_ch[elem1];
1592 }
1593 else
1594 {
1595 if (face_voisins(face,0) != -1)
1596 valeurs_locales(nbval-1) = valcl[0];
1597 else
1598 valeurs_locales(0) = valcl[0];
1599 }
1600 }
1601 }
1602}
Un champ generique qui est construit comme une interpolation d'un autre champ generique (interpolatio...
class Champ_Generique_base
static int composante(const Nom &nom_test, const Nom &nom, const Noms &composantes, const Noms &synonyms)
Classe de champ particuliere qui encapsule une reference a un champ volumique de TRUST de type Champ_...
Classe Champ_Inc_base.
const Domaine_Cl_dis_base & domaine_Cl_dis() const
DoubleTab & valeurs() override
Renvoie le tableau des valeurs du champ au temps courant.
classe Champ_base Cette classe est la base de la hierarchie des champs.
Definition Champ_base.h:43
virtual DoubleVect & valeur_aux_elems_compo_smooth(const DoubleTab &positions, const IntVect &les_polys, DoubleVect &valeurs, int ncomp)
virtual DoubleTab & valeur_aux_elems_smooth(const DoubleTab &positions, const IntVect &les_polys, DoubleTab &valeurs)
classe Cond_lim Classe generique servant a representer n'importe quelle classe
Definition Cond_lim.h:31
SmallArrOfTID_t & chercher_elements(const DoubleTab &pos, SmallArrOfTID_t &elem, int reel=0) const
Recherche des elements contenant les points dont les coordonnees sont specifiees.
Definition Domaine.cpp:405
DoubleTab_t & les_sommets()
Definition Domaine.h:113
IntTab_t & les_elems()
Definition Domaine.h:129
int nb_faces_elem(int=0) const
Renvoie le nombre de face de type i des elements geometriques constituants le domaine.
Definition Domaine.h:484
classe Domaine_Cl_dis_base Les objets Domaine_Cl_dis_base representent les conditions aux limites
int nb_cond_lim() const
Renvoie le nombre de conditions aux limites.
const Cond_lim & les_conditions_limites(int) const
Renvoie la i-ieme condition aux limites.
class Domaine_VF
Definition Domaine_VF.h:44
double xv(int num_face, int k) const
Definition Domaine_VF.h:76
int elem_faces(int i, int j) const
renvoie le numero de le ieme face de la maille num_elem la facon dont ces faces sont numerotees est
Definition Domaine_VF.h:543
double xp(int num_elem, int k) const
Definition Domaine_VF.h:77
virtual int orientation_si_definie(int) const
Definition Domaine_VF.h:654
int premiere_face_int() const
une face est interne ssi elle separe deux elements.
Definition Domaine_VF.h:463
int face_voisins(int num_face, int i) const
renvoie l'element voisin de numface dans la direction i.
Definition Domaine_VF.h:418
const Nom & le_nom() const override
Donne le nom de l'Objet_U Methode a surcharger : renvoie "neant" dans cette implementation.
const Domaine & domaine() const
Cette classe se comporte comme EChaine tant que l'on n'est pas a la fin de la chaine.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
class Front_VF
Definition Front_VF.h:36
int nb_faces() const
Definition Front_VF.h:53
int num_premiere_face() const
Definition Front_VF.h:63
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
int debute_par(const char *const n) const override
Definition Motcle.cpp:309
Un tableau d'objets de la classe Motcle.
Definition Motcle.h:63
int contient_(const char *const ch) const
Definition Motcle.cpp:333
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
Nom & suffix(const char *const)
Extraction de suffixe : Nom x("azerty");.
Definition Nom.cpp:271
const Nom & le_nom() const override
Renvoie *this;.
Definition Nom.cpp:563
Un tableau de chaine de caracteres (VECT(Nom)).
Definition Noms.h:26
classe Objet_U Cette classe est la classe de base des Objets de TRUST
Definition Objet_U.h:73
friend class Entree
Definition Objet_U.h:76
static int dimension
Definition Objet_U.h:99
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
static const Nom & nom_du_cas()
Renvoie une reference constante vers le nom du cas.
Definition Objet_U.cpp:146
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
classe Postraitement La classe est dotee -d une liste de champs generiques champs_post_complet_ qui c...
classe Probleme_base C'est un Probleme_U qui n'est pas un couplage.
void creer_champ(const Motcle &motlu) override
const Champ_base & get_champ(const Motcle &nom) const override
virtual int expression_predefini(const Motcle &motlu, Nom &expression)
static void mp_max_for_each_item(TRUSTArray< _TYPE_ > &x, int n=-1)
Definition Process.cpp:196
static double mp_max(double)
Definition Process.cpp:376
static Sortie & Journal(int message_level=0)
Renvoie un objet statique de type Sortie qui sert de journal d'evenements.
Definition Process.cpp:588
static int nproc()
renvoie le nombre de processeurs dans le groupe courant Voir Comm_Group::nproc() et PE_Groups::curren...
Definition Process.cpp:104
static double mp_sum(double)
Calcule la somme de x sur tous les processeurs du groupe courant.
Definition Process.cpp:146
static int me()
renvoie mon rang dans le groupe de communication courant.
Definition Process.cpp:125
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
static int je_suis_maitre()
renvoie 1 si on est sur le processeur maitre du groupe courant (c'est a dire me() == 0),...
Definition Process.cpp:86
Cette classe est a la classe C++ ofstream ce que la classe Sortie est a la classe C++ ostream Elle re...
Definition SFichier.h:27
classe Sonde Cette classe permet d'effectuer l'evolution d'un champ au cours du temps.
Definition Sonde.h:41
void associer_post(const Postraitement &)
Associer le postraitement a la sonde.
Definition Sonde.cpp:723
virtual void create_champ_generique(Entree &is, const Motcle &motlu)
Definition Sonde.cpp:685
DoubleTab valeurs_locales
Definition Sonde.h:120
int orientation_faces_
Definition Sonde.h:126
double periode
periode d'echantillonnage
Definition Sonde.h:112
virtual void mettre_a_jour_bords()
Definition Sonde.cpp:1559
virtual int get_nb_compo_champ() const
Definition Sonde.cpp:746
IntTab rang_cl_
for a given face, index of the CL that this face bears
Definition Sonde.h:130
const DoubleTab & les_positions() const
Definition Sonde.h:190
virtual void validate_type(const Motcle &loc) const
Definition Sonde.h:85
DoubleTab les_positions_sondes_initiales_
les coordonnees des sondes ponctuelles initiales
Definition Sonde.h:107
const int & get_dim() const
Definition Sonde.h:66
Nom nom_fichier_
le nom du fichier contenant la sonde
Definition Sonde.h:100
Motcle nom_champ_lu_
Definition Sonde.h:123
const DoubleTab & les_positions_sondes_initiales() const
Renvoie le tableau des positions du champ qui sont sondees.
Definition Sonde.h:180
virtual void ajouter_bords(const DoubleTab &coords_bords)
Definition Sonde.cpp:1515
DoubleTab les_positions_
les coordonnees des sondes locales sur chaque proc
Definition Sonde.h:109
virtual void update_source(double un_temps)
Definition Sonde.cpp:1293
virtual double get_temps_champ() const
Definition Sonde.cpp:754
ArrsOfInt participant
Definition Sonde.h:124
bool som
Definition Sonde.h:119
virtual const Noms get_noms_champ() const
Definition Sonde.cpp:741
SFichier le_fichier_
Definition Sonde.h:122
int dim
la dimension de la sone (point:0,segment:1,plan:2,volume:3)
Definition Sonde.h:101
int ncomp
Definition Sonde.h:106
bool chsom
Definition Sonde.h:116
virtual void fix_probe_position()
Definition Sonde.h:90
const DoubleTab & les_positions_sondes() const
Definition Sonde.h:185
IntVect elem_
les elements contenant les sondes ponctuelles locales
Definition Sonde.h:111
virtual void completer()
Definition Sonde.cpp:159
int nbre_points1
Definition Sonde.h:131
virtual void validate_position() const
Definition Sonde.h:87
DoubleTab valeurs_sur_maitre
valeurs_locales les valeurs sur chaque proc, valeurs_sur_maitre les valeurs regroupes sur le maitre
Definition Sonde.h:120
bool grav
Definition Sonde.h:117
const Nom & get_nom() const
Definition Sonde.h:64
virtual void initialiser()
Initialise la sonde.
Definition Sonde.cpp:798
int nbre_points3
faire des sonde_segment,sonde_plan,etc...
Definition Sonde.h:131
ArrOfInt faces_bords_
array containing the indices of the boundary faces hit by the probe
Definition Sonde.h:129
Nom type_
Definition Sonde.h:125
int nbre_points2
Definition Sonde.h:131
int numero_elem_
vaut -1 si pas defini et vaut le numero de l'elem sur le maitre
Definition Sonde.h:110
Nom nom_
le nom de la sonde
Definition Sonde.h:99
virtual void fill_local_values()
Definition Sonde.cpp:1337
SFichier & fichier()
Renvoie un flot de sortie Fichier, pointant sur le fichier de sortie utilise par la sonde.
Definition Sonde.h:209
virtual void fix_probe_position_grav()
Definition Sonde.cpp:760
virtual void postraiter()
Effectue un postraitement.
Definition Sonde.cpp:1365
virtual const Domaine & get_domaine_geom() const
Definition Sonde.cpp:736
const Nom & get_type() const
Definition Sonde.h:65
bool gravcl
Definition Sonde.h:118
virtual void init_bords()
Definition Sonde.cpp:1481
DoubleTab les_positions_sondes_
les coordonnees des sondes sur tout le domaine apres deplacement (uniquement sur le maitre)
Definition Sonde.h:108
Sonde()
Constructeur d'une sonde sans parametre.
Definition Sonde.cpp:145
bool nodes
Definition Sonde.h:115
void ouvrir_fichier()
Ouvre le fichier associe a la sonde.
Definition Sonde.cpp:1124
virtual void mettre_a_jour(double temps, double tinit)
Effectue une mise a jour en temps de la sonde effectue le postraitement.
Definition Sonde.cpp:1306
double nb_bip
Definition Sonde.h:121
OBS_PTR(Postraitement) mon_post
virtual int ouvrir(const char *name, IOS_OPEN_MODE mode=ios::out)
Sortie & flush() override
Force l'ecriture sur disque des donnees dans le tampon Utilise l'implementation de la classe ofstream...
Classe de base des flux de sortie.
Definition Sortie.h:52
_SIZE_ size_array() const
_SIZE_ dimension_tot(int) const override
Definition TRUSTTab.tpp:160
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133
_SIZE_ size() const
Definition TRUSTVect.tpp:45
int line_size() const
Definition TRUSTVect.tpp:67