Skip to content
Snippets Groups Projects
Commit c1eb3ab5 authored by Erin Kuci's avatar Erin Kuci
Browse files

update the call to conveks

parent 5a665cbb
No related branches found
No related tags found
No related merge requests found
...@@ -123,6 +123,9 @@ def Optimize(Optimizer): ...@@ -123,6 +123,9 @@ def Optimize(Optimizer):
lowerBound[label] = var[2] lowerBound[label] = var[2]
upperBound[label] = var[3] upperBound[label] = var[3]
# Initialize conveks
conveks.initialize()
# Initialize the MMA optimizer # Initialize the MMA optimizer
conveks.mma.initialize(initialPoint, lowerBound, upperBound) conveks.mma.initialize(initialPoint, lowerBound, upperBound)
...@@ -170,9 +173,12 @@ def Optimize(Optimizer): ...@@ -170,9 +173,12 @@ def Optimize(Optimizer):
print 'Converged: %4d %3.6f %3.6f %3.6f' %(it, obj, change_rel, change_mma), print 'Converged: %4d %3.6f %3.6f %3.6f' %(it, obj, change_rel, change_mma),
print xFromMMA, grad_obj print xFromMMA, grad_obj
# This should be called at the end # This should be called at the end of MMA
conveks.mma.finalize() conveks.mma.finalize()
# This should be called at the end
conveks.finalize()
def minimize(name): def minimize(name):
global x, modelName, file_geo, file_pro, file_msh, mygmsh, mygetdp, maxIter, maxChange global x, modelName, file_geo, file_pro, file_msh, mygmsh, mygetdp, maxIter, maxChange
modelName = name modelName = name
......
...@@ -87,6 +87,9 @@ lowerBound = 0.001*np.ones(numVariables) ...@@ -87,6 +87,9 @@ lowerBound = 0.001*np.ones(numVariables)
# upper bound for design variables (here all set to 1) # upper bound for design variables (here all set to 1)
upperBound = np.ones(numVariables) upperBound = np.ones(numVariables)
# Initialize conveks
conveks.initialize()
# Initialize the MMA optimizer # Initialize the MMA optimizer
conveks.mma.initialize(x, lowerBound, upperBound) conveks.mma.initialize(x, lowerBound, upperBound)
...@@ -159,5 +162,8 @@ while change > maxChange and it <= maxIter and c.getString('topo/Action') != 'st ...@@ -159,5 +162,8 @@ while change > maxChange and it <= maxIter and c.getString('topo/Action') != 'st
change = conveks.mma.getDesignChange() change = conveks.mma.getDesignChange()
it = conveks.mma.getOuterIteration() it = conveks.mma.getOuterIteration()
# This should be called at the end # This should be called at the end of MMA
conveks.mma.finalize() conveks.mma.finalize()
# This should be called at the end
conveks.finalize()
\ No newline at end of file
...@@ -101,6 +101,9 @@ for label, var in x.iteritems(): ...@@ -101,6 +101,9 @@ for label, var in x.iteritems():
lowerBound[label] = var[2] lowerBound[label] = var[2]
upperBound[label] = var[3] upperBound[label] = var[3]
# Initialize conveks
conveks.initialize()
# Initialize the MMA optimizer # Initialize the MMA optimizer
conveks.mma.initialize(initialPoint, lowerBound, upperBound) conveks.mma.initialize(initialPoint, lowerBound, upperBound)
...@@ -159,5 +162,8 @@ while it <= maxIter and c.getString('shape/Action') != 'stop': ...@@ -159,5 +162,8 @@ while it <= maxIter and c.getString('shape/Action') != 'stop':
change = conveks.mma.getDesignChange() change = conveks.mma.getDesignChange()
it = conveks.mma.getOuterIteration() it = conveks.mma.getOuterIteration()
# This should be called at the end # This should be called at the end of MMA
conveks.mma.finalize() conveks.mma.finalize()
# This should be called at the end
conveks.finalize()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment