TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Op_Diff_PolyMAC_CDO_Gen_base.h
1/****************************************************************************
2* Copyright (c) 2025, 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_Diff_PolyMAC_CDO_Gen_base_included
17#define Op_Diff_PolyMAC_CDO_Gen_base_included
18
19#include <Operateur_Diff_base.h>
20#include <TRUST_Ref.h>
21#include <SFichier.h>
22
25
26/*! @brief class Op_Diff_PolyMAC_CDO_Gen_base
27 *
28 * Generic base class for PolyMAC_CDO diffusion operators.
29 *
30 */
32{
33 Declare_base(Op_Diff_PolyMAC_CDO_Gen_base);
34public:
35 void associer(const Domaine_dis_base&, const Domaine_Cl_dis_base&, const Champ_Inc_base&) override;
36 void associer_diffusivite(const Champ_base& diffu) override { diffusivite_ = diffu; }
37 const Champ_base& diffusivite() const override { return diffusivite_.valeur(); }
38
39 DoubleTab& calculer(const DoubleTab&, DoubleTab&) const override;
40 virtual void modifier_mu(DoubleTab&) const { }
41
42 /* overridable methods in derived classes to modify nu before computing the gradients in update_nu_xwh */
43 virtual int dimension_min_nu() const /* minimum dimension of nu / nu_bord per component */
44 {
45 return 1;
46 }
47
48 /* diffusivity / conductivity. Note: stored as nu(element, component[, dim 1[, dim 2]]) */
49 inline const DoubleTab& nu() const /* at elements */
50 {
51 if (!nu_a_jour_) update_nu();
52 return nu_;
53 }
54
55 virtual void update_nu() const = 0; //update
56
57 int impr(Sortie& os) const override;
58
59 inline const Domaine_PolyMAC_CDO& domaine_poly() const { return le_dom_poly_.valeur(); }
60 inline const Domaine_Cl_PolyMAC_family& domaine_cl_poly() const { return la_zcl_poly_.valeur(); }
61
62protected:
63 mutable SFichier Flux, Flux_moment, Flux_sum; // Fichiers .out
64 mutable DoubleTab nu_; // diffusivity at elements
65 mutable int nu_a_jour_ = 0, nu_constant_ = 0 /* Elie: for valgrind */; // whether nu needs updating, whether nu is constant
66
69 OBS_PTR(Champ_base) diffusivite_;
70};
71
72#endif /* Op_Diff_PolyMAC_CDO_Gen_base_included */
73
Class Champ_Inc_base.
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
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.
friend class Sortie
Definition Objet_U.h:70
class Op_Diff_PolyMAC_CDO_Gen_base
int impr(Sortie &os) const override
DOES NOTHING - to override in derived classes.
virtual void modifier_mu(DoubleTab &) const
const Domaine_PolyMAC_CDO & domaine_poly() const
const Champ_base & diffusivite() const override
void associer_diffusivite(const Champ_base &diffu) override
const Domaine_Cl_PolyMAC_family & domaine_cl_poly() const
OBS_PTR(Domaine_PolyMAC_CDO) le_dom_poly_
OBS_PTR(Champ_base) diffusivite_
DoubleTab & calculer(const DoubleTab &, DoubleTab &) const override
void associer(const Domaine_dis_base &, const Domaine_Cl_dis_base &, const Champ_Inc_base &) override
virtual void update_nu() const =0
OBS_PTR(Domaine_Cl_PolyMAC_family) la_zcl_poly_
Operateur_Diff_base This class is the base of the hierarchy of operators representing.
SFichier is to the C++ ofstream class what Sortie is to the C++ ostream class.
Definition SFichier.h:29