TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Champ_Face_base.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 <Domaine_Cl_dis_base.h>
17#include <Dirichlet_homogene.h>
18#include <Neumann_homogene.h>
19#include <Champ_Face_base.h>
20
21#include <Periodique.h>
22#include <Dirichlet.h>
23#include <Symetrie.h>
24#include <Neumann.h>
25#include <Navier.h>
26
27Implemente_base(Champ_Face_base, "Champ_Face_base", Champ_Inc_base);
28
29Sortie& Champ_Face_base::printOn(Sortie& os) const { return os; }
30Entree& Champ_Face_base::readOn(Entree& is) { return is; }
31
32//tableaux de correspondance pour les CLs
34{
35 const Domaine_VF& domaine = ref_cast(Domaine_VF,le_dom_VF.valeur());
37 int i, f, n;
38
39 fcl_.resize(domaine.nb_faces_tot(), 3);
40 for (n = 0; n < cls.size(); n++)
41 {
42 const Front_VF& fvf = ref_cast(Front_VF, cls[n]->frontiere_dis());
43 int idx = sub_type(Neumann, cls[n].valeur())
44 + 2 * sub_type(Navier, cls[n].valeur())
45 + 3 * sub_type(Dirichlet, cls[n].valeur()) + 3 * sub_type(Neumann_homogene, cls[n].valeur())
46 + 4 * sub_type(Dirichlet_homogene, cls[n].valeur())
47 + 5 * sub_type(Periodique, cls[n].valeur());
48 if (!idx)
49 {
50 Cerr << "Champ_Face_base : CL non codee rencontree!" << finl;
52 }
53 for (i = 0; i < fvf.nb_faces_tot(); i++)
54 f = fvf.num_face(i), fcl_(f, 0) = idx, fcl_(f, 1) = n, fcl_(f, 2) = i;
55 }
56 fcl_init_ = 1;
57}
58
59DoubleTab& Champ_Face_base::get_elem_vector_field(DoubleTab& val_vec , bool is_passe) const
60{
61 const Domaine_VF& domaine = ref_cast(Domaine_VF,le_dom_VF.valeur());
62 const DoubleTab& centres_de_gravites = domaine.xp();
63 IntVect les_polys(domaine.nb_elem_tot());
64
65 for (int elem = 0; elem < domaine.nb_elem_tot(); elem++) les_polys(elem) = elem;
66
67 if (!is_passe) valeur_aux_elems(centres_de_gravites, les_polys, val_vec);
68 else valeur_aux_elems_passe(centres_de_gravites, les_polys, val_vec);
69
70 return val_vec;
71}
72
73DoubleVect& Champ_Face_base::get_elem_vector(const int num_elem, DoubleVect& val_vec) const
74{
75 const Domaine_VF& domaine = ref_cast(Domaine_VF,le_dom_VF.valeur());
76 const DoubleTab& centres_de_gravites = domaine.xp();
77
78 valeur_a_elem(centres_de_gravites, val_vec, num_elem);
79
80 return val_vec;
81}
virtual DoubleVect & get_elem_vector(const int, DoubleVect &) const
void init_fcl() const
virtual DoubleTab & get_elem_vector_field(DoubleTab &, bool passe=false) const
Classe Champ_Inc_base.
const Domaine & domaine() const
const Domaine_Cl_dis_base & domaine_Cl_dis() const
virtual DoubleTab & valeur_aux_elems_passe(const DoubleTab &positions, const IntVect &les_polys, DoubleTab &tab_valeurs) const
Definition Champ_base.h:92
virtual DoubleTab & valeur_aux_elems(const DoubleTab &positions, const IntVect &les_polys, DoubleTab &valeurs) const
provoque une erreur ! doit etre surchargee par les classes derivees
virtual DoubleVect & valeur_a_elem(const DoubleVect &position, DoubleVect &valeurs, int le_poly) const
provoque une erreur ! doit etre surchargee par les classes derivees
classe Conds_lim Cette classe represente un vecteur de conditions aux limites.
Definition Conds_lim.h:32
Classe Dirichlet_homogene Cette classe est la classe de base de la hierarchie des conditions aux limi...
classe Dirichlet Cette classe est la classe de base de la hierarchie des conditions aux limites de ty...
Definition Dirichlet.h:31
const Cond_lim & les_conditions_limites(int) const
Renvoie la i-ieme condition aux limites.
class Domaine_VF
Definition Domaine_VF.h:44
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_tot() const
Definition Front_VF.h:58
int num_face(const int) const
Definition Front_VF.h:68
classe Navier Condition aux limites sur la vitesse de type "Navier" :
Definition Navier.h:31
Classe Neumann_homogene Cette classe est la classe de base de la hierarchie des conditions aux limite...
Classe Neumann Cette classe est la classe de base de la hierarchie des conditions aux limites de type...
Definition Neumann.h:31
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