TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Moyenne_volumique.h
1/****************************************************************************
2* Copyright (c) 2024, 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 Moyenne_volumique_included
17#define Moyenne_volumique_included
18
19#include <TRUSTTabs_forward.h>
20#include <Interprete.h>
21#include <TRUST_Ref.h>
22#include <Parser.h>
23
24class Convolution_function_base;
26class Domaine_VF;
27class Champ_base;
28class Motcles;
29
30/*! @brief This interpreter computes and stores in a lata file the convolution product
31 *
32 * of certain fields of a problem with an arbitrary filter function,
33 * after the computation (i.e. after "resoudre").
34 * It can be used as an interpreter (see Moyenne_volumique::interpreter())
35 * or anywhere inside the code as follows:
36 * Moyenne_volumique moy;
37 * is >> moy; // reading of the filter function
38 * moy.calculer_convolution_champ_elem/face(...)
39 *
40 */
42{
43 Declare_instanciable(Moyenne_volumique);
44
45public:
46 Entree& interpreter(Entree&) override;
47
48 virtual void calculer_convolution_champ_elem(const Domaine_VF& domaine_source, const DoubleTab& champ_source, const DoubleTab& coords_to_compute, DoubleTab& resu) const;
49
50 virtual void calculer_convolution_champ_face(const Domaine_VF& domaine_source, const DoubleTab& champ_source, const DoubleTab& coords_to_compute, DoubleTab& resu) const;
51
52 virtual void eval_filtre(const DoubleTab& coords, ArrOfDouble& result) const;
53 double box_size() const { return box_size_; }
54
55protected:
56 void traiter_champs(const Motcles& noms_champs, const Nom& nom_pb, const Nom& nom_dom, const DoubleTab& coords, Format_Post_base& post, double temps, const Motcle& localisation);
57
58 int get_champ(const Nom& nom_pb, const Nom& nom_champ,
59 OBS_PTR(Champ_base) &ref_champ);
60
61 virtual void calculer_convolution(const Domaine_VF& domaine_source, const DoubleTab& champ_source, const DoubleTab& coords_to_compute, DoubleTab& resu) const;
62
64 // If type_ != PARSER, l_ must be set; otherwise expression_parser_ must be set.
66 // parametre du filtre (largeur de boite, chapeau ou gaussienne)
67 double l_= -1.;
68 // box_size_ doit toujours etre rempli (demi-cote d'un cube contenant le support du filtre)
69 double box_size_ = -100.;
71 mutable Parser parser_;
72};
73
74#endif
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
class Domaine_VF
Definition Domaine_VF.h:44
Base class for post-processing output formats for fields (lata, med, cgns, lml, single_lata).
Base class for "interpreter" objects.
Definition Interprete.h:38
A character string (Nom) in uppercase.
Definition Motcle.h:26
An array of Motcle objects.
Definition Motcle.h:63
This interpreter computes and stores in a lata file the convolution product.
virtual void calculer_convolution_champ_elem(const Domaine_VF &domaine_source, const DoubleTab &champ_source, const DoubleTab &coords_to_compute, DoubleTab &resu) const
Computes the convolution product between the filter function and the field "champ_source",...
virtual void calculer_convolution_champ_face(const Domaine_VF &domaine_source, const DoubleTab &champ_source, const DoubleTab &coords_to_compute, DoubleTab &resu) const
Same as calculer_convolution_champ_elem but for a VDF face field.
int get_champ(const Nom &nom_pb, const Nom &nom_champ, OBS_PTR(Champ_base) &ref_champ)
Searches for the field named "nom_champ" in the problem named "nom_pb" among the interpreter objects.
virtual void calculer_convolution(const Domaine_VF &domaine_source, const DoubleTab &champ_source, const DoubleTab &coords_to_compute, DoubleTab &resu) const
General method to compute a convolution from a field defined at elements or faces.
void traiter_champs(const Motcles &noms_champs, const Nom &nom_pb, const Nom &nom_dom, const DoubleTab &coords, Format_Post_base &post, double temps, const Motcle &localisation)
Helper function that performs the convolution calculations and writes the result to a lata file for a...
Entree & interpreter(Entree &) override
Reads the parameters from the data set.
double box_size() const
virtual void eval_filtre(const DoubleTab &coords, ArrOfDouble &result) const
Evaluates the filter function at each coordinate in coords.
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
friend class Entree
Definition Objet_U.h:71
Representation of data for the Parser class.
Definition Parser.h:39