TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Terme_Source_Qdm_Elem_DG.h
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#ifndef Terme_Source_Qdm_Elem_DG_included
17#define Terme_Source_Qdm_Elem_DG_included
18
19#include <Terme_Source_Qdm.h>
20#include <Source_base.h>
21#include <TRUST_Ref.h>
22#include <Champ_Fonc_Quad_DG.h>
23#include <Probleme_base.h>
24
25class Domaine_Cl_DG;
26class Domaine_DG;
27
28/**
29 * @brief DG momentum source term for element-based velocity unknowns.
30 *
31 * This class adds a volumetric body force f(x) to the momentum right-hand side.
32 * The contribution to the DG weak form for each element e and each velocity DOF (fb, d) is:
33 * secmem(e, fb + d*nb_bfunc) += integral of f_d(x) * phi_fb(x) dV
34 * using a fixed order-5 quadrature rule.
35 *
36 * The source field is read from the input stream as a Champ_Don_base (la_source),
37 * then projected onto the DG quadrature representation (la_source_DG) of type
38 * Champ_Fonc_Quad_DG, which stores the field values pre-sampled at quadrature points.
39 * Both uniform and spatially varying source fields are supported: for a Champ_Uniforme
40 * the same value is used for all elements (index 0 in la_source_DG).
41 *
42 * The class has no matrix contribution (dimensionner_blocs() is a no-op).
43 *
44 * @sa Source_base, Terme_Source_Qdm
45 */
47{
48 Declare_instanciable(Terme_Source_Qdm_Elem_DG);
49public:
50 int has_interface_blocs() const override { return 1; }
51
52 void dimensionner_blocs(matrices_t matrices, const tabs_t& semi_impl = {}) const override { } //rien
53 void ajouter_blocs(matrices_t matrices, DoubleTab& secmem, const tabs_t& semi_impl = {}) const override;
54
55 void associer_pb(const Probleme_base& ) override { }
56 void mettre_a_jour(double ) override;
57
58protected:
59 OBS_PTR(Domaine_DG) le_dom_DG;
60 OBS_PTR(Domaine_Cl_DG) le_dom_Cl_DG;
61 void associer_domaines(const Domaine_dis_base& ,const Domaine_Cl_dis_base& ) override;
62
63 OWN_PTR(Champ_Don_base) la_source_DG;
64};
65
66#endif /* Terme_Source_Qdm_Elem_DG_included */
classe Champ_Don_base classe de base des Champs donnes (non calcules)
classe Domaine_Cl_dis_base Les objets Domaine_Cl_dis_base representent les conditions aux limites
classe Domaine_dis_base Cette classe est la base de la hierarchie des domaines discretisees.
classe Probleme_base C'est un Probleme_U qui n'est pas un couplage.
classe Source_base Un objet Source_base est un terme apparaissant au second membre d'une
Definition Source_base.h:42
DG momentum source term for element-based velocity unknowns.
void dimensionner_blocs(matrices_t matrices, const tabs_t &semi_impl={}) const override
void mettre_a_jour(double) override
DOES NOTHING - to override in derived classes.
OWN_PTR(Champ_Don_base) la_source_DG
OBS_PTR(Domaine_DG) le_dom_DG
void associer_domaines(const Domaine_dis_base &, const Domaine_Cl_dis_base &) override
int has_interface_blocs() const override
void ajouter_blocs(matrices_t matrices, DoubleTab &secmem, const tabs_t &semi_impl={}) const override
Assembles the momentum source contribution into the right-hand side.
OBS_PTR(Domaine_Cl_DG) le_dom_Cl_DG
void associer_pb(const Probleme_base &) override
Classe Terme_Source_Qdm Cette classe represente un terme source qui figure dans l'equation.