TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Assembleur_base.cpp
1/****************************************************************************
2* Copyright (c) 2022, 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#include <Assembleur_base.h>
17
18Implemente_base_sans_constructeur(Assembleur_base,"Assembleur_base",Objet_U);
19
20Assembleur_base::Assembleur_base() :
21 resoudre_increment_pression_(-1),resoudre_en_u_(-1) // -1 means "not initialized"
22
23{
24}
25
26// printOn
27
29{
30 return s << que_suis_je();
31}
32
33
34// readOn
35
37{
38 return is;
39}
40
41/*! @brief Sets the value of the resoudre_increment_pression_ flag.
42 *
43 * This flag determines whether the pressure solver calculates an increment of
44 * pressure between two time steps or the total pressure (this affects
45 * in particular the calculation of boundary conditions).
46 * flag = 0: pressure resolution
47 * flag = 1: pressure increment resolution
48 *
49 */
51{
52 assert(flag == 0 || flag == 1);
53 resoudre_increment_pression_ = flag;
54 return flag;
55}
56
57/*! @brief Returns the value of the resoudre_increment_pression_ flag (0 or 1) Returns -1 if the flag has not been initialized
58 *
59 */
61{
62 return resoudre_increment_pression_;
63}
64
65/*! @brief Sets the value of the resoudre_en_u__ flag.
66 *
67 * This flag determines whether the pressure solver solves for u or for rho*u
68 * (this affects
69 * in particular the calculation of Dirichlet boundary conditions).
70 * flag = 1: u resolution
71 * flag = 0: rho_u resolution
72 *
73 */
75{
76 assert(flag == 0 || flag == 1);
77 resoudre_en_u_ = flag;
78 return flag;
79}
80
81/*! @brief Returns the value of the resoudre_en_u_ flag (0 or 1) Returns -1 if the flag has not been initialized
82 *
83 */
85{
86 return resoudre_en_u_;
87}
88
89/*! @brief Assembly of the matrix div(porosity/rho * grad P) The type of the "rho" field to be provided depends on the discretization (vdf, vef, p1b, .
90 *
91 * ..)
92 * For front-tracking for example.
93 *
94 */
96{
97 Cerr << "Error in Assembleur_base::assembler_rho_variable\n";
98 Cerr << "This method has not been implemented for ";
99 Cerr << que_suis_je() << finl;
100 assert(0);
101 exit();
102 return 0;
103}
104
105int Assembleur_base::assembler_QC(const DoubleTab&, Matrice& matrice)
106{
107 Cerr << "Stop in Assembleur_base::assembler_QC." << finl;
108 assert(0);
109 exit();
110 return 1;
111}
112
114{
115 ;
116}
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...
int set_resoudre_en_u(int flag)
Sets the value of the resoudre_en_u__ flag.
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 int assembler_QC(const DoubleTab &, Matrice &)
int set_resoudre_increment_pression(int flag)
Sets the value of the resoudre_increment_pression_ flag.
virtual void completer(const Equation_base &)=0
class Champ_Don_base base class of Given Fields (not calculated)
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
class Equation_base The role of an equation is the calculation of one or more fields....
Matrice class - Generic class in the matrix hierarchy.
Definition Matrice.h:34
Base class for TRUST objects (Objet_U).
Definition Objet_U.h:68
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
Base class for output streams.
Definition Sortie.h:52