TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Domaine_Coloc.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 <Poly_geom_base.h>
17#include <Domaine_Coloc.h>
18
19Implemente_instanciable(Domaine_Coloc, "Domaine_Coloc", Domaine_Poly_base);
20
22
24
26{
29// discretiser_aretes();
30}
31
33{
34 // Calcul de h_carre
35 h_carre = 1.e30;
36 h_carre_.resize(nb_faces());
37 // Calcul des surfaces
38 Elem_geom_base& elem_geom = domaine().type_elem().valeur();
39 int is_polyedre = sub_type(Poly_geom_base, elem_geom) ? 1 : 0;
40 const ArrOfInt PolyIndex = is_polyedre ? ref_cast(Poly_geom_base, domaine().type_elem().valeur()).getElemIndex() : ArrOfInt(0);
41 const DoubleVect& surfaces=face_surfaces();
42 const int nbe=nb_elem();
43 for (int num_elem=0; num_elem<nbe; num_elem++)
44 {
45 double surf_max = 0;
46 const int nb_faces_elem = is_polyedre ? PolyIndex[num_elem+1] - PolyIndex[num_elem] : domaine().nb_faces_elem();
47 for (int i=0; i<nb_faces_elem; i++)
48 {
49 double surf = surfaces(elem_faces(num_elem,i));
50 surf_max = (surf > surf_max)? surf : surf_max;
51 }
52 double vol = volumes(num_elem)/surf_max;
53 vol *= vol;
54 h_carre_(num_elem) = vol;
55 h_carre = ( vol < h_carre )? vol : h_carre;
56 }
57}
58
60{
61 Cerr << "Le Domaine_Coloc a ete rempli avec succes" << finl;
62 for (int num_cond_lim=0; num_cond_lim<conds_lim.size(); num_cond_lim++)
63 {
64 const Cond_lim_base& cl = conds_lim[num_cond_lim].valeur();
65 if (sub_type(Periodique, cl))
66 Process::exit("Domaine_Coloc::modifier_pour_Cl not coded for Periodic BC \n");
67 }
68
69 // PQ : 10/10/05 : les faces periodiques etant a double contribution
70 // l'appel a marquer_faces_double_contrib s'effectue dans cette methode
71 // afin de pouvoir beneficier de conds_lim.
73}
classe Cond_lim_base Classe de base pour la hierarchie des classes qui representent les differentes c...
classe Conds_lim Cette classe represente un vecteur de conditions aux limites.
Definition Conds_lim.h:32
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
void modifier_pour_Cl(const Conds_lim &) override
void discretiser() override
void calculer_h_carre() override
class Domaine_Poly_base
const Elem_poly_base & type_elem() const
void discretiser() override
virtual const DoubleVect & face_surfaces() const
Definition Domaine_VF.h:51
int nb_faces() const
renvoie le nombre global de faces.
Definition Domaine_VF.h:471
IntTab & elem_faces()
renvoie le tableau de connectivite element/faces
Definition Domaine_VF.h:551
DoubleVect & volumes()
Definition Domaine_VF.h:119
void marquer_faces_double_contrib(const Conds_lim &)
const Domaine & domaine() const
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
classe Periodique Cette classe represente une condition aux limites periodique.
Definition Periodique.h:31
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
Classe de base des flux de sortie.
Definition Sortie.h:52