TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Grid_Level_Data_template.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 Grid_Level_Data_template_included
17#define Grid_Level_Data_template_included
18
19#include <type_traits>
20#include <Domaine_IJK.h>
21#include <TRUST_Vector.h>
22#include <IJK_Field.h>
23
24// Data for each grid
25template<typename _TYPE_>
27{
28protected:
29 unsigned taille_memoire() const override { throw; }
30 int duplique() const override
31 {
33 if (!xxx) Process::exit("Not enough memory !");
34 return xxx->numero();
35 }
36 Sortie& printOn(Sortie& os) const override { return os; }
37 Entree& readOn(Entree& is) override { return is; }
38
39public:
41 void initialize(const Domaine_IJK&, int ghost, int additional_k_layers);
42
43 int get_ghost_size() const { return ghost_size_; }
44 const Domaine_IJK& get_domaine() const { return domaine_ijk_; }
45 // Compute the ijk_faces_coefficients from ijk_rho_
48
49 template <typename MY_TYPE = _TYPE_> std::enable_if_t<std::is_same<MY_TYPE,float>::value, void>
51
52 // Returns the reference to the rho_field (to fill the data)
59
60protected:
65
66 //Domaine_IJK grid_geometry_;
69 bool perio_k_ = false;
70
71 VECT(ArrOfDouble_with_ghost) local_delta_xyz_;
72 bool uniform_[3];
73
74 // Poisson coefficient on each cell on this level
76 // matrix coefficients at faces for each level (computed from ijk_rho_levels_)
77 // These coefficients contain the wall boundary conditions.
78 // The field has 4 components per element
79 // coeff_faces(i,j,k,0) contains data for faces of normal x
80 // coeff_faces(i,j,k,1) contains data for faces of normal y
81 // coeff_faces(i,j,k,2) contains data for faces of normal z
82 // coeff_faces(i,j,k,3) contains the sum of the coefficients at all faces of element (i,j,k)
84
85 // Temporary storage for multigrid algorithm:
86 // Storage for the unknown:
88 // Storage for the right-hand side:
90 // Storage for the residue:
92};
93
94using Grid_Level_Data_double = Grid_Level_Data_template<double>;
95using Grid_Level_Data_float = Grid_Level_Data_template<float>;
96
97#include <Grid_Level_Data_template.tpp>
98
99#endif
This class encapsulates all the information related to the eulerian mesh for TrioIJK.
Definition Domaine_IJK.h:47
IJK_Field_template< double, TRUSTArray< double > > ijk_residue_
const IJK_Field_template< _TYPE_, TRUSTArray< _TYPE_ > > & get_rho() const
IJK_Field_template< _TYPE_, TRUSTArray< _TYPE_ > > & get_update_rho()
Entree & readOn(Entree &is) override
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
IJK_Field_template< double, TRUSTArray< double > > ijk_faces_coefficients_
Sortie & printOn(Sortie &os) const override
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
unsigned taille_memoire() const override
IJK_Field_template< double, TRUSTArray< double > > ijk_rhs_
IJK_Field_template< _TYPE_, TRUSTArray< _TYPE_ > > & get_update_x()
IJK_Field_template< double, TRUSTArray< double > > ijk_rho_
IJK_Field_template< double, TRUSTArray< double > > ijk_x_
const IJK_Field_template< _TYPE_, TRUSTArray< _TYPE_ > > & get_faces_coefficients() const
IJK_Field_template< _TYPE_, TRUSTArray< _TYPE_ > > & get_update_rhs()
std::enable_if_t< std::is_same< MY_TYPE, float >::value, void > compute_faces_coefficients_from_double_coeffs(const Grid_Level_Data_template< double > &)
IJK_Field_template< _TYPE_, TRUSTArray< _TYPE_ > > & get_update_residue()
void initialize(const Domaine_IJK &, int ghost, int additional_k_layers)
const Domaine_IJK & get_domaine() const
VECT(ArrOfDouble_with_ghost) local_delta_xyz_
: This class is an IJK_Field_local with parallel informations.
friend class Entree
Definition Objet_U.h:76
int numero() const
Renvoie l'indice de l'objet dans Memoire::data.
Definition Objet_U.cpp:268
friend class Sortie
Definition Objet_U.h:75
Objet_U()
Constructeur par defaut : attribue un numero d'identifiant unique a l'objet (object_id_),...
Definition Objet_U.cpp:55
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455