Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SemiSmoothNewton.jl
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stephan Hilb
SemiSmoothNewton.jl
Commits
bf7e32b9
Commit
bf7e32b9
authored
3 years ago
by
Stephan Hilb
Browse files
Options
Downloads
Patches
Plain Diff
add temporary initial refinement
parent
4bdfb091
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/run_experiments.jl
+22
-1
22 additions, 1 deletion
scripts/run_experiments.jl
with
22 additions
and
1 deletion
scripts/run_experiments.jl
+
22
−
1
View file @
bf7e32b9
...
...
@@ -77,7 +77,7 @@ function L1L2TVContext(name, mesh, m; T, tdata, S,
Vest
=
FeSpace
(
mesh
,
DP0
(),
(
1
,))
Vg
=
FeSpace
(
mesh
,
P1
(),
(
1
,))
Vu
=
FeSpace
(
mesh
,
P1
(),
(
m
,))
Vp1
=
FeSpace
(
mesh
,
D
P1
(),
(
1
,))
Vp1
=
FeSpace
(
mesh
,
P1
(),
(
1
,))
Vp2
=
FeSpace
(
mesh
,
DP0
(),
(
m
,
d
))
est
=
FeFunction
(
Vest
,
name
=
"est"
)
...
...
@@ -399,6 +399,7 @@ function estimate!(ctx::L1L2TVContext)
w
=
FeFunction
(
ctx
.
u
.
space
)
solve_primal!
(
w
,
ctx
)
#w.data .= .-w.data
# TODO: find better name: is actually a cell-wise integration
project!
(
ctx
.
est
,
estf
;
ctx
.
g
,
ctx
.
u
,
ctx
.
p1
,
ctx
.
p2
,
nablau
=
nabla
(
ctx
.
u
),
w
,
nablaw
=
nabla
(
w
),
ctx
.
tdata
)
...
...
@@ -679,6 +680,7 @@ function denoise_approximation(ctx)
T
(
tdata
,
u
)
=
u
S
(
u
,
nablau
)
=
u
#S(u, nablau) = nablau
st
=
L1L2TVContext
(
ctx
.
params
.
name
,
ctx
.
params
.
mesh
,
1
;
T
,
tdata
=
nothing
,
S
,
...
...
@@ -688,6 +690,7 @@ function denoise_approximation(ctx)
#project_img!(st.g, img)
interpolate!
(
st
.
g
,
x
->
interpolate_bilinear
(
ctx
.
params
.
img
,
x
))
st
.
u
.
data
.=
st
.
g
.
data
#st.u.data .= rand(size(st.u.data))
save_vtk
(
st
,
i
)
=
output
(
st
,
...
...
@@ -708,6 +711,24 @@ function denoise_approximation(ctx)
pvd
[
0
]
=
save_vtk
(
st
,
0
)
println
(
"primal energy:
$
(primal_energy(st))"
)
# initial refinement
for
_
in
1
:
14
marked_cells
=
Set
(
axes
(
st
.
mesh
.
cells
,
2
))
mesh
,
fs
=
refine
(
st
.
mesh
,
marked_cells
;
st
.
est
,
st
.
g
,
st
.
u
,
st
.
p1
,
st
.
p2
,
st
.
du
,
st
.
dp1
,
st
.
dp2
)
st
=
L1L2TVContext
(
"run"
,
mesh
,
st
.
d
,
st
.
m
,
T
,
nothing
,
S
,
st
.
alpha1
,
st
.
alpha2
,
st
.
beta
,
st
.
lambda
,
st
.
gamma1
,
st
.
gamma2
,
fs
.
est
,
fs
.
g
,
fs
.
u
,
fs
.
p1
,
fs
.
p2
,
fs
.
du
,
fs
.
dp1
,
fs
.
dp2
)
end
#marked_cells = Set(axes(st.mesh.cells, 2))
#mesh2, fs = refine(st.mesh, marked_cells;
# st.est, st.g, st.u, st.p1, st.p2, st.du, st.dp1, st.dp2)
#st2 = L1L2TVContext("run", mesh2, st.d, st.m, T, nothing, S,
# st.alpha1, st.alpha2, st.beta, st.lambda,
# st.gamma1, st.gamma2,
# fs.est, fs.g, fs.u, fs.p1, fs.p2, fs.du, fs.dp1, fs.dp2)
k
=
0
while
true
step!
(
st
)
...
...
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