Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
getdp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
getdp
getdp
Commits
404e8859
Commit
404e8859
authored
Aug 18, 2016
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
pp
parent
13c4fcef
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
benchmarks/magnetometer/magnetometer.geo
+2
-4
2 additions, 4 deletions
benchmarks/magnetometer/magnetometer.geo
benchmarks/magnetometer/optdriver.py
+10
-8
10 additions, 8 deletions
benchmarks/magnetometer/optdriver.py
doc/VERSIONS.txt
+2
-0
2 additions, 0 deletions
doc/VERSIONS.txt
with
14 additions
and
12 deletions
benchmarks/magnetometer/magnetometer.geo
+
2
−
4
View file @
404e8859
Include
"magnetometer_data.geo"
;
Include
"magnetometer_data.geo"
;
Solver
.
AutoShowLastStep
=
0
;
Solver
.
AutoShowLastStep
=
0
;
View
.
DisplacementFactor
=
20
*
b
;
DefineConstant
[
s
=
{
1
,
Name
"Input/Geometry/00Mesh size factor"
,
DefineConstant
[
s
=
{
1
,
Name
"Input/Geometry/00Mesh size factor"
,
Min
0.1
,
Max
2
,
Step
0.1
}
];
Min
0.1
,
Max
2
,
Step
0.1
}
];
...
@@ -48,8 +47,8 @@ Physical Volume(CONDUCTOR_RIGHT) = {8, 9};
...
@@ -48,8 +47,8 @@ Physical Volume(CONDUCTOR_RIGHT) = {8, 9};
Physical
Surface
(
VOLTAGE_LEFT
)
=
{
168
,
190
};
Physical
Surface
(
VOLTAGE_LEFT
)
=
{
168
,
190
};
Physical
Surface
(
VOLTAGE_RIGHT
)
=
{
234
,
212
};
Physical
Surface
(
VOLTAGE_RIGHT
)
=
{
234
,
212
};
/* FIXME: show how we could select the mode ti visuzalize interactively without
going through
/* FIXME: show how we could select the mode ti visuzalize interactively without
the whole option menu
going through
the whole option menu
DefineConstant[
DefineConstant[
ts = { View.TimeStep, Name "Selected mode", Choices {0="Eigen mode 0", 1="Eigen mode 1"},
ts = { View.TimeStep, Name "Selected mode", Choices {0="Eigen mode 0", 1="Eigen mode 1"},
AutoCheck 0, GmshOption "View.TimeStep"
AutoCheck 0, GmshOption "View.TimeStep"
...
@@ -72,4 +71,3 @@ DefineConstant[
...
@@ -72,4 +71,3 @@ DefineConstant[
Name
StrCat
(
pInOpt
,
"Structured grid?"
),
Visible
0
}
Name
StrCat
(
pInOpt
,
"Structured grid?"
),
Visible
0
}
];
];
Merge
"perturb.geo"
;
Merge
"perturb.geo"
;
This diff is collapsed.
Click to expand it.
benchmarks/magnetometer/optdriver.py
+
10
−
8
View file @
404e8859
...
@@ -171,14 +171,16 @@ def printOptProblem(xval,xmin,xmax,fmax,opt):
...
@@ -171,14 +171,16 @@ def printOptProblem(xval,xmin,xmax,fmax,opt):
opt
[
'
optimization
'
][
'
iterMax
'
]))
opt
[
'
optimization
'
][
'
iterMax
'
]))
print
(
'
=
'
*
80
)
print
(
'
=
'
*
80
)
def
printCurrIterate
(
xval
,
fval
,
change
,
loop
,
opt
):
def
printCurrIterate
(
client
,
xval
,
fval
,
change
,
loop
,
opt
):
if
opt
[
'
printLevel
'
]
>=
1
:
if
opt
[
'
printLevel
'
]
>=
1
:
print
(
'
It. {:4d},
'
.
format
(
loop
)),
client
.
sendInfo
(
'
=
'
*
60
)
client
.
sendInfo
(
'
It. {:4d},
'
.
format
(
loop
))
for
k
,
xk
in
enumerate
(
xval
):
for
k
,
xk
in
enumerate
(
xval
):
print
(
'
x{}: {:.3e},
'
.
format
(
k
,
xk
))
,
client
.
sendInfo
(
'
x{}: {:.3e},
'
.
format
(
k
,
xk
))
for
k
,
fk
in
enumerate
(
fval
):
for
k
,
fk
in
enumerate
(
fval
):
print
(
'
f{}: {:.3e},
'
.
format
(
k
,
fk
)),
client
.
sendInfo
(
'
f{}: {:.3e},
'
.
format
(
k
,
fk
))
print
(
'
change: {:.3e}
'
.
format
(
change
))
client
.
sendInfo
(
'
change: {:.3e}
'
.
format
(
change
))
client
.
sendInfo
(
'
=
'
*
60
)
def
optimLoop
(
clientOnelab
,
clientOpt
,
xval
,
xmin
,
xmax
,
fmax
,
opt
):
def
optimLoop
(
clientOnelab
,
clientOpt
,
xval
,
xmin
,
xmax
,
fmax
,
opt
):
# Summary of the optimization problem
# Summary of the optimization problem
...
@@ -221,7 +223,7 @@ def optimLoop(clientOnelab, clientOpt, xval, xmin, xmax, fmax, opt):
...
@@ -221,7 +223,7 @@ def optimLoop(clientOnelab, clientOpt, xval, xmin, xmax, fmax, opt):
change
=
np
.
linalg
.
norm
(
xmma
-
xval
,
np
.
inf
)
change
=
np
.
linalg
.
norm
(
xmma
-
xval
,
np
.
inf
)
# Print the current iterate
# Print the current iterate
printCurrIterate
(
xval
,
fval
,
change
,
loop
,
opt
[
'
optimization
'
])
printCurrIterate
(
clientOnelab
,
xval
,
fval
,
change
,
loop
,
opt
[
'
optimization
'
])
# update design variables
# update design variables
xold2
=
np
.
copy
(
xold1
)
xold2
=
np
.
copy
(
xold1
)
...
@@ -230,7 +232,7 @@ def optimLoop(clientOnelab, clientOpt, xval, xmin, xmax, fmax, opt):
...
@@ -230,7 +232,7 @@ def optimLoop(clientOnelab, clientOpt, xval, xmin, xmax, fmax, opt):
loop
=
loop
+
1
loop
=
loop
+
1
# print the final iteration
# print the final iteration
printCurrIterate
(
xval
,
fval
,
change
,
loop
,
opt
[
'
optimization
'
])
printCurrIterate
(
clientOnelab
,
xval
,
fval
,
change
,
loop
,
opt
[
'
optimization
'
])
# output data
# output data
xopt
=
np
.
copy
(
xval
)
xopt
=
np
.
copy
(
xval
)
...
...
This diff is collapsed.
Click to expand it.
doc/VERSIONS.txt
+
2
−
0
View file @
404e8859
2.9.1: small improvements and bug fixes.
2.9.0: new ONELAB 1.2 protocol with native support for lists; simple C++ and
2.9.0: new ONELAB 1.2 protocol with native support for lists; simple C++ and
Python API for exchanging (lists of) numbers and strings; extended .pro language
Python API for exchanging (lists of) numbers and strings; extended .pro language
for the construction of extensible problem definitions ("Append"); new
for the construction of extensible problem definitions ("Append"); new
...
...
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