TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Terme_Source_Coriolis_base.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 <Terme_Source_Coriolis_base.h>
17#include <Motcle.h>
18#include <Param.h>
19
20Implemente_base(Terme_Source_Coriolis_base,"Terme_Source_Coriolis_base",Source_base);
21// XD coriolis source_base coriolis BRACE Keyword for a Coriolis term in hydraulic equation. Warning: Only available in
22// XD_CONT VDF.
23// XD attr omega list omega REQ Value of omega.
24
26
28{
29 Param param(que_suis_je());
30 set_param(param);
31 param.lire_avec_accolades_depuis(is);
32 return is;
33}
34
36{
37 param.ajouter_non_std("omega",(this),Param::REQUIRED);
38}
39
41{
42 int dim_pb=Objet_U::dimension;
43 int sz_lst = -1;
44 if (mot == Motcle("omega") )
45 {
46 is >> sz_lst;
47 if((dim_pb == 2 && sz_lst != 1) || (dim_pb == 3 && sz_lst != 3))
48 {
49 Cerr << "Error in Terme_Source_Coriolis_base::lire_donnees" << finl;
50 Cerr << "Warning ! Dimension of vector after key-word 'omega'" << finl;
51 Cerr << "is not correct - it should be 1 in 2D and 3 in 3D."<< finl;
53 }
54 if (sz_lst == 1)
55 {
56 omega_.resize(1);
57 is >> omega_(0);
58 return 1;
59 }
60 else
61 {
62 assert(sz_lst==3);
63 omega_.resize(3);
64 is >> omega_(0);
65 is >> omega_(1);
66 is >> omega_(2);
67 return 1;
68 }
69 }
70 else
71 {
72 Cerr << "Error while reading the parameters of Terme_Source_Coriolis_base " << finl;
73 Cerr << "We expected the keyword omega instead of " << mot << finl;
75 }
76 return -1;
77}
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
A character string (Nom) in uppercase.
Definition Motcle.h:26
friend class Entree
Definition Objet_U.h:71
static int dimension
Definition Objet_U.h:94
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
@ REQUIRED
Definition Param.h:115
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
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
Base class for output streams.
Definition Sortie.h:52
Source_base A Source_base object is a term appearing on the right-hand side of an.
Definition Source_base.h:42
void set_param(Param &param) const override
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.