TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Masse_DG_base.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 Masse_DG_base_included
17#define Masse_DG_base_included
18
19#include <Solveur_Masse_base.h>
20#include <TRUST_Ref.h>
21
22class Domaine_Cl_DG;
23class Domaine_DG;
24
25/**
26 * @brief Abstract base class for the DG mass matrix operator.
27 *
28 * This class assembles and applies the element-wise L2 mass matrix arising in the
29 * DG time discretization. The mass term appears in the implicit time scheme as:
30 * (M/dt) * u^{n+1} = (M/dt) * u^n + RHS
31 *
32 * Two assembly strategies are supported depending on whether the basis is
33 * orthonormalized via Gram-Schmidt (gram_schmidt flag on Domaine_DG):
34 *
35 * - **Orthonormal basis** (gram_schmidt == true): The mass matrix is diagonal,
36 * with entries equal to the element volume (since the basis is L2-normalized
37 * by volume). The sparsity pattern is therefore purely diagonal (nb_bfunc
38 * entries per element per spatial dimension).
39 *
40 * - **Non-orthonormal basis** (gram_schmidt == false): The mass matrix is a dense
41 * nb_bfunc x nb_bfunc block per element, assembled by numerical quadrature as
42 * M_ij = integral of phi_i * phi_j. The sparsity pattern is a full local block.
43 *
44 * An optional temporal coefficient (e.g., density or porosity) can be applied
45 * element-wise via appliquer_coef(), which multiplies the mass entries by a field
46 * retrieved by name from the equation (name_of_coefficient_temporel_).
47 *
48 * Derived classes must implement appliquer_impl(), which applies M^{-1} to a
49 * right-hand side vector (used for explicit time stepping or lumped-mass inversion).
50 *
51 * @sa Masse_DG_Elem, Solveur_Masse_base
52 */
54{
55 Declare_base(Masse_DG_base);
56public:
57
58 void associer_domaine_dis_base(const Domaine_dis_base& ) override;
60 void appliquer_coef(DoubleVect& coef) const;
61
62 inline int has_interface_blocs() const override { return 1; }
63 void dimensionner_blocs(matrices_t matrices, const tabs_t& semi_impl) const override;
64 void ajouter_blocs(matrices_t matrices, DoubleTab& secmem, double dt, const tabs_t& semi_impl, int resoudre_en_increments) const override;
65
66protected:
67 OBS_PTR(Domaine_DG) le_dom_dg_;
68 OBS_PTR(Domaine_Cl_DG) le_dom_Cl_dg_;
69};
70
71#endif /* Masse_DG_base_included */
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.
Abstract base class for the DG mass matrix operator.
void associer_domaine_cl_dis_base(const Domaine_Cl_dis_base &) override
int has_interface_blocs() const override
OBS_PTR(Domaine_DG) le_dom_dg_
void dimensionner_blocs(matrices_t matrices, const tabs_t &semi_impl) const override
Builds the sparsity pattern of the mass matrix block.
void associer_domaine_dis_base(const Domaine_dis_base &) override
OBS_PTR(Domaine_Cl_DG) le_dom_Cl_dg_
void appliquer_coef(DoubleVect &coef) const
Multiplies the mass coefficient vector element-wise by an optional temporal field.
void ajouter_blocs(matrices_t matrices, DoubleTab &secmem, double dt, const tabs_t &semi_impl, int resoudre_en_increments) const override
Assembles the mass matrix contribution (M/dt) into the matrix and right-hand side.
classe Solveur_Masse_base Represente la matrice de masse d'une equation.