TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Facettes_Interp_FT.cpp
1/****************************************************************************
2* Copyright (c) 2015 - 2016, 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#include <Facettes_Interp_FT.h>
17#include <Intersection_Interface_ijk.h>
18#include <IJK_Navier_Stokes_tools_cut_cell.h>
19
20Implemente_instanciable_sans_constructeur(Facettes_Interp_FT, "Facettes_Interp_FT", Objet_U) ;
21
22Facettes_Interp_FT::Facettes_Interp_FT()
23{
24}
25
27{
28 return os;
29}
30
32{
33 Param param(que_suis_je());
34 set_param(param);
35 param.lire_avec_accolades(is);
36 return is;
37}
38
40{
41 param.ajouter("number_of_interpolation_points", &number_of_interpolation_points_);
42 param.ajouter("scaled_distance_interpolation_1", &scaled_distance_interpolation_1_);
43 param.ajouter("scaled_distance_interpolation_2", &scaled_distance_interpolation_2_);
44}
45
47{
48 ref_interfaces_ = interfaces;
49 ref_cut_cell_disc_ = cut_cell_disc;
50 ref_domaine_ = domaine_ft;
51 ref_maillage_ft_ijk_ = maillage_ft_ijk;
52 ref_old_maillage_ft_ijk_ = old_maillage_ft_ijk;
53}
54
56{
57 // Synchronisation de old_en_premier_ avec le old_en_premier_ de IJK_Interfaces
58 old_en_premier_ = old_en_premier;
59 assert(next() == ref_interfaces_->next());
60
62 ref_cut_cell_disc_,
63 ref_domaine_.valeur(),
64 ref_maillage_ft_ijk_.valeur(),
68}
69
71{
72 // Synchronisation de old_en_premier_ avec le old_en_premier_ de IJK_Interfaces
73 old_en_premier_ = not not_old_en_premier;
74 assert(old() == ref_interfaces_->old());
75
77 ref_cut_cell_disc_,
78 ref_domaine_.valeur(),
79 ref_old_maillage_ft_ijk_.valeur(),
82 coefficient_[old()]);
83}
84
86 const Cut_cell_FT_Disc& cut_cell_disc,
87 const Domaine_IJK& geom,
88 const Maillage_FT_IJK& maillage,
89 FixedVector<DoubleTabFT, 4>& interpolation_coord,
90 FixedVector<IntTabFT, 4>& interpolation_signed_independent_index,
91 FixedVector<DoubleTabFT, 4>& interpolation_coefficient)
92{
93 const double dist_1 = get_distance_interpolation_1();
94 const double dist_2 = get_distance_interpolation_2();
95 const DoubleTab& normale_facettes = maillage.get_update_normale_facettes();
96
98 {
100 dist_1,
101 cut_cell_disc,
102 maillage,
103 interpolation_coord,
104 normale_facettes,
105 interpolation_signed_independent_index,
106 interpolation_coefficient);
107 }
109 {
111 dist_1,
112 dist_2,
113 cut_cell_disc,
114 maillage,
115 interpolation_coord,
116 normale_facettes,
117 interpolation_signed_independent_index,
118 interpolation_coefficient);
119 }
120 else
121 {
122 Cerr << "Nombre de points d'interpolation non reconnu." << finl;
124 }
125}
126
128 bool next_time,
129 const double dist,
130 const Cut_cell_FT_Disc& cut_cell_disc,
131 const Maillage_FT_IJK& maillage,
132 FixedVector<DoubleTabFT, 4>& interpolation_coord,
133 const DoubleTab& normal_on_interf,
134 FixedVector<IntTabFT, 4>& cut_cell_facettes_interpolation_signed_independent_index,
135 FixedVector<DoubleTabFT, 4>& cut_cell_facettes_interpolation_coefficient)
136{
137 const int nb_facettes = maillage.nb_facettes();
138 interpolation_coord[1].resize(nb_facettes, 3);
139 interpolation_coord[0].resize(nb_facettes, 3);
140 for (int fa7 = 0; fa7 < nb_facettes; fa7++)
141 {
142 Vecteur3 coords_fa7 = maillage.coords_fa7(fa7);
143 Vecteur3 normal(normal_on_interf, fa7);
144
146 interpolation_coord[1](fa7, 0) = interp_1[0];
147 interpolation_coord[1](fa7, 1) = interp_1[1];
148 interpolation_coord[1](fa7, 2) = interp_1[2];
149
151 interpolation_coord[0](fa7, 0) = interp_0[0];
152 interpolation_coord[0](fa7, 1) = interp_0[1];
153 interpolation_coord[0](fa7, 2) = interp_0[2];
154 }
155
156 cut_cell_facettes_interpolation_signed_independent_index[1].resize(interpolation_coord[1].dimension(0), 4);
157 cut_cell_facettes_interpolation_coefficient[1].resize(interpolation_coord[1].dimension(0), 4);
158 ijk_interpolate_cut_cell_skip_unknown_points(next_time, 1, cut_cell_disc, interpolation_coord[1], cut_cell_facettes_interpolation_signed_independent_index[1], cut_cell_facettes_interpolation_coefficient[1], 1.e31);
159
160 cut_cell_facettes_interpolation_signed_independent_index[0].resize(interpolation_coord[0].dimension(0), 4);
161 cut_cell_facettes_interpolation_coefficient[0].resize(interpolation_coord[0].dimension(0), 4);
162 ijk_interpolate_cut_cell_skip_unknown_points(next_time, 0, cut_cell_disc, interpolation_coord[0], cut_cell_facettes_interpolation_signed_independent_index[0], cut_cell_facettes_interpolation_coefficient[0], 1.e31);
163}
164
166 bool next_time,
167 const double dist_1,
168 const double dist_2,
169 const Cut_cell_FT_Disc& cut_cell_disc,
170 const Maillage_FT_IJK& maillage,
171 FixedVector<DoubleTabFT, 4>& interpolation_coord,
172 const DoubleTab& normal_on_interf,
173 FixedVector<IntTabFT, 4>& cut_cell_facettes_interpolation_signed_independent_index,
174 FixedVector<DoubleTabFT, 4>& cut_cell_facettes_interpolation_coefficient)
175{
176 const int nb_facettes = maillage.nb_facettes();
177 interpolation_coord[1].resize(nb_facettes, 3);
178 interpolation_coord[0].resize(nb_facettes, 3);
179 interpolation_coord[3].resize(nb_facettes, 3);
180 interpolation_coord[2].resize(nb_facettes, 3);
181 for (int fa7 = 0; fa7 < nb_facettes; fa7++)
182 {
183 Vecteur3 coords_fa7 = maillage.coords_fa7(fa7);
184 Vecteur3 normal(normal_on_interf, fa7);
185
187 interpolation_coord[1](fa7, 0) = interp_1[0];
188 interpolation_coord[1](fa7, 1) = interp_1[1];
189 interpolation_coord[1](fa7, 2) = interp_1[2];
190
192 interpolation_coord[0](fa7, 0) = interp_0[0];
193 interpolation_coord[0](fa7, 1) = interp_0[1];
194 interpolation_coord[0](fa7, 2) = interp_0[2];
195
197 interpolation_coord[3](fa7, 0) = interp_3[0];
198 interpolation_coord[3](fa7, 1) = interp_3[1];
199 interpolation_coord[3](fa7, 2) = interp_3[2];
200
202 interpolation_coord[2](fa7, 0) = interp_2[0];
203 interpolation_coord[2](fa7, 1) = interp_2[1];
204 interpolation_coord[2](fa7, 2) = interp_2[2];
205 }
206
207 cut_cell_facettes_interpolation_signed_independent_index[1].resize(interpolation_coord[1].dimension(0), 4);
208 cut_cell_facettes_interpolation_coefficient[1].resize(interpolation_coord[1].dimension(0), 4);
209 ijk_interpolate_cut_cell_skip_unknown_points(next_time, 1, cut_cell_disc, interpolation_coord[1], cut_cell_facettes_interpolation_signed_independent_index[1], cut_cell_facettes_interpolation_coefficient[1], 1.e31);
210
211 cut_cell_facettes_interpolation_signed_independent_index[0].resize(interpolation_coord[0].dimension(0), 4);
212 cut_cell_facettes_interpolation_coefficient[0].resize(interpolation_coord[0].dimension(0), 4);
213 ijk_interpolate_cut_cell_skip_unknown_points(next_time, 0, cut_cell_disc, interpolation_coord[0], cut_cell_facettes_interpolation_signed_independent_index[0], cut_cell_facettes_interpolation_coefficient[0], 1.e31);
214
215 cut_cell_facettes_interpolation_signed_independent_index[3].resize(interpolation_coord[3].dimension(0), 4);
216 cut_cell_facettes_interpolation_coefficient[3].resize(interpolation_coord[3].dimension(0), 4);
217 ijk_interpolate_cut_cell_skip_unknown_points(next_time, 1, cut_cell_disc, interpolation_coord[3], cut_cell_facettes_interpolation_signed_independent_index[3], cut_cell_facettes_interpolation_coefficient[3], 1.e31);
218
219 cut_cell_facettes_interpolation_signed_independent_index[2].resize(interpolation_coord[2].dimension(0), 4);
220 cut_cell_facettes_interpolation_coefficient[2].resize(interpolation_coord[2].dimension(0), 4);
221 ijk_interpolate_cut_cell_skip_unknown_points(next_time, 0, cut_cell_disc, interpolation_coord[2], cut_cell_facettes_interpolation_signed_independent_index[2], cut_cell_facettes_interpolation_coefficient[2], 1.e31);
222}
223
225{
226 const Domaine_IJK& geom = ref_domaine_.valeur();
227 const double dist_1 = scaled_distance_interpolation_1_/sqrt(3) * std::pow(std::pow(geom.get_constant_delta(DIRECTION_I), 2.) +
228 std::pow(geom.get_constant_delta(DIRECTION_J), 2.) +
229 std::pow(geom.get_constant_delta(DIRECTION_K), 2.),
230 0.5);
231 return dist_1;
232}
233
235{
236 const Domaine_IJK& geom = ref_domaine_.valeur();
237 const double dist_2 = scaled_distance_interpolation_2_/sqrt(3) * std::pow(std::pow(geom.get_constant_delta(DIRECTION_I), 2.) +
238 std::pow(geom.get_constant_delta(DIRECTION_J), 2.) +
239 std::pow(geom.get_constant_delta(DIRECTION_K), 2.),
240 0.5);
241 return dist_2;
242}
243
This class encapsulates all the information related to the eulerian mesh for TrioIJK.
Definition Domaine_IJK.h:47
double get_constant_delta(int direction) const
Returns the size of cells in a direction.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
void set_param(Param &param) const override
const Maillage_FT_IJK & maillage_ft_ijk() const
double get_distance_interpolation_1() const
FixedVector< FixedVector< IntTabFT, 4 >, 2 > signed_independent_index_
void associer(const IJK_Interfaces &interfaces, const Cut_cell_FT_Disc &cut_cell_disc, const Domaine_IJK &splitting_ft, const Maillage_FT_IJK &maillage_ft_ijk, const Maillage_FT_IJK &old_maillage_ft_ijk)
void calcul_coefficient_interpolation_facette_cut_cell_second_order(bool next_time, const double dist_1, const double dist_2, const Cut_cell_FT_Disc &cut_cell_disc, const Maillage_FT_IJK &maillage, FixedVector< DoubleTabFT, 4 > &interpolation_coord, const DoubleTab &normal_on_interf, FixedVector< IntTabFT, 4 > &cut_cell_facettes_interpolation_signed_independent_index, FixedVector< DoubleTabFT, 4 > &cut_cell_facettes_interpolation_coefficient)
const Maillage_FT_IJK & old_maillage_ft_ijk() const
void cut_cell_perform_interpolation_facettes_old(bool not_old_en_premier)
double get_distance_interpolation_2() const
void cut_cell_perform_interpolation_facettes(bool next_time, const Cut_cell_FT_Disc &cut_cell_disc, const Domaine_IJK &geom, const Maillage_FT_IJK &maillage, FixedVector< DoubleTabFT, 4 > &interpolation_coord, FixedVector< IntTabFT, 4 > &interpolation_signed_independent_index, FixedVector< DoubleTabFT, 4 > &interpolation_coefficient)
void cut_cell_perform_interpolation_facettes_next(int old_en_premier)
FixedVector< FixedVector< DoubleTabFT, 4 >, 2 > interpolation_coord_
FixedVector< FixedVector< DoubleTabFT, 4 >, 2 > coefficient_
void calcul_coefficient_interpolation_facette_cut_cell(bool next_time, const double dist, const Cut_cell_FT_Disc &cut_cell_disc, const Maillage_FT_IJK &maillage, FixedVector< DoubleTabFT, 4 > &interpolation_coord, const DoubleTab &normal_on_interf, FixedVector< IntTabFT, 4 > &cut_cell_facettes_interpolation_signed_independent_index, FixedVector< DoubleTabFT, 4 > &cut_cell_facettes_interpolation_coefficient)
: class IJK_Interfaces
static Vecteur3 get_position_interpolation_normal_interf(const Vecteur3 &position_on_interf, const Vecteur3 &normal_on_interf, const double dist)
int nb_facettes() const
renvoie le nombre de facettes (reelles et virtuelles) (egal a facettes().
virtual const DoubleTab & get_update_normale_facettes() const
Calcule la grandeur demandee, stocke le resultat dans un tableau interne a la classe et renvoie le re...
Vecteur3 coords_fa7(int fa7) const
: class Maillage_FT_IJK
classe Objet_U Cette classe est la classe de base des Objets de TRUST
Definition Objet_U.h:73
static int dimension
Definition Objet_U.h:99
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
Definition Objet_U.cpp:104
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
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
void ajouter(const char *keyword, const int *value, Param::Nature nat=Param::OPTIONAL)
Register an integer parameter.
Definition Param.cpp:364
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