Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-tectonic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
podlesny
dune-tectonic
Commits
1a1fb9ae
Commit
1a1fb9ae
authored
12 years ago
by
Elias Pipping
Committed by
Elias Pipping
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Ignore the nonlinearity in CircularConvexFunctions
parent
65f4e7bd
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/tectonic/circularconvexfunction.hh
+3
-12
3 additions, 12 deletions
dune/tectonic/circularconvexfunction.hh
dune/tectonic/ellipticenergy.hh
+5
-3
5 additions, 3 deletions
dune/tectonic/ellipticenergy.hh
with
8 additions
and
15 deletions
dune/tectonic/circularconvexfunction.hh
+
3
−
12
View file @
1a1fb9ae
...
@@ -5,17 +5,12 @@
...
@@ -5,17 +5,12 @@
#include
<dune/fufem/interval.hh>
#include
<dune/fufem/interval.hh>
namespace
Dune
{
namespace
Dune
{
template
<
class
NonlinearityType
>
class
CircularConvexFunction
{
template
<
class
MatrixType
,
class
VectorType
>
class
CircularConvexFunction
{
typedef
typename
NonlinearityType
::
VectorType
VectorType
;
typedef
typename
NonlinearityType
::
MatrixType
MatrixType
;
public:
public:
CircularConvexFunction
(
MatrixType
const
&
A
,
VectorType
const
&
b
,
CircularConvexFunction
(
MatrixType
const
&
A
,
VectorType
const
&
b
,
NonlinearityType
const
&
phi
,
VectorType
const
&
x
,
VectorType
const
&
x
,
VectorType
const
&
dir
)
VectorType
const
&
dir
)
:
A
(
A
),
:
A
(
A
),
b
(
b
),
b
(
b
),
phi
(
phi
),
x
(
x
),
x
(
x
),
dir
(
dir
),
dir
(
dir
),
xnorm
(
x
.
two_norm
()),
xnorm
(
x
.
two_norm
()),
...
@@ -31,14 +26,11 @@ template <class NonlinearityType> class CircularConvexFunction {
...
@@ -31,14 +26,11 @@ template <class NonlinearityType> class CircularConvexFunction {
VectorType
t
;
VectorType
t
;
tangent
(
m
,
t
);
tangent
(
m
,
t
);
phi
.
directionalSubDiff
(
x
,
t
,
D
);
VectorType
tmp
;
VectorType
tmp
;
A
.
mv
(
x
,
tmp
);
// Ax
A
.
mv
(
x
,
tmp
);
// Ax
tmp
-=
b
;
// Ax - b
tmp
-=
b
;
// Ax - b
double
const
dotp
=
tmp
*
t
;
// <Ax - b,t>
double
const
dotp
=
tmp
*
t
;
// <Ax - b,t>
D
[
0
]
+=
dotp
;
D
[
0
]
=
D
[
1
]
=
dotp
;
D
[
1
]
+=
dotp
;
}
}
void
domain
(
Interval
<
double
>
&
domain
)
const
{
void
domain
(
Interval
<
double
>
&
domain
)
const
{
...
@@ -55,7 +47,6 @@ template <class NonlinearityType> class CircularConvexFunction {
...
@@ -55,7 +47,6 @@ template <class NonlinearityType> class CircularConvexFunction {
private
:
private
:
MatrixType
const
&
A
;
MatrixType
const
&
A
;
VectorType
const
&
b
;
VectorType
const
&
b
;
NonlinearityType
const
&
phi
;
VectorType
const
&
x
;
VectorType
const
&
x
;
VectorType
const
&
dir
;
VectorType
const
&
dir
;
...
...
This diff is collapsed.
Click to expand it.
dune/tectonic/ellipticenergy.hh
+
5
−
3
View file @
1a1fb9ae
...
@@ -196,11 +196,13 @@ void tangentialMinimisation(Functional const &J,
...
@@ -196,11 +196,13 @@ void tangentialMinimisation(Functional const &J,
typename
Functional
::
SmallVector
&
x
,
typename
Functional
::
SmallVector
&
x
,
typename
Functional
::
SmallVector
const
&
descDir
,
typename
Functional
::
SmallVector
const
&
descDir
,
Bisection
const
&
bisection
)
{
Bisection
const
&
bisection
)
{
typedef
typename
Functional
::
NonlinearityType
LocalNonlinearityType
;
typedef
typename
Functional
::
SmallMatrix
SmallMatrix
;
typedef
typename
Functional
::
SmallVector
SmallVector
;
typedef
typename
Functional
::
SmallVector
SmallVector
;
CircularConvexFunction
<
LocalNonlinearityType
>
const
JRest
(
J
.
A
,
J
.
b
,
*
J
.
phi
,
x
,
// We completely ignore the nonlinearity here -- when restricted
descDir
);
// to a circle, it just enters as a constant!
CircularConvexFunction
<
SmallMatrix
,
SmallVector
>
const
JRest
(
J
.
A
,
J
.
b
,
x
,
descDir
);
int
count
;
int
count
;
double
const
stepsize
=
bisection
.
minimize
(
JRest
,
0.0
,
1.0
,
count
);
double
const
stepsize
=
bisection
.
minimize
(
JRest
,
0.0
,
1.0
,
count
);
...
...
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