TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Source_Fluide_Dilatable_Face.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 Source_Fluide_Dilatable_Face_included
17#define Source_Fluide_Dilatable_Face_included
18
19#include <Modifier_pour_fluide_dilatable.h>
20#include <Source_QC_QDM_Gen.h>
21#include <Milieu_base.h>
22#include <TRUSTTrav.h>
23class Matrice_Morse;
24
25template <typename DERIVED_T>
27{
28public:
29 DoubleTab& ajouter_impl(DoubleTab& ) const;
30 void contribuer_a_avec_impl(const DoubleTab&, Matrice_Morse&) const;
31protected:
32 DoubleTab& ajouter_mere_impl(DoubleTab& ) const;
33 const Milieu_base& milieu_impl() const;
34};
35
36/*
37 * CRTP PATTERN SUITE AU BRICOLAGE POUR QUE CHECK_SOURCES ET VERIFIE_PERE MARCHENT ... DESOLEE ...
38 */
39
40template <typename DERIVED_T>
42{
43 return static_cast<const DERIVED_T *>(this)->ajouter_mere(resu);
44}
45
46template <typename DERIVED_T>
48{
49 return static_cast<const DERIVED_T *>(this)->equation().milieu();
50}
51
52/* Class template specializations */
53template <typename DERIVED_T>
55{
56 DoubleTrav trav(resu);
58 multiplier_par_rho_si_dilatable(trav,milieu_impl());
59 resu+=trav;
60 return resu;
61}
62
63template <typename DERIVED_T>
65{
66
67 return; /* on ne fait rien pour l'instant ... */
68 /*
69 DoubleTrav toto(present);
70 ajouter_impl(toto);
71 int nb_comp=toto.dimension(1);
72 for (int i=0; i < toto.dimension(0); i++)
73 for (int comp=0; comp<nb_comp; comp++)
74 {
75 if (present(i,comp)!=0)
76 {
77 int i0 = i * nb_comp + comp;
78 matrice(i0,i0) -= toto(i,comp) / present(i,comp);
79 }
80 } */
81}
82
83#endif /* Source_Fluide_Dilatable_Face_included */
Classe Matrice_Morse Represente une matrice M (creuse), non necessairement carree.
classe Milieu_base Cette classe est la base de la hierarchie des milieux (physiques)
Definition Milieu_base.h:50
const Milieu_base & milieu_impl() const
DoubleTab & ajouter_impl(DoubleTab &) const
DoubleTab & ajouter_mere_impl(DoubleTab &) const
void contribuer_a_avec_impl(const DoubleTab &, Matrice_Morse &) const