TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Loi_Fermeture_base.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 Loi_Fermeture_base_included
17#define Loi_Fermeture_base_included
18
19#include <Champs_compris_interface.h>
20#include <Champs_compris.h>
21#include <TRUST_Ref.h>
22
24class Probleme_base;
25class Champ_base;
26class Motcle;
27class Param;
28
29/*! @brief : Base class of closure laws.
30 *
31 * This class calculates fields that can depend
32 * on several unknowns, physical quantities of the medium, etc.
33 * The fields of the class are made accessible to the entire problem
34 * through the get_champ() method and their update is triggered
35 * by the problem, after updating the medium and equations.
36 *
37 */
39{
40 Declare_base(Loi_Fermeture_base);
41public:
42 // Reimplementation of Objet_U
43 void nommer(const Nom& nom) override
44 {
45 nom_ = nom;
46 }
47 const Nom& le_nom () const override
48 {
49 return nom_;
50 }
51 // Implementation of Champs_compris_interface methods:
52 void creer_champ(const Motcle& motlu) override { }
53 const Champ_base& get_champ(const Motcle& nom) const override;
54 bool has_champ(const Motcle& nom, OBS_PTR(Champ_base)& ref_champ) const override;
55 bool has_champ(const Motcle& nom) const override;
56 void get_noms_champs_postraitables(Noms& nom, Option opt=NONE) const override;
57 // New methods:
58 virtual void associer_pb_base(const Probleme_base&);
59 virtual void discretiser(const Discretisation_base& );
60 virtual void set_param(Param& param) const override;
61 virtual void completer();
62 virtual void preparer_calcul();
63 virtual void mettre_a_jour(double temps);
64
65protected:
66 const Probleme_base& mon_probleme() const;
67 Champs_compris champs_compris_;
68
71
72
73private:
74 Nom nom_;
75 // Private because this member gives access to the non-const problem. We hide it.
76 OBS_PTR(Probleme_base) mon_probleme_;
77
78
79
80};
81
82
83#endif
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
class Champs_compris_interface This class contains an interface of methods intended to manage
class Discretisation_base This class represents a spatial discretization scheme, which
: Base class of closure laws.
const Champ_base & get_champ(const Motcle &nom) const override
This method returns the field named "nom" if it is understood by the class, otherwise calls the get_c...
virtual void discretiser(const Discretisation_base &)
This method is called by the problem after the discretization of equations and medium and before.
const Probleme_base & mon_probleme() const
Returns the problem (this method was created to avoid giving write access to the problem via the REF)...
void nommer(const Nom &nom) override
Assigns a name to the Objet_U. Virtual method to override.
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
virtual void associer_pb_base(const Probleme_base &)
This method is the first called by the problem to construct the object when it is associated with the...
virtual void preparer_calcul()
This method is called by the problem after preparer_calcul() of equations and medium.
virtual void set_param(Param &param) const override
This method is called by the readOn of the class.
Champs_compris champs_compris_
void creer_champ(const Motcle &motlu) override
bool has_champ(const Motcle &nom, OBS_PTR(Champ_base)&ref_champ) const override
virtual void completer()
This method is called after reading all equations and closure laws (all fields and boundary condition...
void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const override
virtual void mettre_a_jour(double temps)
This method is called by the problem after mettre_a_jour() of equations and medium.
A character string (Nom) in uppercase.
Definition Motcle.h:26
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
An array of character strings (VECT(Nom)).
Definition Noms.h:26
Objet_U()
Default constructor: assigns a unique identifier to the object (object_id_) and registers the object ...
Definition Objet_U.cpp:54
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
class Probleme_base It is a Probleme_U that is not a coupling.