TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Champ_front_fonc_gradient_VEF.cpp
1/****************************************************************************
2* Copyright (c) 2022, 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
17#include <Champ_front_fonc_gradient_VEF.h>
18#include <Domaine_VEF.h>
19#include <TRUSTTrav.h>
20
21Implemente_instanciable(Champ_front_fonc_gradient_VEF,"Champ_front_fonc_gradient_VEF",Champ_front_fonc_gradient);
22
23
25{
27}
28
29
31{
33 return s;
34}
35
36/*! @brief Mise a jour du temps
37 *
38 */
39
41{
42 Cerr << "Champ_front_fonc_gradient_VEF::mettre_a_jour" << finl;
43 Cerr << "Non encore code..." << finl;
44 exit();
45
46 const Domaine_VEF& domaine_VEF = ref_cast(Domaine_VEF,domaine_dis());
47 const Front_VF& le_bord= ref_cast(Front_VF,frontiere_dis());
48 int premiere=le_bord.num_premiere_face();
49 const DoubleTab& face_normales = domaine_VEF.face_normales();
50 const IntTab& face_voisins = domaine_VEF.face_voisins();
51
52 DoubleTab& tab=valeurs_au_temps(temps);
53
54 // on traite les faces sur la frontiere
55
56 DoubleTab vecteur_tang(le_bord.nb_faces(),3);
57
58 for(int i=0; i<le_bord.nb_faces(); i++)
59 {
60 int elem1=face_voisins(i+premiere,0);
61 if (elem1 == -1)
62 elem1=face_voisins(i+premiere,1);
63 int signe = domaine_VEF.oriente_normale(i+premiere,elem1);
64
65 vecteur_tang(i,2) = 0.0;
66
67 vecteur_tang (i,0) = -face_normales(i+premiere,1)*signe;
68
69 vecteur_tang (i,1) =face_normales(i+premiere,0)*signe;
70
71 double norme=0.0;
72
73 for (int k=0; k<2; k++)
74 norme += vecteur_tang(i,k)* vecteur_tang(i,k);
75
76 norme = sqrt(norme);
77
78 tab(i,2)=0.0;
79 for(int j=0; j<2; j++)
80 {
81 tab(i+premiere,j)=vecteur_tang(i,j);
82 tab(i+premiere,j)*=vit_tang;
83 tab(i+premiere,j)=tab(i+premiere,j)/norme;
84 }
85 }
87}
virtual const Frontiere_dis_base & frontiere_dis() const
Renvoie la frontiere discretisee associee au champ.
virtual const Domaine_dis_base & domaine_dis() const
class Champ_front_fonc_gradient_VEF
void mettre_a_jour(double temps) override
Mise a jour du temps.
class Champ_front_fonc_gradient
DoubleTab & valeurs_au_temps(double temps) override
Renvoie les valeurs au temps desire.
class Domaine_VEF
Definition Domaine_VEF.h:54
virtual double face_normales(int face, int comp) const
Definition Domaine_VF.h:47
int oriente_normale(int f, int e) const
Definition Domaine_VF.h:194
int face_voisins(int num_face, int i) const
renvoie l'element voisin de numface dans la direction i.
Definition Domaine_VF.h:418
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual void fixer_nb_comp(int i)
Fixe le nombre de composantes du champ.
class Front_VF
Definition Front_VF.h:36
int nb_faces() const
Definition Front_VF.h:53
int num_premiere_face() const
Definition Front_VF.h:63
static int dimension
Definition Objet_U.h:99
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
Classe de base des flux de sortie.
Definition Sortie.h:52
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")