22
33import openmdao .api as om
44from openaerostruct .utils .check_surface_dict import check_surface_dict_keys
5+ from openaerostruct .utils .interpolation import get_normalized_span_coords
56
67
78class Geometry (om .Group ):
@@ -29,7 +30,6 @@ def setup(self):
2930
3031 # Get the surface name and create a group to contain components
3132 # only for this surface
32- ny = surface ["mesh" ].shape [1 ]
3333
3434 if self .options ["DVGeo" ]:
3535 from openaerostruct .geometry .ffd_component import GeometryMesh
@@ -39,7 +39,7 @@ def setup(self):
3939 if "t_over_c_cp" in surface .keys ():
4040 n_cp = len (surface ["t_over_c_cp" ])
4141 # Add bspline components for active bspline geometric variables.
42- x_interp = np . linspace ( 0.0 , 1.0 , int ( ny - 1 ) )
42+ x_interp = get_normalized_span_coords ( surface , mid_panel = True )
4343 comp = self .add_subsystem (
4444 "t_over_c_bsp" ,
4545 om .SplineComp (
@@ -67,7 +67,7 @@ def setup(self):
6767 if "twist_cp" in surface .keys ():
6868 n_cp = len (surface ["twist_cp" ])
6969 # Add bspline components for active bspline geometric variables.
70- x_interp = np . linspace ( 0.0 , 1.0 , int ( ny ) )
70+ x_interp = get_normalized_span_coords ( surface )
7171 comp = self .add_subsystem (
7272 "twist_bsp" ,
7373 om .SplineComp (
@@ -86,7 +86,7 @@ def setup(self):
8686 if "chord_cp" in surface .keys ():
8787 n_cp = len (surface ["chord_cp" ])
8888 # Add bspline components for active bspline geometric variables.
89- x_interp = np . linspace ( 0.0 , 1.0 , int ( ny ) )
89+ x_interp = get_normalized_span_coords ( surface )
9090 comp = self .add_subsystem (
9191 "chord_bsp" ,
9292 om .SplineComp (
@@ -103,7 +103,7 @@ def setup(self):
103103 if "t_over_c_cp" in surface .keys ():
104104 n_cp = len (surface ["t_over_c_cp" ])
105105 # Add bspline components for active bspline geometric variables.
106- x_interp = np . linspace ( 0.0 , 1.0 , int ( ny - 1 ) )
106+ x_interp = get_normalized_span_coords ( surface , mid_panel = True )
107107 comp = self .add_subsystem (
108108 "t_over_c_bsp" ,
109109 om .SplineComp (
@@ -119,7 +119,7 @@ def setup(self):
119119 if "xshear_cp" in surface .keys ():
120120 n_cp = len (surface ["xshear_cp" ])
121121 # Add bspline components for active bspline geometric variables.
122- x_interp = np . linspace ( 0.0 , 1.0 , int ( ny ) )
122+ x_interp = get_normalized_span_coords ( surface )
123123 comp = self .add_subsystem (
124124 "xshear_bsp" ,
125125 om .SplineComp (
@@ -136,7 +136,7 @@ def setup(self):
136136 if "yshear_cp" in surface .keys ():
137137 n_cp = len (surface ["yshear_cp" ])
138138 # Add bspline components for active bspline geometric variables.
139- x_interp = np . linspace ( 0.0 , 1.0 , int ( ny ) )
139+ x_interp = get_normalized_span_coords ( surface )
140140 comp = self .add_subsystem (
141141 "yshear_bsp" ,
142142 om .SplineComp (
@@ -153,7 +153,7 @@ def setup(self):
153153 if "zshear_cp" in surface .keys ():
154154 n_cp = len (surface ["zshear_cp" ])
155155 # Add bspline components for active bspline geometric variables.
156- x_interp = np . linspace ( 0.0 , 1.0 , int ( ny ) )
156+ x_interp = get_normalized_span_coords ( surface )
157157 comp = self .add_subsystem (
158158 "zshear_bsp" ,
159159 om .SplineComp (
0 commit comments