TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Domaine_Coloc.cpp
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#include <Poly_geom_base.h>
17#include <Domaine_Coloc.h>
18
19Implemente_instanciable(Domaine_Coloc, "Domaine_Coloc", Domaine_Poly_base);
20
22
24
26{
29// discretiser_aretes();
30}
31
33{
34 // Computation of h_carre
35 h_carre = 1.e30;
36 h_carre_.resize(nb_faces());
37 // Computation of surfaces
38 Elem_geom_base& elem_geom = domaine().type_elem().valeur();
39 int is_polyedre = sub_type(Poly_geom_base, elem_geom) ? 1 : 0;
40 const ArrOfInt PolyIndex = is_polyedre ? ref_cast(Poly_geom_base, domaine().type_elem().valeur()).getElemIndex() : ArrOfInt(0);
41 const DoubleVect& surfaces=face_surfaces();
42 const int nbe=nb_elem();
43 for (int num_elem=0; num_elem<nbe; num_elem++)
44 {
45 double surf_max = 0;
46 const int nb_faces_elem = is_polyedre ? PolyIndex[num_elem+1] - PolyIndex[num_elem] : domaine().nb_faces_elem();
47 for (int i=0; i<nb_faces_elem; i++)
48 {
49 double surf = surfaces(elem_faces(num_elem,i));
50 surf_max = (surf > surf_max)? surf : surf_max;
51 }
52 double vol = volumes(num_elem)/surf_max;
53 vol *= vol;
54 h_carre_(num_elem) = vol;
55 h_carre = ( vol < h_carre )? vol : h_carre;
56 }
57}
58
60{
61 Cerr << "Le Domaine_Coloc a ete rempli avec succes" << finl;
62 for (int num_cond_lim=0; num_cond_lim<conds_lim.size(); num_cond_lim++)
63 {
64 const Cond_lim_base& cl = conds_lim[num_cond_lim].valeur();
65 if (sub_type(Periodique, cl))
66 Process::exit("Domaine_Coloc::modifier_pour_Cl not coded for Periodic BC \n");
67 }
68
69 // PQ : 10/10/05 : periodic faces have double contribution,
70 // so the call to marquer_faces_double_contrib is done in this method
71 // in order to take advantage of conds_lim.
73}
class Cond_lim_base Base class for the hierarchy of classes that represent the different boundary con...
class Conds_lim This class represents a vector of boundary conditions.
Definition Conds_lim.h:32
int nb_faces_elem(int=0) const
Returns the number of faces of type i of the geometric elements that make up the domain.
Definition Domaine.h:484
void modifier_pour_Cl(const Conds_lim &) override
void discretiser() override
void calculer_h_carre() override
class Domaine_Poly_base
const Elem_poly_base & type_elem() const
void discretiser() override
virtual const DoubleVect & face_surfaces() const
Definition Domaine_VF.h:51
int nb_faces() const
Returns the total number of faces.
Definition Domaine_VF.h:471
IntTab & elem_faces()
Returns the element/face connectivity array.
Definition Domaine_VF.h:550
DoubleVect & volumes()
Definition Domaine_VF.h:119
void marquer_faces_double_contrib(const Conds_lim &)
const Domaine & domaine() const
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
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
class Periodique This class represents a periodic boundary condition.
Definition Periodique.h:31
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
Base class for output streams.
Definition Sortie.h:52