TrioCFD 1.9.9_beta
TrioCFD documentation
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() does nothing" << finl;
31 Cerr << que_suis_je() << " must override it!" << 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() does nothing" << finl;
46 Cerr << que_suis_je() << " must override it!" << finl;
48}
49
50/*! @brief Sets the number of degrees of freedom per component.
51 *
52 * @param (int nb_noeuds) the number of degrees of freedom per component
53 * @return (int) the number of degrees of freedom per component
54 */
56{
57 // Note B.M.: another awkward inheritance that prevents factorization
58 // using 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}
class Champ_Don_base base class of Given Fields (not calculated)
DoubleTab & valeurs() override
Overrides Champ_base::valeurs() Returns the array of values.
DoubleTab valeurs_
int remplir_coord_noeuds_et_polys(DoubleTab &positions, IntVect &polys) const override
DOES NOTHING TO override in derived classes.
DoubleTab & remplir_coord_noeuds(DoubleTab &positions) const override
DOES NOTHING TO override in derived classes.
virtual const Domaine & domaine() const
Champ_Ostwald Represents a field that varies as a function of consistency and.
void mettre_a_jour(double temps) override
Time update of the field.
Champ_base & affecter_(const Champ_base &) override
Assigns a Champ_base to a Champ_Fonc_base.
virtual void me_calculer(double tps)
int initialiser(const double temps) override
DOES NOTHING.
int fixer_nb_valeurs_nodales(int nb_noeuds) override
Sets the number of degrees of freedom per component.
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
virtual const Domaine_dis_base & domaine_dis_base() const
virtual DoubleTab & valeur_aux(const DoubleTab &positions, DoubleTab &valeurs) const
Causes an error! Must be overridden by derived classes.
virtual DoubleTab & valeur_aux_elems(const DoubleTab &positions, const IntVect &les_polys, DoubleTab &valeurs) const
Causes an error! Must be overridden by derived classes.
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
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
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
Base class for output streams.
Definition Sortie.h:52