TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Champ_Fonc_reprise.h
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#ifndef Champ_Fonc_reprise_included
17#define Champ_Fonc_reprise_included
18
19#include <Entree_Fichier_base.h>
20#include <Champ_Fonc_base.h>
21#include <Champ_Inc_base.h>
22#include <FichierHDFPar.h>
23#include <TRUST_Deriv.h>
24
25/*! @brief Champ_Fonc_reprise This class allows reading back a field saved in an xyz file.
26 *
27 * It holds a field of type OWN_PTR(Champ_Inc_base) which is of the same type as
28 * the field passed as argument.
29 *
30 */
32{
33 Declare_instanciable(Champ_Fonc_reprise);
34public:
35
36 void mettre_a_jour(double) override;
37
39 inline const DoubleTab& valeurs() const override { return le_champ().valeurs(); }
40 inline DoubleTab& valeurs() override { return le_champ().valeurs(); }
41
42 inline DoubleTab& valeur_aux_elems(const DoubleTab& positions, const IntVect& les_polys, DoubleTab& les_valeurs) const override
43 {
44 return le_champ().valeur_aux_elems(positions, les_polys, les_valeurs);
45 }
46
47 inline DoubleVect& valeur_aux_elems_compo(const DoubleTab& positions, const IntVect& les_polys, DoubleVect& les_valeurs, int ncomp) const override
48 {
49 return le_champ().valeur_aux_elems_compo(positions, les_polys, les_valeurs, ncomp);
50 }
51
52 inline DoubleTab& valeur_aux_sommets(const Domaine& dom, DoubleTab& sommets) const override
53 {
54 return le_champ().valeur_aux_sommets(dom, sommets);
55 }
56
57 inline DoubleVect& valeur_aux_sommets_compo(const Domaine& dom, DoubleVect& sommets, int compo) const override
58 {
59 return le_champ().valeur_aux_sommets_compo(dom, sommets, compo);
60 }
61
62 inline DoubleTab& remplir_coord_noeuds(DoubleTab& coord) const override
63 {
64 return le_champ().remplir_coord_noeuds(coord);
65 }
66
67 inline int remplir_coord_noeuds_et_polys(DoubleTab& coord, IntVect& elems) const override
68 {
69 return le_champ().remplir_coord_noeuds_et_polys(coord, elems);
70 }
71
72 inline DoubleVect& valeur_aux_compo(const DoubleTab& tab, DoubleVect& les_valeurs, int comp) const override
73 {
74 return le_champ().valeur_aux_compo(tab, les_valeurs, comp);
75 }
76
77private:
78 // for PDI, communicator used to read the checkpoint file (useful if the current node partition is different than the one for checkpoint)
79 OWN_PTR(Comm_Group) restartComm_;
80
81 OWN_PTR(Champ_Inc_base) vrai_champ_;
82 void init_pdi( const Probleme_base& pb, const Nom& nom_fic, const Nom& ch_ident, int last_time, double un_temps, int reprend_champ_moyen);
83 void read_field_from_file(Entree& jdd, Entree& file, const Probleme_base& pb, const Nom& nom_ident,
84 const Nom& nom_ident_champ_stat, int reprend_champ_moyen, const Nom& nom_ident_champ_keps, int reprend_modele_k_eps, int pdi_format = 0);
85 inline virtual const Champ_Inc_base& le_champ() const { return vrai_champ_.valeur(); }
86 inline virtual Champ_Inc_base& le_champ() { return vrai_champ_.valeur(); }
87};
88
89#endif /* Champ_Fonc_reprise_included */
DoubleTab & valeurs() override
Overrides Champ_base::valeurs() Returns the array of values.
class Champ_Fonc_base Base class of fields that are functions of a calculated quantity
Champ_Fonc_reprise This class allows reading back a field saved in an xyz file.
DoubleVect & valeur_aux_sommets_compo(const Domaine &dom, DoubleVect &sommets, int compo) const override
Returns the compo-th value at the vertices of dom.
DoubleTab & valeurs() override
Overrides Champ_base::valeurs() Returns the array of values.
DoubleVect & valeur_aux_compo(const DoubleTab &tab, DoubleVect &les_valeurs, int comp) const override
Same as valeur_aux(const DoubleTab &, DoubleTab &), but computes only the component compo of the fiel...
void mettre_a_jour(double) override
Time update of the field.
int remplir_coord_noeuds_et_polys(DoubleTab &coord, IntVect &elems) const override
DOES NOTHING TO override in derived classes.
DoubleTab & remplir_coord_noeuds(DoubleTab &coord) const override
DOES NOTHING TO override in derived classes.
DoubleVect & valeur_aux_elems_compo(const DoubleTab &positions, const IntVect &les_polys, DoubleVect &les_valeurs, int ncomp) const override
Causes an error! Must be overridden by derived classes.
const DoubleTab & valeurs() const override
DoubleTab & valeur_aux_sommets(const Domaine &dom, DoubleTab &sommets) const override
Returns the values at the vertices of the Domain dom.
DoubleTab & valeur_aux_elems(const DoubleTab &positions, const IntVect &les_polys, DoubleTab &les_valeurs) const override
Causes an error! Must be overridden by derived classes.
Class Champ_Inc_base.
: This class describes a group of processors on which
Definition Comm_Group.h:37
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
class Probleme_base It is a Probleme_U that is not a coupling.