Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tutorials
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
conveks
tutorials
Commits
c1eb3ab5
Commit
c1eb3ab5
authored
6 years ago
by
Erin Kuci
Browse files
Options
Downloads
Patches
Plain Diff
update the call to conveks
parent
5a665cbb
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Ccore/onelab_optimize.py
+8
-2
8 additions, 2 deletions
Ccore/onelab_optimize.py
Lbracket/topo.py
+7
-1
7 additions, 1 deletion
Lbracket/topo.py
Team25/shape.py
+7
-1
7 additions, 1 deletion
Team25/shape.py
with
22 additions
and
4 deletions
Ccore/onelab_optimize.py
+
8
−
2
View file @
c1eb3ab5
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Lbracket/topo.py
+
7
−
1
View file @
c1eb3ab5
...
@@ -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
This diff is collapsed.
Click to expand it.
Team25/shape.py
+
7
−
1
View file @
c1eb3ab5
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment