TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Op_Grad_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 Op_Grad_DG_included
17#define Op_Grad_DG_included
18
19#include <Domaine_DG.h>
20#include <Operateur_Grad.h>
21#include <TRUST_Ref.h>
22
23class Domaine_Cl_DG;
24
25/**
26 * @brief DG gradient operator acting on a DG pressure field to produce a velocity-space residual.
27 *
28 * This class implements the DG discretization of the pressure gradient operator used in
29 * the incompressible Navier-Stokes momentum equation. It assembles the coupling between
30 * pressure DOFs and velocity DOFs through the interface_blocs mechanism.
31 *
32 * The weak formulation integrates -grad(p_h) against velocity test functions v_h:
33 * - *Volume term*: integral of grad(p_h) . v_h (element-wise, by parts)
34 * - *Internal face term*: integral of {{p_h}} * [v_h . n] (average-jump coupling)
35 *
36 * This formulation is the transpose of the divergence operator assembled by Op_Div_DG
37 * in the continuous sense. However, Op_Grad_DG and Op_Div_DG use independent
38 * implementations: Op_Grad_DG integrates grad(phi_p) . phi_v on element volumes and
39 * {{phi_p}} * [phi_v . n] on faces, while Op_Div_DG integrates phi_p * div(phi_v) and
40 * [phi_v . n] * {{phi_p}}. Both produce the same matrix up to a sign when the two
41 * basis sets are compatible, but they are kept separate to allow independent tuning.
42 *
43 * @sa Op_Div_DG, Operateur_Grad_base
44 */
46{
47 Declare_instanciable(Op_Grad_DG);
48public:
49
50 void associer(const Domaine_dis_base&, const Domaine_Cl_dis_base&, const Champ_Inc_base&) override;
51
52 inline int has_interface_blocs() const override { return 1; }
53 void dimensionner_blocs(matrices_t matrices, const tabs_t& semi_impl = {}) const override;
54
55 void ajouter_blocs(matrices_t matrices, DoubleTab& secmem, const tabs_t& semi_impl = { }) const override;
56 DoubleTab& calculer(const DoubleTab&, DoubleTab&) const override;
57 int impr(Sortie& os) const override;
58
59protected:
60 OBS_PTR(Domaine_DG) le_dom_DG;
62};
63
64#endif /* Op_Grad_DG_included */
Classe Champ_Inc_base.
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.
friend class Sortie
Definition Objet_U.h:75
DG gradient operator acting on a DG pressure field to produce a velocity-space residual.
Definition Op_Grad_DG.h:46
void ajouter_blocs(matrices_t matrices, DoubleTab &secmem, const tabs_t &semi_impl={ }) const override
Assembles the DG gradient operator into the matrix and right-hand side.
int impr(Sortie &os) const override
DOES NOTHING - to override in derived classes.
OBS_PTR(Domaine_DG) le_dom_DG
void dimensionner_blocs(matrices_t matrices, const tabs_t &semi_impl={}) const override
Sizes the velocity-pressure matrix block for the gradient operator.
DoubleTab & calculer(const DoubleTab &, DoubleTab &) const override
void associer(const Domaine_dis_base &, const Domaine_Cl_dis_base &, const Champ_Inc_base &) override
Associates the operator with a DG domain and its boundary conditions.
int has_interface_blocs() const override
Definition Op_Grad_DG.h:52
OBS_PTR(Domaine_Cl_DG) le_dcl_DG
Classe Operateur_Grad_base Cette classe est la base de la hierarchie des operateurs representant.