Skip to content

Commit 4c762ab

Browse files
A-CGrayArshSaja
andauthored
Various small changes (#241)
* Remove lower bound from triangulated surface constraint * Make addRefAxis work with zero x/y/zFraction * Fix type of CompositeDV modeshapes * Fix other fraction checks * Convert `J_full` to array, not matrix --------- Co-authored-by: ArshSaja <63115167+ArshSaja@users.noreply.github.com>
1 parent 20f491a commit 4c762ab

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

pygeo/constraints/areaConstraint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def __init__(
3838
if geograd_parallel is None:
3939
raise ImportError("Geograd package must be installed to use triangulated surface constraint")
4040

41-
super().__init__(name, 2, -1e10, 0.0, scale, None, addToPyOpt)
41+
super().__init__(name, 2, None, 0.0, scale, None, addToPyOpt)
4242

4343
self.comm = comm
4444

pygeo/parameterization/DVGeo.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ def addRefAxis(
506506
"rot0axis": rot0axis,
507507
}
508508
nAxis = len(curve.coef)
509-
elif xFraction or yFraction or zFraction:
509+
elif xFraction is not None or yFraction is not None or zFraction is not None:
510510
# Some assumptions
511511
# - FFD should be a close approximation of geometry surface so that
512512
# xFraction roughly corresponds to airfoil LE, TE, or 1/4 chord
@@ -594,22 +594,22 @@ def addRefAxis(
594594
pts_vec[ct_, :] = p_rot
595595

596596
# Temporary ref axis node coordinates - aligned with main system of reference
597-
if xFraction:
597+
if xFraction is not None:
598598
# getting the bounds of the FFD section
599599
x_min = np.min(pts_vec[:, 0])
600600
x_max = np.max(pts_vec[:, 0])
601601
x_node = xFraction * (x_max - x_min) + x_min # chordwise
602602
else:
603603
x_node = np.mean(pts_vec[:, 0])
604604

605-
if yFraction:
605+
if yFraction is not None:
606606
y_min = np.min(pts_vec[:, 1])
607607
y_max = np.max(pts_vec[:, 1])
608608
y_node = y_max - yFraction * (y_max - y_min) # top-bottom
609609
else:
610610
y_node = np.mean(pts_vec[:, 1])
611611

612-
if zFraction:
612+
if zFraction is not None:
613613
z_min = np.min(pts_vec[:, 2])
614614
z_max = np.max(pts_vec[:, 2])
615615
z_node = z_max - zFraction * (z_max - z_min) # top-bottom
@@ -1518,7 +1518,7 @@ def addCompositeDV(self, dvName, ptSetName=None, u=None, scale=None, prependName
15181518
if ptSetName is None:
15191519
raise ValueError("If u and s need to be computed, you must specify the ptSetName")
15201520
self.computeTotalJacobian(ptSetName)
1521-
J_full = self.JT[ptSetName].todense() # this is in CSR format but we convert it to a dense matrix
1521+
J_full = self.JT[ptSetName].toarray() # this is in CSR format but we convert it to a dense matrix
15221522
u, s, _ = np.linalg.svd(J_full, full_matrices=False)
15231523
scale = np.sqrt(s)
15241524
# normalize the scaling

0 commit comments

Comments
 (0)