TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Conds_lim.h
1/****************************************************************************
2* Copyright (c) 2024, 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 Conds_lim_included
17#define Conds_lim_included
18
19#include <TRUST_Vector.h>
20
21#include <Cond_lim.h>
22
23/*! @brief class Conds_lim This class represents a vector of boundary conditions.
24 *
25 * An object of this type is carried by each Domaine_Cl_dis_base associated
26 * with an equation. A class representing a vector of objects is
27 * declared through the macro VECT(classe_X)
28 *
29 * @sa Cond_lim Domaine_Cl_dis_base
30 */
31class Conds_lim : public VECT(Cond_lim)
32{
33 Declare_instanciable(Conds_lim);
34public:
35
36 inline int initialiser(double temps);
37 inline void mettre_a_jour(double temps);
38 inline void resetTime(double temps);
39 inline void calculer_coeffs_echange(double temps);
40 void completer(const Domaine_dis_base&);
41 inline int compatible_avec_eqn(const Equation_base&) const;
42 inline int compatible_avec_discr(const Discretisation_base&) const;
43
44 inline void set_modifier_val_imp(int);
45};
46
47
48inline int Conds_lim::initialiser(double temps)
49{
50 int ok = 1;
51 for (auto &itr : *this)
52 ok = ok && itr->initialiser(temps);
53 return ok;
54}
55
56/*! @brief Time update of all boundary conditions in the vector.
57 *
58 * @param (double temps) the time step for update
59 */
60inline void Conds_lim::mettre_a_jour(double temps)
61{
62 for (auto& itr : *this) itr->mettre_a_jour(temps);
63}
64
65inline void Conds_lim::resetTime(double temps)
66{
67 for (auto& itr : *this) itr->resetTime(temps);
68}
69
70/*! @brief Calculation of exchange coefficients for all boundary conditions in the vector.
71 *
72 * @param (double temps) the time step for update
73 */
74inline void Conds_lim::calculer_coeffs_echange(double temps)
75{
76 for (auto& itr : *this) itr->calculer_coeffs_echange(temps);
77}
78
79/*! @brief Returns whether ALL boundary conditions in the vector are compatible with the equation passed as parameter.
80 *
81 * @param (Equation_base& eqn) the equation with which we will check compatibility
82 * @return (int) 1 if all boundary conditions are compatible with the equation, 0 otherwise.
83 */
85{
86 int ok = 1;
87 for (auto& itr : *this) ok *= itr->compatible_avec_eqn(eqn);
88 return ok;
89}
90
91/*! @brief Returns whether ALL boundary conditions in the vector are compatible with the discretization passed as parameter.
92 *
93 * @param the discretization with which we will check compatibility
94 * @return (int) 1 if all boundary conditions are compatible with the discretization, 0 otherwise.
95 */
97{
98 int ok = 1;
99 for (auto& itr : *this) ok *= itr->compatible_avec_discr(dis);
100 return ok;
101}
102
103/*! @brief Sets the modifier_val_imp flag for all boundary conditions in the vector.
104 *
105 * @param (int drap) the value to assign to the flag
106 */
108{
109 for (auto& itr : *this) itr->set_modifier_val_imp(drap);
110}
111
112#endif /* Conds_lim_included */
class Conds_lim This class represents a vector of boundary conditions.
Definition Conds_lim.h:32
int initialiser(double temps)
Definition Conds_lim.h:48
void set_modifier_val_imp(int)
Sets the modifier_val_imp flag for all boundary conditions in the vector.
Definition Conds_lim.h:107
void resetTime(double temps)
Definition Conds_lim.h:65
int compatible_avec_eqn(const Equation_base &) const
Returns whether ALL boundary conditions in the vector are compatible with the equation passed as para...
Definition Conds_lim.h:84
void calculer_coeffs_echange(double temps)
Calculation of exchange coefficients for all boundary conditions in the vector.
Definition Conds_lim.h:74
void mettre_a_jour(double temps)
Time update of all boundary conditions in the vector.
Definition Conds_lim.h:60
void completer(const Domaine_dis_base &)
Calls Cond_lim::completer() on each boundary condition in the vector.
Definition Conds_lim.cpp:37
int compatible_avec_discr(const Discretisation_base &) const
Returns whether ALL boundary conditions in the vector are compatible with the discretization passed a...
Definition Conds_lim.h:96
class Discretisation_base This class represents a spatial discretization scheme, which
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
class Equation_base The role of an equation is the calculation of one or more fields....