TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Champ_base.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 <Domaine_Cl_dis_base.h>
17#include <Discretisation_base.h>
18#include <Dirichlet_homogene.h>
19#include <Format_Post_base.h>
20#include <communications.h>
21#include <Equation_base.h>
22#include <Probleme_base.h>
23#include <Schema_Comm.h>
24#include <Domaine_VF.h>
25#include <Champ_base.h>
26#include <TRUSTVects.h>
27#include <TRUSTTrav.h>
28#include <Dirichlet.h>
29#include <TRUSTList.h>
30#include <Symetrie.h>
31#include <strings.h>
32
33Implemente_base_sans_constructeur(Champ_base,"Champ_base",Field_base);
34
36{
37 return os << le_nom() << finl;
38}
39
41{
42 return is >> nom_;
43}
44
45/*! @brief Default constructor of a Champ_base.
46 *
47 * Sets the field at time 0, specifies an empty unit,
48 * gives the name "anonymous" to the field and gives it a
49 * scalar nature.
50 *
51 */
53{
54 changer_temps(0.);
55 fixer_unite(".");
56 nommer("anonyme");
57 fixer_nature_du_champ(scalaire);
58 nb_compo_ = 1; // By default, scalar field
59}
60
61/*! @brief Computes the "values" of the field at the point with coordinates "pos".
62 *
63 * In this base class, the implementation calls
64 * valeur_aux(const DoubleTab &, DoubleTab &)
65 *
66 * @param (DoubleVect&) the coordinates of the point where to evaluate the field
67 * @param (DoubleVect& valeurs) On input: must have the right size (nb_comp), on output contains the components of the field.
68 * @return (reference to "valeurs")
69 */
70DoubleVect& Champ_base::valeur_a(const DoubleVect& pos, DoubleVect& les_valeurs) const
71{
72 //assert(les_valeurs.size() == nb_comp());
73 DoubleTrav values(1,les_valeurs.size());
74 int taille=pos.size();
75 DoubleTrav pos2(1,taille);
76 for (int dir=0; dir<taille; dir++) pos2(0,dir)=pos(dir);
77 valeur_aux(pos2,values);
78 for (int comp=0; comp<les_valeurs.size(); comp++)
79 les_valeurs(comp)=values(0,comp);
80 return les_valeurs;
81}
82
83/*! @brief Causes an error! Must be overridden by derived classes
84 *
85 * Not pure virtual for convenience of development!
86 * Returns the value of the field at the point specified
87 * by its coordinates, indicating that this point is
88 * located in a specified element.
89 *
90 * @param (DoubleVect&) the coordinates of the calculation point
91 * @param (DoubleVect& les_valeurs) the value of the field at the specified point
92 * @param (int) the element in which the calculation point is located
93 * @return (DoubleVect&) the value of the field at the specified point
94 */
95DoubleVect& Champ_base::valeur_a_elem(const DoubleVect& ,
96 DoubleVect& les_valeurs,
97 int ) const
98{
99 Cerr << que_suis_je();
100 Cerr << "::valeur_a_elem(...) is not coded " << finl ;
101 exit();
102 return les_valeurs;
103}
104
105/*! @brief Computes the point value of the component "compo" of the field at the point with coordinates pos.
106 *
107 * In the base class, the implementation calls
108 * valeur_a(const DoubleVect &, DoubleVect &)
109 *
110 * @param (DoubleVect&) the coordinates of the calculation point
111 * @param (int) the index of the component of the field to calculate
112 * @return (double)
113 */
114double Champ_base::valeur_a_compo(const DoubleVect& pos, int compo) const
115{
116 DoubleVect values(nb_comp());
117 valeur_a(pos, values);
118 const double x = values[compo];
119 return x;
120}
121
122/*! @brief Causes an error! Must be overridden by derived classes
123 *
124 * Not pure virtual for convenience of development!
125 *
126 */
127double Champ_base::valeur_a_elem_compo(const DoubleVect&, int ,int ) const
128{
129 Cerr << que_suis_je();
130 Cerr << "::valeur_a_elem_compo(...) is not coded " << finl ;
131 exit();
132 return 0;
133}
134
135/*! @brief This method, generic but slow (calculation of gravity centers, filling les_poly, use of shape functions in the discretized field)
136 * can be overridden by the discretized field for a much faster implementation
137 */
138DoubleTab& Champ_base::valeur_aux_centres_de_gravite(const Domaine& dom, DoubleTab& les_valeurs) const
139{
140#ifdef TRUST_USE_GPU
141 Cerr << "Warning, try to implement a " << que_suis_je() << "::valeur_aux_centres_de_gravite() for a faster compute." << finl;
142#endif
143 int nb_elem = les_valeurs.dimension(0);
144 DoubleTrav positions(nb_elem, dimension);
145 if(sub_type(Champ_Inc_base, *this))
146 {
147 const Domaine_VF& zvf = ref_cast(Domaine_VF,ref_cast(Champ_Inc_base, *this).domaine_dis_base());
148 // PL: ToDo Kokkos kernel host kept because difficult-to-find bug (case decroissance_ktau_jdd1 with TrioCFD):
149 // stencil.append_line() allocates memory via a resize() on HOST memory already allocated on DEVICE!
150 // Probably, DEVICE memory not properly deallocated in a PolyMAC_CDO mechanism not used in VEF...
151 if (zvf.xp().isDataOnDevice())
152 {
153 // To avoid a resize by nb_elem_tot per call to xp()
154 CDoubleTabView xp = zvf.xp().view_ro();
155 DoubleTabView positions_v = positions.view_wo();
156 Kokkos::parallel_for(start_gpu_timer(__KERNEL_NAME__),
157 Kokkos::MDRangePolicy < Kokkos::Rank < 2 >> ({ 0, 0 },
158 {nb_elem, dimension}), KOKKOS_LAMBDA(
159 const int i,
160 const int j)
161 {
162 positions_v(i, j) = xp(i, j);
163 });
164 end_gpu_timer(__KERNEL_NAME__);
165 }
166 else
167 {
168 for (int i=0; i<nb_elem; i++)
169 for (int k=0; k<dimension ; k++)
170 positions(i,k) = zvf.xp(i,k);
171 }
172 }
173 else
174 {
175 dom.calculer_centres_gravite(positions);
176 }
177
178 IntTrav les_polys(nb_elem);
179 IntArrView les_polys_v = static_cast<ArrOfInt&>(les_polys).view_wo();
180 Kokkos::parallel_for(start_gpu_timer(__KERNEL_NAME__), nb_elem, KOKKOS_LAMBDA(const int i)
181 {
182 les_polys_v(i) = i;
183 });
184 end_gpu_timer(__KERNEL_NAME__);
185
186 return valeur_aux_elems(positions, les_polys, les_valeurs);
187}
188
189/*! @brief Causes an error! Must be overridden by derived classes
190 *
191 * Not pure virtual for convenience of development!
192 * Returns the values of the field at the specified points
193 * by their coordinates.
194 *
195 * @param (DoubleTab&) the array of coordinates of the calculation points
196 * @param (DoubleTab& les_valeurs) the array of field values at the specified points
197 * @return (DoubleTab&) the array of field values at the specified points
198 */
199DoubleTab& Champ_base::valeur_aux(const DoubleTab& ,
200 DoubleTab& les_valeurs) const
201{
202 Cerr << que_suis_je();
203 Cerr << "::valeur_aux(const DoubleTab& ,DoubleTab& ) is not coded " << finl ;
204 exit();
205 return les_valeurs;
206}
207
208/*! @brief Same as valeur_aux(const DoubleTab &, DoubleTab &), but computes only the component compo of the field.
209 *
210 * In the implementation of champ_base, we call
211 * valeur_aux(const DoubleTab &, DoubleTab &)
212 *
213 * @param (pos) the array of coordinates of the calculation points (we do not process the virtual space of the array)
214 * @param (les_valeurs) destination array of values to calculate. The values array must have the right size on input, i.e. les_valeurs.size() == pos.dimension(0)
215 * @param (compo) the index of the component of the field to calculate
216 * @return (reference to the array les_valeurs)
217 */
218DoubleVect& Champ_base::valeur_aux_compo(const DoubleTab& pos ,
219 DoubleVect& les_valeurs,
220 int compo) const
221{
222 // Not optimal but works
223 int nb_val=pos.dimension(0);
224 // The array les_valeurs must have the right size on input:
225// assert(les_valeurs.size() == nb_val);
226 DoubleTrav prov(nb_val,nb_comp());
227 valeur_aux(pos,prov);
228 for (int i=0; i<nb_val; i++)
229 les_valeurs(i)=prov(i,compo);
230 return les_valeurs;
231}
232
233/*! @brief Causes an error! Must be overridden by derived classes
234 *
235 * Not pure virtual for convenience of development!
236 * Returns the values of the field at the specified points
237 * by their coordinates, indicating that the calculation
238 * points are located in the specified elements.
239 *
240 * @param (DoubleTab&) the array of coordinates of the calculation points
241 * @param (IntVect&) the array of elements in which the calculation points are located
242 * @param (DoubleTab& les_valeurs) the array of field values at the specified points
243 * @return (DoubleTab&) the array of field values at the specified points
244 */
245DoubleTab& Champ_base::valeur_aux_elems(const DoubleTab&,
246 const IntVect& ,
247 DoubleTab& les_valeurs) const
248{
249 Cerr << que_suis_je();
250 Cerr << "::valeur_aux_elems(...) is not coded " << finl ;
251 exit();
252 return les_valeurs;
253}
254
255/*! @brief Causes an error! Must be overridden by derived classes
256 *
257 * Not pure virtual for convenience of development!
258 * Returns the values of a component of the field at the specified points
259 * by their coordinates, indicating that the calculation
260 * points are located in the specified elements.
261 *
262 * @param (DoubleTab&) the array of coordinates of the calculation points
263 * @param (IntVect&) the array of elements in which the calculation points are located
264 * @param (DoubleVect& les_valeurs) the array of values of the component of the field at the specified points
265 * @param (int) the index of the component of the field to calculate
266 * @return (DoubleVect&) the array of values of the component of the field at the specified points
267 */
268DoubleVect& Champ_base::valeur_aux_elems_compo(const DoubleTab&,
269 const IntVect&,
270 DoubleVect& les_valeurs,
271 int ) const
272{
273 Cerr << que_suis_je();
274 Cerr << "::valeur_aux_elems_compo(...) is not coded " << finl ;
275 exit();
276 return les_valeurs;
277}
278
279DoubleTab& Champ_base::valeur_aux_elems_smooth(const DoubleTab&,
280 const IntVect& ,
281 DoubleTab& les_valeurs)
282{
283 Cerr << que_suis_je();
284 Cerr << "::valeur_aux_elems_smooth(...) is not coded " << finl ;
285 Cerr << "The chsom option of probes does apply for the moment only for the field of type P1NC in VEF " << finl ;
286 exit();
287 return les_valeurs;
288}
289
290DoubleVect& Champ_base::valeur_aux_elems_compo_smooth(const DoubleTab&,
291 const IntVect&,
292 DoubleVect& les_valeurs,
293 int )
294{
295 Cerr << que_suis_je();
296 Cerr << "::valeur_aux_elems_compo_smooth(...) is not coded " << finl ;
297 Cerr << "The chsom option of probes does apply for the moment only for the field of type P1NC in VEF " << finl ;
298 exit();
299 return les_valeurs;
300}
301
302/*! @brief Time update.
303 *
304 * DOES NOTHING (in the base class)
305 *
306 * @param (double) update time
307 */
308DoubleVect& Champ_base::valeur_a_sommet(int sommet, const Domaine& dom, DoubleVect& val) const
309{
310 DoubleVect position(dimension);
311 for(int i=0; i<dimension; i++)
312 {
313 position(i)=dom.coord(sommet,i);
314 }
315 return valeur_a(position, val);
316}
317
318/*! @brief Returns the compo-th coordinate of the values at the element le_poly at the vertex sommet
319 *
320 */
321double Champ_base::valeur_a_sommet_compo(int sommet, int le_poly, int compo) const
322{
323 Cerr << que_suis_je();
324 Cerr << "::valeur_a_sommet_compo(...) is not coded " << finl ;
325 exit();
326 return -1;
327}
328
329/*! @brief Returns the values at the vertices of the Domain dom
330 *
331 */
332DoubleTab& Champ_base::valeur_aux_sommets(const Domaine& dom, DoubleTab& val) const
333{
334 const DoubleTab& positions=dom.coord_sommets();
335 IntVect les_polys(positions.dimension(0));
336 dom.chercher_elements(positions, les_polys);
337 return valeur_aux_elems(positions, les_polys, val);
338}
339
340/*! @brief Returns the compo-th value at the vertices of dom.
341 *
342 */
343DoubleVect& Champ_base::valeur_aux_sommets_compo(const Domaine& dom,
344 DoubleVect& val, int compo) const
345{
346 const DoubleTab& positions=dom.coord_sommets();
347 IntVect les_polys(positions.dimension(0));
348 dom.chercher_elements(positions, les_polys);
349 return valeur_aux_elems_compo(positions, les_polys, val, compo);
350}
351
352/*! @brief Returns the field value at the faces
353 *
354 */
355DoubleTab& Champ_base::valeur_aux_faces(DoubleTab& result) const
356{
357 return valeur_aux(ref_cast(Domaine_VF, domaine_dis_base()).xv(), result);
358}
359
360/*! @brief Returns the field value at the boundary faces
361 *
362 */
364{
365 const DoubleTab& xv_bord = ref_cast(Domaine_VF, domaine_dis_base()).xv_bord();
366 DoubleTrav result(xv_bord.dimension_tot(0), valeurs().line_size());
367 return valeur_aux(xv_bord, result);
368}
369
370/*! @brief Update of the base class Champ_base: does nothing!
371 *
372 */
374{
375
376}
380
381/*! @brief Assign a field to another.
382 *
383 * Returns the result of the assignment.
384 *
385 * @param (Champ_base& ch) right side of the assignment
386 * @return (Champ_base&) the result of the assignment (*this)
387 */
389{
390 affecter_(ch);
392 return *this;
393}
394
395// Factorize the error message for fields
396// whose affecter method has no meaning.
398{
399 Nom message;
400 message ="The method ";
401 message += que_suis_je();
402 message += "::affecter has no sense.\n";
403 message += "TRUST has caused an error and will stop.\nUnexpected error during TRUST calculation.";
404 Process::exit(message);
405}
406
407/*! @brief This method will set the units and the name of components, it is not actually const!!!
408 *
409 */
411{
412 if(unite_.size() != nb_compo_)
413 {
414 Noms& unit=ref_cast_non_const(Noms,unite_);
415 Nom nom=unite_[0];
416 unit.dimensionner_force(nb_compo_);
417 for(int compo=0; compo<nb_compo_; compo++)
418 unit[compo] = nom;
419 }
420 int compo_nommees=(nom_compo(0) != Nom());
421 if((!compo_nommees)&&(nb_compo_ != 1))
422 {
423 Noms ext(nb_compo_);
424 if (nb_compo_<=3)
425 {
426 if(!axi)
427 {
428 ext[0]=le_nom()+"X";
429 if (nb_compo_> 1) ext[1]=le_nom()+"Y";
430 if (nb_compo_> 2) ext[2]=le_nom()+"Z";
431 }
432 else
433 {
434 ext[0]=le_nom()+"R";
435 if (nb_compo_> 1) ext[1]=le_nom()+"teta";
436 if (nb_compo_> 2) ext[2]=le_nom()+"Z";
437 }
438 }
439 else for (int c=0; c<nb_compo_; c++)
440 ext[c]=le_nom()+"_"+Nom(c);
441 Champ_base& ch=ref_cast_non_const(Champ_base,*this);
442 ch.fixer_noms_compo(ext);
443 }
444}
445
446DoubleTab& Champ_base::eval_elem(DoubleTab& tab_valeurs) const
447{
448 Process::exit("This function is only for DG");
449
450 return tab_valeurs;
451}
452
453
454void Champ_base::calculer_valeurs_elem_post(DoubleTab& les_valeurs,int nb_elem,Nom& nom_post,const Domaine& dom) const
455{
456 //nom_post=le_nom();
457 Nom nom_dom=dom.le_nom();
458 Nom nom_dom_inc= dom.le_nom();
459 if(sub_type(Champ_Inc_base, *this) )
460 {
461 nom_dom_inc=ref_cast(Champ_Inc_base, *this).domaine().le_nom();
462 }
463 else if(sub_type(Champ_Fonc_base, *this) )
464 {
465 nom_dom_inc=ref_cast(Champ_Fonc_base, *this).domaine().le_nom();
466 }
467
468 bool isChamp_basis_function = is_basis_function();
469 if (isChamp_basis_function)
470 {
471 int ndim = is_vectorial() ? Objet_U::dimension : 1;
472 les_valeurs.resize(nb_elem, ndim);
473 }
474 else
475 les_valeurs.resize(nb_elem, nb_compo_);
476
477 if(nom_dom==nom_dom_inc)
478 {
479 valeur_aux_centres_de_gravite(dom, les_valeurs);
480 }
481 else
482 {
483 DoubleTrav centres_de_gravites(nb_elem, dimension);
484 dom.calculer_centres_gravite(centres_de_gravites);
485 valeur_aux(centres_de_gravites, les_valeurs);
486 }
487
488
489 if((axi) && (nb_compo_==dimension))
490 {
491 DoubleTrav centres_de_gravites(nb_elem, dimension);
492 dom.calculer_centres_gravite(centres_de_gravites);
493 double teta, vR, vT;
494 for (int num_elem=0; num_elem<nb_elem; num_elem++)
495 {
496 teta = centres_de_gravites(num_elem,1);
497 vR=les_valeurs(num_elem, 0);
498 vT=les_valeurs(num_elem, 1);
499 les_valeurs(num_elem, 0) =vR*cos(teta)-vT*sin(teta);
500 les_valeurs(num_elem, 1) =vR*sin(teta)+vT*cos(teta);
501 }
502 }
503
504 nom_post+= Nom("_elem_");
505 nom_post+= nom_dom;
506}
507
508void Champ_base::calculer_valeurs_elem_compo_post(DoubleTab& les_valeurs,int ncomp,int nb_elem,Nom& nom_post,const Domaine& dom) const
509{
510 //nom_post=nom_compo(ncomp);
511 Nom nom_dom=dom.le_nom();
512 Nom nom_dom_inc= dom.le_nom();
513 if(sub_type(Champ_Inc_base, *this) )
514 {
515 nom_dom_inc=ref_cast(Champ_Inc_base, *this).domaine().le_nom();
516 }
517 else if(sub_type(Champ_Fonc_base, *this) )
518 {
519 nom_dom_inc=ref_cast(Champ_Fonc_base, *this).domaine().le_nom();
520 }
521 ToDo_Kokkos("Critical; rewrite as Champ_base::calculer_valeurs_elem_post");
522 DoubleTrav centres_de_gravites(nb_elem, dimension);
523 les_valeurs.resize(nb_elem);
524 if(nom_dom==nom_dom_inc)
525 {
526 if(sub_type(Champ_Inc_base, *this) )
527 {
528 const Domaine_VF& zvf = ref_cast(Domaine_VF,ref_cast(Champ_Inc_base, *this).equation().domaine_dis());
529 // To avoid a resize by nb_elem_tot per call to xp()
530 for (int i=0; i<nb_elem; i++)
531 for (int k=0; k<dimension; k++)
532 centres_de_gravites(i,k) = zvf.xp(i,k);
533 }
534 else
535 dom.calculer_centres_gravite(centres_de_gravites);
536
537 IntVect les_polys(nb_elem);
538 {
539 for(int elem=0; elem<nb_elem; elem++)
540 {
541 les_polys(elem)=elem;
542 }
543 }
544 valeur_aux_elems_compo(centres_de_gravites, les_polys, les_valeurs, ncomp);
545 }
546 else
547 {
548 dom.calculer_centres_gravite(centres_de_gravites);
549 valeur_aux_compo(centres_de_gravites, les_valeurs, ncomp);
550 }
551 nom_post+= Nom("_elem_");
552 nom_post+= nom_dom;
553}
554
555// Adds the contribution of other processors to values and counter
556inline void add_sommets_communs(const Domaine& dom, DoubleTab& les_valeurs, IntTab& compteur)
557{
558
559 // if (Process::nproc()>9) return;
560 char* theValue = getenv("TRUST_POST_SOM_NON_PARA");
561 if (theValue != nullptr)
562 return;
563 int nb_compo_ = les_valeurs.line_size();
564
565 // Iterate over joints
566 const Joints& joints = dom.faces_joint();
567 const int nb_joints = joints.size();
568 for (int i_joint = 0; i_joint < nb_joints; i_joint++)
569 {
570 const Joint& joint = joints[i_joint];
571 const int PEvoisin = joint.PEvoisin();
572 const Joint_Items& joint_item = joint.joint_item(JOINT_ITEM::SOMMET);
573 const ArrOfInt& sommets_communs = joint_item.items_communs();
574
575 // Temporary arrays
576 IntTab envoie_sommets;
577 DoubleTab envoie_valeurs;
578 IntTab envoie_compteur;
579 IntTab recoit_sommets;
580 DoubleTab recoit_valeurs;
581 IntTab recoit_compteur;
582 int size=0;
583 // Iterate over common vertices
584 int size_sommets_communs = sommets_communs.size_array();
585 for (int j=0; j<size_sommets_communs; j++)
586 {
587 int sommet = sommets_communs[j];
588 // If this common vertex belongs to the list of Dirichlet vertices:
589 if ( compteur(sommet)>0)
590 {
591 // The index of the remote neighboring vertex is:
592 int sommet_voisin = joint_item.renum_items_communs()(j,0);
593 // Verify that the local vertex is indeed a vertex:
594 assert(joint_item.renum_items_communs()(j,1)==sommet);
595 // Resize the send arrays and fill them
596 size++;
597 envoie_sommets.resize(size);
598 envoie_sommets(size-1) = sommet_voisin;
599 envoie_compteur.resize(size);
600 envoie_compteur(size-1) = compteur(sommet);
601 envoie_valeurs.resize(size, nb_compo_);
602 for(int compo=0; compo<nb_compo_; compo++)
603 envoie_valeurs(size-1,compo) = les_valeurs(sommet,compo);
604 }
605 }
606 if (Process::me()<PEvoisin)
607 {
608 // Send arrays to PEvoisin
609 envoyer(envoie_sommets,Process::me(),PEvoisin,Process::me()+1000);
610 envoyer(envoie_valeurs,Process::me(),PEvoisin,Process::me()+2000);
611 envoyer(envoie_compteur,Process::me(),PEvoisin,Process::me()+3000);
612 // Receive arrays from PEvoisin
613 recevoir(recoit_sommets,PEvoisin,Process::me(),PEvoisin+1000);
614 recevoir(recoit_valeurs,PEvoisin,Process::me(),PEvoisin+2000);
615 recevoir(recoit_compteur,PEvoisin,Process::me(),PEvoisin+3000);
616 }
617 else
618 {
619 // Receive arrays from PEvoisin
620 recevoir(recoit_sommets,PEvoisin,Process::me(),PEvoisin+1000);
621 recevoir(recoit_valeurs,PEvoisin,Process::me(),PEvoisin+2000);
622 recevoir(recoit_compteur,PEvoisin,Process::me(),PEvoisin+3000);
623 // Send arrays to PEvoisin
624 envoyer(envoie_sommets,Process::me(),PEvoisin,Process::me()+1000);
625 envoyer(envoie_valeurs,Process::me(),PEvoisin,Process::me()+2000);
626 envoyer(envoie_compteur,Process::me(),PEvoisin,Process::me()+3000);
627
628 }
629 // Add the contribution of PEvoisin to the values and counter arrays
630 // if the counters on both sides are non-zero
631 int recoit_size = recoit_sommets.size_array();
632 for (int i=0; i<recoit_size; i++)
633 {
634 int sommet = recoit_sommets(i);
635
636 // Contribution received from a Dirichlet vertex
637 if (recoit_compteur(i))
638 {
639 // If the local vertex is not Dirichlet, zero out values
640 if (compteur(sommet)==0)
641 for(int compo=0; compo<nb_compo_; compo++)
642 les_valeurs(sommet,compo)=0;
643
644 compteur(sommet)+=recoit_compteur(i);
645 for(int compo=0; compo<nb_compo_; compo++)
646 les_valeurs(sommet,compo)+=recoit_valeurs(i,compo);
647 }
648 }
649 }
650}
651
652void Champ_base::calculer_valeurs_som_post(DoubleTab& les_valeurs,int nb_som,Nom& nom_post,const Domaine& dom) const
653{
654 Nom nom_dom=dom.le_nom();
655 Nom nom_dom_inc= dom.le_nom();
656 if(sub_type(Champ_Inc_base, *this) )
657 {
658 nom_dom_inc=ref_cast(Champ_Inc_base, *this).domaine().le_nom();
659 }
660 else if(sub_type(Champ_Fonc_base, *this) )
661 {
662 nom_dom_inc=ref_cast(Champ_Fonc_base, *this).domaine().le_nom();
663 }
664
665 const DoubleTab& coord_sommets=dom.coord_sommets() ;
666
667 les_valeurs.resize(nb_som, nb_compo_);
668
669 if(nom_dom==nom_dom_inc)
670 {
671 valeur_aux_sommets(dom,les_valeurs);
672 }
673 else
674 {
675 valeur_aux(coord_sommets, les_valeurs);
676 }
677 int old_traitement_symetrie=0;
678 {
679 char* theValue = getenv("TRUST_POST_SOM_SYMETRIE_ERREUR");
680 if (theValue != nullptr)
681 {
682 Cerr<<"results depend on order of bc or faces in bc ..."<<finl;
683 old_traitement_symetrie=1;
684 }
685 }
686 int impose_cl_diri=1;
687
688 {
689 char* theValue = getenv("TRUST_POST_SOM_NO_DIRICHLET");
690 if (theValue != nullptr)
691 {
692 impose_cl_diri=0;
693 }
694 }
695
696 // Taking boundary conditions into account:
697 if (sub_type(Champ_Inc_base, *this)&&impose_cl_diri)
698 {
699 const Champ_Inc_base& chi=ref_cast(Champ_Inc_base, *this);
700 if (!chi.mon_equation_non_nul())
701 {
702 Cerr<<"no equation associated to "<<que_suis_je()<<finl;
703 impose_cl_diri=0;
704 }
705 }
706 if (sub_type(Champ_Inc_base, *this)&&impose_cl_diri)
707 {
708 const Champ_Inc_base& chi=ref_cast(Champ_Inc_base, *this);
709
710 const Equation_base& eqn=chi.equation();
711 // GF we do not want to take into account the BCs in EF
712 if (eqn.discretisation().que_suis_je()!="EF")
713 if((eqn.inconnue().le_nom() == le_nom())
714 && (sub_type(Champ_Inc_base, *this))
715 && (dom==(ref_cast(Champ_Inc_base, *this).equation().probleme().domaine() ) ) )
716 {
717 IntTab compteur(dom.nb_som());
718 compteur = 0;
719
720 const Domaine_Cl_dis_base& zcl=eqn.domaine_Cl_dis();
721 int nb_cond_lim=zcl.nb_cond_lim(),num_cl;
722 for (num_cl=0; num_cl<nb_cond_lim; num_cl++)
723 {
724 const Cond_lim& la_cl=zcl.les_conditions_limites(num_cl);
725 const Frontiere_dis_base& frontiere_dis=la_cl->frontiere_dis();
726 const Frontiere& frontiere=frontiere_dis.frontiere();
727 const Faces& faces=frontiere.faces();
728 // modif bm: boundary faces now have virtual faces,
729 // we must not loop over virtual faces (old code: nb_faces_tot())
730 int nb_faces=faces.nb_faces();
731 int nb_som_faces=faces.nb_som_faces();
732 if(sub_type(Dirichlet, la_cl.valeur()))
733 {
734 const Dirichlet& diri=ref_cast(Dirichlet, la_cl.valeur());
735 for(int num_face=0; num_face<nb_faces ; num_face++)
736 for(int num_som=0; num_som<nb_som_faces; num_som++)
737 {
738 int sommet=faces.sommet(num_face, num_som);
739
740 if (sommet < 0) continue;
741
742 for(int compo=0; compo<nb_compo_; compo++)
743 {
744 if (compteur(sommet) == 0)
745 les_valeurs(sommet, compo) = 0;
746
747 les_valeurs(sommet, compo) += diri.val_imp(num_face, compo);
748
749 }
750 compteur(sommet) += 1;
751 }
752 }
753 else if(sub_type(Dirichlet_homogene, la_cl.valeur()))
754 {
755 for(int num_face=0; num_face<nb_faces ; num_face++)
756 for(int num_som=0; num_som<nb_som_faces; num_som++)
757 {
758 int sommet=faces.sommet(num_face, num_som);
759
760 if (sommet < 0) continue;
761
762 for(int compo=0; compo<nb_compo_; compo++)
763 {
764 if (compteur(sommet) == 0)
765 les_valeurs(sommet, compo) = 0;
766
767 les_valeurs(sommet, compo) += 0;
768
769 }
770 compteur(sommet) += 1;
771 }
772 }
773 else if((sub_type(Symetrie, la_cl.valeur()))&&old_traitement_symetrie)
774 {
776 {
777 ArrOfDouble normale(dimension);
778 DoubleTab delta(dimension-1,dimension);
779 int nb_faces_tot=faces.nb_faces_tot();
780 for(int num_face=0; num_face<nb_faces_tot ; num_face++)
781 {
782 // compute the normal:
783 int sommet0=faces.sommet(num_face, 0);
784 for (int k=1; k<dimension; k++)
785 {
786 int sommet=faces.sommet(num_face, k);
787
788 if (sommet < 0) continue;
789
790 for(int compo=0; compo<dimension; compo++)
791 delta(k-1,compo)=coord_sommets(sommet,compo)-coord_sommets(sommet0,compo);
792 }
793 if(dimension==2)
794 {
795 normale[0]=-delta(0,1);
796 normale[1]=delta(0,0);
797 }
798 else if(dimension==3)
799 {
800 normale[0]=delta(0,1)*delta(1,2) - delta(0,2)*delta(1,1);
801 normale[1]=delta(0,2)*delta(1,0) - delta(0,0)*delta(1,2);
802 normale[2]=delta(0,0)*delta(1,1) - delta(0,1)*delta(1,0);
803 }
804 else
805 {
806 Cerr << "We do not know treating the dimension : " << dimension << finl;
807 exit();
808 }
809 normale *= 1. / norme_array(normale);
810 for(int num_som=0; num_som<nb_som_faces; num_som++)
811 {
812 int sommet=faces.sommet(num_face, num_som);
813
814 if (sommet < 0) continue;
815
816 if (sommet<dom.nb_som()) // Real vertex
817 {
818 double psc=0;
819 for(int k=0; k< dimension; k++)
820 psc+=normale[k]*les_valeurs(sommet,k);
821 for(int compo=0; compo<nb_compo_; compo++)
822 les_valeurs(sommet, compo) -= psc*normale[compo];
823 }
824 }
825 }
826 }
827 }
828 }
829 // Adds the contribution of other processors to values and counter
830 add_sommets_communs(dom, les_valeurs, compteur);
831
832 // Finish computing the average for cases that were modified
833 // by a Dirichlet boundary condition
834 int nb_som_l = dom.nb_som();
835 //assert (nb_som_l==nb_som_l); // GF not sure about the assert, just to check
836 for (int sommet = 0; sommet<nb_som_l; sommet++)
837 for(int compo=0; compo<nb_compo_; compo++)
838 if (compteur(sommet) != 0)
839 les_valeurs(sommet,compo) /= compteur(sommet);
840
841 }
842 }
843
844 // Taking axisymmetry into account:
845 if((axi) && (nb_compo_==dimension))
846 {
847 double teta, vR, vT;
848 for(int sommet=0; sommet<nb_som; sommet++)
849 {
850 teta = coord_sommets(sommet,1);
851 vR=les_valeurs(sommet, 0);
852 vT=les_valeurs(sommet, 1);
853 les_valeurs(sommet, 0) =vR*cos(teta)-vT*sin(teta);
854 les_valeurs(sommet, 1) =vR*sin(teta)+vT*cos(teta);
855 }
856 }
857
858 nom_post+= Nom("_som_");
859 nom_post+= nom_dom;
860}
861
862void Champ_base::calculer_valeurs_som_compo_post(DoubleTab& les_valeurs,int ncomp,int nb_som,Nom& nom_post,const Domaine& dom,int appliquer_cl) const
863{
864 Nom nom_dom=dom.le_nom();
865 Nom nom_dom_inc= dom.le_nom();
866 if(sub_type(Champ_Inc_base, *this) )
867 {
868 nom_dom_inc=ref_cast(Champ_Inc_base, *this).domaine().le_nom();
869 }
870 else if(sub_type(Champ_Fonc_base, *this) )
871 {
872 nom_dom_inc=ref_cast(Champ_Fonc_base, *this).domaine().le_nom();
873 }
874 const DoubleTab& coord_sommets=dom.coord_sommets() ;
875 les_valeurs.resize(nb_som);
876 if(nom_dom==nom_dom_inc)
877 {
878 valeur_aux_sommets_compo(dom,les_valeurs, ncomp);
879 }
880 else
881 {
882 valeur_aux_compo(coord_sommets, les_valeurs, ncomp);
883 }
884
885 //int impose_cl_diri=1;
886
887 {
888 char* theValue = getenv("TRUST_POST_SOM_NO_DIRICHLET");
889 if (theValue != nullptr)
890 {
891 appliquer_cl=0;
892 }
893 }
894
895 if (appliquer_cl)
896 {
897 // List of boundary vertices in contact with a Dirichlet face:
898 // Taking boundary conditions into account:
899 if (sub_type(Champ_Inc_base, *this))
900 {
901 const Champ_Inc_base& chi=ref_cast(Champ_Inc_base, *this);
902 const Equation_base& eqn=chi.equation();
903 if((eqn.inconnue().le_nom() == le_nom())
904 && (sub_type(Champ_Inc_base, *this))
905 && (dom==(ref_cast(Champ_Inc_base, *this).equation().probleme().domaine() ) ) )
906 {
907
908 IntTab compteur(dom.nb_som());
909 compteur = 0;
910 int num_cl;
911 const Domaine_Cl_dis_base& zcl=eqn.domaine_Cl_dis();
912 int nb_cond_lim=zcl.nb_cond_lim();
913 for (num_cl=0; num_cl<nb_cond_lim; num_cl++)
914 {
915 const Cond_lim& la_cl=zcl.les_conditions_limites(num_cl);
916 const Frontiere_dis_base& frontiere_dis=la_cl->frontiere_dis();
917 const Frontiere& frontiere=frontiere_dis.frontiere();
918 const Faces& faces=frontiere.faces();
919 int nb_faces=faces.nb_faces_tot();
920 int nb_som_faces=faces.nb_som_faces();
921
922 if(sub_type(Dirichlet, la_cl.valeur()))
923 {
924 const Dirichlet& diri=ref_cast(Dirichlet, la_cl.valeur());
925 for(int num_face=0; num_face<nb_faces ; num_face++)
926 {
927 for(int num_som=0; num_som<nb_som_faces; num_som++)
928 {
929 int sommet=faces.sommet(num_face, num_som);
930 if (compteur(sommet) == 0)
931 les_valeurs(sommet) = 0;
932
933 les_valeurs(sommet) += diri.val_imp(num_face,ncomp);
934 compteur(sommet) += 1;
935 }
936 }
937 }
938 else if(sub_type(Dirichlet_homogene, la_cl.valeur()))
939 {
940 const Dirichlet_homogene& diri=ref_cast(Dirichlet_homogene, la_cl.valeur());
941 for(int num_face=0; num_face<nb_faces ; num_face++)
942 {
943 for(int num_som=0; num_som<nb_som_faces; num_som++)
944 {
945 int sommet=faces.sommet(num_face, num_som);
946
947 les_valeurs(sommet) = diri.val_imp(num_face,ncomp);
948 compteur(sommet) += 1;
949
950 }
951 }
952 }
953 }
954 // Adds the contribution of other processors to les_valeurs and counter
955 add_sommets_communs(dom, les_valeurs, compteur);
956
957 // Finish computing the average for cases that were modified
958 // by a Dirichlet boundary condition
959 int nb_som_l = dom.nb_som();
960 assert (nb_som==nb_som_l); // GF not sure about the assert, just to check
961 for (int sommet = 0; sommet<nb_som_l; sommet++)
962 if (compteur(sommet) != 0)
963 les_valeurs(sommet) /= compteur(sommet);
964 }
965 }
966 }
967 nom_post+= Nom("_som_");
968 nom_post+= nom_dom;
969}
970
971int Champ_base::completer_post_champ(const Domaine& dom,const int is_axi,const Nom& loc_post,
972 const Nom& le_nom_champ_post,Format_Post_base& format) const
973{
974
975 const Nature_du_champ& la_nature = nature_du_champ();
976 const int nb_compo = nb_comp();
977 const Noms& noms_composante = noms_compo();
978
979 format.completer_post(dom,is_axi,la_nature,nb_compo,noms_composante,loc_post,le_nom_champ_post);
980
981 return 1;
982}
983
984// Sets the conditions for taking boundary conditions into account
985// during field filtering/postprocessing operations
989
990/*! @brief Sets the time at which the field is defined
991 *
992 * @param (double& t) the new time at which the field is defined
993 * @return (double) the new time at which the field is defined
994 */
995double Champ_base::changer_temps(const double t)
996{
997 return temps_ = t ;
998}
999
1000/*! @brief Returns the time of the field
1001 *
1002 * @return (double) the time of the field
1003 */
1004double Champ_base::temps() const
1005{
1006 return temps_ ;
1007}
1008
1009
1010
1012{
1013 Cerr << "Champ_base::fixer_nb_valeurs_nodales\n ";
1014 Cerr << que_suis_je() << " does not have nb_valeurs_nodales" << finl;
1015 exit();
1016 return 0;
1017}
1018
1019// Not all fields have a domaine_dis_base. For those that
1020// do not, the call is invalid.
1022{
1023 Cerr << "Error in Champ_base::associer_domaine_dis_base\n";
1024 Cerr << " (field name : " << le_nom() << ")\n";
1025 Cerr << " The method " << que_suis_je();
1026 Cerr << "::associer_domaine_dis_base is not coded\n";
1027 Cerr << " or the field does not possess a domaine_dis_base." << finl;
1028 exit();
1029}
1030
1031// Not all fields have a domaine_dis_base. For those that
1032// do not, the call is invalid.
1034{
1035 Cerr << "Error in Champ_base::domaine_dis_base\n";
1036 Cerr << " (field name : " << le_nom() << ")\n";
1037 Cerr << " The method " << que_suis_je();
1038 Cerr << "::domaine_dis_base is not coded\n";
1039 Cerr << " or the field does not possess a domaine_dis_base." << finl;
1040 exit();
1041 throw;
1042}
1043
1044
1045/*! @brief Computes the trace of a field on a boundary at time tps
1046 *
1047 * WEC:
1048 * The boundary passed as a parameter must be part of the domain
1049 * on which the field is based.
1050 * The result is computed on this boundary and the size of
1051 * the DoubleTab x corresponds to the number of faces of the boundary.
1052 * x can have a virtual space; the trace function calls
1053 * echange_espace_virtuel.
1054 *
1055 * Special case (unfortunately) of Champ_P0_VDF:
1056 * If the boundary is a connector, the result is computed on the
1057 * associated connector. In this case, the DoubleTab x must be
1058 * dimensioned on the associated connector.
1059 *
1060 *
1061 * @param (Frontiere_dis_base&) discretized boundary on which we want to compute the trace of the field at time tps
1062 * @param (DoubleTab& x , double tps) the values of the field on the boundary at time tps
1063 * @return (DoubleTab&) the values of the field on the boundary at time tps
1064 */
1065DoubleTab& Champ_base::trace(const Frontiere_dis_base& , DoubleTab& x , double tps,int distant) const
1066{
1067 Cerr << que_suis_je() << "did not overloaded Champ_base::trace" << finl;
1068 exit();
1069 return x;
1070}
class Champ_Fonc_base Base class of fields that are functions of a calculated quantity
Class Champ_Inc_base.
virtual DoubleTab & valeurs()=0
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
virtual DoubleVect & valeur_aux_elems_compo_smooth(const DoubleTab &positions, const IntVect &les_polys, DoubleVect &valeurs, int ncomp)
void calculer_valeurs_som_compo_post(DoubleTab &valeurs, int ncomp, int nbsom, Nom &nom_post, const Domaine &dom, int appliquer_cl=0) const
double temps_
Definition Champ_base.h:123
virtual double valeur_a_sommet_compo(int, int, int) const
Returns the compo-th coordinate of the values at the element le_poly at the vertex sommet.
virtual DoubleVect & valeur_a(const DoubleVect &position, DoubleVect &valeurs) const
Computes the "values" of the field at the point with coordinates "pos".
virtual DoubleTab & valeur_aux_elems_smooth(const DoubleTab &positions, const IntVect &les_polys, DoubleTab &valeurs)
virtual DoubleVect & valeur_a_sommet(int, const Domaine &, DoubleVect &) const
Time update.
void calculer_valeurs_elem_post(DoubleTab &valeurs, int nbelem, Nom &nom_post, const Domaine &dom) const
virtual int completer_post_champ(const Domaine &dom, const int axi, const Nom &loc_post, const Nom &le_nom_champ_post, Format_Post_base &format) const
virtual int fixer_nb_valeurs_nodales(int n)
virtual void completer(const Domaine_Cl_dis_base &zcl)
Champ_base()
Default constructor of a Champ_base.
Champ_base & affecter(const Champ_base &)
Assign a field to another.
virtual const Domaine_dis_base & domaine_dis_base() const
virtual DoubleTab & eval_elem(DoubleTab &valeurs) const
virtual DoubleVect & valeur_aux_elems_compo(const DoubleTab &positions, const IntVect &les_polys, DoubleVect &valeurs, int ncomp) const
Causes an error! Must be overridden by derived classes.
virtual double changer_temps(const double t)
Sets the time at which the field is defined.
virtual DoubleTab valeur_aux_bords() const
Returns the field value at the boundary faces.
void affecter_erreur()
void calculer_valeurs_elem_compo_post(DoubleTab &valeurs, int ncomp, int nbelem, Nom &nom_post, const Domaine &dom) const
virtual Champ_base & affecter_(const Champ_base &)=0
double temps() const
Returns the time of the field.
virtual void associer_domaine_dis_base(const Domaine_dis_base &)
virtual DoubleVect & valeur_aux_sommets_compo(const Domaine &, DoubleVect &, int) const
Returns the compo-th value at the vertices of dom.
virtual DoubleTab & valeur_aux(const DoubleTab &positions, DoubleTab &valeurs) const
Causes an error! Must be overridden by derived classes.
virtual DoubleTab & valeur_aux_faces(DoubleTab &result) const
Returns the field value at the faces.
virtual DoubleTab & valeur_aux_elems(const DoubleTab &positions, const IntVect &les_polys, DoubleTab &valeurs) const
Causes an error! Must be overridden by derived classes.
void calculer_valeurs_som_post(DoubleTab &valeurs, int nbsom, Nom &nom_post, const Domaine &dom) const
virtual DoubleVect & valeur_a_elem(const DoubleVect &position, DoubleVect &valeurs, int le_poly) const
Causes an error! Must be overridden by derived classes.
virtual double valeur_a_compo(const DoubleVect &position, int ncomp) const
Computes the point value of the component "compo" of the field at the point with coordinates pos.
virtual double valeur_a_elem_compo(const DoubleVect &position, int le_poly, int ncomp) const
Causes an error! Must be overridden by derived classes.
virtual void abortTimeStep()
void corriger_unite_nom_compo()
This method will set the units and the name of components, it is not actually const!...
virtual DoubleTab & valeur_aux_sommets(const Domaine &, DoubleTab &) const
Returns the values at the vertices of the Domain dom.
virtual DoubleVect & valeur_aux_compo(const DoubleTab &positions, DoubleVect &valeurs, int ncomp) const
Same as valeur_aux(const DoubleTab &, DoubleTab &), but computes only the component compo of the fiel...
virtual void mettre_a_jour(double)
Update of the base class Champ_base: does nothing!
virtual DoubleTab & valeur_aux_centres_de_gravite(const Domaine &, DoubleTab &valeurs) const
This method, generic but slow (calculation of gravity centers, filling les_poly, use of shape functio...
virtual DoubleTab & trace(const Frontiere_dis_base &, DoubleTab &, double, int distant) const
Computes the trace of a field on a boundary at time tps.
class Cond_lim Generic class used to represent any class
Definition Cond_lim.h:31
Classe Dirichlet_homogene This class is the base class of the hierarchy of homogeneous Dirichlet-type...
double val_imp(int i) const
Dirichlet This class is the base class of the hierarchy of Dirichlet-type boundary conditions.
Definition Dirichlet.h:31
virtual double val_imp(int i) const
Returns the imposed value on the i-th component of the field at the boundary at the default time of c...
Definition Dirichlet.cpp:35
SmallArrOfTID_t & chercher_elements(const DoubleTab &pos, SmallArrOfTID_t &elem, int reel=0) const
Searches for the elements containing the points whose coordinates are specified.
Definition Domaine.cpp:404
void calculer_centres_gravite(DoubleTab_t &xp) const
Calculates the centers of gravity of the domain elements.
Definition Domaine.h:503
const DoubleTab_t & coord_sommets() const
Definition Domaine.h:112
Joints_t & faces_joint()
Definition Domaine.h:265
double coord(int_t i, int j) const
Definition Domaine.h:110
int_t nb_som() const
Returns the number of vertices of the domain.
Definition Domaine.h:121
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
int nb_cond_lim() const
Returns the number of boundary conditions.
const Cond_lim & les_conditions_limites(int) const
Returns the i-th boundary condition.
class Domaine_VF
Definition Domaine_VF.h:44
double xp(int num_elem, int k) const
Definition Domaine_VF.h:77
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
class Equation_base The role of an equation is the calculation of one or more fields....
const Discretisation_base & discretisation() const
Returns the discretization associated with the equation.
virtual const Champ_Inc_base & inconnue() const =0
virtual Domaine_Cl_dis_base & domaine_Cl_dis()
Returns the discretized boundary condition domain associated with the equation.
int_t nb_faces_tot() const
Returns the total number of Faces i (real and virtual) on the current processor.
Definition Faces.h:68
int_t nb_faces() const
Definition Faces.h:66
int_t sommet(int_t, int) const
Returns the number of the j-th vertex of the i-th face.
Definition Faces.h:130
int nb_som_faces() const
Returns the number of vertices per face.
Definition Faces.h:149
const Nom & nom_compo() const
Returns the name of a scalar field.
const Nom & le_nom() const override
Returns the name of the field.
void nommer(const Nom &) override
Gives a name to the field.
virtual const Nom & fixer_unite(const Nom &)
Specifies the unit of a scalar field or whose all components have the same unit.
virtual Nature_du_champ fixer_nature_du_champ(Nature_du_champ nat)
Sets the nature of a field: scalar, multiscalar, vectorial.
virtual int nb_comp() const
Definition Field_base.h:56
virtual const Noms & fixer_noms_compo(const Noms &)
Sets the names of the field components.
int nb_compo_
Definition Field_base.h:95
bool is_vectorial() const
Definition Field_base.h:82
virtual Nature_du_champ nature_du_champ() const
Definition Field_base.h:77
Noms unite_
Definition Field_base.h:94
bool is_basis_function() const
Definition Field_base.h:80
const Noms & noms_compo() const
Returns the array of names of the field components.
Base class for post-processing output formats for fields (lata, med, cgns, lml, single_lata).
virtual int completer_post(const Domaine &dom, const int axi, const Nature_du_champ &nature, const int nb_compo, const Noms &noms_compo, const Motcle &loc_post, const Nom &le_nom_champ_post)
const Faces_t & faces() const
Definition Frontiere.h:54
class Frontiere_dis_base Class representing a discretized boundary.
const Frontiere & frontiere() const
Returns the associated geometric boundary.
const Joint_Items_t & joint_item(JOINT_ITEM type) const
Returns the joint information for the requested type (read-only).
Definition Joint.cpp:131
int PEvoisin() const
Definition Joint.h:49
const ArrOfInt_t & items_communs() const
Definition Joint_Items.h:44
const IntTab_t & renum_items_communs() const
Returns the renum_items_communs_ array (read-only). See renum_items_communs_.
int mon_equation_non_nul() const
Definition MorEqn.h:85
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
Definition MorEqn.h:62
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
const Nom & le_nom() const override
Returns *this.
Definition Nom.cpp:555
An array of character strings (VECT(Nom)).
Definition Noms.h:26
static int dimension
Definition Objet_U.h:94
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
static int axi
Definition Objet_U.h:96
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
static int me()
Returns the rank of the local processor in the current communication group. See Comm_Group::rank() an...
Definition Process.cpp:122
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
Base class for output streams.
Definition Sortie.h:52
Symetrie On symmetry faces, the following properties hold:
Definition Symetrie.h:37
_SIZE_ size_array() const
std::enable_if_t< is_default_exec_space< EXEC_SPACE >, View< _TYPE_, _SHAPE_ > > view_wo()
Definition TRUSTTab.h:276
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
Definition TRUSTTab.tpp:469
_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
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")