TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Groupes_Faces.cpp
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#include <Groupes_Faces.h>
17
18Implemente_instanciable_32_64(Groupes_Faces_32_64, "Groupes_Faces", LIST(Groupe_Faces_32_64<_T_>));
19
20template <typename _SIZE_>
22
23template <typename _SIZE_>
25
26/*! @brief Associe un domaine a tous les objets Groupe_Faces de la liste.
27 *
28 * @param (Domaine& un_domaine) le domaine a associer aux Groupe_Faces de la liste
29 */
30template <typename _SIZE_>
32{
33 for (auto& itr : *this) itr.associer_domaine(un_domaine);
34}
35
36/*! @brief Renvoie le nombre total de faces contenues dans la liste des Groupe_Faces, i.
37 *
38 * e. la somme de toutes
39 * les faces de tous les objet Groupe_Faces contenu dans
40 * la liste.
41 *
42 * @return (int) le nombre total de faces contenues dans la liste des Groupe_Faces
43 */
44template <typename _SIZE_>
46{
47 int_t nombre = 0;
48 for (const auto &itr : *this) nombre += itr.nb_faces();
49
50 return nombre;
51}
52
53/*! @brief Renvoie le nombre total de faces de type specifie contenues dans la liste des Groupe_Faces
54 *
55 * i.e. la somme de toutes les faces de type specifie
56 * de tous les objet Groupe_Faces contenu dans
57 * la liste.
58 *
59 * @param (Type_Face type) le type des faces a compter
60 * @return (int) le nombre total de faces contenues dans la liste des Groupe_Faces
61 */
62template <typename _SIZE_>
64{
65 int_t nombre = 0;
66 for (const auto &itr : *this)
67 if (type == itr.faces().type_face()) nombre += itr.nb_faces();
68
69 return nombre;
70}
71
72/*! Mise a jour des indices des groupes de faces avec table inversee: reverse_index[ancien_numero] = nouveau numero:
73 * necessaire lorsque les numeros des faces ont ete modifies
74 */
75template <typename _SIZE_>
77{
78 for (auto &itr : *this)
79 {
80 ArrOfInt_t& indices_faces = itr.get_indices_faces();
81 const int_t nbfaces2 = indices_faces.size_array();
82 assert(nbfaces2 == itr.nb_faces());
83 for (int_t i = 0; i < nbfaces2; i++)
84 {
85 const int_t old = indices_faces[i]; // ancien indice local
86 indices_faces[i] = reverse_index[old];
87 }
88 }
89}
90
91
92template class Groupes_Faces_32_64<int>;
93#if INT_is_64_ == 2
95#endif
96
97
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Classe Groupe_Face La classe sert a representer une selection de faces lu dans le fichier med.
Class Groupes_Faces Cette classe represente une liste d'objets de type Groupe_Faces.
Domaine_32_64< _SIZE_ > Domaine_t
ArrOfInt_T< _SIZE_ > ArrOfInt_t
void associer_domaine(const Domaine_t &)
Associe un domaine a tous les objets Groupe_Faces de la liste.
void renumerote(ArrOfInt_t &reverse_index)
int_t nb_faces() const
Renvoie le nombre total de faces contenues dans la liste des Groupe_Faces, i.
Classe de base des flux de sortie.
Definition Sortie.h:52
_SIZE_ size_array() const