TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Terme_Derivee_Forme_EF.cpp
1/****************************************************************************
2* Copyright (c) 2025, 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_Derivee_Forme_EF.h>
17
18Implemente_instanciable(Terme_Derivee_Forme_EF,"Derivee_Forme_EF",Terme_Derivee_Forme_base);
19
20// ################################# READON AND PRINTON ###############################################
22{
24 return s;
25}
26
27
29{
31 return s ;
32}
33// ##################################################################################################
34
36 const Domaine_Cl_dis_base& domaine_Cl_dis)
37{
38 le_dom_EF = ref_cast(Domaine_EF, domaine_dis);
39}
40
42
43DoubleTab& Terme_Derivee_Forme_EF::ajouter(DoubleTab& resu) const
44{
45 const Domaine_EF& domaine_EF = le_dom_EF.valeur();
46 int ncomp=equation().inconnue().nb_comp();
47 const IntTab& elems= domaine_EF.domaine().les_elems() ;
48 int nb_som_elem=domaine_EF.domaine().nb_som_elem();
49 int nb_elems=domaine_EF.domaine().nb_elem_tot();
50
51 // Attention calcul IPhi *S(e)
52 // const DoubleTab& IPhi_thilde=domaine_EF.IPhi_thilde();
53
54 const DoubleTab& IPhi=domaine_EF.IPhi();
55
56 int is_source_unif=0;
57
58 if (sub_type(Champ_Uniforme,source_derivee_forme.valeur()))
59 is_source_unif=1;
60 const DoubleTab& tab_source=source_derivee_forme->valeurs();
61 if (ncomp>1)
62 for (int num_elem=0; num_elem<nb_elems; num_elem++)
63 for (int comp=0; comp<ncomp; comp++)
64 {
65 double source ;
66 int cc=0;
67 if (!is_source_unif) cc=num_elem;
68 source=tab_source(cc,comp);
69 for (int i=0; i<nb_som_elem; i++)
70 resu(elems(num_elem,i),comp)+=source*IPhi(num_elem,i);
71 }
72 else
73 {
74 for (int num_elem=0; num_elem<nb_elems; num_elem++)
75 {
76 double source ;
77
78 if (!is_source_unif)
79 source=tab_source(num_elem);
80 else
81 source=tab_source(0,0);
82 for (int i=0; i<nb_som_elem; i++)
83 resu(elems(num_elem,i))+=source*IPhi(num_elem,i);
84
85 }
86
87 }
88
89 return resu;
90}
91
92DoubleTab& Terme_Derivee_Forme_EF::calculer(DoubleTab& resu) const
93{
95}
96
classe Champ_Uniforme Represente un champ constant dans l'espace et dans le temps.
int nb_som_elem() const
Renvoie le nombre de sommets des elements geometriques constituants le domaine.
Definition Domaine.h:474
int_t nb_elem_tot() const
Definition Domaine.h:132
IntTab_t & les_elems()
Definition Domaine.h:129
classe Domaine_Cl_dis_base Les objets Domaine_Cl_dis_base representent les conditions aux limites
class Domaine_EF
Definition Domaine_EF.h:59
const DoubleTab & IPhi() const
Definition Domaine_EF.h:94
classe Domaine_dis_base Cette classe est la base de la hierarchie des domaines discretisees.
const Domaine & domaine() const
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
virtual int nb_comp() const
Definition Field_base.h:56
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
classe Probleme_base C'est un Probleme_U qui n'est pas un couplage.
Classe de base des flux de sortie.
Definition Sortie.h:52
class Terme_Derivee_Forme_EF
DoubleTab & ajouter(DoubleTab &) const override
void associer_domaines(const Domaine_dis_base &, const Domaine_Cl_dis_base &) override
void mettre_a_jour(double) override
DOES NOTHING - to override in derived classes.
void associer_pb(const Probleme_base &) override
DoubleTab & calculer(DoubleTab &) const override
Classe Terme_Derivee_Forme_base Cette classe represente un terme source de l'equation de projection e...
void mettre_a_jour(double) override
DOES NOTHING - to override in derived classes.
DoubleTab & calculer(DoubleTab &) const override