TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Champ_Fonc_base.h
1/****************************************************************************
2* Copyright (c) 2025, 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#ifndef Champ_Fonc_base_included
17#define Champ_Fonc_base_included
18
19#include <Champ_Don_base.h>
20#include <TRUST_Ref.h>
21#include <YAML_data.h>
22#include <Motcle.h>
23
25class MD_Vector;
26class Domaine_VF;
27
28#include <Domaine_forward.h>
29
30/*! @brief class Champ_Fonc_base Base class of fields that are functions of a calculated quantity
31 *
32 * over time
33 *
34 * @sa Champ_base Champ_Don_base, Abstract class., Abstract methods:, void mettre_a_jour(double temps), void associer_domaine_dis_base(const Domaine_dis_base&), const Domaine_dis_base& domaine_dis_base() const
35 */
37{
38 Declare_base(Champ_Fonc_base);
39public:
40 void mettre_a_jour(double temps) override;
41 int fixer_nb_valeurs_nodales(int nb_noeuds) override;
42 int reprendre(Entree&) override;
43 int sauvegarder(Sortie&) const override;
44 inline void set_pdi_name(const Nom& nom) { pdi_name_ = (Motcle)nom; }
45 Nom get_pdi_name() const;
46 virtual std::vector<YAML_data> data_a_sauvegarder() const;
47
48 Champ_base& affecter_(const Champ_base&) override;
49 Champ_base& affecter_compo(const Champ_base&, int compo) override;
50 virtual int remplir_coord_noeuds_et_polys(DoubleTab&, IntVect&) const;
51 virtual int remplir_coord_noeuds_et_polys_compo(DoubleTab&, IntVect&, int) const;
52 virtual DoubleTab& remplir_coord_noeuds(DoubleTab&) const;
53 virtual DoubleTab& remplir_coord_noeuds_compo(DoubleTab&, int) const;
54 DoubleTab& valeur_aux(const DoubleTab&, DoubleTab&) const override;
55 virtual const Domaine& domaine() const;
56 int a_un_domaine_dis_base() const override { return 1; }
57 // Obsolete method: signature changed in order to generate a compiler error if old code is not removed
58 virtual void creer_espace_distant(int dummy) { }
59
60 void associer_domaine_dis_base(const Domaine_dis_base&) override;
61 const Domaine_dis_base& domaine_dis_base() const override;
62 virtual const Domaine_VF& domaine_vf() const;
63
64protected:
65 // By default, initialize values to zero
66 virtual void creer_tableau_distribue(const MD_Vector&, RESIZE_OPTIONS = RESIZE_OPTIONS::COPY_INIT);
67 OBS_PTR(Domaine_VF) le_dom_VF;
68 Nom pdi_name_; // name to use when saving the field with PDI (ensures that the name is unique among all the other fields, as we can't the same data declared multiples times with PDI)
69};
70
71#endif /* Champ_Fonc_base_included */
class Champ_Don_base base class of Given Fields (not calculated)
class Champ_Fonc_base Base class of fields that are functions of a calculated quantity
Champ_base & affecter_compo(const Champ_base &, int compo) override
Assigns a component of a Champ_base to the same component of a Champ_Fonc_base.
int a_un_domaine_dis_base() const override
void associer_domaine_dis_base(const Domaine_dis_base &) override
virtual DoubleTab & remplir_coord_noeuds_compo(DoubleTab &, int) const
DOES NOTHING TO override in derived classes.
virtual int remplir_coord_noeuds_et_polys(DoubleTab &, IntVect &) const
DOES NOTHING TO override in derived classes.
OBS_PTR(Domaine_VF) le_dom_VF
virtual int remplir_coord_noeuds_et_polys_compo(DoubleTab &, IntVect &, int) const
DOES NOTHING TO override in derived classes.
void set_pdi_name(const Nom &nom)
virtual const Domaine & domaine() const
DoubleTab & valeur_aux(const DoubleTab &, DoubleTab &) const override
Causes an error! Must be overridden by derived classes.
virtual const Domaine_VF & domaine_vf() const
virtual void creer_espace_distant(int dummy)
Champ_base & affecter_(const Champ_base &) override
Assigns a Champ_base to a Champ_Fonc_base.
void mettre_a_jour(double temps) override
Time update of the field.
virtual std::vector< YAML_data > data_a_sauvegarder() const
for PDI IO: retrieve name, type and dimensions of the field to save/restore.
virtual DoubleTab & remplir_coord_noeuds(DoubleTab &) const
DOES NOTHING TO override in derived classes.
int reprendre(Entree &) override
Restart from an input stream. Reads the time and values of the field.
virtual void creer_tableau_distribue(const MD_Vector &, RESIZE_OPTIONS=RESIZE_OPTIONS::COPY_INIT)
const Domaine_dis_base & domaine_dis_base() const override
int sauvegarder(Sortie &) const override
Saves the field to an output stream. Writes the name, time and values.
Nom get_pdi_name() const
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
double temps() const
Returns the time of the field.
class Domaine_VF
Definition Domaine_VF.h:44
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
: This class is an OWN_PTR but the pointed object is shared among multiple
Definition MD_Vector.h:48
A character string (Nom) in uppercase.
Definition Motcle.h:26
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
Base class for output streams.
Definition Sortie.h:52