TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Champ_Don_base.cpp
1/****************************************************************************
2* Copyright (c) 2026, 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_Don_base.h>
17#include <Check_espace_virtuel.h>
18
19Implemente_base(Champ_Don_base,"Champ_Don_base",Champ_base);
20// XD champ_don_base field_base champ_don_base INHERITS_BRACE Basic class for data fields (not calculated), p.e. physics
21// XD_CONT properties.
22
23
26
27/*! @brief Sets the number of degrees of freedom per component
28 *
29 * @param (int nb_noeuds) the number of degrees of freedom per component
30 */
32{
33 valeurs_.resize(nb_noeuds, nb_compo_);
34 return nb_noeuds;
35}
36
37/*! @brief Causes an error! To be overridden by derived classes! Not a pure virtual for development convenience!
38 *
39 */
41{
42 Cerr << "Champ_Don_base::affecter_ : " << que_suis_je() << "::affecter_ must be overloaded in derived classes" << finl;
43 throw;
44}
45
46/*! @brief Causes an error! To be overridden by derived classes! Not a pure virtual for development convenience!
47 *
48 */
50{
51 Cerr << "Champ_Don_base::affecter_compo must be overloaded in derived classes" << finl;
52 throw;
53}
54
55/*! @brief Time update.
56 *
57 * @param (double) the update time
58 */
60{
62}
63
64/*!
65 * See comments in Probleme_base_interface_proto::resetTime_impl()
66 * Here we update.
67 */
69{
70 mettre_a_jour(time);
71}
72
73/*! @brief DOES NOTHING.
74 *
75 * To be overridden in derived classes. Causes the field initialization if necessary
76 *
77 */
78int Champ_Don_base::initialiser(const double un_temps)
79{
80 mettre_a_jour(un_temps);
81 return 1;
82}
83
84/*! @brief DOES NOTHING.
85 *
86 * To be overridden in derived classes
87 *
88 */
90{
91 return 1;
92}
93
94/*! @brief DOES NOTHING.
95 *
96 * To be overridden in derived classes
97 *
98 */
100{
101 return 1;
102}
103
104/*! @brief DOES NOTHING.
105 *
106 * EXIT! To be overridden in derived classes
107 *
108 */
109int Champ_Don_base::imprime(Sortie& os, int ncomp) const
110{
111 Cerr << que_suis_je() << "::imprime not coded." << finl;
113 return 1;
114}
115
116/*! @brief Sets the number of components and the number of nodal values.
117 *
118 * @param (int) the number of nodes per component of the field (the number of dof per component)
119 * @param (int) the number of components of the field
120 */
121void Champ_Don_base::dimensionner(int nb_noeuds, int nb_compo)
122{
123 fixer_nb_comp(nb_compo);
124 fixer_nb_valeurs_nodales(nb_noeuds);
125}
class Champ_Don_base base class of Given Fields (not calculated)
void mettre_a_jour(double temps) override
Time update.
void dimensionner(int, int)
Sets the number of components and the number of nodal values.
Champ_base & affecter_(const Champ_base &) override
Causes an error! To be overridden by derived classes! Not a pure virtual for development convenience!
Champ_base & affecter_compo(const Champ_base &, int) override
Causes an error! To be overridden by derived classes! Not a pure virtual for development convenience!
int reprendre(Entree &) override
DOES NOTHING.
int fixer_nb_valeurs_nodales(int nb_noeuds) override
Sets the number of degrees of freedom per component.
virtual int initialiser(const double temps)
DOES NOTHING.
int imprime(Sortie &, int) const override
DOES NOTHING.
void resetTime(double time) override
DoubleTab valeurs_
int sauvegarder(Sortie &) const override
DOES NOTHING.
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
Champ_base()
Default constructor of a Champ_base.
virtual double changer_temps(const double t)
Sets the time at which the field is defined.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual void fixer_nb_comp(int i)
Sets the number of components of the field.
int nb_compo_
Definition Field_base.h:95
friend class Entree
Definition Objet_U.h:71
friend class Sortie
Definition Objet_U.h:70
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