TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Eval_Dirac_VEF_Face.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 Eval_Dirac_VEF_Face_included
17#define Eval_Dirac_VEF_Face_included
18
19#include <Evaluateur_Source_VEF_Face.h>
20#include <TRUST_Ref.h>
21
22#include <Domaine.h>
23
25{
26public:
28
29 void associer_champs(const Champ_Don_base& );
30 void mettre_a_jour() override;
31
32 template <typename Type_Double>
33 inline void calculer_terme_source_standard(const int num_face, Type_Double& source) const { calculer_terme_source(num_face,source); }
34
35 template <typename Type_Double>
36 inline void calculer_terme_source_non_standard(const int num_face, Type_Double& source) const { calculer_terme_source(num_face,source); }
37
38 void associer_nb_elem_dirac(int );
39 DoubleVect le_point;
40
41protected:
42 OBS_PTR(Champ_Don_base) la_puissance;
43 OBS_PTR(Domaine) mon_dom;
45
46 template <typename Type_Double>
47 inline void calculer_terme_source(int , Type_Double&) const;
48};
49
50template <typename Type_Double>
51inline void Eval_Dirac_VEF_Face::calculer_terme_source(const int num_face, Type_Double& source) const
52{
53 const int size = source.size_array();
54 if (size > 1) Process::exit("Eval_Dirac_VEF_Face::calculer_terme_source not available for multi-inco !");
55
56 int elem; // pour recuperer l'element associe a cette face
57
58 if (face_voisins(num_face, 1) == -1) elem = face_voisins(num_face, 0);
59 else elem = face_voisins(num_face, 1);
60
61 const int test = mon_dom->type_elem()->contient(le_point, elem);
62 assert(nb_dirac != -123. && puissance != -123.);
63 for (int i = 0; i < size; i++) source[i] = (test == 1) ? nb_dirac * puissance : 0.;
64}
65
67{
68public:
69 void set(const Eval_Dirac_VEF_Face& eval) const
70 {
71 };
72 KOKKOS_INLINE_FUNCTION
73 void calculer_terme_source_standard_view(int num_face, DoubleArrView source) const
74 {
75 Process::Kokkos_exit("Not coded!");
76 };
77 KOKKOS_INLINE_FUNCTION
78 void calculer_terme_source_non_standard_view(int num_face, DoubleArrView source) const
79 {
80 Process::Kokkos_exit("Not coded!");
81 };
82private:
83 // Views
84};
85#endif /* Eval_Dirac_VEF_Face_included */
classe Champ_Don_base classe de base des Champs donnes (non calcules)
KOKKOS_INLINE_FUNCTION void calculer_terme_source_non_standard_view(int num_face, DoubleArrView source) const
KOKKOS_INLINE_FUNCTION void calculer_terme_source_standard_view(int num_face, DoubleArrView source) const
void set(const Eval_Dirac_VEF_Face &eval) const
void calculer_terme_source_non_standard(const int num_face, Type_Double &source) const
void mettre_a_jour() override
OBS_PTR(Domaine) mon_dom
void calculer_terme_source_standard(const int num_face, Type_Double &source) const
OBS_PTR(Champ_Don_base) la_puissance
void associer_champs(const Champ_Don_base &)
void calculer_terme_source(int, Type_Double &) const
static KOKKOS_INLINE_FUNCTION void Kokkos_exit(const char *)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.h:173
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455