TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Op_Dift_VEF_Face_Gen.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 Op_Dift_VEF_Face_Gen_included
17#define Op_Dift_VEF_Face_Gen_included
18
19enum class Type_Champ { SCALAIRE, VECTORIEL };
20enum class Type_Schema { EXPLICITE, IMPLICITE };
21
22#include <Domaine_Cl_VEF.h>
23#include <Matrice_Morse.h>
24#include <Domaine_VEF.h>
25#include <TRUST_Ref.h>
26
27template <typename DERIVED_T>
29{
30public:
31 template <Type_Champ _TYPE_>
32 void fill_grad_Re(const DoubleTab&, const DoubleTab&, const DoubleTab&, const DoubleTab&) const;
33
34 // corrige flux bord
35 template <bool _IS_STAB_ = false>
36 void modifie_pour_cl_gen(const DoubleTab&, DoubleTab&, DoubleTab&) const;
37
38 // methodes pour l'explicite
39 template <Type_Champ _TYPE_, bool _IS_RANS_ = false> std::enable_if_t<_TYPE_ == Type_Champ::VECTORIEL, void>
40 ajouter_bord_gen(const DoubleTab& , DoubleTab& , DoubleTab& , const DoubleTab& , const DoubleTab&) const;
41
42 template <Type_Champ _TYPE_, bool _IS_RANS_ = false> std::enable_if_t<_TYPE_ == Type_Champ::VECTORIEL, void>
43 ajouter_interne_gen(const DoubleTab& , DoubleTab& , DoubleTab& , const DoubleTab& , const DoubleTab&) const;
44
45 template <Type_Champ _TYPE_, bool _IS_RANS_ = false> std::enable_if_t<_TYPE_ == Type_Champ::SCALAIRE, void>
46 ajouter_bord_gen(const DoubleTab& , DoubleTab& , DoubleTab& , const DoubleTab& , const DoubleTab&) const;
47
48 template <Type_Champ _TYPE_, bool _IS_RANS_ = false> std::enable_if_t<_TYPE_ == Type_Champ::SCALAIRE, void>
49 ajouter_interne_gen(const DoubleTab& inco, DoubleTab& resu, DoubleTab& , const DoubleTab& nu, const DoubleTab& nu_turb) const
50 {
51 ajouter_interne_gen__<_TYPE_, Type_Schema::EXPLICITE, false, _IS_RANS_ >(inco, &resu, nullptr, nu, nu_turb, nu_turb /* poubelle */);
52 }
53
54 // methodes pour l'implicite
55 template <Type_Champ _TYPE_, bool _IS_STAB_ = false, bool _IS_RANS_ = false>
56 void ajouter_contribution_bord_gen(const DoubleTab&, Matrice_Morse&, const DoubleTab&, const DoubleTab&, const DoubleVect&) const;
57
58 template <Type_Champ _TYPE_, bool _IS_STAB_ = false, bool _IS_RANS_ = false>
59 void ajouter_contribution_interne_gen(const DoubleTab& inco, Matrice_Morse& mat, const DoubleTab& nu, const DoubleTab& nu_turb, const DoubleVect& porosite_eventuelle) const
60 {
61 ajouter_interne_gen__<_TYPE_, Type_Schema::IMPLICITE, _IS_STAB_, _IS_RANS_>(inco, nullptr, &mat, nu, nu_turb, porosite_eventuelle);
62 }
63
64protected:
65 mutable DoubleTab grad_, Re_;
66
67private:
68
69 public_for_cuda
70 template <Type_Champ _TYPE_, Type_Schema _SCHEMA_, bool _IS_STAB_ = false, bool _IS_RANS_ = false >
71 void ajouter_bord_perio_gen__(const int , const DoubleTab&, DoubleTab* /* Si explicite */ , Matrice_Morse* /* Si implicite */, const DoubleTab&, const DoubleTab&, const DoubleVect& , DoubleTab* flux_bord = nullptr /* flux_bords */) const;
72
73 template <Type_Champ _TYPE_, Type_Schema _SCHEMA_, bool _IS_STAB_ = false>
74 void ajouter_bord_scalaire_impose_gen__(const int , const DoubleTab&, DoubleTab* /* Si explicite */ , Matrice_Morse* /* Si implicite */, const DoubleTab&, const DoubleTab&, const DoubleVect& , DoubleTab* flux_bord = nullptr /* flux_bords */ ) const;
75
76 template <Type_Champ _TYPE_, Type_Schema _SCHEMA_, bool _IS_STAB_ = false, bool _IS_RANS_ = false >
77 void ajouter_bord_gen__(const int , const DoubleTab&, DoubleTab* /* Si explicite */ , Matrice_Morse* /* Si implicite */, const DoubleTab&, const DoubleTab&, const DoubleVect& , DoubleTab* flux_bord = nullptr /* flux_bords */ ) const;
78
79 template <Type_Champ _TYPE_, Type_Schema _SCHEMA_, bool _IS_STAB_ = false, bool _IS_RANS_ = false >
80 void ajouter_interne_gen__(const DoubleTab&, DoubleTab* /* Si explicite */ , Matrice_Morse* /* Si implicite */, const DoubleTab&, const DoubleTab&, const DoubleVect&) const;
81};
82
83#include <Op_Dift_VEF_Face_Gen.tpp>
84
85#endif /* Op_Dift_VEF_Face_Gen_included */
Classe Matrice_Morse Represente une matrice M (creuse), non necessairement carree.
std::enable_if_t< _TYPE_==Type_Champ::SCALAIRE, void > ajouter_interne_gen(const DoubleTab &inco, DoubleTab &resu, DoubleTab &, const DoubleTab &nu, const DoubleTab &nu_turb) const
std::enable_if_t< _TYPE_==Type_Champ::VECTORIEL, void > ajouter_bord_gen(const DoubleTab &, DoubleTab &, DoubleTab &, const DoubleTab &, const DoubleTab &) const
void modifie_pour_cl_gen(const DoubleTab &, DoubleTab &, DoubleTab &) const
void fill_grad_Re(const DoubleTab &, const DoubleTab &, const DoubleTab &, const DoubleTab &) const
void ajouter_contribution_bord_gen(const DoubleTab &, Matrice_Morse &, const DoubleTab &, const DoubleTab &, const DoubleVect &) const
std::enable_if_t< _TYPE_==Type_Champ::VECTORIEL, void > ajouter_interne_gen(const DoubleTab &, DoubleTab &, DoubleTab &, const DoubleTab &, const DoubleTab &) const
void ajouter_contribution_interne_gen(const DoubleTab &inco, Matrice_Morse &mat, const DoubleTab &nu, const DoubleTab &nu_turb, const DoubleVect &porosite_eventuelle) const