TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Operateur_IJK_data_channel.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 <Operateur_IJK_data_channel.h>
17
19{
20
21 nb_elem_k_tot_ = grid_geom.get_nb_elem_tot(2);
23 delta_x_ = grid_geom.get_constant_delta(0);
24 delta_y_ = grid_geom.get_constant_delta(1);
25
26 grid_geom.get_local_mesh_delta(2 /*direction*/, 2 /* number of ghost cells to get */, delta_z_);
27
30 {
31 const int n = delta_z_.size();
32 inv_elem_size_z_.resize(n, 1);
33 for (int i = -1; i < n+1; i++)
34 inv_elem_size_z_[i] = 1. / delta_z_[i];
35 inv_dist_z_elemcenter_.resize(n+1,0); // neither
36 for (int i = 0; i < n+1; i++)
37 {
38 const int global_k = i + offset_to_global_k_layer_;
39 if (global_k == first_global_k_layer_flux(0, 2) - 1)
40 {
41 // bottom wall
43 }
44 else if (global_k == last_global_k_layer_flux(0, 2) + 1)
45 {
46 // top wall
47 inv_dist_z_elemcenter_[i] = 2. / delta_z_[i-1];
48 }
49 else
50 {
51 inv_dist_z_elemcenter_[i] = 2. / (delta_z_[i-1] + delta_z_[i]);
52 }
53 }
54 }
55
56 perio_k_ = grid_geom.get_periodic_flag(2);
57 uniform_k_ = grid_geom.is_uniform(2);
58}
This class encapsulates all the information related to the eulerian mesh for TrioIJK.
Definition Domaine_IJK.h:47
int get_offset_local(int direction) const
Returns the local offset in requested direction.
bool is_uniform(int direction) const
Method returns true if uniform in this direction.
bool get_periodic_flag(int direction) const
Method returns true if periodic in this direction.
void get_local_mesh_delta(int direction, int ghost_cells, ArrOfDouble_with_ghost &delta) const
Fills the "delta" array with the size of the cells owned by the processor in the requested direction.
double get_constant_delta(int direction) const
Returns the size of cells in a direction.
int get_nb_elem_tot(int direction) const
Returns the total (global) number of mesh cells in requested direction.
int last_global_k_layer_flux(int icompo, int idir) const
void initialize(const Domaine_IJK &splitting)
int first_global_k_layer_flux(int icompo, int idir) const
ArrOfDouble_with_ghost inv_dist_z_elemcenter_