TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Champ_Generique_Interpolation.h
1/****************************************************************************
2* Copyright (c) 2026, 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_Generique_Interpolation_included
17#define Champ_Generique_Interpolation_included
18
19#include <Champ_Gen_de_Champs_Gen.h>
20
21
22/*! @brief A generic field constructed as an interpolation of another generic field (interpolation at vertices or elements).
23 *
24 * The interpolation will be performed on a domain that can be
25 * the computational domain or a different domain specified by the user
26 *
27 */
28
29//// Data file syntax to follow
30//
31// "field_name" Interpolation { [ domain ] "interp_domain"
32// localisation "loc"
33// source "generic_field_type" { ...source ref_Champ { Pb_champ "pb_name" "discrete_field_name" } }
34// }
35// "field_name" set by the user will be the name of the generic field
36// "interp_domain" name of the interpolation domain in case it differs from the computational domain (optional)
37// "loc" designates the interpolation localisation "elem", "elem_dg", "faces" or "som"
38// "generic_field_type" type of a generic field
39
41{
42 Declare_instanciable(Champ_Generique_Interpolation);
43public:
44 void reset() override;
45 void set_param(Param& param) const override;
46 //int lire_motcle_non_standard(const Motcle&, Entree&);
47 virtual int set_localisation(const Motcle& localisation, int exit_on_error = 1);
48 virtual int set_methode(const Motcle& methode, int exit_on_error = 1);
49 virtual int set_domaine(const Nom& nom_domaine, int exit_on_error = 1);
50 const Champ_base& get_champ(OWN_PTR(Champ_base)& espace_stockage) const override;
51 const Champ_base& get_champ_without_evaluation(OWN_PTR(Champ_base)& espace_stockage) const override;
53
54 const DoubleTab& get_ref_values() const override;
55 void get_copy_values(DoubleTab&) const override;
56 //virtual void get_xyz_values(const DoubleTab & coords, DoubleTab & values, ArrOfBit & validity_flag) const;
57
58 Entity get_localisation(const int index = -1) const override;
59 const Domaine& get_ref_domain() const override;
60 void get_copy_domain(Domaine&) const override;
61
62 const DoubleTab& get_ref_coordinates() const override;
63 void get_copy_coordinates(DoubleTab&) const override;
64 //virtual const IntTab& get_ref_connectivity(Entity index1, Entity index2) const;
65 //virtual void get_copy_connectivity(Entity index1, Entity index2, IntTab &) const;
66
67 const Noms get_property(const Motcle& query) const override;
68 void nommer_source() override;
69 void completer(const Postraitement_base& post) override;
70 const Domaine_dis_base& get_ref_domaine_dis_base() const override;
71 const Motcle get_directive_pour_discr() const override;
73
74 const Noms& fixer_noms_compo(const Noms& noms) override;
75 const Noms& fixer_noms_synonyms(const Noms& noms) override;
76 //The compo_ attribute of Champ_Generique_Interpolation is only filled for Champ_Generique_Interpolation
77 //instances created by macro, in order to reproduce component names in lml files
79
80private:
81 Motcle localisation_; // interpolation localisation: elem, som
82 Motcle methode_; // calculer_champ_post, etc...
83 Nom nom_domaine_lu_; // Name of the domain read
84 OBS_PTR(Domaine) domaine_; // domain on which we want to interpolate the field (native domain if reference is null)
85 OBS_PTR(Domaine_dis_base) le_dom_dis; // filled if interpolation domain differs from native domain. A REF since Domaine_dis_cache owns the memory
86 // ex: Sonde uses valeur_aux...() which requires a discretized domain
87 int optimisation_sous_maillage_,optimisation_demande_;
88 ArrOfInt renumerotation_maillage_;
89 mutable OWN_PTR(Champ_Fonc_base) espace_stockage_;
90 mutable OWN_PTR(Champ_base) espace_stockage_source_;
91};
92
93#endif
class Champ_Fonc_base Base class of fields that are functions of a calculated quantity
Base class of generic fields having other generic fields as source. The use of the class methods reli...
A generic field constructed as an interpolation of another generic field (interpolation at vertices o...
void get_copy_domain(Domaine &) const override
Creates a copy of the domain on which the storage space will be evaluated.
const Noms & fixer_noms_compo(const Noms &noms) override
const Motcle get_directive_pour_discr() const override
Returns the directive (champ_elem, champ_sommets, champ_face or pression) to launch the discretizatio...
void completer(const Postraitement_base &post) override
void set_param(Param &param) const override
const DoubleTab & get_ref_values() const override
Returns a reference to the array of discrete values if it exists in memory.
const DoubleTab & get_ref_coordinates() const override
Returns a reference to the array of coordinates of the vertices of the mesh supporting the field,...
void reset() override
Restore the initial configuration of the object: localisation not specified, source not specified,...
virtual int set_domaine(const Nom &nom_domaine, int exit_on_error=1)
Class initialization: initialization of the interpolation domain. Valid parameters: "" => native doma...
const Domaine_dis_base & get_ref_domaine_dis_base() const override
Returns a ref to the discretized domain on which the storage space will be evaluated.
const Domaine & get_ref_domain() const override
Returns a ref to the domain on which the storage space will be evaluated.
virtual const Champ_base & get_champ_with_calculer_champ_post() const
Interpolation of the source field using Champ_base::calculer_champ_xxx_post.
Entity get_localisation(const int index=-1) const override
Returns the type of geometric entities on which the discrete values are attached (NODE for a P1 field...
void get_copy_values(DoubleTab &) const override
Fills the values array with the discrete values of the field (creates a copy).
virtual int set_methode(const Motcle &methode, int exit_on_error=1)
Class initialization: initialization of the interpolation method. Valid parameters: calculer_champ_po...
const Noms get_property(const Motcle &query) const override
Returns the requested property.
void get_copy_coordinates(DoubleTab &) const override
const Champ_base & get_champ(OWN_PTR(Champ_base)&espace_stockage) const override
Interpolation of the source field based on the requested method, localisation, and domain.
const Champ_base & get_champ_without_evaluation(OWN_PTR(Champ_base)&espace_stockage) const override
virtual int set_localisation(const Motcle &localisation, int exit_on_error=1)
Class initialization: initialization of the requested localisation.
const Noms & fixer_noms_synonyms(const Noms &noms) override
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
A character string (Nom) in uppercase.
Definition Motcle.h:26
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
An array of character strings (VECT(Nom)).
Definition Noms.h:26
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
Base class for all post-processing objects.