TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Champ_Ostwald.cpp
1/****************************************************************************
2* Copyright (c) 2023, 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 <Champ_Ostwald.h>
17#include <Domaine_dis_base.h>
18
19Implemente_instanciable(Champ_Ostwald,"Champ_Ostwald",Champ_Fonc_P0_base);
20// XD champ_ostwald field_base champ_ostwald NO_BRACE This keyword is used to define the viscosity variation law: NL2
21// XD_CONT Mu(T)= K(T)*(D:D/2)**((n-1)/2)
22
23
24Sortie& Champ_Ostwald::printOn(Sortie& os) const { return os; }
25
26Entree& Champ_Ostwald::readOn(Entree& is) { return is; }
27
29{
30 Cerr << "Champ_Ostwald::mettre_a_jour() ne fait rien" << finl;
31 Cerr << que_suis_je() << "doit la surcharger !" << finl;
33}
34
35int Champ_Ostwald::initialiser(const double un_temps)
36{
37 Cerr << "Champ_Ostwald::initialiser(temps) must be overloaded" << finl;
38 Cerr << " by " << que_suis_je() << finl;
40 return 0;
41}
42
44{
45 Cerr << "Champ_Ostwald::me_calculer() ne fait rien" << finl;
46 Cerr << que_suis_je() << "doit la surcharger !" << finl;
48}
49
50/*! @brief Fixe le nombre de degres de liberte par composante
51 *
52 * @param (int nb_noeuds) le nombre de degre de liberte par composante
53 * @return (int) le nombre de degres de liberte par composante
54 */
56{
57 // Note B.M.: encore un heritage a la noix qui m'empeche de factoriser
58 // en utilisant creer_tableau_distribue:
59 const Champ_Don_base& cdb = *this;
60 const Domaine& domaine = cdb.domaine_dis_base().domaine();
61
62 assert(nb_noeuds == domaine.nb_elem());
63
64 if (nb_compo_ == 1)
65 valeurs_.resize(0);
66 else
67 valeurs_.resize(0, nb_compo_);
68 domaine.creer_tableau_elements(valeurs_);
69 return nb_noeuds;
70}
71
73{
74 DoubleTab noeuds;
75 IntVect polys;
76 if (!remplir_coord_noeuds_et_polys(noeuds, polys))
77 {
79 ch.valeur_aux(noeuds, valeurs());
80 }
81 else
82 ch.valeur_aux_elems(noeuds, polys, valeurs());
83 return *this;
84}
classe Champ_Don_base classe de base des Champs donnes (non calcules)
DoubleTab & valeurs() override
Surcharge Champ_base::valeurs() Renvoie le tableau des valeurs.
DoubleTab valeurs_
int remplir_coord_noeuds_et_polys(DoubleTab &positions, IntVect &polys) const override
NE FAIT RIEN A surcharger dans les classes derivees.
DoubleTab & remplir_coord_noeuds(DoubleTab &positions) const override
NE FAIT RIEN A surcharger dans les classes derivees.
virtual const Domaine & domaine() const
classe Champ_Ostwald Represente un champ qui varie en fonction de la consistance et
void mettre_a_jour(double temps) override
Mise a jour en temps du champ.
Champ_base & affecter_(const Champ_base &) override
Affecte un Champ_base dans un Champ_Fonc_base.
virtual void me_calculer(double tps)
int initialiser(const double temps) override
NE FAIT RIEN.
int fixer_nb_valeurs_nodales(int nb_noeuds) override
Fixe le nombre de degres de liberte par composante.
classe Champ_base Cette classe est la base de la hierarchie des champs.
Definition Champ_base.h:43
virtual const Domaine_dis_base & domaine_dis_base() const
virtual DoubleTab & valeur_aux(const DoubleTab &positions, DoubleTab &valeurs) const
Provoque une erreur ! Doit etre surchargee par les classes derivees.
virtual DoubleTab & valeur_aux_elems(const DoubleTab &positions, const IntVect &les_polys, DoubleTab &valeurs) const
provoque une erreur ! doit etre surchargee par les classes derivees
const Domaine & domaine() const
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
int nb_compo_
Definition Field_base.h:95
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
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
Classe de base des flux de sortie.
Definition Sortie.h:52