Esempio n. 1
0
 def redim(self,nPts,overwrite=True,distribution='sin'):
     """
     Redimension and redistribution of airfoil points using cosine function. 
     More points are located at leading and trailing edge.
     
     Parameters
     ----------
     
     numPts : integer
         number of points for target airfoil. If number of points is same 
         as source airfoil, points will be redistributed to make smooth 
         surface
     overwrite : bool
         If True then self.pts, self.upPts and self.loPts will be 
         overwritten, otherwise will return array of redimensioned points 
         in format of self.pts
     """
     if nPts%2==0:
         nPts1 = nPts/2
         nPts2 = nPts/2+1
     else:
         nPts1 = (nPts+1)/2
         nPts2 = nPts1
     #nPts *= 0.5
     t1 = self._get_point_distribution(nPts1,distribution)
     t2 = self._get_point_distribution(nPts2,distribution)
     self._create_splines()
     xUp, yUp = self._curveUp(t1)
     xLo, yLo = self._curveLo(t2)
     upPts = np.transpose(np.vstack([xUp,yUp]))
     loPts = np.transpose(np.vstack([xLo,yLo]))
     coord = geom.join_coordinates(upPts,loPts)
     if overwrite:
         self.pts   = coord
         self.ptsUp = upPts
         self.ptsLo = loPts
     else:
         return coord
Esempio n. 2
0
 def _join_coordinates(self):
     self.pts = geom.join_coordinates(self.ptsUp, self.ptsLo)