TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Operateur_IJK_elem_conv.cpp
1/****************************************************************************
2* Copyright (c) 2023, 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#include <Operateur_IJK_elem_conv.h>
16#include <Param.h>
17
18Implemente_instanciable_sans_constructeur( Operateur_IJK_elem_conv, "Operateur_IJK_elem_conv", OWN_PTR(Operateur_IJK_elem_conv_base_double) );
19
20Operateur_IJK_elem_conv::Operateur_IJK_elem_conv()
21{
22 convection_op_words_ = Motcles(5);
23 {
24 convection_op_words_[0] = "centre";
25 convection_op_words_[1] = "centre2";
26 convection_op_words_[2] = "quick";
27 convection_op_words_[3] = "discquick";
28 convection_op_words_[4] = "quickinterface";
29 }
30 prefix_ = Nom("OpConv");
31 suffix_ = Nom("IJKScalar_double");
32 convection_op_ = "";
35 is_cast_ = false;
36}
37
45
46Sortie& Operateur_IJK_elem_conv::printOn(Sortie& os) const
47{
48 // OWN_PTR(Operateur_IJK_elem_conv_base_double)::printOn( os );
50 return os;
51}
52
53Entree& Operateur_IJK_elem_conv::readOn(Entree& is)
54{
56 return is;
57}
58
60{
61 param.ajouter_non_std("velocity_convection_form", (this));
62}
63
65{
66 return 1;
67}
68
70{
71 if (is_cast_)
73 Cerr << "Read and Cast Operateur_IJK_elem_conv :" << finl;
74 Motcle word;
75 is >> word;
77 typer(type);
78 Cerr << "Operateur_IJK_elem_conv cast to " << type << finl;
79 is >> valeur();
80 is_cast_ = true;
81 return is;
82}
83
84void Operateur_IJK_elem_conv::typer_convection_op(const char *convection_op)
85{
86 if (is_cast_)
88 Cerr << "Read and Cast Operateur_IJK_elem_conv :" << finl;
89 Motcle word(convection_op);
91 typer(type);
92 Cerr << "Operateur_IJK_elem_conv cast to " << type << finl;
93 is_cast_ = true;
94}
95
97{
98 Nom type(prefix_);
100 switch(convection_rank_)
101 {
102 case 0:
103 {
104 convection_op_ += "Centre2";
105 break;
106 }
107 case 1:
108 {
109 convection_op_ += "Centre2";
110 break;
111 }
112 case 2:
113 {
114 convection_op_ += "Quick";
115 break;
116 }
117 case 3:
118 {
119 convection_op_ += "DiscQuick";
120 break;
121 }
122 case 4:
123 {
124 convection_op_ += "QuickInterface";
125 break;
126 }
127 default:
128 {
129 Cerr << "ERROR : Scalar convection operators that are already implemented are:" << finl;
130 Cerr << convection_op_words_ << finl;
131 abort();
132 }
133 }
134 type += convection_op_;
135 type += suffix_;
136 return type;
137}
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
void set_param(Param &param) const override
int lire_motcle_non_standard(const Motcle &mot, Entree &is) override
Entree & typer_convection_op(Entree &is)
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
void ajouter_non_std(const char *keyword, const Objet_U *value, Param::Nature nat=Param::OPTIONAL)
Register a keyword handled by Objet_U::lire_motcle_non_standard.
Definition Param.cpp:489
Classe de base des flux de sortie.
Definition Sortie.h:52