libsurf
Programmer's Documentation

initgrid.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_INITGRID_H
16 #define SURF_INITGRID_H
17 
18 #include "forward.h"
19 #include <genua/dvector.h>
20 
29 class InitGrid
30 {
31  public:
32 
34  InitGrid(const Surface *p) : psf(p) {}
35 
37  void initPattern(const Vector & u, const Vector & v);
38 
40  void initPattern(const PointGrid<2> & pg);
41 
43  void refine(Real lmax, Real lmin, Real phimax);
44 
48  Real uAdapt(Real lmax, Real lmin, Real phimax, uint numax = 0);
49 
51  void uRefineByLength(Real lmax);
52 
54  void vRefineByLength(Real lmax);
55 
57  Real vRefineByGap(Real maxgap);
58 
60  Real vRefineByAngle(Real maxphi);
61 
63  Real vRefineByStretch(uint nvmax, Real smax);
64 
66  void uRefineByAngle(Real phimax, Real lmin);
67 
69  void vsmooth(uint niter);
70 
72  void usmooth(uint niter);
73 
75  void enforceUSymmetry();
76 
78  void enforceVSymmetry();
79 
81  void enforceColumns(const Vector & vpos);
82 
84  uint nrows() const {return up[0].size();}
85 
87  uint ncols() const {return vp.size();}
88 
90  void collect(PointGrid<2> & pts) const;
91 
92  private:
93 
95  void initPattern(uint nu, uint nv);
96 
98  void kinks(uint j, Vector & cphi) const;
99 
101  void shift(uint j, Real cminphi, const Vector & cphi);
102 
104  uint insertFrame(Real v, uint nu);
105 
107  void insertStringer(Real u);
108 
110  void usmoothColumn(uint j, uint niter);
111 
113  Real adaptULine(uint i, uint nu, Real lmax, Real lmin, Real phimax);
114 
116  bool smoothSeam(Real v) const;
117 
118  private:
119 
121  const Surface *psf;
122 
124  Vector vp;
125 
127  VectorArray up;
128 };
129 
130 #endif
void kinks(uint j, Vector &cphi) const
compute cosines of local kink angles at section j
Definition: initgrid.cpp:144
void usmoothColumn(uint j, uint niter)
smooth u-distribution at vj
Definition: initgrid.cpp:434
void vRefineByLength(Real lmax)
adapt spacing by insertion, so that lmax criterion is fullfilled
Definition: initgrid.cpp:181
uint nrows() const
current size
Definition: initgrid.h:84
void usmooth(uint niter)
equilibrate by performing laplacian smoothing within cuts
Definition: initgrid.cpp:427
void shift(uint j, Real cminphi, const Vector &cphi)
shift nodes in one section in order to decrease kink angles
Definition: initgrid.cpp:125
void refine(Real lmax, Real lmin, Real phimax)
create a grid without any knowledge about the surface
Definition: initgrid.cpp:57
uint insertFrame(Real v, uint nu)
insert an evenly spaced frame at v, return new frame index
Definition: initgrid.cpp:406
Vector vp
v-parameter values for the frames
Definition: initgrid.h:124
void enforceColumns(const Vector &vpos)
force kink columns to be present
Definition: initgrid.cpp:593
Real adaptULine(uint i, uint nu, Real lmax, Real lmin, Real phimax)
adapte a single u-line
Definition: initgrid.cpp:444
void uRefineByLength(Real lmax)
adapt spacing by insertion, so that lmax criterion is fullfilled
Definition: initgrid.cpp:159
void vsmooth(uint niter)
equilibrate by performing laplacian smoothing between cuts
Definition: initgrid.cpp:538
void insertStringer(Real u)
insert a new u values in all frames
Definition: initgrid.cpp:416
void enforceUSymmetry()
enforce symmetry about u = 0.5
Definition: initgrid.cpp:557
bool smoothSeam(Real v) const
determine if the surface is smooth at u=0/1
Definition: initgrid.cpp:611
Real vRefineByAngle(Real maxphi)
adapt spacing (once) to avoid large v-direction kinks
Definition: initgrid.cpp:223
const Surface * psf
pointer to surface
Definition: initgrid.h:121
InitGrid(const Surface *p)
construct grid generator
Definition: initgrid.h:34
Utility class to generate simple quad mesh.
Definition: initgrid.h:29
Real vRefineByStretch(uint nvmax, Real smax)
adapt v-spacing so that stretch ratio is reduced
Definition: initgrid.cpp:301
VectorArray up
u-parameter values of the frames
Definition: initgrid.h:127
void uRefineByAngle(Real phimax, Real lmin)
adapt spacing by insertion, so that phimax criterion is fullfilled
Definition: initgrid.cpp:357
uint ncols() const
current size
Definition: initgrid.h:87
void collect(PointGrid< 2 > &pts) const
create grid from parameter arrays
Definition: initgrid.cpp:393
Surface interface.
Definition: surface.h:37
void initPattern(const Vector &u, const Vector &v)
define an initial pattern to start from
Definition: initgrid.cpp:21
Real vRefineByGap(Real maxgap)
adapt spacing to avoid excissive approximation error (gap)
Definition: initgrid.cpp:262
Real uAdapt(Real lmax, Real lmin, Real phimax, uint numax=0)
Adapt distribution.
Definition: initgrid.cpp:103
void enforceVSymmetry()
enforce symmetry about v = 0.5
Definition: initgrid.cpp:574
Generated on Wed Jan 19 2022 03:03:15 for libsurf by   doxygen 1.8.5