TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Champ_Face_PolyMAC_CDO.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_Face_PolyMAC_CDO_included
17#define Champ_Face_PolyMAC_CDO_included
18
19#include <Champ_Face_base.h>
20#include <SolveurSys.h>
21
22// Field corresponding to an unknown described by its face fluxes (e.g. velocity)
23// Degrees of freedom: normal component at faces + tangential component at edges of the vorticity
25{
26 Declare_instanciable(Champ_Face_PolyMAC_CDO);
27public:
28 DoubleVect& valeur_a_elem(const DoubleVect& position, DoubleVect& result, int poly) const override;
29 double valeur_a_elem_compo(const DoubleVect& position, int poly, int ncomp) const override;
30 DoubleTab& valeur_aux_elems(const DoubleTab& positions, const IntVect& polys, DoubleTab& result) const override;
31 DoubleTab& valeur_aux_elems_passe(const DoubleTab& positions, const IntVect& polys, DoubleTab& result) const override;
32 DoubleVect& valeur_aux_elems_compo(const DoubleTab& positions, const IntVect& polys, DoubleVect& result, int ncomp) const override;
33
34 DoubleTab& remplir_coord_noeuds(DoubleTab& positions) const override;
35 int remplir_coord_noeuds_et_polys(DoubleTab& positions, IntVect& polys) const override;
36
37 DoubleTab& valeur_aux_faces(DoubleTab& result) const override;
38 DoubleVect& calcul_S_barre_sans_contrib_paroi(const DoubleTab& vitesse, DoubleVect& SMA_barre) const;
39 DoubleVect& calcul_S_barre(const DoubleTab& vitesse, DoubleVect& SMA_barre) const;
40 DoubleTab& trace(const Frontiere_dis_base&, DoubleTab&, double, int distant) const override;
41
42 Champ_base& affecter_(const Champ_base&) override;
43 int nb_valeurs_nodales() const override;
44
45 int fixer_nb_valeurs_nodales(int n) override;
46
47 //integral of velocity on the boundary of dual edges -> to compute the vorticity
48 void init_ra() const;
49 mutable IntTab radeb, raji, rajf; //reconstruction of the curl via (raji, raci)[radeb(a, 0), radeb(a + 1, 0)[ (face velocities)
50 mutable DoubleTab raci, racf; // + (rajf, racf)[radeb(a, 1), radeb(a + 1, 1)[ (imposed values at boundary faces)
51
52 //interpolation of velocity at edges (in the plane normal to each edge)
53 void init_va() const;
54 mutable IntTab vadeb, vaji, vajf; //reconstruction of velocity via (vaji, vaci)[vadeb(a, 0), vadeb(a + 1, 0)[ (face velocities)
55 mutable DoubleTab vaci, vacf; // + (vajf, vacf)[vadeb(a, 1), vadeb(a + 1, 1)[ (imposed values at boundary faces) + (vaja, vaca)[vadeb(., 2)] (imposed values at edges)
56
57 //interpolations at elements: velocity val(e, i) = v_i, gradient vals(e, i, j) = dv_i / dx_j
58 virtual void interp_ve(const DoubleTab& inco, DoubleTab& val, bool is_vit = true) const;
59 virtual void interp_ve(const DoubleTab& inco, const IntVect&, DoubleTab& val, bool is_vit = true) const;
60 virtual void interp_gve(const DoubleTab& inco, DoubleTab& vals) const final;
61
62protected:
63 virtual Champ_base& le_champ() { return *this; }
64 virtual const Champ_base& le_champ() const { return *this; }
65
66 virtual DoubleTab& valeur_aux_elems_(const DoubleTab& val_face ,const DoubleTab& positions, const IntVect& les_polys, DoubleTab& valeurs) const;
67};
68
69#endif /* Champ_Face_PolyMAC_CDO_included */
DoubleTab & remplir_coord_noeuds(DoubleTab &positions) const override
int fixer_nb_valeurs_nodales(int n) override
Champ_base & affecter_(const Champ_base &) override
virtual void interp_ve(const DoubleTab &inco, DoubleTab &val, bool is_vit=true) const
virtual void interp_gve(const DoubleTab &inco, DoubleTab &vals) const final
double valeur_a_elem_compo(const DoubleVect &position, int poly, int ncomp) const override
Causes an error! Must be overridden by derived classes.
int remplir_coord_noeuds_et_polys(DoubleTab &positions, IntVect &polys) const override
DOES NOTHING. Method to override.
virtual const Champ_base & le_champ() const
DoubleVect & valeur_a_elem(const DoubleVect &position, DoubleVect &result, int poly) const override
Causes an error! Must be overridden by derived classes.
DoubleVect & calcul_S_barre_sans_contrib_paroi(const DoubleTab &vitesse, DoubleVect &SMA_barre) const
DoubleTab & valeur_aux_faces(DoubleTab &result) const override
Returns the field value at the faces.
virtual DoubleTab & valeur_aux_elems_(const DoubleTab &val_face, const DoubleTab &positions, const IntVect &les_polys, DoubleTab &valeurs) const
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.
int nb_valeurs_nodales() const override
virtual Champ_base & le_champ()
DoubleTab & trace(const Frontiere_dis_base &, DoubleTab &, double, int distant) const override
Computes the trace of a field on a boundary at time tps.
DoubleVect & calcul_S_barre(const DoubleTab &vitesse, DoubleVect &SMA_barre) const
DoubleTab & valeur_aux_elems_passe(const DoubleTab &positions, const IntVect &polys, DoubleTab &result) const override
DoubleTab & valeurs() override
Returns the array of field values at the current time.
Champ_base()
Default constructor of a Champ_base.
class Frontiere_dis_base Class representing a discretized boundary.