TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Champ_Inc_P0_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 Champ_Inc_P0_base_included
17#define Champ_Inc_P0_base_included
18
19#include <Champ_implementation_P0.h>
20#include <Champ_Inc_base.h>
21#include <TRUST_Ref.h>
22#include <Domaine_VF.h>
23
24/*! @brief : class Champ_Inc_P0_base
25 *
26 * Describe here the Champ_Inc_P0_base class
27 *
28 */
30{
31 Declare_base(Champ_Inc_P0_base);
32public :
33 double valeur_au_bord(int face) const;
34
35 DoubleTab& trace(const Frontiere_dis_base&, DoubleTab&, double,int distant ) const override;
36 Champ_base& affecter_(const Champ_base& ) override ;
37 int fixer_nb_valeurs_nodales(int n) override;
38
39 //utility arrays for boundary conditions: fcl(f, .) = (BC type, BC number, index in BC)
40 //BC types: 0 -> no BC
41 // 1 -> Echange_externe_impose
42 // 2 -> Echange_global_impose
43 // 3 -> Echange_contact_PolyMAC_HFV
44 // 4 -> Neumann_paroi
45 // 5 -> Neumann_val_ext or Neumann_homogene or Symetrie
46 // 6 -> Dirichlet
47 // 7 -> Dirichlet_homogene
48 inline const IntTab& fcl() const
49 {
50 if (!fcl_init_) init_fcl();
51 return fcl_;
52 }
53
54 inline DoubleVect& valeur_a_elem(const DoubleVect& position, DoubleVect& result, int poly) const override
55 {
56 return Champ_implementation_P0::valeur_a_elem(position,result,poly);
57 }
58
59 inline double valeur_a_elem_compo(const DoubleVect& position, int poly, int ncomp) const override
60 {
61 return Champ_implementation_P0::valeur_a_elem_compo(position,poly,ncomp);
62 }
63
64 inline DoubleTab& valeur_aux_elems(const DoubleTab& positions, const IntVect& polys, DoubleTab& result) const override
65 {
66 return Champ_implementation_P0::valeur_aux_elems(positions,polys,result);
67 }
68
69 inline DoubleVect& valeur_aux_elems_compo(const DoubleTab& positions, const IntVect& polys, DoubleVect& result, int ncomp) const override
70 {
71 return Champ_implementation_P0::valeur_aux_elems_compo(positions,polys,result,ncomp);
72 }
73
74 inline DoubleTab& remplir_coord_noeuds(DoubleTab& positions) const override
75 {
77 }
78
79 inline int remplir_coord_noeuds_et_polys(DoubleTab& positions, IntVect& polys) const override
80 {
82 }
83
84 inline DoubleTab& valeur_aux_sommets(const Domaine& domain, DoubleTab& result) const override
85 {
86 return Champ_implementation::valeur_aux_sommets(domain,result);
87 }
88
89 inline DoubleVect& valeur_aux_sommets_compo(const Domaine& domain, DoubleVect& result, int ncomp) const override
90 {
91 return Champ_implementation::valeur_aux_sommets_compo(domain,result,ncomp);
92 }
93
94protected:
95 Champ_base& le_champ() override { return *this; }
96 const Champ_base& le_champ() const override { return *this; }
97
98 virtual void init_fcl() const;
99 mutable IntTab fcl_;
100 mutable int fcl_init_ = 0; // fcl(f, .) = (BC type, BC number, index in BC)
101};
102
103#endif /* Champ_Inc_P0_base_included */
: class Champ_Inc_P0_base
DoubleVect & valeur_a_elem(const DoubleVect &position, DoubleVect &result, int poly) const override
Causes an error! Must be overridden by derived classes.
const Champ_base & le_champ() const override
virtual void init_fcl() const
Champ_base & le_champ() override
int remplir_coord_noeuds_et_polys(DoubleTab &positions, IntVect &polys) const override
DOES NOTHING. Method to override.
DoubleTab & remplir_coord_noeuds(DoubleTab &positions) const override
DoubleTab & valeur_aux_elems(const DoubleTab &positions, const IntVect &polys, DoubleTab &result) const override
Causes an error! Must be overridden by derived classes.
DoubleVect & valeur_aux_elems_compo(const DoubleTab &positions, const IntVect &polys, DoubleVect &result, int ncomp) const override
Causes an error! Must be overridden by derived classes.
DoubleVect & valeur_aux_sommets_compo(const Domaine &domain, DoubleVect &result, int ncomp) const override
Returns the compo-th value at the vertices of dom.
double valeur_au_bord(int face) const
DoubleTab & trace(const Frontiere_dis_base &, DoubleTab &, double, int distant) const override
Trace of the P0 field on the boundary.
double valeur_a_elem_compo(const DoubleVect &position, int poly, int ncomp) const override
Causes an error! Must be overridden by derived classes.
Champ_base & affecter_(const Champ_base &) override
Assignment of a generic OWN_PTR(Champ_base) (Champ_base) to an unknown field.
int fixer_nb_valeurs_nodales(int n) override
DoubleTab & valeur_aux_sommets(const Domaine &domain, DoubleTab &result) const override
Returns the values at the vertices of the Domain dom.
const IntTab & fcl() const
Champ_base()
Default constructor of a Champ_base.
DoubleVect & valeur_a_elem(const DoubleVect &position, DoubleVect &result, int poly) const override
DoubleTab & valeur_aux_elems(const DoubleTab &positions, const IntVect &polys, DoubleTab &result) const override
double valeur_a_elem_compo(const DoubleVect &position, int poly, int ncomp) const override
int remplir_coord_noeuds_et_polys(DoubleTab &positions, IntVect &polys) const override
DoubleTab & remplir_coord_noeuds(DoubleTab &positions) const override
DoubleVect & valeur_aux_elems_compo(const DoubleTab &positions, const IntVect &polys, DoubleVect &result, int ncomp) const override
virtual DoubleVect & valeur_aux_sommets_compo(const Domaine &domain, DoubleVect &result, int ncomp) const
virtual DoubleTab & valeur_aux_sommets(const Domaine &domain, DoubleTab &result) const
class Frontiere_dis_base Class representing a discretized boundary.