TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Interpolation_IBM_mean_gradient.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 <Interpolation_IBM_mean_gradient.h>
17#include <TRUSTTrav.h>
18
19#include <Domaine.h>
20#include <Param.h>
21#include <Source_PDF_base.h>
22
23Implemente_instanciable( Interpolation_IBM_mean_gradient, "Interpolation_IBM_gradient_moyen|IBM_gradient_moyen", Interpolation_IBM_base ) ;
24// XD interpolation_ibm_mean_gradient interpolation_ibm_base ibm_gradient_moyen BRACE Immersed Boundary Method (IBM):
25// XD_CONT mean gradient interpolation.
26
28{
29 return Objet_U::printOn( os );
30}
31
33{
34 Param param(que_suis_je());
35 param.ajouter("points_solides",&solid_points_lu_,Param::OPTIONAL); // XD_ADD_P field_base
36 // XD_CONT Node field giving the projection of the node on the immersed boundary
37 param.ajouter("est_dirichlet",&is_dirichlet_lu_,Param::OPTIONAL); // XD_ADD_P field_base
38 // XD_CONT Node field of booleans indicating whether the node belong to an element where the interface is
39 param.ajouter("correspondance_elements",&corresp_elems_lu_,Param::OPTIONAL); // XD_ADD_P field_base
40 // XD_CONT Cell field giving the SALOME cell number
41 param.ajouter("elements_solides",&solid_elems_lu_,Param::OPTIONAL); // XD_ADD_P field_base
42 // XD_CONT Node field giving the element number containing the solid point
43 param.ajouter_flag("get_solid_points_from_prepro", &solid_points_from_prepro_); // XD_ADD_P rien
44 // XD_CONT get IBM solid points from prepro.
45 param.ajouter_flag("get_solid_elems_from_prepro", &solid_elems_from_prepro_); // XD_ADD_P rien
46 // XD_CONT get IBM solid elems from prepro.
47 param.ajouter_flag("get_is_dirichlet_from_prepro", &is_dirichlet_from_prepro_); // XD_ADD_P rien
48 // XD_CONT get IBM is_dirichlet from prepro.
49 param.ajouter_flag("get_corresp_elems_from_prepro", &corresp_elems_from_prepro_); // XD_ADD_P rien
50 // XD_CONT get IBM corresp_elems from prepro.
51 param.lire_avec_accolades_depuis(is);
52 return is;
53}
54
56{
58 int nb_comp = Objet_U::dimension;
59 Noms units(nb_comp);
60 Noms c_nam(nb_comp);
61
62 if (corresp_elems_) has_corresp_ = true;
63
64 dis.discretiser_champ("champ_sommets",le_dom_,"solid_elems","none",1,0., solid_elems_);
66 {
67 OBS_PTR(Prepro_IBM_base) my_prep = my_source_->getpreproLu();
68 if (my_prep)
69 {
70 DoubleTab& the_values = ref_cast_non_const(DoubleTab, my_prep->get_champ_solid_elems());
71 solid_elems_->valeurs() = the_values;
72 }
73 }
74 else
75 {
76 if (solid_elems_lu_) solid_elems_->affecter(solid_elems_lu_);
77 }
78
79 if(!is_dirichlet_)
80 {
81 Cerr<<"Interpolation_IBM_mean_gradient: field est_dirichlet is required. exit()"<<finl;
83 }
84 else
85 my_is_dirichlet_ = is_dirichlet_;
86 computeSommetsVoisins(le_dom_, solid_points_, corresp_elems_, has_corresp_);
87}
88
classe Discretisation_base Cette classe represente un schema de discretisation en espace,...
void discretiser_champ(const Motcle &directive, const Domaine_dis_base &z, const Nom &nom, const Nom &unite, int nb_comp, int nb_pas_dt, double temps, OWN_PTR(Champ_Inc_base)&champ, const Nom &sous_type=NOM_VIDE) const
classe Domaine_dis_base Cette classe est la base de la hierarchie des domaines discretisees.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual void set_fields_from_prepro_to_interp(Prepro_IBM_base &)
virtual void discretise(const Discretisation_base &, Domaine_dis_base &)
OBS_PTR(Source_PDF_base) my_source_
void computeSommetsVoisins(Domaine_dis_base &le_dom_, const Champ_Don_base &solid_points, const Champ_Don_base &corresp_elems, bool has_corres)
void discretise(const Discretisation_base &, Domaine_dis_base &le_dom_) override
void set_fields_from_prepro_to_interp(Prepro_IBM_base &) override
Un tableau de chaine de caracteres (VECT(Nom)).
Definition Noms.h:26
static int dimension
Definition Objet_U.h:99
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
@ OPTIONAL
Definition Param.h:115
const DoubleTab & get_champ_solid_elems()
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
Classe de base des flux de sortie.
Definition Sortie.h:52