TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Op_Diff_negligeable.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_Diff_negligeable.h>
17#include <Discretisation_base.h>
18#include <Champ_base.h>
19
20
21Implemente_instanciable(Op_Diff_negligeable,"Op_Diff_negligeable",Operateur_Diff_base);
22Implemente_instanciable(Op_Dift_negligeable,"Op_Dift_negligeable",Op_Diff_negligeable);
23
25
27
28Sortie& Op_Diff_negligeable::printOn(Sortie& os) const { return os; }
29
30Entree& Op_Diff_negligeable::readOn(Entree& is) { return is; }
31
32/*! @brief Associates the diffusivity to the operator.
33 *
34 * @param (Champ_Don_base& ch) the field representing the diffusivity
35 */
37{
38 la_diffusivite=ch;
39}
40
41/*! @brief Returns the field representing the diffusivity.
42 *
43 * @return (Champ_Don_base&) the field representing the diffusivity
44 */
46{
47 return la_diffusivite.valeur();
48}
49
50void Op_Diff_negligeable::calculer_pour_post(Champ_base& espace_stockage,const Nom& option,int comp) const
51{
52 if (Motcle(option)=="stabilite")
53 {
54 DoubleTab& es_valeurs = espace_stockage.valeurs();
55 es_valeurs = calculer_dt_stab();
56 }
57 else
58 Operateur_base::calculer_pour_post(espace_stockage,option,comp);
59}
60
62{
63 Motcle loc;
64 if (Motcle(option)=="stabilite")
65 loc = "elem";
66 else if (Motcle(option)=="flux_bords" || Motcle(option)=="flux_surfacique_bords")
67 loc = "face";
68
69 return loc;
70}
71
72void Op_Diff_negligeable::ajouter_flux(const DoubleTab& inconnue, DoubleTab& contribution) const
73{
74 // nothing to do
75}
76
77void Op_Diff_negligeable::calculer_flux(const DoubleTab& inconnue, DoubleTab& flux) const
78{
79 flux = 0.0;
80}
81
virtual DoubleTab & valeurs()=0
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
A character string (Nom) in uppercase.
Definition Motcle.h:26
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
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
Classe Op_Diff_negligeable This class represents a negligible diffusion operator.
void calculer_pour_post(Champ_base &espace_stockage, const Nom &option, int comp) const override
Motcle get_localisation_pour_post(const Nom &option) const override
void associer_diffusivite(const Champ_base &) override
Associates the diffusivity to the operator.
void calculer_flux(const DoubleTab &inconnue, DoubleTab &flux) const override
void ajouter_flux(const DoubleTab &inconnue, DoubleTab &contribution) const override
const Champ_base & diffusivite() const override
Returns the field representing the diffusivity.
Operateur_Diff_base This class is the base of the hierarchy of operators representing.
void calculer_pour_post(Champ_base &espace_stockage, const Nom &option, int comp) const override
virtual double calculer_dt_stab() const
Computes dt_stab.
Base class for output streams.
Definition Sortie.h:52