libsurf
Programmer's Documentation

dispinterpolator.h (r6227/r5716)
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_DISPINTERPOLATOR_H
16 #define SURF_DISPINTERPOLATOR_H
17 
18 #include "forward.h"
19 #include <genua/logger.h>
20 #include <genua/forward.h>
21 #include <genua/dvector.h>
22 #include <genua/svector.h>
23 
34 class DispInterpolator : public Logger
35 {
36 public:
37 
39 
42 
44  virtual ~DispInterpolator() {}
45 
47  void setStructural(MxMeshPtr pmstr) {m_pstr = pmstr;}
48 
50  void setAerodynamic(MxMeshPtr pmaer) {m_paer = pmaer;}
51 
53  void collectWallBocos(const Indices &movingBc,
54  const Indices &slidingBc = Indices(),
55  const Indices &rubberBc = Indices());
56 
58  void collectWallSections(const Indices &movingSec,
59  const Indices &slidingSec = Indices(),
60  const Indices &rubberSec = Indices());
61 
63  uint useEigenmodes(uint maxModeCount = NotFound, Real minFreq = -1.0,
64  Real maxFreq = std::numeric_limits<Real>::max() );
65 
67  void dispScale(Real s) {m_scale = s;}
68 
70  Real dispScale() const {return m_scale;}
71 
73  uint nodesToMap() const {return m_mappedNodes.size();}
74 
76  virtual uint map() = 0;
77 
79  virtual void hmap(MapMatrix &) {}
80 
82  virtual uint map(const MapMatrix &H, DMatrix<float> &m);
83 
85  void maxBenignScale(Vector &maxscale) const;
86 
88  void autoScale();
89 
91  void appendFields(const DMatrix<float> &m);
92 
94  virtual void writeBdis(const std::string &prefix) const;
95 
97  virtual FFANodePtr mapToFFA(const MapMatrix &H) const;
98 
100  virtual bool mapFromFFA(const FFANodePtr &root, MapMatrix &H);
101 
102 protected:
103 
105  void collectWallNodes();
106 
108  void collectDispFields();
109 
111  void boundingBox(Vct3 &plo, Vct3 &phi) const;
112 
114  void mergeSlidingNodes(const Indices &slidingNodes);
115 
117  Vct3 slidingNormal(uint eix) const;
118 
120  void pinSlidingNodes(DMatrix<float> & dsp) const;
121 
123  void pinSlidingNodes(MapMatrix &H) const;
124 
126  void findMappedElements(Indices &elix) const;
127 
129  void mapAerTopology(const Indices &nodeSet, ConnectMap &v2v) const;
130 
132  void nearbyNodes(Real threshold, const Indices &src, Indices &nbnodes) const;
133 
135  void rubberTriangles(Indices &tri) const;
136 
138  void smoothMap(int niter, float omega, const Indices &rnodes,
139  const ConnectMap &v2v, MapMatrix &H) const;
140 
142  uint appendNodeSet(const Indices &rnodes);
143 
145  void smoothedRegionRim(const ConnectMap &v2v,
146  const Indices &rnodes, Indices &rim) const;
147 
149  void bfsWalk(uint k, Real sqlmax, const ConnectMap &v2v,
150  const Indices &subset, Indices &vnb) const;
151 
153  bool isMappedElement(uint k) const;
154 
155 protected:
156 
159  {
160  Indices nodes;
161  Vct3 normal;
162  std::string boundaryName;
163  };
164  typedef std::vector<SlidingNodeSet> SlidingSet;
165 
167  MxMeshPtr m_pstr;
168 
170  MxMeshPtr m_paer;
171 
173  Indices m_mappedNodes;
174 
176  Indices m_rubberNodes;
177 
179  SlidingSet m_snset;
180 
182  Indices m_movingBocos, m_movingSections;
183 
185  Indices m_slidingBocos, m_slidingSections;
186 
188  Indices m_fixedBocos, m_fixedSections;
189 
191  Indices m_rubberBocos, m_rubberSections;
192 
194  Indices m_aerFields;
195 
197  Indices m_strFields;
198 
200  Vector m_modalMass, m_modalStiffness;
201 
203  Vector m_autoScales;
204 
206  Real m_scale;
207 };
208 
209 #endif // DISPINTERPOLATOR_H
Indices m_slidingBocos
indices of the aerodynamic mesh bocos (element sets) marked as moving
Definition: dispinterpolator.h:185
void smoothedRegionRim(const ConnectMap &v2v, const Indices &rnodes, Indices &rim) const
flag fixed aerodynamic nodes which touch smoothed nodes
Definition: dispinterpolator.cpp:1068
virtual ~DispInterpolator()
base class
Definition: dispinterpolator.h:44
virtual uint map()=0
implemented by child classes, return number of fields processed
void nearbyNodes(Real threshold, const Indices &src, Indices &nbnodes) const
determine all mapped aerodynamic nodes which are closer than threshold
Definition: dispinterpolator.cpp:873
uint nodesToMap() const
query the number of nodes to process
Definition: dispinterpolator.h:73
uint appendNodeSet(const Indices &rnodes)
used for debugging : create index sets
Definition: dispinterpolator.cpp:1051
void boundingBox(Vct3 &plo, Vct3 &phi) const
compute bounding box of mapped node set
Definition: dispinterpolator.cpp:1016
SlidingSet m_snset
information used to enforce sliding conditions
Definition: dispinterpolator.h:179
void collectWallSections(const Indices &movingSec, const Indices &slidingSec=Indices(), const Indices &rubberSec=Indices())
define the subset of aerodynamic nodes which are to be deformed
Definition: dispinterpolator.cpp:159
void autoScale()
rescale all mapped fields to at least avoid triangle inversion
Definition: dispinterpolator.cpp:431
virtual void writeBdis(const std::string &prefix) const
write surface displacement files for EDGE (.bdis)
Definition: dispinterpolator.cpp:620
Indices m_fixedBocos
indices of mesh sections marked as fixed
Definition: dispinterpolator.h:188
Vct3 slidingNormal(uint eix) const
determine the sliding plane normal from element
Definition: dispinterpolator.cpp:229
Real dispScale() const
access scale factor
Definition: dispinterpolator.h:70
Vector m_autoScales
modal scaling factors computed by autoScale
Definition: dispinterpolator.h:203
void mergeSlidingNodes(const Indices &slidingNodes)
mark sliding nodes
Definition: dispinterpolator.cpp:216
Real m_scale
scale displacements by this global factor
Definition: dispinterpolator.h:206
void pinSlidingNodes(DMatrix< float > &dsp) const
restrict displacements of sliding nodes
Definition: dispinterpolator.cpp:445
void maxBenignScale(Vector &maxscale) const
determine maximum permitted scale to avoid surface triangle inversion
Definition: dispinterpolator.cpp:357
Indices m_aerFields
indices of the resulting displacement fields in aerodynamic mesh
Definition: dispinterpolator.h:194
void mapAerTopology(const Indices &nodeSet, ConnectMap &v2v) const
assemble node-to-node connectivity of mapped aerodynamic nodes
Definition: dispinterpolator.cpp:824
void collectWallNodes()
collect wall nodes when mapped nodes not explicitely given
Definition: dispinterpolator.cpp:79
void smoothMap(int niter, float omega, const Indices &rnodes, const ConnectMap &v2v, MapMatrix &H) const
apply smoothing to mapping matrix
Definition: dispinterpolator.cpp:942
virtual FFANodePtr mapToFFA(const MapMatrix &H) const
pack mapping matrix H into FFA format
Definition: dispinterpolator.cpp:746
Indices m_rubberNodes
aerodynamic nodes for which deformations will be extrapolated
Definition: dispinterpolator.h:176
void collectDispFields()
collect all fields marked as displacements or eigenmodes
Definition: dispinterpolator.cpp:255
MxMeshPtr m_pstr
structural mesh
Definition: dispinterpolator.h:167
uint useEigenmodes(uint maxModeCount=NotFound, Real minFreq=-1.0, Real maxFreq=std::numeric_limits< Real >::max())
define the subset of modes to use in terms of frequencies
Definition: dispinterpolator.cpp:282
virtual bool mapFromFFA(const FFANodePtr &root, MapMatrix &H)
retreive mapping matrix H from FFA format file
Definition: dispinterpolator.cpp:790
void findMappedElements(Indices &elix) const
determine which aerodynamic elements are involved in mapping
Definition: dispinterpolator.cpp:1030
void collectWallBocos(const Indices &movingBc, const Indices &slidingBc=Indices(), const Indices &rubberBc=Indices())
define the subset of aerodynamic nodes which are to be deformed
Definition: dispinterpolator.cpp:94
DispInterpolator()
empty object
Definition: dispinterpolator.h:41
Indices m_movingBocos
indices of the aerodynamic mesh bocos (element sets) marked as moving
Definition: dispinterpolator.h:182
MxMeshPtr m_paer
aerodynamic mesh
Definition: dispinterpolator.h:170
void setAerodynamic(MxMeshPtr pmaer)
set aerodynamic mesh, which will be updated with deformation fields
Definition: dispinterpolator.h:50
Base class for displacement interpolation.
Definition: dispinterpolator.h:34
void rubberTriangles(Indices &tri) const
identify aerodynamic surface triangles for rubber sections
Definition: dispinterpolator.cpp:910
data needed to enforce sliding condition
Definition: dispinterpolator.h:158
Indices m_mappedNodes
aerodynamic nodes to map
Definition: dispinterpolator.h:173
Indices m_strFields
indices of fields in structural mesh to use for mapping
Definition: dispinterpolator.h:197
bool isMappedElement(uint k) const
check whether aerodynamic element k is moving entirely (all nodes mapped)
Definition: dispinterpolator.cpp:1137
virtual void hmap(MapMatrix &)
construct mapping matrix H (optionally implemented)
Definition: dispinterpolator.h:79
void dispScale(Real s)
change scale factor to used for displacements
Definition: dispinterpolator.h:67
Indices m_rubberBocos
indices of mesh sections/bocos marked as rubber sections
Definition: dispinterpolator.h:191
void bfsWalk(uint k, Real sqlmax, const ConnectMap &v2v, const Indices &subset, Indices &vnb) const
walk from k and find all in subset reachable within distance
Definition: dispinterpolator.cpp:1093
void setStructural(MxMeshPtr pmstr)
set structural mesh
Definition: dispinterpolator.h:47
void appendFields(const DMatrix< float > &m)
add fields to aerodynamic mesh
Definition: dispinterpolator.cpp:500
Vector m_modalMass
modal mass and stiffness values
Definition: dispinterpolator.h:200
Generated on Mon Jan 24 2022 03:03:16 for libsurf by   doxygen 1.8.5