Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ref axis optional when adding a child FFD #150

Merged
merged 10 commits into from
Aug 19, 2022
Merged
18 changes: 9 additions & 9 deletions pygeo/parameterization/DVGeo.py
Original file line number Diff line number Diff line change
Expand Up @@ -1686,22 +1686,22 @@ def update(self, ptSetName, childDelta=True, config=None):
# We've postponed things as long as we can...do the finalization.
self._finalize()

for iChild in range(len(self.children)):
if len(self.children[iChild].axis) > 0:
self.children[iChild]._finalize()
refaxis_ptSetName = "child%d_axis" % (iChild)
if refaxis_ptSetName not in self.FFD.embeddedVolumes:
print("adding refaxis_ptSetName", refaxis_ptSetName)
self.FFD.attachPoints(self.children[iChild].refAxis.coef, refaxis_ptSetName)
self.FFD.calcdPtdCoef("child%d_axis" % (iChild))

# Make sure coefficients are complex
self._complexifyCoef()

# Set all coef Values back to initial values
if not self.isChild:
self.FFD.coef = self.origFFDCoef.copy()
self._setInitialValues()

for iChild in range(len(self.children)):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch here, did not realize that the children were trying to initialize themselves again. Out of curiosity, did you have issues because of this or you just re-checked the code?

if len(self.children[iChild].axis) > 0:
self.children[iChild]._finalize()
refaxis_ptSetName = "child%d_axis" % (iChild)
if refaxis_ptSetName not in self.FFD.embeddedVolumes:
print("adding refaxis_ptSetName", refaxis_ptSetName)
self.FFD.attachPoints(self.children[iChild].refAxis.coef, refaxis_ptSetName)
self.FFD.calcdPtdCoef("child%d_axis" % (iChild))
else:
# Update all coef
self.FFD._updateVolumeCoef()
Expand Down