Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-gfe
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
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sander, Oliver
dune-gfe
Commits
29d925d0
Commit
29d925d0
authored
15 years ago
by
Oliver Sander
Committed by
sander@PCPOOL.MI.FU-BERLIN.DE
15 years ago
Browse files
Options
Downloads
Patches
Plain Diff
The trust region is now defined using an L2-type norm
[[Imported from SVN: r4197]]
parent
3ce49eab
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
src/riemanniantrsolver.cc
+28
-4
28 additions, 4 deletions
src/riemanniantrsolver.cc
with
28 additions
and
4 deletions
src/riemanniantrsolver.cc
+
28
−
4
View file @
29d925d0
...
...
@@ -203,11 +203,30 @@ setupTCG(const GridType& grid,
Dune
::
LeafP1OperatorAssembler
<
GridType
,
double
,
blocksize
>*
B
=
new
Dune
::
LeafP1OperatorAssembler
<
GridType
,
double
,
blocksize
>
(
grid
);
B
->
assemble
(
massMatrixStiffness
,
uvv
,
fvv
);
// /////////////////////////////////////////////////////////
// Scale rotational components
// /////////////////////////////////////////////////////////
#warning RigidBody-specific stuff hardwired into the RiemannianTRSolver!
int
alpha
=
1
;
for
(
int
i
=
0
;
i
<
(
**
B
).
N
();
i
++
)
{
// make matrix row an identity row
typename
MatrixType
::
row_type
::
Iterator
cIt
=
(
**
B
)[
i
].
begin
();
typename
MatrixType
::
row_type
::
Iterator
cEndIt
=
(
**
B
)[
i
].
end
();
for
(;
cIt
!=
cEndIt
;
++
cIt
)
for
(
int
j
=
0
;
j
<
3
;
j
++
)
(
*
cIt
)[
j
][
j
]
*=
alpha
;
}
// ////////////////////////////////////////////////////
// Create a truncated conjugate gradient solver
// ////////////////////////////////////////////////////
innerSolver_
=
new
TruncatedCGSolver
<
MatrixType
,
CorrectionType
>
(
innerIterations_
,
innerSolver_
=
new
TruncatedCGSolver
<
MatrixType
,
CorrectionType
>
(
NULL
,
// the preconditioner
innerIterations_
,
innerTolerance_
,
h1SemiNorm_
,
&**
B
,
// the norm of the trust region
...
...
@@ -310,6 +329,8 @@ void RiemannianTrustRegionSolver<GridType,TargetSpace>::solve()
}
// The cg solver overwrites the rhs. Therefore it is given a copy
CorrectionType
backupRhs
=
rhs
;
if
(
mgStep
)
{
// inner solver is a monotone multigrid
...
...
@@ -321,7 +342,10 @@ void RiemannianTrustRegionSolver<GridType,TargetSpace>::solve()
}
else
{
// inner solver is a truncated cg
assert
((
dynamic_cast
<
TruncatedCGSolver
<
MatrixType
,
CorrectionType
>*>
(
innerSolver_
)));
dynamic_cast
<
TruncatedCGSolver
<
MatrixType
,
CorrectionType
>*>
(
innerSolver_
)
->
setProblem
(
*
hessianMatrix_
,
&
corr
,
&
rhs
,
trustRegion
.
radius
());
dynamic_cast
<
TruncatedCGSolver
<
MatrixType
,
CorrectionType
>*>
(
innerSolver_
)
->
setProblem
(
*
hessianMatrix_
,
&
corr
,
&
backupRhs
,
trustRegion
.
radius
());
}
...
...
@@ -335,9 +359,9 @@ void RiemannianTrustRegionSolver<GridType,TargetSpace>::solve()
if
(
mgStep
)
corr
=
mgStep
->
getSol
();
//std::cout << "Correction: " << std::endl << corr << std::endl;
if
(
instrumented_
)
{
fprintf
(
fp
,
"Trust-region step: %d, trust-region radius: %g
\n
"
,
...
...
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