TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Tri_VEF.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 Tri_VEF_included
17#define Tri_VEF_included
18
19#include <Elem_VEF_base.h>
20
21class Tri_VEF : public Elem_VEF_base
22{
23
24 Declare_instanciable_sans_constructeur(Tri_VEF);
25
26public:
27 Tri_VEF();
28 inline int nb_facette() const override
29 {
30 return 3;
31 };
32 void creer_facette_normales(const Domaine_VEF&, const IntVect& ) const override;
33 void creer_normales_facettes_Cl(DoubleTab& ,int ,int ,
34 const DoubleTab& ,const DoubleVect& ,const Domaine&) const override;
35 void modif_volumes_entrelaces(int ,int ,const Domaine_VEF& ,DoubleVect& ,int ) const override;
36 void modif_volumes_entrelaces_faces_joints(int ,int ,const Domaine_VEF& ,DoubleVect& ,int ) const override;
37 void modif_normales_facettes_Cl(DoubleTab&,int ,int
38 ,int ,int ,int ,int ) const override;
39 void calcul_vc(const ArrOfInt& ,ArrOfDouble& ,const ArrOfDouble& ,
40 const DoubleTab& ,const Champ_Inc_base& ,int, const DoubleVect& ) const override;
41 void calcul_xg(DoubleVect& ,const DoubleTab& ,const int ,int& ,
42 int& ,int& ,int& ) const override;
43 void creer_face_normales(DoubleTab&, const IntTab& ,const IntTab&,
44 const IntTab& ,const Domaine& ) const override ;
45};
46
47KOKKOS_INLINE_FUNCTION void calcul_vc_tri_views(const int* Face, double *vc, const double * vs, const double * vsom,
48 CDoubleTabView vitesse,int type_cl, CDoubleArrView porosite_face)
49{
50 int comp;
51 switch(type_cl)
52 {
53 case 0: // the triangle has no Dirichlet face
54 {
55 for (comp=0; comp<2; comp++)
56 vc[comp] = vs[comp]/3;
57 break;
58 }
59
60 case 1: // the triangle has one Dirichlet face: face 2
61 {
62 for (comp=0; comp<2; comp++)
63 vc[comp] = vitesse(Face[2], comp) * porosite_face(Face[2]);
64 break;
65 }
66
67 case 2: // the triangle has one Dirichlet face: face 1
68 {
69 for (comp=0; comp<2; comp++)
70 vc[comp] = vitesse(Face[1], comp) * porosite_face(Face[1]);
71 break;
72 }
73
74 case 4: // the triangle has one Dirichlet face: face 0
75 {
76 for (comp=0; comp<2; comp++)
77 vc[comp] = vitesse(Face[0], comp) * porosite_face(Face[0]);
78 break;
79 }
80
81 case 3: // the triangle has two Dirichlet faces: faces 1 and 2
82 {
83 for (comp=0; comp<2; comp++)
84 vc[comp] = vsom[comp];
85 break;
86 }
87
88 case 5: // the triangle has two Dirichlet faces: faces 0 and 2
89 {
90 for (comp=0; comp<2; comp++)
91 vc[comp] = vsom[2+comp];
92 break;
93 }
94
95 case 6: // the triangle has two Dirichlet faces: faces 0 and 1
96 {
97 for (comp=0; comp<2; comp++)
98 vc[comp] = vsom[4+comp];
99 break;
100 }
101
102 } // end of switch
103}
104#endif
105
106
107
Class Champ_Inc_base.
class Domaine_VEF
Definition Domaine_VEF.h:53
void calcul_xg(DoubleVect &, const DoubleTab &, const int, int &, int &, int &, int &) const override
Computes the coordinates xg of the centre of a non-standard element.
Definition Tri_VEF.cpp:462
void creer_face_normales(DoubleTab &, const IntTab &, const IntTab &, const IntTab &, const Domaine &) const override
Fills the face_normales array in Domaine_VEF.
Definition Tri_VEF.cpp:56
void modif_normales_facettes_Cl(DoubleTab &, int, int, int, int, int, int) const override
Modifies normales_facettes_Cl when idirichlet=2.
Definition Tri_VEF.cpp:561
void creer_facette_normales(const Domaine_VEF &, const IntVect &) const override
Computes the facet normals for standard elements.
Definition Tri_VEF.cpp:104
void modif_volumes_entrelaces_faces_joints(int, int, const Domaine_VEF &, DoubleVect &, int) const override
Modifies the interlaced volumes for joint face j of a non-standard element.
Definition Tri_VEF.cpp:291
void calcul_vc(const ArrOfInt &, ArrOfDouble &, const ArrOfDouble &, const DoubleTab &, const Champ_Inc_base &, int, const DoubleVect &) const override
Definition Tri_VEF.cpp:391
int nb_facette() const override
Definition Tri_VEF.h:28
Tri_VEF()
Definition Tri_VEF.cpp:36
void creer_normales_facettes_Cl(DoubleTab &, int, int, const DoubleTab &, const DoubleVect &, const Domaine &) const override
Fills the normales_facettes_Cl array in Domaine_Cl_VEF for facet fa7 of element num_elem.
Definition Tri_VEF.cpp:172
void modif_volumes_entrelaces(int, int, const Domaine_VEF &, DoubleVect &, int) const override
Modifies the interlaced volumes for face j of a non-standard element.
Definition Tri_VEF.cpp:211