TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Op_Div_VDF_Elem.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 <Op_Div_VDF_Elem.h>
17
18Implemente_instanciable_sans_constructeur(Op_Div_VDF_Elem,"Op_Div_VDF_Face",Op_Div_VDF_base);
19
20Sortie& Op_Div_VDF_Elem::printOn(Sortie& s ) const { return s << que_suis_je(); }
21Entree& Op_Div_VDF_Elem::readOn(Entree& s ) { return s; }
22
24
25void Op_Div_VDF_Elem::associer(const Domaine_dis_base& domaine_dis, const Domaine_Cl_dis_base& domaine_Cl_dis, const Champ_Inc_base& )
26{
27 const Domaine_VDF& zvdf = ref_cast(Domaine_VDF,domaine_dis);
28 const Domaine_Cl_VDF& zclvdf = ref_cast(Domaine_Cl_VDF,domaine_Cl_dis);
29 // On n'associe pas div a la vitesse car non P0.
30 // On n'associe pas div a la pression car div(P) n'a pas de sens. Donc on fait rien !
31
32 iter_->associer(zvdf,zclvdf,*this);
33 Eval_Div_VDF_Elem& eval_div = static_cast<Eval_Div_VDF_Elem&> (iter_->evaluateur());
34 eval_div.associer_domaines(zvdf, zclvdf );
35
36 le_dom_vdf = zvdf;
37 la_zcl_vdf = zclvdf;
38}
39
40void Op_Div_VDF_Elem::volumique(DoubleTab& div) const
41{
42 const Domaine_VDF& domaine_VDF = le_dom_vdf.valeur();
43 const DoubleVect& vol = domaine_VDF.volumes();
44 const int nb_elem = domaine_VDF.domaine().nb_elem_tot();
45
46 for(int num_elem = 0; num_elem < nb_elem; num_elem++) div(num_elem) /= vol(num_elem);
47}
Classe Champ_Inc_base.
int_t nb_elem_tot() const
Definition Domaine.h:132
class Domaine_Cl_VDF
classe Domaine_Cl_dis_base Les objets Domaine_Cl_dis_base representent les conditions aux limites
class Domaine_VDF
Definition Domaine_VDF.h:64
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.
const Domaine & domaine() const
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
class Eval_Div_VDF_Elem Evaluateur VDF pour la divergence
virtual void associer_domaines(const Domaine_VDF &, const Domaine_Cl_VDF &)
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
class Op_Div_VDF_Elem Cette classe represente l'operateur de divergence
void associer(const Domaine_dis_base &, const Domaine_Cl_dis_base &, const Champ_Inc_base &) override
void volumique(DoubleTab &) const override
class Op_Div_VDF_base Classe de base des operateurs de divergence VDF
Op_Div_VDF_base(const Iterateur_VDF_base &iter_base)
Classe de base des flux de sortie.
Definition Sortie.h:52