Comments (3)
@joanibal can you post the global design variable function you used in the child?
While writing the tutorial I wanted to understand why global variable funcs that use += operations work properly. When self.update() is called, the FFD coefficients are set back to their original (baseline) locations and then the global DVs are computed in order of their addition, then sectionlocal and local variables. So you don't accumulate changes across iterations via += operations.
On the other hand, child FFDs do some weird stuff that I don't totally understand, but I don't think it's doing the same reset. So if you used += or *= operations in your child global dv funcs, it could lead to some weird behavior. It may or may not be relevant to your debugging here
if not self.isChild:
self.FFD.coef = self.origFFDCoef.copy()
self._setInitialValues()
else:
# Update all coef
self.FFD._updateVolumeCoef()
# Evaluate starting pointset
Xstart = self.FFD.getAttachedPoints(ptSetName)
if self.complex:
# Now we have to propagate the complex part through Xstart
tempCoef = self.FFD.coef.copy().astype('D')
Xstart = Xstart.astype('D')
imag_part = numpy.imag(tempCoef)
imag_j = 1j
dPtdCoef = self.FFD.embededVolumes[ptSetName].dPtdCoef
if dPtdCoef is not None:
for ii in range(3):
Xstart[:, ii] += imag_j*dPtdCoef.dot(imag_part[:, ii])
from pygeo.
Here are the functions I used with child FFDs
def twist_flap(val, geo):
geo.rot_z['flap_axis'].coef[:] = val[:] - 29.5
def translate_x_flap(val, geo):
C = geo.extractCoef('flap_axis')
C[:, 0] += val[:] + 0.15421028
geo.restoreCoef(C, 'flap_axis')
def translate_y_flap(val, geo):
C = geo.extractCoef('flap_axis')
C[:, 1] += val[:] - 0.0816069
geo.restoreCoef(C, 'flap_axis')
def twist_slat(val, geo):
geo.rot_z['slat_axis'].coef[:] = val[:] + 29.0
def translate_x_slat(val, geo):
C = geo.extractCoef('slat_axis')
C[:, 0] += val[:] - .0911552
geo.restoreCoef(C, 'slat_axis')
def translate_y_slat(val, geo):
C = geo.extractCoef('slat_axis')
C[:, 1] += val[:] - 0.0735696
geo.restoreCoef(C, 'slat_axis')
from pygeo.
Yeah I can't say for certain that the weird behavior is caused by the per-iteration reset behavior of the coefficients referenced by C = geo.extractCoef('slat_axis')
but it's possible.
from pygeo.
Related Issues (20)
- Define base classes to unify the various DVGeo modules HOT 1
- Document Python dependencies HOT 4
- DVGeo does not use original FFD coef values when complex-stepping user functions HOT 5
- Local DVs are not consistent with in-plane section rotations HOT 1
- Prefoil dependency HOT 3
- Remove the duplicate tolerance when embedding points. HOT 1
- The symmPlane argument does not work with all of the feature set in DVGeo.
- Rename some modules HOT 14
- Increase 'nIter' for 'attachPoints' in 'pyBlock.py' HOT 2
- DVGeometryCST import fails silently due to dependency not described in the docs HOT 2
- Tests fail due to skipped tests
- MPhys DVCon derivatives are incorrect with multiple processors HOT 2
- Is there a way to link design variables of shared nodes in multi block FFDs? HOT 6
- Issue with determining interior points HOT 2
- Discussion: Get the derivative of the dXpt/dDV and the DVConstraint. HOT 1
- FIXED FFD POINTS FOR AN OPTIMIZATION HOT 5
- issue using addLocalDV HOT 8
- installation error HOT 1
- mpiexec is not working with pyGeo imported HOT 4
- Replace kwargs for ESP and VSP functions in the MPhys interface
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pygeo.