TrioCFD 1.9.9_beta
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 // Note: computation is 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
Champ_Uniforme Represents a field that is constant in space and time.
int nb_som_elem() const
Returns the number of vertices of the geometric elements that make up the domain.
Definition Domaine.h:474
int_t nb_elem_tot() const
Definition Domaine.h:132
IntTab_t & les_elems()
Definition Domaine.h:129
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
class Domaine_EF
Definition Domaine_EF.h:56
const DoubleTab & IPhi() const
Definition Domaine_EF.h:91
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
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
Returns the reference to the equation pointed to by MorEqn::mon_equation.
Definition MorEqn.h:62
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
class Probleme_base It is a Probleme_U that is not a coupling.
Base class for output streams.
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
Class Terme_Derivee_Forme_base represents a source term of the projection equation in shape optimizat...
void mettre_a_jour(double) override
DOES NOTHING - to override in derived classes.
DoubleTab & calculer(DoubleTab &) const override