libsurf
Programmer's Documentation

tetboundarygroup.h (r6227/r5385)
1 
2 /* Copyright (C) 2015 David Eller <david@larosterna.com>
3  *
4  * Commercial License Usage
5  * Licensees holding valid commercial licenses may use this file in accordance
6  * with the terms contained in their respective non-exclusive license agreement.
7  * For further information contact david@larosterna.com .
8  *
9  * GNU General Public License Usage
10  * Alternatively, this file may be used under the terms of the GNU General
11  * Public License version 3.0 as published by the Free Software Foundation and
12  * appearing in the file gpl.txt included in the packaging of this file.
13  */
14 
15 #ifndef SURF_TETBOUNDARYGROUP_H
16 #define SURF_TETBOUNDARYGROUP_H
17 
18 #include <vector>
19 #include <string>
20 #include <genua/ffanode.h>
21 #include <genua/dmatrix.h>
22 #include <genua/svector.h>
23 
24 //#ifdef HAVE_CGNS
25 #include <genua/cgnsfwd.h>
26 class CgnsZone;
27 //#endif
28 
29 class TriMesh;
30 class TetFace;
31 typedef std::vector<TetFace> TetFaceArray;
32 
38 {
39 public:
40 
41  enum BCondition {BcWall, BcFarfield, BcNacelleInlet, BcNacelleOutlet,
42  BcMassFlowInlet, BcMassFlowOutlet,
43  BcEulerTransp, BcUser};
44 
45  typedef DMatrix<int> IndexMatrix;
46  typedef DVector<int> IndexVector;
47 
49  TetBoundaryGroup() : bc(BcWall), pratio(1.0), tratio(1.0), epsfan(0.5) {}
50 
52  TetBoundaryGroup(const TriMesh & m, int tag);
53 
55  void capture(const TetFaceArray & tfa);
56 
58  void enforce(TetFaceArray & tfa) const;
59 
61  void facelist(const IndexVector & v, int offset);
62 
64  void tag(int t) {itag = t;}
65 
67  int tag() const {return itag;}
68 
70  const std::string & name() const {return bname;}
71 
73  void rename(const std::string & s) {bname = s;}
74 
76  uint size() const {return ifaces.size();}
77 
79  uint face(uint k) const { assert(k < ifaces.size()); return ifaces[k]; }
80 
82  BCondition boundaryCondition() const {return bc;}
83 
85  void boundaryCondition(BCondition b) {bc = b;}
86 
88  void nacelleInlet(Real eps);
89 
91  void nacelleOutlet(Real pr, Real tr);
92 
94  void mdotInflow(Real tmf, Real tt, const Vct3 & direction);
95 
97  void mdotOutflow(Real tmf);
98 
100  void ffamsh(const TetFaceArray & faces, FFANode & node) const;
101 
103  void ffaboc(FFANode & node) const;
104 
105  //#ifdef HAVE_CGNS
106 
108  void cgnsBoundaryCondition(cgns::BCType_t b);
109 
111  void writeCgnsBoco(CgnsZone & z, int offset);
112 
113  //#endif // HAVE_CGNS
114 
115 private:
116 
118  void collectVertices(const TetFaceArray & faces,
119  IndexMatrix & vertices,
120  bool sensible_ordering) const;
121 
122 private:
123 
126 
128  std::string bname;
129 
131  int itag;
132 
134  BCondition bc;
135 
137  Vct3 fdir;
138 
140  Real pratio, tratio, epsfan, mdot, ttotal;
141 };
142 
143 typedef std::vector<TetBoundaryGroup> BGroupArray;
144 
145 #endif
uint size() const
number of triangles in this boundary group
Definition: tetboundarygroup.h:76
void nacelleOutlet(Real pr, Real tr)
set BC and BC data for nacelle outlet
Definition: tetboundarygroup.cpp:70
void nacelleInlet(Real eps)
set BC and BC data for nacelle inlet
Definition: tetboundarygroup.cpp:64
void writeCgnsBoco(CgnsZone &z, int offset)
write as cgns boundary condition set
Definition: tetboundarygroup.cpp:255
void ffaboc(FFANode &node) const
append data to FFA boundary data structure
Definition: tetboundarygroup.cpp:158
void collectVertices(const TetFaceArray &faces, IndexMatrix &vertices, bool sensible_ordering) const
collect vertex indices
Definition: tetboundarygroup.cpp:91
size_t size() const
Boundary condition in a tetrahedral mesh.
Definition: tetboundarygroup.h:37
void facelist(const IndexVector &v, int offset)
face index list
Definition: tetboundarygroup.cpp:58
int itag
integer tag associated with this group
Definition: tetboundarygroup.h:131
void mdotInflow(Real tmf, Real tt, const Vct3 &direction)
set BC data for massflow inlet (edge)
Definition: tetboundarygroup.cpp:77
void enforce(TetFaceArray &tfa) const
imprint boundary tag on faces
Definition: tetboundarygroup.cpp:51
BCondition boundaryCondition() const
access BC tag
Definition: tetboundarygroup.h:82
void cgnsBoundaryCondition(cgns::BCType_t b)
assimilate CGNS boundary condition
Definition: tetboundarygroup.cpp:235
uint face(uint k) const
access triangle indices
Definition: tetboundarygroup.h:79
void boundaryCondition(BCondition b)
change boundary condition tag
Definition: tetboundarygroup.h:85
std::string bname
boundary name/identifier
Definition: tetboundarygroup.h:128
IndexVector ifaces
list of triangles belonging to this group
Definition: tetboundarygroup.h:125
Vct3 fdir
flow direction for mass flow BCs
Definition: tetboundarygroup.h:137
void tag(int t)
access tag
Definition: tetboundarygroup.h:64
void ffamsh(const TetFaceArray &faces, FFANode &node) const
append data to FFA mesh data structure
Definition: tetboundarygroup.cpp:115
BCondition bc
type of boundary condition to enforce
Definition: tetboundarygroup.h:134
TetBoundaryGroup()
empty boundary group
Definition: tetboundarygroup.h:49
Real pratio
boundary condition data for Edge nacelle BCs
Definition: tetboundarygroup.h:140
Boundary face in a pure tetrahdral mesh.
Definition: tetmesh.h:96
void mdotOutflow(Real tmf)
set BC data for massflow outflow (edge)
Definition: tetboundarygroup.cpp:85
const std::string & name() const
group name
Definition: tetboundarygroup.h:70
int tag() const
access tag
Definition: tetboundarygroup.h:67
void capture(const TetFaceArray &tfa)
determine face list from tags
Definition: tetboundarygroup.cpp:41
void rename(const std::string &s)
rename group
Definition: tetboundarygroup.h:73
Generated on Wed Jan 19 2022 03:03:15 for libsurf by   doxygen 1.8.5