TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Champ_val_tot_sur_vol_VDF.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_val_tot_sur_vol_VDF.h>
17#include <Domaine_Cl_dis_base.h>
18#include <Equation_base.h>
19#include <Sous_Domaine.h>
20#include <Milieu_base.h>
21#include <Domaine_VF.h>
22
23Implemente_instanciable(Champ_val_tot_sur_vol_VDF,"Valeur_totale_sur_volume_VDF",Champ_val_tot_sur_vol_base);
24
25
27{
29}
30
32{
34}
35
36DoubleVect& Champ_val_tot_sur_vol_VDF::eval_contrib_loc(const Domaine_dis_base& zdis,const Domaine_Cl_dis_base& zcldis,DoubleVect& vol_glob_pond)
37{
38 const Domaine_VF& zvf = ref_cast(Domaine_VF,zdis);
39 const int nb_elem = zvf.nb_elem();
40 int size_vol = les_sous_domaines.size()+1;
41 vol_glob_pond.resize(size_vol);
42
43 const DoubleVect& vol = zvf.volumes();
44 const DoubleVect& por_elem = zcldis.equation().milieu().porosite_elem();
45
46 int cpt=1;
47 for (auto& itr : les_sous_domaines)
48 {
49 const Sous_Domaine& sz = itr.valeur();
50 int size_sz = sz.nb_elem_tot();
51 int el;
52
53 for (int elem=0; elem<size_sz; elem++)
54 {
55 el = sz(elem);
56 //On ne retient que les elements reels
57 if (el<nb_elem)
58 vol_glob_pond(cpt) += vol(el)*por_elem(el);
59 }
60 cpt++;
61 }
62
63 for (int elem=0; elem<nb_elem; elem++)
64 vol_glob_pond(0) += vol(elem)*por_elem(elem);
65
66 vol_glob_pond(0) = mp_sum(vol_glob_pond(0));
67
68 for (int i=1; i<size_vol; i++)
69 {
70 vol_glob_pond(i) = mp_sum(vol_glob_pond(i));
71 vol_glob_pond(0) -= vol_glob_pond(i);
72 }
73
74 return vol_glob_pond;
75}
classe Champ_val_tot_sur_vol_VDF derivee de Champ_val_tot_sur_vol_base Evaluation de Somme_vol_poro_l...
DoubleVect & eval_contrib_loc(const Domaine_dis_base &zdis, const Domaine_Cl_dis_base &zcldis, DoubleVect &vol) override
classe Champ_val_tot_sur_vol_base Classe de base derivee de Champ_Uniforme_Morceaux qui represente le...
classe Domaine_Cl_dis_base Les objets Domaine_Cl_dis_base representent les conditions aux limites
class Domaine_VF
Definition Domaine_VF.h:44
double volumes(int i) const
Definition Domaine_VF.h:113
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
DoubleVect & porosite_elem()
Definition Milieu_base.h:58
const Equation_base & equation() const
Renvoie la reference sur l'equation pointe par MorEqn::mon_equation.
Definition MorEqn.h:62
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
static double mp_sum(double)
Calcule la somme de x sur tous les processeurs du groupe courant.
Definition Process.cpp:146
Classe de base des flux de sortie.
Definition Sortie.h:52
int_t nb_elem_tot() const
void resize(_SIZE_, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
Definition TRUSTVect.tpp:91