TrioCFD 1.9.9_beta
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 << "Number of groups to read: " << nb_groupes << finl;
37 for (int i = 0; i < nb_groupes; i++)
38 {
39 s >> lambda_tmp;
40 Cerr << "lambda read: " << 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
Returns the array of field values at the current time.
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
class Domaine_VEF
Definition Domaine_VEF.h:53
class Domaine_VF
Definition Domaine_VF.h:44
DoubleVect & volumes_entrelaces()
Definition Domaine_VF.h:99
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
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
Matrice_Morse class - Represents a (sparse) matrix M, not necessarily square,.
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
Definition MorEqn.h:62
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
Base class for output streams.
Definition Sortie.h:52
Source_base A Source_base object is a term appearing on the right-hand side of an.
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 to the implicit matrix of source terms, by default no contribution