TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Terme_Source_Decroissance_Radioactive_VEF_Face.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 <Terme_Source_Decroissance_Radioactive_VEF_Face.h>
17#include <Equation_base.h>
18
19#include <Domaine_VEF.h>
20#include <Synonyme_info.h>
21
22Implemente_instanciable_sans_constructeur(Terme_Source_Decroissance_Radioactive_VEF_Face,"Decroissance_Radioactive_VEF_P1NC",Source_base);
23Add_synonym(Terme_Source_Decroissance_Radioactive_VEF_Face,"Radioactive_Decay_VEF_P1NC");
24
25
27{
28 return s << que_suis_je();
29}
30
32{
33 double lambda_tmp;
34 int nb_groupes;
35 s >> nb_groupes;
36 Cerr << "Nombre de groupes a lire : " << nb_groupes << finl;
37 for (int i = 0; i < nb_groupes; i++)
38 {
39 s >> lambda_tmp;
40 Cerr << "lambda lu : " << lambda_tmp << finl;
41 lambda.push_back(lambda_tmp);
42 }
43
44 const int N = equation().inconnue().valeurs().line_size(), ng = (int)lambda.size();
45 if (N != ng)
46 {
47 Cerr << "Terme_Source_Decroissance_Radioactive_VEF_Face: inconsistency between the number of radioactive decay constants ( " << ng
48 << " ) and the number of components of the unknown of the equation ( " << N << " )" << finl;
50 }
51 return s ;
52}
53
55 const Domaine_Cl_dis_base& domaine_Cl_dis)
56{
57 Cerr << " Terme_Source_Decroissance_Radioactive_VEF_Face::associer_domaines " << finl ;
58 le_dom_VEF = ref_cast(Domaine_VEF, domaine_dis);
59}
60
62{
63 const Domaine_VF& domaine = le_dom_VEF.valeur();
64 const DoubleVect& vf = domaine.volumes_entrelaces();
65 const DoubleTab& c = equation().inconnue().valeurs();
66 const int nb_faces = le_dom_VEF->nb_faces(), N = c.line_size();
67
68 for (int f = 0; f < nb_faces; f++)
69 for (int l = 0; l < N; l++)
70 resu(f, l) -= lambda[l] * c(f, l) * vf(f);
71
72 return resu;
73}
74
76{
77 resu=0;
78 ajouter(resu);
79 return resu;
80}
81
83{
84 const Domaine_VF& domaine = le_dom_VEF.valeur();
85 const DoubleVect& vf = domaine.volumes_entrelaces();
86 const int nb_faces = le_dom_VEF->nb_faces(), N = equation().inconnue().valeurs().line_size();
87
88 for (int f = 0; f < nb_faces; f++)
89 for (int l = 0; l < N; l++)
90 {
91 const int k = f * N + l;
92 matrice(k, k) += lambda[l] * vf(f);
93 }
94}
DoubleTab & valeurs() override
Renvoie le tableau des valeurs du champ au temps courant.
classe Domaine_Cl_dis_base Les objets Domaine_Cl_dis_base representent les conditions aux limites
class Domaine_VEF
Definition Domaine_VEF.h:54
class Domaine_VF
Definition Domaine_VF.h:44
DoubleVect & volumes_entrelaces()
Definition Domaine_VF.h:99
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 Champ_Inc_base & inconnue() const =0
Classe Matrice_Morse Represente une matrice M (creuse), non necessairement carree.
const Equation_base & equation() const
Renvoie la reference sur l'equation pointe par MorEqn::mon_equation.
Definition MorEqn.h:62
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
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
classe Source_base Un objet Source_base est un terme apparaissant au second membre d'une
Definition Source_base.h:42
int line_size() const
Definition TRUSTVect.tpp:67
void associer_domaines(const Domaine_dis_base &, const Domaine_Cl_dis_base &) override
void contribuer_a_avec(const DoubleTab &, Matrice_Morse &) const override
contribution a la matrice implicite des termes sources par defaut pas de contribution