TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Assembleur_base.h
1/****************************************************************************
2* Copyright (c) 2023, 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_base_included
17#define Assembleur_base_included
18
19#include <TRUSTTabs_forward.h>
20#include <Equation_base.h>
21#include <SolveurSys.h>
22
25class Champ_Don_base;
27class Matrice;
28
30{
31 Declare_base(Assembleur_base);
32public:
35 int set_resoudre_en_u(int flag);
36 int get_resoudre_en_u() const;
37 virtual int assembler(Matrice&)=0;
38 inline virtual int assembler_mat(Matrice&, const DoubleVect&, int incr_pression, int resoudre_en_u)
39 {
40 Cerr << "assembler_mat(Matrice&,const DoubleVect&,int incr_pression,int resoudre_en_u) must be overloaded by " << que_suis_je() << finl;
41 exit();
42 return 1;
43 }
44
45 virtual int assembler_rho_variable(Matrice&, const Champ_Don_base& rho);
46 virtual int assembler_QC(const DoubleTab&, Matrice&);
47 virtual void completer(const Equation_base&) =0;
50 virtual const Domaine_dis_base& domaine_dis_base() const =0;
51 virtual const Domaine_Cl_dis_base& domaine_Cl_dis_base() const =0;
52 virtual int modifier_secmem(DoubleTab&)=0;
53 /* accounting for pressure variations at boundary conditions during pressure increment calculation.
54 Used only by PolyMAC_HFV. fac is the coefficient such that p_final - press = fac * sol */
55 virtual void modifier_secmem_pour_incr_p(const DoubleTab& press, const double fac, DoubleTab& incr) const { };
56 virtual int modifier_solution(DoubleTab&)=0;
57
58 /* sizing / assembly of the continuity equation sum_k alpha_k = 1 in Pb_continuite */
59 /* same interface as dimensionner/assembler_blocs in Equation_base */
60 virtual void dimensionner_continuite(matrices_t matrices, int aux_only = 0) const
61 {
62 Process::exit(Nom("dimensionner_continuite(...) must be overloaded by ") + que_suis_je());
63 }
64
65 virtual void assembler_continuite(matrices_t matrices, DoubleTab& secmem, int aux_only = 0) const
66 {
67 Process::exit(Nom("assembler_continuite(...) must be overloaded by ") + que_suis_je());
68 }
69
70 virtual DoubleTab norme_continuite() const
71 {
72 Process::exit(Nom("norme_continuite(...) must be overloaded by ") + que_suis_je());
73 return DoubleTab();
74 }
75
76 virtual void corriger_vitesses(const DoubleTab& dP, DoubleTab& dv) const
77 {
78 Process::exit(Nom("corriger_vitesses(...) must be overloaded by ") + que_suis_je());
79 }
80
81private:
82 // Flag, indicates whether the solver solves a pressure increment or
83 // the pressure.
84 int resoudre_increment_pression_;
85 int resoudre_en_u_;
86};
87
88#endif
89
90
virtual void assembler_continuite(matrices_t matrices, DoubleTab &secmem, int aux_only=0) const
virtual int assembler_mat(Matrice &, const DoubleVect &, int incr_pression, int resoudre_en_u)
virtual int modifier_secmem(DoubleTab &)=0
virtual int assembler_rho_variable(Matrice &, const Champ_Don_base &rho)
Assembly of the matrix div(porosity/rho * grad P) The type of the "rho" field to be provided depends ...
int get_resoudre_en_u() const
Returns the value of the resoudre_en_u_ flag (0 or 1) Returns -1 if the flag has not been initialized...
virtual DoubleTab norme_continuite() const
virtual const Domaine_dis_base & domaine_dis_base() const =0
virtual const Domaine_Cl_dis_base & domaine_Cl_dis_base() const =0
virtual int assembler(Matrice &)=0
int set_resoudre_en_u(int flag)
Sets the value of the resoudre_en_u__ flag.
virtual void associer_domaine_cl_dis_base(const Domaine_Cl_dis_base &)=0
int get_resoudre_increment_pression() const
Returns the value of the resoudre_increment_pression_ flag (0 or 1) Returns -1 if the flag has not be...
virtual void associer_domaine_dis_base(const Domaine_dis_base &)=0
virtual int modifier_solution(DoubleTab &)=0
virtual void dimensionner_continuite(matrices_t matrices, int aux_only=0) const
virtual int assembler_QC(const DoubleTab &, Matrice &)
int set_resoudre_increment_pression(int flag)
Sets the value of the resoudre_increment_pression_ flag.
virtual void modifier_secmem_pour_incr_p(const DoubleTab &press, const double fac, DoubleTab &incr) const
virtual void completer(const Equation_base &)=0
virtual void corriger_vitesses(const DoubleTab &dP, DoubleTab &dv) const
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_Sym class - Represents a sparse symmetric matrix M stored in Morse format.
Matrice class - Generic class in the matrix hierarchy.
Definition Matrice.h:34
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
Objet_U()
Default constructor: assigns a unique identifier to the object (object_id_) and registers the object ...
Definition Objet_U.cpp:54
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466