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
88daf3e1
Commit
88daf3e1
authored
3 years ago
by
Stephan Hilb
Browse files
Options
Downloads
Patches
Plain Diff
fixup error estimator slightly
parent
d08424eb
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/run_experiments.jl
+15
-11
15 additions, 11 deletions
scripts/run_experiments.jl
with
15 additions
and
11 deletions
scripts/run_experiments.jl
+
15
−
11
View file @
88daf3e1
...
@@ -622,7 +622,6 @@ function estimate_res!(st::L1L2TVState)
...
@@ -622,7 +622,6 @@ function estimate_res!(st::L1L2TVState)
st
.
T
(
adjoint
,
tdata
,
p1
)
+
st
.
T
(
adjoint
,
tdata
,
p1
)
+
(
isSnabla
?
zero
(
p1
)
:
st
.
beta
*
u
)
(
isSnabla
?
zero
(
p1
)
:
st
.
beta
*
u
)
facetf
(
hfacet
,
n
;
g
,
u
,
nablau
,
p1
,
p2
,
tdata
)
=
facetf
(
hfacet
,
n
;
g
,
u
,
nablau
,
p1
,
p2
,
tdata
)
=
#display(n' * p2)
# norm2 is calculated later after both facet contributions are
# norm2 is calculated later after both facet contributions are
# consolidated
# consolidated
n
'
*
((
isSnabla
?
st
.
beta
*
st
.
S
(
zero
(
u
),
nablau
)
:
zero
(
p2
))
+
p2
)
n
'
*
((
isSnabla
?
st
.
beta
*
st
.
S
(
zero
(
u
),
nablau
)
:
zero
(
p2
))
+
p2
)
...
@@ -633,7 +632,8 @@ function estimate_res!(st::L1L2TVState)
...
@@ -633,7 +632,8 @@ function estimate_res!(st::L1L2TVState)
fs
=
(;
st
.
g
,
st
.
u
,
nablau
=
nabla
(
st
.
u
),
st
.
p1
,
st
.
p2
,
st
.
tdata
)
fs
=
(;
st
.
g
,
st
.
u
,
nablau
=
nabla
(
st
.
u
),
st
.
p1
,
st
.
p2
,
st
.
tdata
)
space
=
st
.
est
.
space
space
=
st
.
est
.
space
facetV
=
Dict
{
Tuple
{
Int
,
Int
},
MVector
{
ndims_u_codomain
(
st
),
Float64
}}()
facetv
=
Dict
{
Tuple
{
Int
,
Int
},
MVector
{
ndims_u_codomain
(
st
),
Float64
}}()
st
.
est
.
data
.=
0.
for
cell
in
cells
(
mesh
)
for
cell
in
cells
(
mesh
)
A
=
SArray
{
Tuple
{
ndims_space
(
mesh
),
nvertices_cell
(
mesh
)}}(
A
=
SArray
{
Tuple
{
ndims_space
(
mesh
),
nvertices_cell
(
mesh
)}}(
...
@@ -670,29 +670,33 @@ function estimate_res!(st::L1L2TVState)
...
@@ -670,29 +670,33 @@ function estimate_res!(st::L1L2TVState)
v
=
A
[
:
,
j
]
-
A
[
:
,
i
]
v
=
A
[
:
,
j
]
-
A
[
:
,
i
]
hfacet
=
norm
(
v
)
hfacet
=
norm
(
v
)
normal
=
-
normalize
(
cross
(
v
))
normal
=
-
normalize
(
cross
(
v
))
intel
=
hfacet
# we don't need to recompute values since only piecewise
# we don't need to recompute
`op
values
`
since only piecewise
# constant data is used in `facetf`
# constant data is used in `facetf`
# we use sqrt here since this value will be squared later
facetres
=
facetf
(
hfacet
,
normal
;
opvalues
...
)
facetres
=
(
isSnabla
?
sqrt
(
hfacet
)
:
inv
(
sqrt
(
hfacet
)))
*
facetf
(
hfacet
,
normal
;
opvalues
...
)
.*
sqrt
(
intel
)
# average facet contributions
# average facet contributions
v
=
SVector
(
facetres
)
v
=
SVector
{
ndims_u_codomain
(
st
)}
(
facetres
/
2
)
facet
V
[(
fi
,
fj
)]
=
get
(
facet
V
,
(
fi
,
fj
),
zero
(
v
))
+
SVector
(
v
)
facet
v
[(
fi
,
fj
)]
=
get
(
facet
v
,
(
fi
,
fj
),
zero
(
v
))
+
v
facet
V
[(
fj
,
fi
)]
=
get
(
facet
V
,
(
fj
,
fi
),
zero
(
v
))
+
SVector
(
v
)
facet
v
[(
fj
,
fi
)]
=
get
(
facet
v
,
(
fj
,
fi
),
zero
(
v
))
+
v
end
end
end
end
# add facet contributions to cells
# add facet contributions to cells
for
cell
in
cells
(
mesh
)
for
cell
in
cells
(
mesh
)
for
(
i
,
j
)
in
((
i
,
mod1
(
i
+
1
,
3
))
for
i
in
1
:
3
)
for
(
i
,
j
)
in
((
i
,
mod1
(
i
+
1
,
3
))
for
i
in
1
:
3
)
A
=
SArray
{
Tuple
{
ndims_space
(
mesh
),
nvertices_cell
(
mesh
)}}(
view
(
mesh
.
vertices
,
:
,
view
(
mesh
.
cells
,
:
,
cell
)))
v
=
A
[
:
,
j
]
-
A
[
:
,
i
]
hfacet
=
norm
(
v
)
intel
=
hfacet
fi
=
mesh
.
cells
[
i
,
cell
]
fi
=
mesh
.
cells
[
i
,
cell
]
fj
=
mesh
.
cells
[
j
,
cell
]
fj
=
mesh
.
cells
[
j
,
cell
]
gdofs
=
space
.
dofmap
[
:
,
1
,
cell
]
gdofs
=
space
.
dofmap
[
:
,
1
,
cell
]
st
.
est
.
data
[
gdofs
]
.+=
norm2
(
facetV
[(
fi
,
fj
)])
st
.
est
.
data
[
gdofs
]
.+=
(
isSnabla
?
hfacet
:
inv
(
hfacet
))
*
norm2
(
facetv
[(
fi
,
fj
)])
*
intel
end
end
end
end
...
...
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