TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Champ_Input_Proto.h
1/****************************************************************************
2* Copyright (c) 2024, 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 Champ_Input_Proto_included
17#define Champ_Input_Proto_included
18
19#include <ICoCoTrioField.h>
20#include <TRUSTArray.h>
21#include <TRUST_Ref.h>
22#include <Domaine_forward.h>
23
24using ICoCo::TrioField;
25
26class Probleme_base;
27
28/*! @brief This is the base class for all the Fields which can be written by a call to Problem::setInputField
29 *
30 * There are for derived classes for uniform or not / domain or boundary fields.
31 * All are supposed to be time-dependent.
32 *
33 * Each Pb_base keeps a list of references to the Champ_Input_Proto it contains.
34 *
35 *
36 * @sa Champ_Input, Champ_Input_Uniforme, Champ_Front_Input, Champ_Front_Input_Uniforme
37 */
38
40{
41
42public:
43
44 virtual ~Champ_Input_Proto() {};
45 virtual void getTemplate(TrioField& afield) const=0;
46 virtual void setValue(const TrioField& afield)=0;
47 void setInitialValue(const ArrOfDouble& vo);
48 virtual void setDoubleValue(const double val);
49 const Probleme_base& z_probleme() const { return mon_pb.valeur(); }
50
51protected:
52
53 // Factorisation of functions from different input fields
54 void read(Entree& is);
55 void setValueOnTab(const TrioField& afield, DoubleTab& tab);
56
57 // Provide access to similar functions from Champ_base and Champ_front_base
58 // Used by Champ_Input_Proto::read
59 virtual void set_nb_comp(int i)=0; // calls fixer_nb_comp
60 virtual void set_name(const Nom& name)=0; // calls nommer
61
63 bool sous_domaine_ok; // This fields knows how to deal with a sous_domaine
64 OBS_PTR(Sous_Domaine) mon_sous_domaine;
65 ArrOfDouble initial_value_;
66};
67
68#endif
This is the base class for all the Fields which can be written by a call to Problem::setInputField.
virtual void set_name(const Nom &name)=0
virtual void set_nb_comp(int i)=0
OBS_PTR(Sous_Domaine) mon_sous_domaine
void setValueOnTab(const TrioField &afield, DoubleTab &tab)
const Probleme_base & z_probleme() const
void read(Entree &is)
Lecture d'un champ input dans un flot d'entree Factorisation des readOn des differents Champ_input.
OBS_PTR(Probleme_base) mon_pb
virtual void setValue(const TrioField &afield)=0
void setInitialValue(const ArrOfDouble &vo)
virtual void setDoubleValue(const double val)
ArrOfDouble initial_value_
virtual void getTemplate(TrioField &afield) const =0
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
classe Probleme_base C'est un Probleme_U qui n'est pas un couplage.