TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Force_ph.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 Force_ph_included
17#define Force_ph_included
18
19
20#include <iostream>
21#include <string>
22#include <vector>
23#include <Force_sp.h>
24#include <IJK_Field_vector.h>
25// #include <fftw3.h>
26#include <Domaine_IJK.h>
27#include <communications.h>
28#include <Objet_U.h>
29
30#include <IJK_Field.h>
31
32class Force_ph : public Objet_U
33{
34
35 Declare_instanciable( Force_ph ) ;
36
37public:
38
39 // void initialise(int nproc_tot, int ni, int nj, int nk, int nl,int nm,int nn,
40 // double Lx, double Ly, double Lz, double Ox,double Oy,double Oz, int momin, int momax, double kmin, double kmax,
41 // std::string nom_fichier, const Domaine_IJK& splitting
42 // );
43 void initialise(int nproc_tot, int ni, int nj, int nk, int nl,int nm,int nn,
44 double Lx, double Ly, double Lz, double Ox,double Oy,double Oz, int momin, int momax, double kmin, double kmax,
45 std::string nom_fichier, const Domaine_IJK& splitting,
46 int a_i_offset, int a_j_offset, int a_k_offset
47 );
48 void from_spect_to_phys2(const std:: vector <double >& coeff_force);
49 void from_spect_to_phys_opti2(ArrOfDouble& coeff_force);
50 void from_spect_to_phys_opti2_advection(ArrOfDouble& coeff_force, const ArrOfDouble& advection_length);
51 void from_spect_to_phys_bis(const std::vector< std::vector< std:: vector <double >>>& coeff_force);
52 void set_zero();
53 void cheat_function();
54 // void from_spect_to_phys_fftw(fftw_complex* in);
55 void write(std::string nom_fichier_sortie, double t);
56 void write_separate(std::string nom_fichier_sortie, double t);
57 void write_offset_index_position( const Domaine_IJK& my_splitting);
58 void compute_energie();
59 double get_energie();
60 IJK_Field_vector3_double get_force_attribute();
61 IJK_Field_vector3_double& get_force_attribute2();
62
63 void gbz_gather(IJK_Field_vector3_double force_);
64
65private:
66 int nproc_tot = 0;
67
68 int ni = 0;
69 int nj = 0;
70 int nk = 0;
71 int n_ijk = 0;
72 int nl = 0;
73 int nm = 0;
74 int nn = 0;
75 int n_lmn = 0;
76 double Lx = 0.;
77 double Ly = 0.;
78 double Lz = 0.;
79 double Ox = 0.;
80 double Oy = 0.;
81 double Oz = 0.;
82 double kmin = 0.;
83 double kmax = 0.;
84 int momin = 0;
85 int momax = 0;
86 IJK_Field_vector3_double force_;
87 std::vector<std::vector< std:: vector < double > > > force;
88 double energie = 0.;
89
90 int nproc_i = 0;
91 int nproc_j = 0;
92 int nproc_k = 0;
93 int i_offset = 0;
94 int j_offset = 0;
95 int k_offset = 0;
96
97
98};
99
100std::vector< std::vector< std:: vector <double >>> set_dimensions(std::vector< std::vector< std:: vector <double >>> the_vector, int dim_one, int dim_two, int dim_three);
101
102// IJK_Field_vector3_double set_to_zero(IJK_Field_vector3_double vector)
103// {
104// for (int dir=0; dir<3; dir++)
105// for (int i=0; i<vector[0].ni(); i++)
106// for (int j=0; j<vector[1].nj(); j++)
107// for (int k=0; k<vector[2].nk(); k++)
108// vector[dir](i,j,k) = 0.;
109// return vector;
110// }
111
112#endif
This class encapsulates all the information related to the eulerian mesh for TrioIJK.
Definition Domaine_IJK.h:47
void compute_energie()
Definition Force_ph.cpp:610
IJK_Field_vector3_double & get_force_attribute2()
Definition Force_ph.cpp:670
void from_spect_to_phys_opti2(ArrOfDouble &coeff_force)
Definition Force_ph.cpp:275
void write_offset_index_position(const Domaine_IJK &my_splitting)
Definition Force_ph.cpp:578
double get_energie()
Definition Force_ph.cpp:624
void set_zero()
Definition Force_ph.cpp:98
void write(std::string nom_fichier_sortie, double t)
Definition Force_ph.cpp:549
void from_spect_to_phys_bis(const std::vector< std::vector< std::vector< double > > > &coeff_force)
void gbz_gather(IJK_Field_vector3_double force_)
void from_spect_to_phys2(const std::vector< double > &coeff_force)
Definition Force_ph.cpp:145
IJK_Field_vector3_double get_force_attribute()
Definition Force_ph.cpp:665
void write_separate(std::string nom_fichier_sortie, double t)
Definition Force_ph.cpp:629
void cheat_function()
Definition Force_ph.cpp:106
void initialise(int nproc_tot, int ni, int nj, int nk, int nl, int nm, int nn, double Lx, double Ly, double Lz, double Ox, double Oy, double Oz, int momin, int momax, double kmin, double kmax, std::string nom_fichier, const Domaine_IJK &splitting, int a_i_offset, int a_j_offset, int a_k_offset)
Definition Force_ph.cpp:40
void from_spect_to_phys_opti2_advection(ArrOfDouble &coeff_force, const ArrOfDouble &advection_length)
Definition Force_ph.cpp:410
Objet_U()
Constructeur par defaut : attribue un numero d'identifiant unique a l'objet (object_id_),...
Definition Objet_U.cpp:55