TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Champ_Q1NC_implementation.cpp
1/****************************************************************************
2* Copyright (c) 2024, 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_Q1NC_implementation.h>
17#include <Domaine.h>
18#include <Domaine_VEF.h>
19#include <Champ_Inc_base.h>
20#include <verif_cast.h>
21
22DoubleTab& Champ_Q1NC_implementation::Derivee_fonction_forme_2D_normalise(double u, double v, DoubleTab& DF)
23{
24 DF(0, 0) = -0.5 + 0.5 * u;
25 DF(0, 1) = -0.5 * u;
26 DF(0, 2) = 0.5 + 0.5 * u;
27 DF(0, 3) = -0.5 * u;
28
29 DF(1, 0) = -0.5 * v;
30 DF(1, 1) = -0.5 + 0.5 * v;
31 DF(1, 2) = -0.5 * v;
32 DF(1, 3) = 0.5 + 0.5 * v;
33
34 return DF;
35
36}
37
38DoubleTab& Champ_Q1NC_implementation::Derivee_fonction_forme_3D_normalise(double u, double v, double w, DoubleTab& DF)
39{
40 double tier = 1. / 3.;
41 DF(0, 0) = -0.5 + 2 * tier * u;
42 DF(0, 1) = -tier * u;
43 DF(0, 2) = -tier * u;
44 DF(0, 3) = 0.5 + 2 * tier * u;
45 DF(0, 4) = -tier * u;
46 DF(0, 5) = -tier * u;
47
48 DF(1, 0) = -tier * v;
49 DF(1, 1) = -0.5 + 2 * tier * v;
50 DF(1, 2) = -tier * v;
51 DF(1, 3) = -tier * v;
52 DF(1, 4) = 0.5 + 2 * tier * v;
53 DF(1, 5) = -tier * v;
54
55 DF(2, 0) = -tier * w;
56 DF(2, 1) = -tier * w;
57 DF(2, 2) = -0.5 + 2 * tier * w;
58 DF(2, 3) = -tier * w;
59 DF(2, 4) = -tier * w;
60 DF(2, 5) = 0.5 + 2 * tier * w;
61
62 return DF;
63
64}
65
66DoubleVect& Champ_Q1NC_implementation::valeur_a_elem(const DoubleVect& position, DoubleVect& val, int le_poly) const
67{
68 const Champ_base& cha = le_champ();
69 int face, nb_compo_ = cha.nb_comp();
70 double xs, ys, zs;
71 const DoubleTab& ch = cha.valeurs();
72 const Domaine_VEF& domaine_VEF = domaine_vef();
73 int init = tab_param.size(), D = Objet_U::dimension;
74 if (init == 0 && D == 2)
75 (verif_cast(Champ_Q1NC_implementation&, *this)).transforme_coord2D();
76 if (init == 0 && D == 3)
77 (verif_cast(Champ_Q1NC_implementation&, *this)).transforme_coord3D();
78
79 val = 0;
80 if (le_poly != -1)
81 {
82 xs = position(0);
83 ys = position(1);
84 zs = (D == 3) ? position(2) : 0.;
85
86 for (int i = 0; i < 2 * D; i++)
87 {
88 face = domaine_VEF.elem_faces(le_poly, i);
89 for (int ncomp = 0; ncomp < nb_compo_; ncomp++)
90 val(ncomp) += ch(face, ncomp)
91 * ((D == 2) ? (verif_cast(Champ_Q1NC_implementation&, *this)).fonction_forme_2D(xs, ys, le_poly, i) : (verif_cast(Champ_Q1NC_implementation&, *this)).fonction_forme_3D(xs, ys, zs, le_poly, i));
92 }
93
94 }
95 return val;
96}
97
98double Champ_Q1NC_implementation::calcule_valeur_a_elem_compo(double xs, double ys, double zs, int le_poly, int ncomp) const
99{
100 const Domaine_VEF& domaine_VEF = domaine_vef();
101 const DoubleTab& ch = le_champ().valeurs();
102 int face, init = tab_param.size(), D = Objet_U::dimension;
103
104 if (init == 0 && D == 2)
105 (verif_cast(Champ_Q1NC_implementation&, *this)).transforme_coord2D();
106 if (init == 0 && D == 3)
107 (verif_cast(Champ_Q1NC_implementation&, *this)).transforme_coord3D();
108
109 double val;
110
111 if (le_poly == -1)
112 val = 0;
113 else
114 {
115 // Calcul d'apres les fonctions de forme sur le quadrangle ou son extension en 3D
116 val = 0;
117 for (int i = 0; i < 2 * D; i++)
118 {
119 face = domaine_VEF.elem_faces(le_poly, i);
120 val += ch(face, ncomp)
121 * ((D == 2) ? (verif_cast(Champ_Q1NC_implementation&, *this)).fonction_forme_2D(xs, ys, le_poly, i) : (verif_cast(Champ_Q1NC_implementation&, *this)).fonction_forme_3D(xs, ys, zs, le_poly, i));
122 }
123 }
124 return val;
125}
126
127double Champ_Q1NC_implementation::valeur_a_elem_compo(const DoubleVect& position, int le_poly, int ncomp) const
128{
129 double xs, ys, zs = 0;
130 xs = position(0);
131 ys = position(1);
132 if (Objet_U::dimension == 3)
133 zs = position(2);
134 return calcule_valeur_a_elem_compo(xs, ys, zs, le_poly, ncomp);
135}
136
137double Champ_Q1NC_implementation::valeur_a_sommet_compo(int num_som, int le_poly, int ncomp) const
138{
139 //Cerr << "Champ_Q1NC_implementation::valeur_a_sommet_compo" << finl;
140 // Contrairement au Champ_P1NC les fonctions de forme
141 // ne sont pas triviales au sommet des hexas... On repasse
142 // par calcule_valeur_a_elem_compo
143 double xs, ys, zs = 0;
144 const Domaine& dom = get_domaine_geom();
145 xs = dom.coord(num_som, 0);
146 ys = dom.coord(num_som, 1);
147 if (Objet_U::dimension == 3)
148 zs = dom.coord(num_som, 2);
149 return calcule_valeur_a_elem_compo(xs, ys, zs, le_poly, ncomp);
150}
151
152DoubleTab& Champ_Q1NC_implementation::valeur_aux_elems(const DoubleTab& positions, const IntVect& les_polys, DoubleTab& val) const
153{
154 const Champ_base& cha = le_champ();
155 int face, nb_compo_ = cha.nb_comp();
156 double xs, ys, zs;
157 const Domaine_VEF& domaine_VEF = domaine_vef();
158 int init = tab_param.size(), D = Objet_U::dimension;
159
160 if (init == 0 && D == 2)
161 (verif_cast(Champ_Q1NC_implementation&, *this)).transforme_coord2D();
162 if (init == 0 && D == 3)
163 (verif_cast(Champ_Q1NC_implementation&, *this)).transforme_coord3D();
164
165 if (val.nb_dim() > 2)
166 {
167 Cerr << "Erreur TRUST dans Champ_Q1NC_implementation::valeur_aux_elems()\n";
168 Cerr << "Le DoubleTab val a plus de 2 entrees\n";
170 }
171
172 int le_poly;
173 const DoubleTab& ch = cha.valeurs();
174
175 for (int rang_poly = 0; rang_poly < les_polys.size(); rang_poly++)
176 {
177 le_poly = les_polys(rang_poly);
178 if (le_poly == -1)
179 for (int ncomp = 0; ncomp < nb_compo_; ncomp++)
180 val(rang_poly, ncomp) = 0;
181 else
182 {
183 for (int ncomp = 0; ncomp < nb_compo_; ncomp++)
184 {
185 val(rang_poly, ncomp) = 0;
186 xs = positions(rang_poly, 0);
187 ys = positions(rang_poly, 1);
188 zs = (D == 3) ? positions(rang_poly, 2) : 0.;
189 for (int i = 0; i < 2 * D; i++)
190 {
191 face = domaine_VEF.elem_faces(le_poly, i);
192 val(rang_poly, ncomp) += ch(face, ncomp)
193 * ((D == 2) ? (verif_cast(Champ_Q1NC_implementation&, *this)).fonction_forme_2D(xs, ys, le_poly, i) : (verif_cast(Champ_Q1NC_implementation&, *this)).fonction_forme_3D(xs, ys, zs, le_poly, i));
194 }
195 }
196 }
197 }
198 return val;
199}
200
201DoubleVect& Champ_Q1NC_implementation::valeur_aux_elems_compo(const DoubleTab& positions, const IntVect& les_polys, DoubleVect& val, int ncomp) const
202{
203 // Cerr << "Champ_Q1NC_implementation::valeur_aux_elems_compo " << finl;
204 const Champ_base& cha = le_champ();
205 double xs, ys, zs;
206 int face;
207 const Domaine_VEF& domaine_VEF = domaine_vef();
208 assert(val.size_totale() >= les_polys.size());
209 int le_poly;
210 const DoubleTab& ch = cha.valeurs();
211 int init = tab_param.size(), D = Objet_U::dimension;
212
213 if (init == 0 && D == 2)
214 (verif_cast(Champ_Q1NC_implementation&, *this)).transforme_coord2D();
215 if (init == 0 && D == 3)
216 (verif_cast(Champ_Q1NC_implementation&, *this)).transforme_coord3D();
217
218 for (int rang_poly = 0; rang_poly < les_polys.size(); rang_poly++)
219 {
220 le_poly = les_polys(rang_poly);
221 if (le_poly == -1)
222 val(rang_poly) = 0;
223 else
224 {
225 // Calcul d'apres les fonctions de forme sur le quadrangle ou son extension en 3D
226 val = 0;
227 xs = positions(rang_poly, 0);
228 ys = positions(rang_poly, 1);
229 zs = (D == 3) ? positions(rang_poly, 2) : 0.;
230 for (int i = 0; i < 2 * D; i++)
231 {
232 face = domaine_VEF.elem_faces(le_poly, i);
233 val(rang_poly) += ch(face, ncomp)
234 * ((D == 2) ? (verif_cast(Champ_Q1NC_implementation&, *this)).fonction_forme_2D(xs, ys, le_poly, i) : (verif_cast(Champ_Q1NC_implementation&, *this)).fonction_forme_3D(xs, ys, zs, le_poly, i));
235 }
236 }
237 }
238 return val;
239}
240
241DoubleTab& Champ_Q1NC_implementation::valeur_aux_sommets(const Domaine& dom, DoubleTab& ch_som) const
242{
243 // Cerr << "Champ_Q1NC_implementation::valeur_aux_sommets " << finl;
244 const Domaine_dis_base& domaine_dis = get_domaine_dis();
245 const Domaine& mon_dom = domaine_dis.domaine();
246 int nb_elem_tot = mon_dom.nb_elem_tot(), nb_som = mon_dom.nb_som(), nb_som_elem = mon_dom.nb_som_elem();
247 const Champ_base& cha = le_champ();
248 int nb_compo_ = cha.nb_comp();
249 IntVect compteur(nb_som);
250 int ncomp, num_elem, num_som, j;
251 ch_som = 0;
252 compteur = 0;
253
254 DoubleVect position(Objet_U::dimension);
255 for (num_elem = 0; num_elem < nb_elem_tot; num_elem++)
256 for (j = 0; j < nb_som_elem; j++)
257 {
258 num_som = mon_dom.sommet_elem(num_elem, j);
259 // Cerr << "num_som " << num_som << finl;
260 for (int k = 0; k < Objet_U::dimension; k++)
261 position(k) = dom.coord(num_som, k);
262 // Cerr << "position " << position << finl;
263 if (num_som < nb_som)
264 {
265 compteur[num_som]++;
266 for (ncomp = 0; ncomp < nb_compo_; ncomp++)
267 {
268 ch_som(num_som, ncomp) += valeur_a_elem_compo(position, num_elem, ncomp);
269 // Cerr << "ch_som " << ch_som(num_som,ncomp) << finl;
270 }
271 }
272 }
273
274 for (num_som = 0; num_som < nb_som; num_som++)
275 for (ncomp = 0; ncomp < nb_compo_; ncomp++)
276 ch_som(num_som, ncomp) /= compteur[num_som];
277
278 return ch_som;
279}
280DoubleVect& Champ_Q1NC_implementation::valeur_aux_sommets_compo(const Domaine& dom, DoubleVect& ch_som, int ncomp) const
281{
282 // Cerr << "Champ_Q1NC_implementation::valeur_aux_sommets_compo " << finl;
283 const Domaine_dis_base& domaine_dis = get_domaine_dis();
284 const Domaine& mon_dom = domaine_dis.domaine();
285 int nb_elem_tot = mon_dom.nb_elem_tot(), nb_som = mon_dom.nb_som(), nb_som_elem = mon_dom.nb_som_elem();
286 IntVect compteur(nb_som);
287 int num_elem, num_som, j;
288 ch_som = 0;
289 compteur = 0;
290
291 DoubleVect position(Objet_U::dimension);
292 for (num_elem = 0; num_elem < nb_elem_tot; num_elem++)
293 for (j = 0; j < nb_som_elem; j++)
294 {
295 num_som = mon_dom.sommet_elem(num_elem, j);
296 for (int k = 0; k < Objet_U::dimension; k++)
297 position(k) = dom.coord(num_som, k);
298
299 if (num_som < nb_som)
300 {
301 compteur[num_som]++;
302 ch_som(num_som) += valeur_a_elem_compo(position, num_elem, ncomp);
303 }
304 }
305 for (num_som = 0; num_som < nb_som; num_som++)
306 ch_som(num_som) /= compteur[num_som];
307
308 return ch_som;
309}
310
311DoubleTab& Champ_Q1NC_implementation::remplir_coord_noeuds(DoubleTab& noeuds) const
312{
313 const Domaine_VEF& zvef = domaine_vef();
314 const DoubleTab& xv = zvef.xv();
315 int nb_fac = zvef.nb_faces();
316 if ((xv.dimension(0) == nb_fac) && (xv.line_size() == Objet_U::dimension))
317 noeuds.ref(xv);
318 else
319 {
320 Cerr << "Erreur dans Champ_Q1NC_implementation::remplir_coord_noeuds()" << finl;
321 Cerr << "Les centres de gravite des faces n'ont pas ete calcules" << finl;
323 }
324 return noeuds;
325}
326
327int Champ_Q1NC_implementation::remplir_coord_noeuds_et_polys(DoubleTab& positions, IntVect& polys) const
328{
329 remplir_coord_noeuds(positions);
330 const Domaine_VEF& zvef = domaine_vef();
331 const IntTab& face_voisins = zvef.face_voisins();
332 int nb_faces = zvef.nb_faces();
333 polys.resize(nb_faces);
334
335 for (int i = 0; i < nb_faces; i++)
336 polys(i) = face_voisins(i, 0);
337
338 return 1;
339}
340
341//
342// cree un tableau des parametres geometrique
343// (tab_param) au debut du calcul pour le fonction_form
344// (vois les inlines dans Champ_Q1NC_implementation.h)
345//
347{
348 // const Domaine_VEF& domaine_VEF = le_dom_vef.valeur();
349 const Domaine_VEF& domaine_VEF = domaine_vef();
350 const Domaine& domaine_geom = get_domaine_geom();
351 const int nb_elem_tot = domaine_VEF.nb_elem_tot();
352 const IntTab& sommet_face = domaine_VEF.face_sommets();
353 const IntTab& elem_faces = domaine_VEF.elem_faces();
354 const Domaine& dom = domaine_geom;
355 const DoubleTab& coords = dom.les_sommets();
356 double lec0, lec1, alpha, beta;
357 int i, poly, som0, som1;
358 //
359 //
360 tab_param.resize(nb_elem_tot, 6);
361 int Nb_noeud_elem = 4;
362 DoubleVect le_coord0(Nb_noeud_elem), le_coord1(Nb_noeud_elem);
363 for (poly = 0; poly < nb_elem_tot; poly++)
364 {
365 for (i = 0; i < Nb_noeud_elem; i++)
366 {
367 som0 = sommet_face(elem_faces(poly, i), 0);
368 som1 = sommet_face(elem_faces(poly, i), 1);
369 le_coord0(i) = 0.5 * (coords(som0, 0) + coords(som1, 0));
370 le_coord1(i) = 0.5 * (coords(som0, 1) + coords(som1, 1));
371 }
372 //
373 // calcul de ksi
374 //
375 // ksi = a_ksi x + b_ksi y + c_ksi
376 // ksi = [ (x2-x0) x + (y2-y0) y ] alpha + beta
377 // a_ksi = alpha (x2-x0)
378 // b_ksi = alpha (y2-y0)
379 // c_ksi = beta
380 //
381 // ou ksi(x0,y0) = -1 eqn(1)
382 // et ksi(x2,y2) = 1 eqn(2)
383 //
384 // donc (2)-(1) donne
385 // alpha = 2/[ (x2-x0)x2 - (x2-x0)x0 + (y2-y0)y2 - (y2-y0)y0 ]
386 // beta = 1 - [(x2-x0)x2 + (y2-y0)y2] alpha
387 //
388 lec0 = carre(le_coord0(2)) + carre(le_coord0(0)) - 2. * le_coord0(2) * le_coord0(0);
389 lec1 = carre(le_coord1(2)) + carre(le_coord1(0)) - 2. * le_coord1(2) * le_coord1(0);
390 alpha = 2. / (lec0 + lec1);
391 lec0 = (le_coord0(2) - le_coord0(0)) * le_coord0(2);
392 lec1 = (le_coord1(2) - le_coord1(0)) * le_coord1(2);
393 beta = 1. - (lec0 + lec1) * alpha;
394 //
395 tab_param(poly, 0) = alpha * (le_coord0(2) - le_coord0(0));
396 tab_param(poly, 1) = alpha * (le_coord1(2) - le_coord1(0));
397 tab_param(poly, 2) = beta;
398 //
399 // calcul de eta
400 //
401 lec0 = carre(le_coord0(3)) + carre(le_coord0(1)) - 2. * le_coord0(3) * le_coord0(1);
402 lec1 = carre(le_coord1(3)) + carre(le_coord1(1)) - 2. * le_coord1(3) * le_coord1(1);
403 alpha = 2. / (lec0 + lec1);
404 lec0 = (le_coord0(3) - le_coord0(1)) * le_coord0(3);
405 lec1 = (le_coord1(3) - le_coord1(1)) * le_coord1(3);
406 beta = 1. - (lec0 + lec1) * alpha;
407 //
408 tab_param(poly, 3) = alpha * (le_coord0(3) - le_coord0(1));
409 tab_param(poly, 4) = alpha * (le_coord1(3) - le_coord1(1));
410 tab_param(poly, 5) = beta;
411 }
412}
413
415{
416 const Domaine_VEF& domaine_VEF = domaine_vef();
417 const Domaine& domaine_geom = get_domaine_geom();
418 const int nb_elem_tot = domaine_VEF.nb_elem_tot();
419 const IntTab& sommet_face = domaine_VEF.face_sommets();
420 const IntTab& elem_faces = domaine_VEF.elem_faces();
421 const Domaine& dom = domaine_geom;
422 const DoubleTab& coords = dom.les_sommets();
423 double lec0, lec1, lec2;
424 double alpha, beta;
425 int i, poly;
426 int som0, som1, som2, som3;
427 tab_param.resize(nb_elem_tot, 12);
428 //
429 //
430 int Nb_noeud_elem = 6;
431 DoubleVect le_coord0(Nb_noeud_elem), le_coord1(Nb_noeud_elem), le_coord2(Nb_noeud_elem);
432 for (poly = 0; poly < nb_elem_tot; poly++)
433 {
434 for (i = 0; i < Nb_noeud_elem; i++)
435 {
436 som0 = sommet_face(elem_faces(poly, i), 0);
437 som1 = sommet_face(elem_faces(poly, i), 1);
438 som2 = sommet_face(elem_faces(poly, i), 2);
439 som3 = sommet_face(elem_faces(poly, i), 3);
440 le_coord0(i) = 0.25 * (coords(som0, 0) + coords(som1, 0) + coords(som2, 0) + coords(som3, 0));
441 le_coord1(i) = 0.25 * (coords(som0, 1) + coords(som1, 1) + coords(som2, 1) + coords(som3, 1));
442 le_coord2(i) = 0.25 * (coords(som0, 2) + coords(som1, 2) + coords(som2, 2) + coords(som3, 2));
443 }
444 //
445 // calcul de ksi
446 //
447 lec0 = carre(le_coord0(3)) + carre(le_coord0(0)) - 2. * le_coord0(3) * le_coord0(0);
448 lec1 = carre(le_coord1(3)) + carre(le_coord1(0)) - 2. * le_coord1(3) * le_coord1(0);
449 lec2 = carre(le_coord2(3)) + carre(le_coord2(0)) - 2. * le_coord2(3) * le_coord2(0);
450 alpha = 2. / (lec0 + lec1 + lec2);
451 lec0 = (le_coord0(3) - le_coord0(0)) * le_coord0(3);
452 lec1 = (le_coord1(3) - le_coord1(0)) * le_coord1(3);
453 lec2 = (le_coord2(3) - le_coord2(0)) * le_coord2(3);
454 beta = 1. - (lec0 + lec1 + lec2) * alpha;
455 //
456 tab_param(poly, 0) = alpha * (le_coord0(3) - le_coord0(0));
457 tab_param(poly, 1) = alpha * (le_coord1(3) - le_coord1(0));
458 tab_param(poly, 2) = alpha * (le_coord2(3) - le_coord2(0));
459 tab_param(poly, 3) = beta;
460 //
461 // calcul de eta
462 //
463 lec0 = carre(le_coord0(4)) + carre(le_coord0(1)) - 2. * le_coord0(4) * le_coord0(1);
464 lec1 = carre(le_coord1(4)) + carre(le_coord1(1)) - 2. * le_coord1(4) * le_coord1(1);
465 lec2 = carre(le_coord2(4)) + carre(le_coord2(1)) - 2. * le_coord2(4) * le_coord2(1);
466 alpha = 2. / (lec0 + lec1 + lec2);
467 lec0 = (le_coord0(4) - le_coord0(1)) * le_coord0(4);
468 lec1 = (le_coord1(4) - le_coord1(1)) * le_coord1(4);
469 lec2 = (le_coord2(4) - le_coord2(1)) * le_coord2(4);
470 beta = 1. - (lec0 + lec1 + lec2) * alpha;
471 //
472 tab_param(poly, 4) = alpha * (le_coord0(4) - le_coord0(1));
473 tab_param(poly, 5) = alpha * (le_coord1(4) - le_coord1(1));
474 tab_param(poly, 6) = alpha * (le_coord2(4) - le_coord2(1));
475 tab_param(poly, 7) = beta;
476 //
477 // calcul de psi
478 //
479 lec0 = carre(le_coord0(5)) + carre(le_coord0(2)) - 2. * le_coord0(5) * le_coord0(2);
480 lec1 = carre(le_coord1(5)) + carre(le_coord1(2)) - 2. * le_coord1(5) * le_coord1(2);
481 lec2 = carre(le_coord2(5)) + carre(le_coord2(2)) - 2. * le_coord2(5) * le_coord2(2);
482 alpha = 2. / (lec0 + lec1 + lec2);
483 lec0 = (le_coord0(5) - le_coord0(2)) * le_coord0(5);
484 lec1 = (le_coord1(5) - le_coord1(2)) * le_coord1(5);
485 lec2 = (le_coord2(5) - le_coord2(2)) * le_coord2(5);
486 beta = 1. - (lec0 + lec1 + lec2) * alpha;
487 //
488 tab_param(poly, 8) = alpha * (le_coord0(5) - le_coord0(2));
489 tab_param(poly, 9) = alpha * (le_coord1(5) - le_coord1(2));
490 tab_param(poly, 10) = alpha * (le_coord2(5) - le_coord2(2));
491 tab_param(poly, 11) = beta;
492 }
493}
virtual DoubleTab & valeurs()=0
DoubleTab & valeur_aux_elems(const DoubleTab &positions, const IntVect &les_polys, DoubleTab &valeurs) const override
DoubleTab & valeur_aux_sommets(const Domaine &, DoubleTab &) const override
double calcule_valeur_a_elem_compo(double xs, double ys, double zs, int le_poly, int ncomp) const
double valeur_a_elem_compo(const DoubleVect &position, int le_poly, int ncomp) const override
DoubleTab & remplir_coord_noeuds(DoubleTab &positions) const override
DoubleVect & valeur_aux_sommets_compo(const Domaine &, DoubleVect &, int) const override
virtual const Domaine_VEF & domaine_vef() const =0
int remplir_coord_noeuds_et_polys(DoubleTab &positions, IntVect &polys) const override
static DoubleTab & Derivee_fonction_forme_3D_normalise(double u, double v, double w, DoubleTab &DF)
double valeur_a_sommet_compo(int num_som, int le_poly, int ncomp) const
double fonction_forme_3D(double x, double y, double z, int le_poly, int face)
static DoubleTab & Derivee_fonction_forme_2D_normalise(double u, double v, DoubleTab &DF)
DoubleVect & valeur_aux_elems_compo(const DoubleTab &positions, const IntVect &les_polys, DoubleVect &valeurs, int ncomp) const override
DoubleVect & valeur_a_elem(const DoubleVect &position, DoubleVect &val, int le_poly) const override
classe Champ_base Cette classe est la base de la hierarchie des champs.
Definition Champ_base.h:43
const Domaine & get_domaine_geom() const
virtual Champ_base & le_champ()=0
const Domaine_VF & get_domaine_dis() const
int nb_som_elem() const
Renvoie le nombre de sommets des elements geometriques constituants le domaine.
Definition Domaine.h:474
int_t nb_elem_tot() const
Definition Domaine.h:132
DoubleTab_t & les_sommets()
Definition Domaine.h:113
double coord(int_t i, int j) const
Definition Domaine.h:110
int_t nb_som() const
Renvoie le nombre de sommets du domaine.
Definition Domaine.h:121
int_t sommet_elem(int_t i, int j) const
Renvoie le numero (global) du j-ieme sommet du i-ieme element.
Definition Domaine.h:136
class Domaine_VEF
Definition Domaine_VEF.h:54
int nb_faces() const
renvoie le nombre global de faces.
Definition Domaine_VF.h:471
double xv(int num_face, int k) const
Definition Domaine_VF.h:76
int face_sommets(int i, int j) const
renvoie le numero du ieme sommet de la face num_face.
Definition Domaine_VF.h:583
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
int face_voisins(int num_face, int i) const
renvoie l'element voisin de numface dans la direction i.
Definition Domaine_VF.h:418
classe Domaine_dis_base Cette classe est la base de la hierarchie des domaines discretisees.
int nb_elem_tot() const
const Domaine & domaine() const
virtual int nb_comp() const
Definition Field_base.h:56
static int dimension
Definition Objet_U.h:99
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
virtual void ref(const TRUSTTab &)
Definition TRUSTTab.tpp:308
int nb_dim() const
Definition TRUSTTab.h:199
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133
_SIZE_ size() const
Definition TRUSTVect.tpp:45
_SIZE_ size_totale() const
Definition TRUSTVect.tpp:61
int line_size() const
Definition TRUSTVect.tpp:67
void resize(_SIZE_, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
Definition TRUSTVect.tpp:91