TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Coarsen_Operator_Uniform.cpp
1/****************************************************************************
2* Copyright (c) 2026, 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 <Coarsen_Operator_Uniform.h>
17#include <Domaine_IJK.h>
18
19Implemente_instanciable_sans_constructeur(Coarsen_Operator_Uniform, "Coarsen_Operator_Uniform", Coarsen_Operator_base);
20// XD Coarsen_Operator_Uniform objet_lecture nul NO_BRACE Object defining the uniform coarsening process of the given
21// XD_CONT grid in IJK discretization
22// XD attr Coarsen_Operator_Uniform chaine Coarsen_Operator_Uniform OPT not_set
23// XD attr aco chaine(into=["{"]) aco REQ opening curly brace
24// XD attr coarsen_i chaine(into=["coarsen_i"]) coarsen_i OPT not_set
25// XD attr coarsen_i_val entier coarsen_i_val OPT Integer indicating the number by which we will divide the number of
26// XD_CONT elements in the I direction (in order to obtain a coarser grid)
27// XD attr coarsen_j chaine(into=["coarsen_j"]) coarsen_j OPT not_set
28// XD attr coarsen_j_val entier coarsen_j_val OPT Integer indicating the number by which we will divide the number of
29// XD_CONT elements in the J direction (in order to obtain a coarser grid)
30// XD attr coarsen_k chaine(into=["coarsen_k"]) coarsen_k OPT not_set
31// XD attr coarsen_k_val entier coarsen_k_val OPT Integer indicating the number by which we will divide the number of
32// XD_CONT elements in the K direction (in order to obtain a coarser grid)
33// XD attr acof chaine(into=["}"]) acof REQ closing curly brace
34// XD coarsen_operators listobj nul NO_BRACE Coarsen_Operator_Uniform NO_COMMA not_set
35Coarsen_Operator_Uniform::Coarsen_Operator_Uniform()
36{
37 coarsen_factors_.resize_array(3);
38 // default: uniform refinement by factor 2
40}
41
42// Reads coarsening parameters in the .data file. See ajouter_param()
44{
46
47 const int coarsenCode = coarsen_factors_[0]*100 + coarsen_factors_[1]*10 + coarsen_factors_[2];
48
49 Cerr << "\nCoarsen Operator Uniform code: " << coarsenCode << "\n";
50
51 return is;
52}
53
55{
57}
58
60{
61 param.ajouter("coarsen_i", &coarsen_factors_[0]);
62 param.ajouter("coarsen_j", &coarsen_factors_[1]);
63 param.ajouter("coarsen_k", &coarsen_factors_[2]);
65}
void ajouter_param(Param &param) override
virtual void ajouter_param(Param &param)
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
void ajouter(const char *keyword, const int *value, Param::Nature nat=Param::OPTIONAL)
Register an integer parameter.
Definition Param.cpp:364
Classe de base des flux de sortie.
Definition Sortie.h:52