TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Source_Generique_VDF_Face.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 <Source_Generique_VDF_Face.h>
17#include <Dirichlet_homogene.h>
18#include <Equation_base.h>
19#include <Domaine_Cl_VDF.h>
20
21#include <Milieu_base.h>
22#include <Dirichlet.h>
23#include <Domaine_VDF.h>
24
25Implemente_instanciable(Source_Generique_VDF_Face,"Source_Generique_VDF_Face",Source_Generique_base);
26
27
29{
30 return os << que_suis_je() ;
31}
32
34{
36 return is;
37}
38
39void Source_Generique_VDF_Face::ajouter_blocs(matrices_t matrices, DoubleTab& secmem, const tabs_t& semi_impl) const
40{
41 OWN_PTR(Champ_base) espace_stockage;
42 const Champ_base& champ_calc = ch_source_->get_champ(espace_stockage);
43 const DoubleTab& valeurs_calc = champ_calc.valeurs();
44
45 int nb_faces = le_dom_VDF->nb_faces();
46 const DoubleVect& vol_entrelaces = le_dom_VDF->volumes_entrelaces();
47 const DoubleVect& poro_face = equation().milieu().porosite_face();
48 int nb_front_cl = le_dom_VDF->nb_front_Cl();
49 int premiere_face_interne = le_dom_VDF->premiere_face_int();
50 int num_face;
51
52 for (int num_cl = 0; num_cl < nb_front_cl; num_cl++)
53 {
54 const Cond_lim& la_cl = la_zcl_VDF->les_conditions_limites(num_cl);
55 const Front_VF& le_bord = ref_cast(Front_VF, la_cl->frontiere_dis());
56 int ndeb = le_bord.num_premiere_face();
57 int nfin = ndeb + le_bord.nb_faces();
58 if ((sub_type(Dirichlet, la_cl.valeur())) || (sub_type(Dirichlet_homogene, la_cl.valeur()))) { /* Do nothing */ }
59 else
60 for (num_face = ndeb; num_face < nfin; num_face++)
61 {
62 secmem(num_face) += valeurs_calc(num_face) * vol_entrelaces(num_face) * poro_face(num_face);
63 }
64 }
65
66 for (num_face=premiere_face_interne; num_face<nb_faces; num_face++)
67 secmem(num_face) += valeurs_calc(num_face)*vol_entrelaces(num_face)*poro_face(num_face);
68
70}
71
73 const Domaine_Cl_dis_base& zcl_dis)
74{
75 le_dom_VDF = ref_cast(Domaine_VDF,domaine_dis);
76 la_zcl_VDF = ref_cast(Domaine_Cl_VDF,zcl_dis);
77}
78
virtual DoubleTab & valeurs()=0
classe Champ_base Cette classe est la base de la hierarchie des champs.
Definition Champ_base.h:43
classe Cond_lim Classe generique servant a representer n'importe quelle classe
Definition Cond_lim.h:31
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
class Domaine_Cl_VDF
classe Domaine_Cl_dis_base Les objets Domaine_Cl_dis_base representent les conditions aux limites
class Domaine_VDF
Definition Domaine_VDF.h:64
classe Domaine_dis_base Cette classe est la base de la hierarchie des domaines discretisees.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual const Milieu_base & milieu() const =0
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
DoubleVect & porosite_face()
Definition Milieu_base.h:62
const Equation_base & equation() const
Renvoie la reference sur l'equation pointe par MorEqn::mon_equation.
Definition MorEqn.h:62
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
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
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
Classe de base des flux de sortie.
Definition Sortie.h:52
class Source_Generique_VDF_Face
void associer_domaines(const Domaine_dis_base &, const Domaine_Cl_dis_base &) override
void ajouter_blocs(matrices_t matrices, DoubleTab &secmem, const tabs_t &semi_impl) const override
classe Source_Generique_base Cette classe est la base de la hierarchie des sources portant
OWN_PTR(Champ_Generique_base) ch_source_
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")