TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Coarsen_Operator_base.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 Coarsen_Operator_base_included
17#define Coarsen_Operator_base_included
18
19#include <Grid_Level_Data_template.h>
20#include <TRUST_Vector.h>
21#include <Param.h>
22
23// Describes refine and coarsening operators
25{
26 Declare_base(Coarsen_Operator_base);
27public:
28 virtual void initialize_grid_data(const Grid_Level_Data_double& fine, Grid_Level_Data_double& coarse,
29 int additional_k_layers) = 0;
30 // Compute values on coarse mesh from values on fine mesh
31 virtual void coarsen(const IJK_Field_double& fine, IJK_Field_double& coarse, int compute_weighted_average = 0) const = 0;
32 // Interpolate values on coarse mesh to fine mesh and substract them from existing values
33 virtual void interpolate_sub_shiftk(const IJK_Field_double& coarse, IJK_Field_double& fine, const int kshift) const = 0;
34 virtual void initialize_grid_data(const Grid_Level_Data_float& fine, Grid_Level_Data_float& coarse,
35 int additional_k_layers) = 0;
36 // Compute values on coarse mesh from values on fine mesh
37 virtual void coarsen(const IJK_Field_float& fine, IJK_Field_float& coarse, int compute_weighted_average = 0) const = 0;
38 // Interpolate values on coarse mesh to fine mesh and substract them from existing values
39 virtual void interpolate_sub_shiftk(const IJK_Field_float& coarse, IJK_Field_float& fine, const int kshift) const = 0;
40protected:
41 virtual void ajouter_param(Param& param) {};
42};
43
44#endif
virtual void coarsen(const IJK_Field_double &fine, IJK_Field_double &coarse, int compute_weighted_average=0) const =0
virtual void initialize_grid_data(const Grid_Level_Data_double &fine, Grid_Level_Data_double &coarse, int additional_k_layers)=0
virtual void initialize_grid_data(const Grid_Level_Data_float &fine, Grid_Level_Data_float &coarse, int additional_k_layers)=0
virtual void ajouter_param(Param &param)
virtual void interpolate_sub_shiftk(const IJK_Field_double &coarse, IJK_Field_double &fine, const int kshift) const =0
virtual void coarsen(const IJK_Field_float &fine, IJK_Field_float &coarse, int compute_weighted_average=0) const =0
virtual void interpolate_sub_shiftk(const IJK_Field_float &coarse, IJK_Field_float &fine, const int kshift) const =0
Objet_U()
Constructeur par defaut : attribue un numero d'identifiant unique a l'objet (object_id_),...
Definition Objet_U.cpp:55
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112