libsurf
Programmer's Documentation

wingpart.h (r6227/r5765)
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_WINGPART_H
16 #define SURF_WINGPART_H
17 
18 #include "forward.h"
19 #include "topopart.h"
20 #include <genua/svector.h>
21 
39 class WingPart : public TopoPart
40 {
41 public:
42 
44  WingPart(const std::string &s);
45 
47  virtual ~WingPart();
48 
50  void configure(const ConfigParser &cfg);
51 
53  void meshBias(Real leRefine, Real teRefine, Real tipRefine);
54 
56  void meshQuality(DcMeshCritBasePtr wingCrit,
57  DcMeshCritBasePtr wakeCrit = DcMeshCritBasePtr());
58 
60  uint appendSegment(SurfacePtr wingSegment);
61 
63  uint appendSegment(SurfacePtr wingSegment, SurfacePtr wakeSegment);
64 
66  void mirrorSegments(const Vct3 &mipo = Vct3(0,0,0),
67  const Vct3 &mipn = Vct3(0,1,0));
68 
70  virtual void inject(Topology &topo);
71 
73  std::pair<uint, uint> makeFlatCaps(Topology &topo,
74  bool makeLeft=true, bool makeRight=true);
75 
77  std::pair<uint, uint> makeRoundedCaps(Topology &topo,
78  bool makeLeft=true, bool makeRight=true);
79 
81  uint findWingTipEdge(const Topology &topo, Real v) const;
82 
84  uint findWakeTipEdge(const Topology &topo, Real v) const;
85 
87  void createSimpleWakes(const Vct3 &edgeDistance = Vct3(),
88  const Vct3 &farTangent = Vct3(),
89  Real compression = 0.2);
90 
92  void createAttachedWakes(SurfaceArray bodies,
93  const Vct3 &edgeDistance = Vct3(),
94  const Vct3 &farTangent = Vct3());
95 
97  virtual void appendTo(const Topology &topo, MxMesh &mx, bool mergeBc=false);
98 
100  virtual void importLegacy(const XmlElement &xe);
101 
103  virtual void makeLegacyCaps(Topology &topo);
104 
106  void toIges(IgesFile &file, int tfi = 0) const;
107 
108 private:
109 
111  DcMeshCritPtr appendStitched(const XmlElement &xe);
112 
114  void fillDefaultDimensions(Vct3 &ed, Vct3 &ft) const;
115 
117  CurvePtr tryAttachWake(SurfacePtr body, int iseg, Real v,
118  const Vct3 &edgeDistance,
119  const Vct3 &farTangent) const;
120 
121 private:
122 
124  SurfaceArray m_segments;
125 
127  SurfaceArray m_wakes;
128 
130  Indices m_ifaces, m_iwakes;
131 
133  Indices m_ifbocos, m_iwbocos;
134 
136  DcMeshCritBasePtr m_wingCrit, m_wakeCrit;
137 
139  //SurfaceArray m_trailingEdgeCaps;
140 
143 
145  Real m_leBias, m_teBias, m_tipBias;
146 
149 
151  Real m_capheight[4];
152 
154  uint m_rightCap, m_leftCap;
155 
157  bool m_toroidal = false;
158 
160  bool m_bluntEdge = false;
161 
164 };
165 
166 #endif // SURF_CHAINED_PART_H
void meshBias(Real leRefine, Real teRefine, Real tipRefine)
change mesh bias properties to apply to mesh quality criteria internally
Definition: wingpart.cpp:57
WingPart(const std::string &s)
create empty default part
Definition: wingpart.cpp:37
Indices m_ifbocos
indices of bocos generated when adding to MxMesh object
Definition: wingpart.h:133
DcMeshCritBasePtr m_wingCrit
meshing criterion used for all wing and wake segments
Definition: wingpart.h:136
virtual void appendTo(const Topology &topo, MxMesh &mx, bool mergeBc=false)
append final face meshes to global (does no merge nodes)
Definition: wingpart.cpp:547
virtual void makeLegacyCaps(Topology &topo)
generate cap surfaces for sumo 2.x geometry
Definition: wingpart.cpp:708
void fillDefaultDimensions(Vct3 &ed, Vct3 &ft) const
generate default wake parameters if needed
Definition: wingpart.cpp:532
virtual ~WingPart()
can be base class
Definition: wingpart.cpp:45
Real m_capheight[4]
used for import of legacy surfaces
Definition: wingpart.h:151
Base class for mesh generation components assembled from multiple surfaces.
Definition: topopart.h:30
Main interface to IGES files.
Definition: igesfile.h:32
Indices m_ifaces
indices of body faces and wake faces once added to topology
Definition: wingpart.h:130
CurvePtr tryAttachWake(SurfacePtr body, int iseg, Real v, const Vct3 &edgeDistance, const Vct3 &farTangent) const
test whether a wake at v on segment iseg can be attached to body
Definition: wingpart.cpp:511
void meshQuality(DcMeshCritBasePtr wingCrit, DcMeshCritBasePtr wakeCrit=DcMeshCritBasePtr())
set mesh quality criterion for wing and wake segments
Definition: wingpart.cpp:64
void createSimpleWakes(const Vct3 &edgeDistance=Vct3(), const Vct3 &farTangent=Vct3(), Real compression=0.2)
create wakes using the default cubic guide curves
Definition: wingpart.cpp:447
Segmented lifting surface with wake.
Definition: wingpart.h:39
bool m_toroidal
whether the first segment connects to the last (ring-wing)
Definition: wingpart.h:157
bool m_bluntEdge
trailing edge thickness switch (default false)
Definition: wingpart.h:160
Real m_leBias
mesh bias options
Definition: wingpart.h:145
SurfaceArray m_segments
segment surfaces of the wing
Definition: wingpart.h:124
void toIges(IgesFile &file, int tfi=0) const
export all surfaces to IGES
Definition: wingpart.cpp:723
bool m_fromSymSurf
remember whether this was constructed from a mirrored surface
Definition: wingpart.h:163
uint findWakeTipEdge(const Topology &topo, Real v) const
locate the wake edge at v = 0 or v = 1
Definition: wingpart.cpp:433
void mirrorSegments(const Vct3 &mipo=Vct3(0, 0, 0), const Vct3 &mipn=Vct3(0, 1, 0))
generate new segments mirrored about the plane mipo, mipn
Definition: wingpart.cpp:89
virtual void importLegacy(const XmlElement &xe)
simplify import of legacy smx data
Definition: wingpart.cpp:614
void createAttachedWakes(SurfaceArray bodies, const Vct3 &edgeDistance=Vct3(), const Vct3 &farTangent=Vct3())
create wakes using body-attached guide curves
Definition: wingpart.cpp:464
Real m_maxProjectedU
maximum permitted edge length in terms of u-coordinate projection
Definition: wingpart.h:148
void configure(const ConfigParser &cfg)
configuration parameters
Definition: wingpart.cpp:47
Container for topology information.
Definition: topology.h:30
uint findWingTipEdge(const Topology &topo, Real v) const
locate the end-cap boundary edge at v = 0 or v = 1
Definition: wingpart.cpp:419
virtual void inject(Topology &topo)
insert this part into the topology object
Definition: wingpart.cpp:119
uint appendSegment(SurfacePtr wingSegment)
append segment to wing w/o wakes
Definition: wingpart.cpp:74
std::pair< uint, uint > makeFlatCaps(Topology &topo, bool makeLeft=true, bool makeRight=true)
generate flat tip caps (requires that edges are discretized), left: v=1
Definition: wingpart.cpp:198
std::pair< uint, uint > makeRoundedCaps(Topology &topo, bool makeLeft=true, bool makeRight=true)
generate elliptic tip caps (requires that edges are discretized), left: v=1
Definition: wingpart.cpp:226
Real m_relWakeLength
internally generated surfaces which close blunt trailing edges
Definition: wingpart.h:142
uint m_rightCap
indices of autogenerated tip caps, if any, generated by
Definition: wingpart.h:154
SurfaceArray m_wakes
one wake surface for each segment
Definition: wingpart.h:127
DcMeshCritPtr appendStitched(const XmlElement &xe)
cut up a stitched surface and add each segment
Definition: wingpart.cpp:683
Generated on Mon Jan 24 2022 03:03:16 for libsurf by   doxygen 1.8.5