TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Operateur.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 Operateur_included
17#define Operateur_included
18
19#include <TRUSTTabs_forward.h>
20#include <TRUST_Ref.h>
21#include <MorEqn.h>
22#include <Motcle.h>
23
25class Operateur_base;
26class Champ_Inc_base;
27
28/*! @brief class Operateur Generic class of the operator hierarchy.
29 *
30 * This generic class is special because it does NOT INHERIT
31 * from OWN_PTR(Operateur_base) but from MorEqn.
32 * A reference to an Operateur_base is returned by the method
33 * Operateur::l_op_base() which is pure virtual and must be overridden
34 * in derived classes.
35 *
36 * @sa MorEqn Operateur_base, Abstract class, Abstract methods:, Operateur_base& l_op_base(), const Operateur_base& l_op_base() const, DoubleTab& calculer(const DoubleTab&,DoubleTab& ) const, DoubleTab& calculer(const DoubleTab&,DoubleTab& ) const
37 */
38class Operateur : public MorEqn
39{
40public :
41
43 virtual const Operateur_base& l_op_base() const=0;
44 virtual DoubleTab& ajouter(const DoubleTab&, DoubleTab& ) const=0;
45 virtual DoubleTab& calculer(const DoubleTab&,DoubleTab& ) const=0;
46 DoubleTab& ajouter(const Champ_Inc_base&, DoubleTab& ) const;
47 DoubleTab& calculer(const Champ_Inc_base&,DoubleTab& ) const;
48 DoubleTab& ajouter(DoubleTab& ) const;
49 DoubleTab& calculer(DoubleTab& ) const;
50 const Nom& type() const;
51 double calculer_pas_de_temps() const;
52 void calculer_pas_de_temps_locaux(DoubleTab&) const; //Local time step calculation
53 int impr(Sortie& os) const;
54
55 virtual void typer()=0;
56 virtual void completer();
57 virtual void mettre_a_jour(double temps);
58 const Champ_Inc_base& mon_inconnue() const;
60 int limpr() const;
61 void imprimer(Sortie& os) const;
62 Sortie& ecrire(Sortie& ) const;
63 Entree& lire(Entree& );
64 void ajouter_contribution_explicite_au_second_membre(const Champ_Inc_base& inconnue, DoubleTab& derivee) const;
65 void associer_champ(const Champ_Inc_base&, const std::string& nom_ch);
66
67 void set_fichier(const Nom& nom);
68 void set_description(const Nom& nom);
69 // Method op_non_nul declared because Operateur does not derive from OWN_PTR(Operateur_base)
70 // and therefore does not have access to the non_nul method
71 virtual int op_non_nul() const =0;
72
73protected :
74 std::string nom_inco_;
75 OBS_PTR(Champ_Inc_base) le_champ_inco;
77};
78#endif
Class Champ_Inc_base.
class Discretisation_base This class represents a spatial discretization scheme, which
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
class MorEqn Class that groups the functionalities of linking with an
Definition MorEqn.h:35
A character string (Nom) in uppercase.
Definition Motcle.h:26
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
class Operateur_base This class is the base of the hierarchy of objects representing an
class Operateur Generic class of the operator hierarchy.
Definition Operateur.h:39
std::string nom_inco_
Definition Operateur.h:74
const Champ_Inc_base & mon_inconnue() const
Returns the field representing the unknown of the equation to which the operator belongs.
virtual Operateur_base & l_op_base()=0
virtual void typer()=0
virtual int op_non_nul() const =0
Entree & lire(Entree &)
Reads an operator from an input stream.
Definition Operateur.cpp:44
double calculer_pas_de_temps() const
Computes the next time step.
int limpr() const
Asks the equation whether printing is needed. Returns 1 for YES, 0 otherwise.
int impr(Sortie &os) const
Prints the operator to an output stream unconditionally.
virtual DoubleTab & calculer(const DoubleTab &, DoubleTab &) const =0
Sortie & ecrire(Sortie &) const
Definition Operateur.cpp:24
void imprimer(Sortie &os) const
Prints the operator to an output stream, if necessary.
virtual void mettre_a_jour(double temps)
Performs a time update of the operator.
const Nom & type() const
Returns the (name of the) type of operator to create.
virtual const Operateur_base & l_op_base() const =0
const Discretisation_base & discretisation() const
Returns the discretization of the equation to which the operator belongs.
void ajouter_contribution_explicite_au_second_membre(const Champ_Inc_base &inconnue, DoubleTab &derivee) const
virtual DoubleTab & ajouter(const DoubleTab &, DoubleTab &) const =0
void set_description(const Nom &nom)
virtual void completer()
Updates the references of the objects associated with the operator.
OBS_PTR(Champ_Inc_base) le_champ_inco
void set_fichier(const Nom &nom)
Motcle typ
Definition Operateur.h:76
void associer_champ(const Champ_Inc_base &, const std::string &nom_ch)
void calculer_pas_de_temps_locaux(DoubleTab &) const
Calculate the next local time steps.
Base class for output streams.
Definition Sortie.h:52