TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Front_VF.h
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#ifndef Front_VF_included
17#define Front_VF_included
18
19
20
21/*! @brief class Front_VF
22 *
23 * @sa Frontiere_dis_base
24 */
25
26#include <Frontiere_dis_base.h>
27#include <Frontiere.h>
28
29//////////////////////////////////////////////////////////////////////////////////
30//
31// CLASS: Front_VF
32//
33/////////////////////////////////////////////////////////////////////////////////
34
36{
37 Declare_instanciable(Front_VF);
38
39public :
40
41 inline int nb_faces() const; // Number of real faces of the boundary
42 inline int nb_faces_tot() const; // Number of real and virtual faces of the boundary
43 inline int num_premiere_face() const; // Index of the first face of the boundary in the global face list
44 inline int num_face(const int) const; // Returns the global face index of the i-th boundary face
45 inline int num_local_face(const int) const; //Returns the local face index (inverse of num_face())
46 inline const ArrOfInt& num_face() const;
47protected:
48 mutable ArrOfInt num_face_;
49};
50
51// Inline functions
52
53inline int Front_VF::nb_faces() const
54{
55 return frontiere().nb_faces();
56}
57
58inline int Front_VF::nb_faces_tot() const
59{
61}
62
64{
66}
67
68inline int Front_VF::num_face(const int ind_face) const
69{
70 if (ind_face<nb_faces()) // Real boundary face
71 return num_premiere_face()+ind_face;
72 else // Virtual boundary face
73 return frontiere().get_faces_virt()[ind_face-nb_faces()];
74}
75
76inline const ArrOfInt& Front_VF::num_face() const
77{
78 if (num_face_.size_array()==0)
79 {
80 num_face_.resize(nb_faces_tot());
81 for(int ind_face=0; ind_face<nb_faces_tot(); ind_face++)
82 num_face_(ind_face) = num_face(ind_face);
83 }
84 return num_face_;
85}
86
87inline int Front_VF::num_local_face(const int ind_global_face) const
88{
89 if (ind_global_face<num_premiere_face()+nb_faces())
90 {
91 return ind_global_face-num_premiere_face();
92 }
93 else
94 {
95 for (int i=0; i<frontiere().get_faces_virt().size_array(); i++)
96 {
97 if (frontiere().get_faces_virt()[i]==ind_global_face)
98 return i+nb_faces();
99 }
100 }
101 return -1;
102}
103
104#endif
class Front_VF
Definition Front_VF.h:36
const ArrOfInt & num_face() const
Definition Front_VF.h:76
ArrOfInt num_face_
Definition Front_VF.h:48
int num_local_face(const int) const
Definition Front_VF.h:87
int nb_faces() const
Definition Front_VF.h:53
int num_premiere_face() const
Definition Front_VF.h:63
int nb_faces_tot() const
Definition Front_VF.h:58
const ArrOfInt_t & get_faces_virt() const
Definition Frontiere.h:69
int_t num_premiere_face() const
Definition Frontiere.h:67
int_t nb_faces() const
Returns the number of faces of the boundary.
Definition Frontiere.h:59
class Frontiere_dis_base Class representing a discretized boundary.
const Frontiere & frontiere() const
Returns the associated geometric boundary.
_SIZE_ size_array() const