TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Ch_front_var_instationnaire_dep.cpp
1/****************************************************************************
2* Copyright (c) 2022, 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#include <Ch_front_var_instationnaire_dep.h>
17#include <Champ_Inc_base.h>
18#include <Frontiere_dis_base.h>
19#include <Domaine_dis_base.h>
20#include <Domaine_VF.h>
21#include <TRUSTTab_parts.h>
22
23Implemente_instanciable(Ch_front_var_instationnaire_dep,"Ch_front_var_instationnaire_dep",Champ_front_var_instationnaire);
24
26{
27 return s << que_suis_je() << " " << le_nom();
28}
29
31{
32 int dim;
33 s >> dim;
34 fixer_nb_comp(dim);
35
36 return s;
37}
38
40{
41
43 return 0;
44
45 // Default initialization to the value of the unknown at the boundary
46 // This means taking the trace of its own boundary
47 // Warning: do not go through the connectors!
48 DoubleTab& tab=les_valeurs->valeurs();
49 assert(temps==inco.temps());
50 if(nb_comp()!=inco.nb_comp())
51 {
52 // Used by ICoCo see U_in_var_impl test case
53 // Different field so we initialize to 0:
54 tab = 0;
55 }
56 else
57 {
58 const Frontiere& MaFrontiere = frontiere_dis().frontiere();
59 ConstDoubleTab_parts parts(inco.valeurs());
60 if (parts[0].dimension(0)==inco.domaine_dis_base().nb_elem())
61 MaFrontiere.Frontiere::trace_elem_local(inco.valeurs(),tab);
62 else if (parts[0].dimension(0)==ref_cast(Domaine_VF,inco.domaine_dis_base()).nb_faces())
63 MaFrontiere.Frontiere::trace_face_local(inco.valeurs(),tab);
64 else
65 {
66 Cerr << "Warning: Field " << inco.que_suis_je() << " is not supported yet in Ch_front_var_instationnaire_dep::initialiser" << finl;
67 //Process::exit();
68 }
69 }
71
72 return 1;
73}
74
class Ch_front_var_instationnaire_dep This abstract class represents a field on a boundary,
Champ_front_base & affecter_(const Champ_front_base &ch) override
int initialiser(double temps, const Champ_Inc_base &inco) override
Initialization at the beginning of calculation.
Class Champ_Inc_base.
const Domaine_dis_base & domaine_dis_base() const override
DoubleTab & valeurs() override
Returns the array of field values at the current time.
double temps() const
Returns the time of the field.
virtual const Frontiere_dis_base & frontiere_dis() const
Returns the discretized boundary associated with the field.
class Champ_front_var_instationnaire Derived class from Champ_front_var that represents fields on
int initialiser(double temps, const Champ_Inc_base &inco) override
Initializes the current time and Gpoint.
class Domaine_VF
Definition Domaine_VF.h:44
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual void fixer_nb_comp(int i)
Sets the number of components of the field.
const Nom & le_nom() const override
Returns the name of the field.
virtual int nb_comp() const
Definition Field_base.h:56
const Frontiere & frontiere() const
Returns the associated geometric boundary.
static int dimension
Definition Objet_U.h:94
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
Base class for output streams.
Definition Sortie.h:52
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")