TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Champ_implementation.cpp
1/****************************************************************************
2* Copyright (c) 2022, 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 <Champ_implementation.h>
17#include <Champ_Fonc_base.h>
18#include <Champ_Inc_base.h>
19#include <Domaine_VF.h>
20#include <Domaine.h>
21
22DoubleTab& Champ_implementation::valeur_aux_sommets(const Domaine& domain, DoubleTab& result) const
23{
24 Nom domain_name = domain.le_nom();
25 Nom support_name = get_domaine_geom().le_nom();
26
27 if (domain_name == support_name)
28 {
30 }
31 else
32 {
33 const DoubleTab& positions = domain.coord_sommets();
34 le_champ().valeur_aux(positions, result);
35 }
36
37 return result;
38}
39
40DoubleVect& Champ_implementation::valeur_aux_sommets_compo(const Domaine& domain, DoubleVect& result, int ncomp) const
41{
42 Nom domain_name = domain.le_nom();
43 Nom support_name = get_domaine_geom().le_nom();
44
45 if (domain_name == support_name)
46 {
47 valeur_aux_sommets_compo_impl(result, ncomp);
48 }
49 else
50 {
51 const DoubleTab& positions = domain.coord_sommets();
52 le_champ().valeur_aux_compo(positions, result, ncomp);
53 }
54
55 return result;
56}
57
59{
60 const Champ_base& ch_base = le_champ();
61
62 if (sub_type(Champ_Inc_base, ch_base))
63 {
64 const Champ_Inc_base& ch_inc = ref_cast(Champ_Inc_base, ch_base);
65 return ref_cast(Domaine_VF, ch_inc.domaine_dis_base());
66 }
67 else if (sub_type(Champ_Fonc_base, ch_base))
68 {
69 const Champ_Fonc_base& ch_fonc = ref_cast(Champ_Fonc_base, ch_base);
70 return ref_cast(Domaine_VF, ch_fonc.domaine_dis_base());
71 }
72 else
73 {
74 Cerr << le_champ().que_suis_je() << " do not know/refer to a Domaine_VF !" << finl;
76 return get_domaine_dis();
77 }
78}
79
81{
82 return get_domaine_dis().domaine();
83}
classe Champ_Fonc_base Classe de base des champs qui sont fonction d'une grandeur calculee
const Domaine_dis_base & domaine_dis_base() const override
Classe Champ_Inc_base.
const Domaine_dis_base & domaine_dis_base() const override
classe Champ_base Cette classe est la base de la hierarchie des champs.
Definition Champ_base.h:43
virtual DoubleTab & valeur_aux(const DoubleTab &positions, DoubleTab &valeurs) const
Provoque une erreur ! Doit etre surchargee par les classes derivees.
virtual DoubleVect & valeur_aux_compo(const DoubleTab &positions, DoubleVect &valeurs, int ncomp) const
Idem que valeur_aux(const DoubleTab &, DoubleTab &), mais calcule uniquement la composante compo du c...
virtual DoubleVect & valeur_aux_sommets_compo(const Domaine &domain, DoubleVect &result, int ncomp) const
const Domaine & get_domaine_geom() const
virtual Champ_base & le_champ()=0
virtual DoubleTab & valeur_aux_sommets(const Domaine &domain, DoubleTab &result) const
virtual DoubleTab & valeur_aux_sommets_impl(DoubleTab &result) const =0
const Domaine_VF & get_domaine_dis() const
virtual DoubleVect & valeur_aux_sommets_compo_impl(DoubleVect &result, int ncomp) const =0
const DoubleTab_t & coord_sommets() const
Definition Domaine.h:112
class Domaine_VF
Definition Domaine_VF.h:44
const Nom & le_nom() const override
Donne le nom de l'Objet_U Methode a surcharger : renvoie "neant" dans cette implementation.
const Domaine & domaine() const
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
Definition Objet_U.cpp:104
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455