TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Assembleur_P_PolyMAC_CDO.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 Assembleur_P_PolyMAC_CDO_included
17#define Assembleur_P_PolyMAC_CDO_included
18
19#include <Matrice_Morse_Sym.h>
20#include <Assembleur_base.h>
21#include <Domaine_PolyMAC_CDO.h>
22#include <TRUST_Ref.h>
23
25
27{
28 Declare_instanciable(Assembleur_P_PolyMAC_CDO);
29public:
30 void associer_domaine_dis_base(const Domaine_dis_base&) override;
32 const Domaine_dis_base& domaine_dis_base() const override;
33 const Domaine_Cl_dis_base& domaine_Cl_dis_base() const override;
34
35 int assembler(Matrice&) override;
36 int assembler_rho_variable(Matrice&, const Champ_Don_base& rho) override;
37 int assembler_QC(const DoubleTab&, Matrice&) override;
38 int assembler_mat(Matrice&, const DoubleVect&, int incr_pression, int resoudre_en_u) override;
39
40 int modifier_secmem(DoubleTab&) override;
41 int modifier_solution(DoubleTab&) override;
42
43 void completer(const Equation_base&) override;
44 inline const Equation_base& equation() const { return mon_equation.valeur(); }
45
46 /* corrects velocities for a given pressure correction of type (-Cp, Cv) */
47 void corriger_vitesses(const DoubleTab& dP, DoubleTab& dv) const override
48 {
49 rec.ajouter_multvect(dP, dv);
51 }
52
53protected:
54 OBS_PTR(Equation_base) mon_equation;
55 OBS_PTR(Domaine_PolyMAC_CDO) le_dom_PolyMAC_CDO;
56 OBS_PTR(Domaine_Cl_PolyMAC_family) le_dom_Cl_PolyMAC_CDO;
57
59
60 int has_P_ref = 0, stencil_done = 0;
61#ifdef TRUST_USE_GPU
62 ArrOfTID tab1; //tab1 array of the Matrice_Morse (does not change)
63 BigArrOfInt tab2; //tab2 array of the Matrice_Morse (does not change)
64#else
65 IntVect tab1; //tab1 array of the Matrice_Morse (does not change)
66 IntVect tab2; //tab2 array of the Matrice_Morse (does not change)
67#endif
68 Matrice_Morse rec; //for reconstructing velocities
69};
70
71#endif /* Assembleur_P_PolyMAC_CDO_included */
int assembler_QC(const DoubleTab &, Matrice &) override
Assemble the pressure matrix for a quasi-compressible fluid; laplacian(P) is replaced by div(grad(P)/...
int assembler_rho_variable(Matrice &, const Champ_Don_base &rho) override
Assembly of the matrix div(porosity/rho * grad P) The type of the "rho" field to be provided depends ...
void corriger_vitesses(const DoubleTab &dP, DoubleTab &dv) const override
void completer(const Equation_base &) override
int modifier_secmem(DoubleTab &) override
const Domaine_dis_base & domaine_dis_base() const override
OBS_PTR(Domaine_PolyMAC_CDO) le_dom_PolyMAC_CDO
int assembler_mat(Matrice &, const DoubleVect &, int incr_pression, int resoudre_en_u) override
OBS_PTR(Domaine_Cl_PolyMAC_family) le_dom_Cl_PolyMAC_CDO
const Domaine_Cl_dis_base & domaine_Cl_dis_base() const override
void associer_domaine_dis_base(const Domaine_dis_base &) override
const Equation_base & equation() const
void associer_domaine_cl_dis_base(const Domaine_Cl_dis_base &) override
int modifier_solution(DoubleTab &) override
OBS_PTR(Equation_base) mon_equation
int assembler(Matrice &) override
class Champ_Don_base base class of Given Fields (not calculated)
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
class Equation_base The role of an equation is the calculation of one or more fields....
Matrice_Morse class - Represents a (sparse) matrix M, not necessarily square,.
Matrice class - Generic class in the matrix hierarchy.
Definition Matrice.h:34
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")