TrioCFD 1.9.9_beta
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 Associates a domain with all connectors in the list.
27 *
28 * @param (Domaine& un_domaine) the domain to associate
29 */
30template <typename _SIZE_>
32{
33 for (auto& itr : *this) itr->associer_domaine(un_domaine);
34}
35
36/*! @brief Returns the total number of faces of all Raccords_32_64 in the list.
37 *
38 * (the sum of the faces of all
39 * connectors in the list).
40 *
41 * @return (int) total number of faces of all Raccords_32_64 in the list
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 Returns the number of faces of the specified type contained in the connector list.
53 *
54 * (sum of faces of this type across all
55 * connectors in the list)
56 *
57 * @param (Type_Face type) the type of faces to count
58 * @return (int) number of faces of the specified type in the connector list
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
Class Raccord_base This class is simply a boundary; it is the base class of the.
Class Raccords This represents a list of Raccord type objects.
Definition Raccords.h:29
void associer_domaine(const Domaine_t &)
Associates a domain with all connectors in the list.
Definition Raccords.cpp:31
Domaine_32_64< _SIZE_ > Domaine_t
Definition Raccords.h:33
int_t nb_faces() const
Returns the total number of faces of all Raccords_32_64 in the list.
Definition Raccords.cpp:44
_SIZE_ int_t
Definition Raccords.h:32
Base class for output streams.
Definition Sortie.h:52