TrioCFD 1.9.9_beta
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 // Do not associate div with the velocity because it is not P0.
30 // Do not associate div with the pressure because div(P) makes no sense. So do nothing!
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}
Class Champ_Inc_base.
int_t nb_elem_tot() const
Definition Domaine.h:132
class Domaine_Cl_VDF
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
class Domaine_VDF
Definition Domaine_VDF.h:61
double volumes(int i) const
Definition Domaine_VF.h:113
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
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
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
class Op_Div_VDF_Elem This class represents the divergence operator
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)
Base class for output streams.
Definition Sortie.h:52