TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Raccords.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 <Raccords.h>
17
18Implemente_instanciable_32_64(Raccords_32_64, "Raccords", LIST(OWN_PTR(Raccord_base_32_64<_T_>)));
19
20template <typename _SIZE_>
21Sortie& Raccords_32_64<_SIZE_>::printOn(Sortie& os) const { return LIST(OWN_PTR(Raccord_base_32_64<_SIZE_>))::printOn(os); }
22
23template <typename _SIZE_>
24Entree& Raccords_32_64<_SIZE_>::readOn(Entree& is) { return LIST(OWN_PTR(Raccord_base_32_64<_SIZE_>))::readOn(is); }
25
26/*! @brief Associe un domaine a tous les raccords de la liste.
27 *
28 * @param (Domaine& un_domaine) le domaine a associer
29 */
30template <typename _SIZE_>
32{
33 for (auto& itr : *this) itr->associer_domaine(un_domaine);
34}
35
36/*! @brief Renvoie le nombre de face total des Raccords_32_64 de la liste.
37 *
38 * (la somme des faces de tous les
39 * raccords de la liste).
40 *
41 * @return (int) le nombre de face total des Raccords_32_64 de la liste
42 */
43template <typename _SIZE_>
45{
46 int_t nombre = 0;
47 for (const auto &itr : *this) nombre += itr->nb_faces();
48
49 return nombre;
50}
51
52/*! @brief Renvoie le nombre de faces du type specifie contenues dans la liste de raccords.
53 *
54 * (somme des faces de ce type sur tous les
55 * raccords de la liste)
56 *
57 * @param (Type_Face type) le type des faces a compter
58 * @return (int) le nombre de faces du type specifie contenues dans la liste de raccords
59 */
60template <typename _SIZE_>
62{
63 int_t nombre = 0;
64 for (const auto &itr : *this)
65 if (type == itr->faces().type_face()) nombre += itr->nb_faces();
66
67 return nombre;
68}
69
70template class Raccords_32_64<int>;
71#if INT_is_64_ == 2
72template class Raccords_32_64<trustIdType>;
73#endif
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Classe Raccord_base Cette classe est simplement une frontiere, c'est la classe de base de la.
Classe Raccords Cette represente une liste d'objets de type Raccord.
Definition Raccords.h:29
void associer_domaine(const Domaine_t &)
Associe un domaine a tous les raccords de la liste.
Definition Raccords.cpp:31
Domaine_32_64< _SIZE_ > Domaine_t
Definition Raccords.h:33
int_t nb_faces() const
Renvoie le nombre de face total des Raccords_32_64 de la liste.
Definition Raccords.cpp:44
_SIZE_ int_t
Definition Raccords.h:32
Classe de base des flux de sortie.
Definition Sortie.h:52