TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Bords.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 <Bords.h>
17
18Implemente_instanciable_32_64(Bords_32_64, "Bords", LIST(Bord_32_64<_T_>));
19// XD list_bord listobj list_bord BRACE bord_base NO_COMMA The block sides.
20
21template <typename _SIZE_>
22Sortie& Bords_32_64<_SIZE_>::printOn(Sortie& os) const { return LIST(Bord_32_64<_SIZE_>)::printOn(os); }
23
24template <typename _SIZE_>
25Entree& Bords_32_64<_SIZE_>::readOn(Entree& is) { return LIST(Bord_32_64<_SIZE_>)::readOn(is); }
26
27/*! @brief Associates a domain to all boundaries in the list.
28 *
29 * @param (Domaine& un_domaine) the domain to associate to the boundaries in the list
30 */
31template <typename _SIZE_>
33{
34 for (auto &itr : *this) itr.associer_domaine(un_domaine);
35}
36
37/*! @brief Returns the total number of faces of all boundaries in the list.
38 *
39 * @return (int) the total number of faces of all boundaries in the list
40 */
41template <typename _SIZE_>
43{
44 int_t nombre = 0;
45
46 for (const auto &itr : *this) nombre += itr.nb_faces();
47
48 return nombre;
49}
50
51/*! @brief Returns the total number of faces of the specified type, for all boundaries in the list.
52 *
53 * @param (Type_Face type) the type of faces to count
54 * @return (int) the total number of faces of the specified type, for all boundaries in the list
55 */
56template <typename _SIZE_>
58{
59 int_t nombre = 0;
60
61 for (const auto &itr : *this)
62 if (type == itr.faces().type_face()) nombre += itr.nb_faces();
63
64 return nombre;
65}
66
67
68template class Bords_32_64<int>;
69#if INT_is_64_ == 2
70template class Bords_32_64<trustIdType>;
71#endif
72
73
Class Bord This class represents a boundary of a domain, it is a type of frontier.
Definition Bord.h:31
Class Bords This class represents a list of objects of type Bord.
Definition Bords.h:28
_SIZE_ int_t
Definition Bords.h:33
int_t nb_faces() const
Returns the total number of faces of all boundaries in the list.
Definition Bords.cpp:42
Domaine_32_64< _SIZE_ > Domaine_t
Definition Bords.h:34
void associer_domaine(const Domaine_t &)
Associates a domain to all boundaries in the list.
Definition Bords.cpp:32
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Base class for output streams.
Definition Sortie.h:52