TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Cut_field.h
1/****************************************************************************
2* Copyright (c) 2019, 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 Cut_field_included
17#define Cut_field_included
18
19#include <Objet_U.h>
20#include <IJK_Field.h>
21#include <IJK_Field_vector.h>
22#include <TRUSTTabFT_cut_cell.h>
23
25
27{
28 double overall;
29 double overall_l;
30 double overall_v;
31 double pure;
32 double diph_l;
33 double diph_v;
34 double diph_small;
37 double diph_dying;
38};
39
40/*! @brief : class Cut_field_template
41 *
42 */
43template<typename _TYPE_, typename _TYPE_ARRAY_>
44class Cut_field_template : public IJK_Field_template<_TYPE_,_TYPE_ARRAY_>
45{
46public :
48
51
54
56
60
62
66
67 void set_field_data(const Nom& parser_expression_of_x_y_z_and_t, const IJK_Field_template<_TYPE_,_TYPE_ARRAY_>& input_f, const double current_time);
68 void set_to_uniform_value(_TYPE_ valeur);
70
72 void associer_ephemere(Cut_cell_FT_Disc& cut_cell_disc);
74
76 void add_from(const Cut_field_template<_TYPE_,_TYPE_ARRAY_>& data, _TYPE_ constant = 1);
77
78 const Cut_cell_FT_Disc& get_cut_cell_disc() const { return cut_cell_disc_.valeur(); }
79
80 void allocate_persistant(Cut_cell_FT_Disc& cut_cell_disc, const Domaine_IJK& splitting, Domaine_IJK::Localisation loc, int ghost_size, int additional_k_layers=0, int nb_compo=1, bool external_storage = false, int monofluide=0, double rov=0., double rol=0., int use_inv_rho_in_pressure_solver=0)
81 {
82 IJK_Field_template<_TYPE_,_TYPE_ARRAY_>::allocate(splitting, loc, ghost_size, additional_k_layers, nb_compo, this->le_nom(), external_storage, monofluide, rov, rol, use_inv_rho_in_pressure_solver);
83 associer_persistant(cut_cell_disc);
84 }
85
86 void allocate_ephemere(Cut_cell_FT_Disc& cut_cell_disc, const Domaine_IJK& splitting, Domaine_IJK::Localisation loc, int ghost_size, int additional_k_layers = 0, int nb_compo = 1, bool external_storage = false, int monofluide=0, double rov=0., double rol=0., int use_inv_rho_in_pressure_solver=0)
87 {
88 IJK_Field_template<_TYPE_,_TYPE_ARRAY_>::allocate(splitting, loc, ghost_size, additional_k_layers, nb_compo, this->le_nom(), external_storage, monofluide, rov, rol, use_inv_rho_in_pressure_solver);
89 associer_ephemere(cut_cell_disc);
90 }
91
92 void allocate_paresseux(Cut_cell_FT_Disc& cut_cell_disc, const Domaine_IJK& splitting, Domaine_IJK::Localisation loc, int ghost_size, int additional_k_layers = 0, int nb_compo = 1, bool external_storage = false, int monofluide=0, double rov=0., double rol=0., int use_inv_rho_in_pressure_solver=0)
93 {
94 IJK_Field_template<_TYPE_,_TYPE_ARRAY_>::allocate(splitting, loc, ghost_size, additional_k_layers, nb_compo, this->le_nom(), external_storage, monofluide, rov, rol, use_inv_rho_in_pressure_solver);
95 associer_paresseux(cut_cell_disc);
96 }
97 void dumplata_scalar(const char *filename, int step) const override;
98
99
100 _TYPE_& from_signed_independent_index(int signed_independent_index);
101 const _TYPE_& from_signed_independent_index(int signed_independent_index) const;
102
103 _TYPE_& from_ijk_and_phase(int i, int j, int k, bool phase);
104 const _TYPE_& from_ijk_and_phase(int i, int j, int k, bool phase) const;
105
106 _TYPE_& from_n_num_face_and_phase(int n, int num_face, bool phase);
107 const _TYPE_& from_n_num_face_and_phase(int n, int num_face, bool phase) const;
108
109 CutCell_GlobalInfo compute_global_energy_cut_cell(bool next, double constant_l, double constant_v) const;
114 Nom get_value_location(_TYPE_ T) const;
115
116 _TYPE_& pure_(int i, int j, int k)
117 {
119 }
120
121 const _TYPE_& pure_(int i, int j, int k) const
122 {
124 }
125
126 _TYPE_& operator()(int i, int j, int k)
127 {
128 Cerr << "Disabling operator() for the derived class Cut_field_template<_TYPE_,_TYPE_ARRAY_> of IJK_Field_template<_TYPE_,_TYPE_ARRAY_>. Please use pure_() instead." << finl;
131 }
132
133 const _TYPE_& operator()(int i, int j, int k) const
134 {
135 Cerr << "Disabling operator() for the derived class Cut_field_template<_TYPE_,_TYPE_ARRAY_> of IJK_Field_template<_TYPE_,_TYPE_ARRAY_>. Please use pure_() instead." << finl;
138 }
139
140 _TYPE_& operator()(int i, int j, int k, int compo)
141 {
142 Cerr << "Disabling operator() for the derived class Cut_field_template<_TYPE_,_TYPE_ARRAY_> of IJK_Field_template<_TYPE_,_TYPE_ARRAY_>. Please use pure_() instead." << finl;
145 }
146
147 const _TYPE_& operator()(int i, int j, int k, int compo) const
148 {
149 Cerr << "Disabling operator() for the derived class Cut_field_template<_TYPE_,_TYPE_ARRAY_> of IJK_Field_template<_TYPE_,_TYPE_ARRAY_>. Please use pure_() instead." << finl;
152 }
153
154 void multiply_by_scalar(_TYPE_ scalar_l, _TYPE_ scalar_v);
155 void divide_by_scalar(_TYPE_ scalar_l, _TYPE_ scalar_v);
156
157protected :
158 OBS_PTR(Cut_cell_FT_Disc) cut_cell_disc_;
159};
160
161using Cut_field_int = Cut_field_template<int,ArrOfInt>;
162using Cut_field_double = Cut_field_template<double,ArrOfDouble>;
163
164/*! @brief : class Cut_field_vector
165 *
166 */
167template<class T, int N>
196
197using Cut_field_vector3_int = Cut_field_vector<int, 3>;
198using Cut_field_vector3_double = Cut_field_vector<double, 3>;
199
200#endif /* Cut_field_included */
201
: class Cut_field_template
Definition Cut_field.h:45
CutCell_GlobalInfo compute_d_global_energy_cut_cell(bool next) const
void remplir_tableau_pure_cellules_diphasiques_max(bool next_time)
const _TYPE_ & from_signed_independent_index(int signed_independent_index) const
_TYPE_ & from_ijk_and_phase(int i, int j, int k, bool phase)
void echange_espace_virtuel(int ghost)
Definition Cut_field.cpp:29
void multiply_by_scalar(_TYPE_ scalar_l, _TYPE_ scalar_v)
bool check_agreement_diph_pure_cellules_initialement_pures() const
void divide_by_scalar(_TYPE_ scalar_l, _TYPE_ scalar_v)
_TYPE_ & pure_(int i, int j, int k)
Definition Cut_field.h:116
const _TYPE_ & from_ijk_and_phase(int i, int j, int k, bool phase) const
void copie_pure_vers_diph_sans_interpolation()
Definition Cut_field.cpp:37
CutCell_GlobalInfo compute_min_cut_cell(bool next) const
void add_from(const Cut_field_template< _TYPE_, _TYPE_ARRAY_ > &data, _TYPE_ constant=1)
const Cut_cell_FT_Disc & get_cut_cell_disc() const
Definition Cut_field.h:78
void associer_ephemere(Cut_cell_FT_Disc &cut_cell_disc)
void allocate_ephemere(Cut_cell_FT_Disc &cut_cell_disc, const Domaine_IJK &splitting, Domaine_IJK::Localisation loc, int ghost_size, int additional_k_layers=0, int nb_compo=1, bool external_storage=false, int monofluide=0, double rov=0., double rol=0., int use_inv_rho_in_pressure_solver=0)
Definition Cut_field.h:86
void remplir_tableau_pure_cellules_diphasiques(bool next_time)
_TYPE_ & operator()(int i, int j, int k, int compo)
Definition Cut_field.h:140
void allocate_persistant(Cut_cell_FT_Disc &cut_cell_disc, const Domaine_IJK &splitting, Domaine_IJK::Localisation loc, int ghost_size, int additional_k_layers=0, int nb_compo=1, bool external_storage=false, int monofluide=0, double rov=0., double rol=0., int use_inv_rho_in_pressure_solver=0)
Definition Cut_field.h:80
bool check_agreement_tableau_pure_cellules_diphasiques(bool next_time) const
void set_to_uniform_value(_TYPE_ valeur)
OBS_PTR(Cut_cell_FT_Disc) cut_cell_disc_
const _TYPE_ & operator()(int i, int j, int k) const
Definition Cut_field.h:133
CutCell_GlobalInfo compute_max_cut_cell(bool next) const
TRUSTTabFT_cut_cell< int > diph_l_
Definition Cut_field.h:49
_TYPE_ & operator()(int i, int j, int k)
Definition Cut_field.h:126
void associer_paresseux(Cut_cell_FT_Disc &cut_cell_disc)
CutCell_GlobalInfo compute_norm_cut_cell(bool next) const
const _TYPE_ & from_n_num_face_and_phase(int n, int num_face, bool phase) const
_TYPE_ & from_signed_independent_index(int signed_independent_index)
void set_to_sum(const Cut_field_template< _TYPE_, _TYPE_ARRAY_ > &data_1, const Cut_field_template< _TYPE_, _TYPE_ARRAY_ > &data_2)
void copy_from(const Cut_field_template< _TYPE_, _TYPE_ARRAY_ > &data)
void vide_phase_invalide_cellules_diphasiques()
void echange_pure_vers_diph_cellules_initialement_pures()
Definition Cut_field.cpp:54
bool check_agreement_diph_pure_cellules_finalement_pures() const
void dumplata_scalar(const char *filename, int step) const override
const _TYPE_ & pure_(int i, int j, int k) const
Definition Cut_field.h:121
void set_field_data(const Nom &parser_expression_of_x_y_z_and_t, const IJK_Field_template< _TYPE_, _TYPE_ARRAY_ > &input_f, const double current_time)
_TYPE_ & from_n_num_face_and_phase(int n, int num_face, bool phase)
void echange_diph_vers_pure_cellules_finalement_pures()
TRUSTTabFT_cut_cell< int > diph_v_
Definition Cut_field.h:50
CutCell_GlobalInfo compute_global_energy_cut_cell(bool next, double constant_l, double constant_v) const
const _TYPE_ & operator()(int i, int j, int k, int compo) const
Definition Cut_field.h:147
void associer_persistant(Cut_cell_FT_Disc &cut_cell_disc)
void allocate_paresseux(Cut_cell_FT_Disc &cut_cell_disc, const Domaine_IJK &splitting, Domaine_IJK::Localisation loc, int ghost_size, int additional_k_layers=0, int nb_compo=1, bool external_storage=false, int monofluide=0, double rov=0., double rol=0., int use_inv_rho_in_pressure_solver=0)
Definition Cut_field.h:92
Nom get_value_location(_TYPE_ T) const
: class Cut_field_vector
Definition Cut_field.h:169
void echange_espace_virtuel(int ghost)
void set_to_uniform_value(int valeur)
void echange_diph_vers_pure_cellules_finalement_pures()
void vide_phase_invalide_cellules_diphasiques()
Cut_field_template< T, TRUSTArray< T > > & operator[](int i)
Definition Cut_field.h:181
const Cut_field_template< T, TRUSTArray< T > > & operator[](int i) const
Definition Cut_field.h:187
void echange_pure_vers_diph_cellules_initialement_pures()
This class encapsulates all the information related to the eulerian mesh for TrioIJK.
Definition Domaine_IJK.h:47
Localisation
Localisation sub class.
Definition Domaine_IJK.h:53
const Nom & le_nom() const override
Renvoie le nom du champ.
_TYPE_ & operator()(int i, int j, int k)
: This class is an IJK_Field_local with parallel informations.
void allocate(const Domaine_IJK &d, Domaine_IJK::Localisation l, int ghost_size, int additional_k_layers=0, int nb_compo=1, const Nom &name=Nom(), bool external_storage=false, int monofluide=0, double rov=0., double rol=0., int use_inv_rho_in_pressure_solver=0)
IJK_Field_template< T, TRUSTArray< T > > & operator[](int i)
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
: class TRUSTTabFT_cut_cell